Skip to content

Commit

Permalink
#5398: fix unicast binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
aliuTT committed Mar 11, 2024
1 parent 49a6887 commit e9bd503
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
44 changes: 17 additions & 27 deletions tests/tt_metal/tt_metal/unit_tests_common/watcher/test_waypoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,6 @@ static void RunTest(WatcherFixture* fixture, Device* device) {
CoreRange(xy_start, xy_end),
ComputeConfig{});

// Also run on ethernet cores if they're present
bool has_eth_cores = !device->get_active_ethernet_cores(true).empty();
// TODO: Change back to a single erisc_kid once the bug with CoreRange fast dispatch is fixed.
vector<KernelHandle> erisc_kids;
if (has_eth_cores) {
std::set<CoreRange> eth_core_ranges;
for (const auto& core : device->get_active_ethernet_cores(true)) {
eth_core_ranges.insert(CoreRange(core, core));
auto erisc_kid = CreateKernel(
program,
"tests/tt_metal/tt_metal/test_kernels/misc/watcher_waypoints.cpp",
core,
tt_metal::EthernetConfig{
.noc = tt_metal::NOC::NOC_0
}
);
erisc_kids.push_back(erisc_kid);
}
}

// The kernels need arguments to be passed in: the number of cycles to delay while syncing,
// and an L1 buffer to use for the syncing.
uint32_t clk_mhz = tt::Cluster::instance().get_device_aiclk(device->id());
Expand Down Expand Up @@ -108,16 +88,26 @@ static void RunTest(WatcherFixture* fixture, Device* device) {
);
}
}
int idx = 0;
for (const auto& core : device->get_active_ethernet_cores(true)) {
SetRuntimeArgs(
// Also run on ethernet cores if they're present
bool has_eth_cores = !device->get_active_ethernet_cores(true).empty();
if (has_eth_cores) {
KernelHandle erisc_kid;
std::set<CoreRange> eth_core_ranges;
for (const auto& core : device->get_active_ethernet_cores(true)) {
eth_core_ranges.insert(CoreRange(core, core));
}
erisc_kid = CreateKernel(
program,
erisc_kids[idx++],
core,
args
);
"tests/tt_metal/tt_metal/test_kernels/misc/watcher_waypoints.cpp",
eth_core_ranges,
tt_metal::EthernetConfig{.noc = tt_metal::NOC::NOC_0});

for (const auto& core : device->get_active_ethernet_cores(true)) {
SetRuntimeArgs(program, erisc_kid, core, args);
}
}


// Run the program in a new thread, we'll have to update gate values in this thread.
fixture->RunProgram(device, program);

Expand Down
7 changes: 6 additions & 1 deletion tt_metal/impl/program/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,12 @@ ProgramDeviceMap ConstructProgramDeviceMap(const Device* device, Program& progra

align_program_page_idx_to_new_page();
for (const KernelGroup& kernel_group : kernel_group_unicast) {
populate_program_binaries_pages(kernel_group);
if (kernel_group.get_core_type() == CoreType::ETH) {
auto kernel = detail::GetKernel(program, kernel_group.erisc_id.value());
for (const auto& logical_core : kernel->logical_cores()) {
populate_program_binaries_pages(kernel_group);
}
}
}

// Since GO signal begin in a new page, I need to advance my idx
Expand Down

0 comments on commit e9bd503

Please sign in to comment.