Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UMD] Remove a couple of leftover usages of old soc descriptor API #17707

Merged
merged 4 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions tt_metal/common/metal_soc_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,27 +134,31 @@ void metal_SocDescriptor::load_dram_metadata_from_device_descriptor() {
int worker_endpoint = dram_view["worker_endpoint"].as<int>();
size_t address_offset = dram_view["address_offset"].as<size_t>();

if (channel >= dram_cores.size()) {
if (channel >= get_grid_size(CoreType::DRAM).x) {
TT_THROW(
"DRAM channel {} does not exist in the device descriptor, but is specified in dram_view.channel",
channel);
}
if (eth_endpoint >= dram_cores[channel].size()) {
if (eth_endpoint >= get_grid_size(CoreType::DRAM).y) {
TT_THROW(
"DRAM subchannel {} does not exist in the device descriptor, but is specified in "
"dram_view.eth_endpoint",
eth_endpoint);
}
if (worker_endpoint >= dram_cores[channel].size()) {
if (worker_endpoint >= get_grid_size(CoreType::DRAM).y) {
TT_THROW(
"DRAM subchannel {} does not exist in the device descriptor, but is specified in "
"dram_view.worker_endpoint",
worker_endpoint);
}

this->dram_view_channels.push_back(channel);
this->dram_view_eth_cores.push_back(dram_cores[channel][eth_endpoint]);
this->dram_view_worker_cores.push_back(dram_cores[channel][worker_endpoint]);
tt::umd::CoreCoord eth_dram_endpoint_coord =
get_dram_core_for_channel(channel, eth_endpoint, CoordSystem::VIRTUAL);
this->dram_view_eth_cores.push_back({eth_dram_endpoint_coord.x, eth_dram_endpoint_coord.y});
tt::umd::CoreCoord worker_endpoint_coord =
get_dram_core_for_channel(channel, worker_endpoint, CoordSystem::VIRTUAL);
this->dram_view_worker_cores.push_back({worker_endpoint_coord.x, worker_endpoint_coord.y});
this->dram_view_address_offsets.push_back(address_offset);
}
}
Expand Down
13 changes: 7 additions & 6 deletions tt_metal/llrt/tlb_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,10 @@ void configure_static_tlbs(
default: TT_THROW("Configuring static TLBs is not supported for {}", tt::get_string(arch));
}

auto statically_mapped_cores = sdesc.workers;
statically_mapped_cores.insert(
statically_mapped_cores.end(), sdesc.ethernet_cores.begin(), sdesc.ethernet_cores.end());
std::int32_t address = 0;

// Setup static TLBs for all worker cores
for (auto& core : statically_mapped_cores) {
auto tlb_index = get_static_tlb_index(core);
for (const CoreCoord& core : sdesc.get_cores(CoreType::TENSIX, sdesc.get_umd_coord_system())) {
auto tlb_index = get_static_tlb_index({core.x, core.y});
// TODO
// Note: see issue #10107
// Strict is less performant than Posted, however, metal doesn't presently
Expand All @@ -188,6 +184,11 @@ void configure_static_tlbs(
// Revisit this when we have a more flexible UMD api
device_driver.configure_tlb(mmio_device_id, core, tlb_index, address, TLB_DATA::Strict);
}
// Setup static TLBs for all eth cores
for (const CoreCoord& core : sdesc.get_cores(CoreType::ETH, sdesc.get_umd_coord_system())) {
auto tlb_index = get_static_tlb_index({core.x, core.y});
device_driver.configure_tlb(mmio_device_id, core, tlb_index, address, TLB_DATA::Strict);
}

// TODO (#9932): Remove workaround for BH
if (arch != tt::ARCH::BLACKHOLE) {
Expand Down
Loading