Skip to content

Commit

Permalink
#0: Fix switching between multi cq with eth dispatch. Dynamic idle et…
Browse files Browse the repository at this point in the history
…h cores were not being added to dispatch pool when changing number of cqs
  • Loading branch information
tt-aho committed Jul 10, 2024
1 parent 0af65cd commit 7ef58ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tt_metal/impl/device/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1805,10 +1805,12 @@ void Device::update_dispatch_cores_for_multi_cq_eth_dispatch() {
// When running Multiple CQs using Ethernet Dispatch, we may need more dispatch cores than those allocated in the
// core descriptor (ex: 2 CQs on N300 need 10 dispatch cores and the core descriptor only allocates 6).
// Infer the remaining dispatch cores from the idle eth core list (this is device dependent).
if (dispatch_core_manager::get(this->num_hw_cqs()).get_dispatch_core_type(this->id()) == CoreType::ETH) {
auto& dispatch_core_manager = dispatch_core_manager::get(this->num_hw_cqs());
for (const auto& idle_eth_core : this->get_inactive_ethernet_cores()) {
dispatch_core_manager.add_dispatch_core_to_device(this->id(), idle_eth_core);
for (uint8_t num_hw_cqs = 1; num_hw_cqs <= Device::max_num_hw_cqs; ++num_hw_cqs) {
if (dispatch_core_manager::get(num_hw_cqs).get_dispatch_core_type(this->id()) == CoreType::ETH) {
auto& dispatch_core_manager = dispatch_core_manager::get(num_hw_cqs);
for (const auto& idle_eth_core : this->get_inactive_ethernet_cores()) {
dispatch_core_manager.add_dispatch_core_to_device(this->id(), idle_eth_core);
}
}
}
}
Expand Down

0 comments on commit 7ef58ab

Please sign in to comment.