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

Fix Grayskull tests #138

Merged
merged 3 commits into from
Oct 10, 2024
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: 7 additions & 7 deletions device/tt_silicon_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,21 +686,21 @@ tt_SiliconDevice::tt_SiliconDevice(const std::string &sdesc_path, const std::str
for (auto device_id = target_devices.begin(); device_id != target_devices.end(); device_id++) {
log_assert(simulated_harvesting_masks.find(*device_id) != simulated_harvesting_masks.end(), "Could not find harvesting mask for device_id {}", *device_id);
if(arch_name == tt::ARCH::GRAYSKULL) {
log_assert((simulated_harvesting_masks.at(*device_id) & harvested_rows_per_target[*device_id]) == harvested_rows_per_target[*device_id],
"Simulated harvesting config for device {} does not include the actual harvesting config (real config must be contained in simulated config when running on device). Actual Harvested Rows : {} Simulated Harvested Rows : {}",
*device_id, harvested_rows_per_target[*device_id], simulated_harvesting_masks.at(*device_id));

if ((simulated_harvesting_masks.at(*device_id) & harvested_rows_per_target[*device_id]) != harvested_rows_per_target[*device_id]) {
log_warning(LogSiliconDriver,
"Simulated harvesting config for device {} does not include the actual harvesting config. Simulated harvesting mask will be added to the real harvesting mask. Actual Harvested Rows : {} Simulated Harvested Rows : {}",
*device_id, harvested_rows_per_target[*device_id], simulated_harvesting_masks.at(*device_id));
}
simulated_harvesting_masks.at(*device_id) |= harvested_rows_per_target[*device_id];
}
else if(arch_name == tt::ARCH::WORMHOLE_B0 || arch_name == tt::ARCH::WORMHOLE) {
log_assert(std::bitset<32>(simulated_harvesting_masks.at(*device_id)).count() >= std::bitset<32>(harvested_rows_per_target[*device_id]).count(),
"Simulated Harvesting for WH must contain at least as many rows as the actual harvesting config. Actual Harvested Rows : {} Simulated Harvested Rows : {}",
harvested_rows_per_target[*device_id], simulated_harvesting_masks.at(*device_id));
num_rows_harvested.at(*device_id) = std::bitset<32>(simulated_harvesting_masks.at(*device_id)).count();
}
harvested_rows_per_target[*device_id] = simulated_harvesting_masks.at(*device_id);
if(arch_name == tt::ARCH::WORMHOLE or arch_name == tt::ARCH::WORMHOLE_B0) {
log_assert(performed_harvesting ? translation_tables_en : true, "Using a harvested WH cluster with NOC translation disabled.");
}
harvested_rows_per_target[*device_id] = simulated_harvesting_masks.at(*device_id);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/grayskull/test_silicon_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ TEST(SiliconDriverGS, Harvesting) {

ASSERT_EQ(device.using_harvested_soc_descriptors(), true) << "Expected Driver to have performed harvesting";
for(const auto& chip : sdesc_per_chip) {
ASSERT_EQ(chip.second.workers.size(), 96) << "Expected SOC descriptor with harvesting to have 96 workers for chip " << chip.first;
ASSERT_LE(chip.second.workers.size(), 96) << "Expected SOC descriptor with harvesting to have less than or equal to 96 workers for chip " << chip.first;
}
ASSERT_EQ(device.get_harvesting_masks_for_soc_descriptors().at(0), 6) << "Expected first chip to have harvesting mask of 6";
ASSERT_EQ(device.get_harvesting_masks_for_soc_descriptors().at(0) & simulated_harvesting_masks[0], 6) << "Expected first chip to include simulated harvesting mask of 6";
// ASSERT_EQ(device.get_harvesting_masks_for_soc_descriptors().at(1), 12) << "Expected second chip to have harvesting mask of 12";
device.close_device();
}
Expand Down