-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fix bug when calling CreateDevice in a loop on TG #16260
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -973,18 +973,21 @@ std::tuple<tt_cxy_pair, tt_cxy_pair> Cluster::get_eth_tunnel_core( | |
} | ||
|
||
// TODO: ALLAN Can change to write one bit | ||
void Cluster::set_internal_routing_info_for_ethernet_cores(bool enable_internal_routing) const { | ||
void Cluster::set_internal_routing_info_for_ethernet_cores(bool enable_internal_routing, const std::vector<chip_id_t> &target_mmio_devices) const { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we call this function in a number of different spots for both init and close. Do we need to survey whether those callsites need update? Is it simpler to just read back the enable bit before writing ? |
||
log_debug(tt::LogDevice, "Set internal routing bit {}", enable_internal_routing); | ||
const uint32_t routing_info_addr = eth_l1_mem::address_map::ERISC_APP_ROUTING_INFO_BASE; | ||
// TODO: initialize devices if user does not | ||
// Must initialize remote chips first, then mmio chips since once mmio chips are doing fd routing | ||
// we do not always context switch to base FW | ||
std::vector<chip_id_t> mmio_devices; | ||
mmio_devices.reserve(this->devices_grouped_by_assoc_mmio_device_.size()); | ||
std::vector<chip_id_t> non_mmio_devices; | ||
for (const auto &[assoc_mmio_device, devices] : this->devices_grouped_by_assoc_mmio_device_) { | ||
mmio_devices.emplace_back(assoc_mmio_device); | ||
for (const auto &chip_id : devices) { | ||
std::vector<chip_id_t> mmio_devices = target_mmio_devices; | ||
if (mmio_devices.size() == 0) { | ||
for (const auto &[assoc_mmio_device, devices] : this->devices_grouped_by_assoc_mmio_device_) { | ||
mmio_devices.emplace_back(assoc_mmio_device); | ||
} | ||
} | ||
for (const auto &mmio_chip_id : mmio_devices) { | ||
for (const auto &chip_id : this->devices_grouped_by_assoc_mmio_device_.at(mmio_chip_id)) { | ||
Comment on lines
+983
to
+990
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we reserve sizes for non_mmio_devices vector and also mmio_devices vector if target_mmio_devices is empty ahead of time? |
||
non_mmio_devices.emplace_back(chip_id); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could reserve by device_ids.size() ahead of time? May slightly over-allocate but this vector is discarded after right?
Edit: Reserving by
tt::Cluster::instance().number_of_pci_devices()
might be better?