Skip to content

Commit

Permalink
remove get_harvest_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
broskoTT committed Feb 7, 2025
1 parent cc63fc1 commit 971671a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,6 @@ bool Device::is_mmio_capable() const;
const metal_SocDescriptor& tt_cluster::get_soc_desc(chip_id_t chip) const;

// Get harvesting information for this chip
uint32_t tt_cluster::get_harvested_rows(chip_id_t chip) const;
uint32_t tt_cluster::get_harvesting_mask(chip_id_t chip) const;

// Get the clock frequency for this chip
Expand Down
5 changes: 3 additions & 2 deletions tests/tt_metal/tt_metal/api/test_soc_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ using namespace tt::test_utils;

namespace unit_tests::basic::soc_desc {
std::unordered_set<int> get_harvested_rows(chip_id_t device_id) {
uint32_t harvested_rows_mask = tt::Cluster::instance().get_harvested_rows(device_id);
uint32_t harvested_rows_mask = CoordinateManager::shuffle_tensix_harvesting_mask_to_noc0_coords(
tt::Cluster::instance().get_soc_desc(device_id).arch, tt::Cluster::instance().get_harvesting_mask(device_id));
std::unordered_set<int> harvested_rows;
int row_coordinate = 0;
int tmp = harvested_rows_mask;
Expand Down Expand Up @@ -51,7 +52,7 @@ TEST(SOC, TensixValidateLogicalToPhysicalCoreCoordHostMapping) {
num_devices = (arch == tt::ARCH::GRAYSKULL) ? 1 : num_devices;
for (int device_id = 0; device_id < num_devices; device_id++) {
tt_metal::IDevice* device = tt_metal::CreateDevice(device_id);
uint32_t harvested_rows_mask = tt::Cluster::instance().get_harvested_rows(device_id);
uint32_t harvested_rows_mask = tt::Cluster::instance().get_harvesting_mask(device_id);
const metal_SocDescriptor& soc_desc = tt::Cluster::instance().get_soc_desc(device_id);
log_info(LogTest, "Device {} harvesting mask {}", device_id, harvested_rows_mask);
std::unordered_set<int> harvested_rows = unit_tests::basic::soc_desc::get_harvested_rows(device_id);
Expand Down
4 changes: 2 additions & 2 deletions tests/tt_metal/tt_metal/device/test_galaxy_cluster_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TEST_F(GalaxyFixture, ValidateAllGalaxyChipsAreUnharvested) {
for (IDevice* device : this->devices_) {
const chip_id_t device_id = device->id();
if (is_galaxy_device(device_id)) {
const uint32_t harvest_mask = tt::Cluster::instance().get_harvested_rows(device_id);
const uint32_t harvest_mask = tt::Cluster::instance().get_harvesting_mask(device_id);
ASSERT_TRUE(harvest_mask == 0)
<< "Harvest mask for chip " << device_id << ": " << harvest_mask << std::endl;
}
Expand All @@ -128,7 +128,7 @@ TEST_F(GalaxyFixture, ValidateAllMMIOChipsHaveSingleRowHarvested) {
const chip_id_t device_id = device->id();
if (!is_galaxy_device(device_id)) {
uint32_t num_rows_harvested = 0;
uint32_t harvest_mask = tt::Cluster::instance().get_harvested_rows(device_id);
uint32_t harvest_mask = tt::Cluster::instance().get_harvesting_mask(device_id);
while (harvest_mask) {
if (harvest_mask & 1) {
num_rows_harvested++;
Expand Down
1 change: 0 additions & 1 deletion tt_metal/api/tt-metalium/tt_cluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class Cluster {
const std::unordered_set<CoreCoord>& get_virtual_worker_cores(chip_id_t chip_id) const;
const std::unordered_set<CoreCoord>& get_virtual_eth_cores(chip_id_t chip_id) const;

uint32_t get_harvested_rows(chip_id_t chip) const;
uint32_t get_harvesting_mask(chip_id_t chip) const {
return this->driver_->get_soc_descriptor(chip).harvesting_masks.tensix_harvesting_mask;
}
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/common/core_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const core_descriptor_t& get_core_descriptor_config(
config_by_arch;

ARCH arch = tt::Cluster::instance().arch();
uint32_t harvesting_mask = tt::Cluster::instance().get_harvested_rows(device_id);
uint32_t harvesting_mask = tt::Cluster::instance().get_harvesting_mask(device_id);
std::bitset<32> mask_bitset(harvesting_mask);
uint32_t num_harvested_rows = mask_bitset.count();

Expand Down
3 changes: 2 additions & 1 deletion tt_metal/impl/device/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ void Device::initialize_and_launch_firmware() {
// Determine which noc-coords are harvested
// TODO(PGK/Almeet): fix this w/ new UMD
std::vector<uint32_t> harvested_rows;
uint32_t harvested_noc_rows = tt::Cluster::instance().get_harvested_rows(this->id());
uint32_t harvested_noc_rows = CoordinateManager::shuffle_tensix_harvesting_mask_to_noc0_coords(
tt::Cluster::instance().get_soc_desc(this->id()).arch, tt::Cluster::instance().get_harvesting_mask(this->id()));
for (uint32_t y = 0; y < soc_d.grid_size.y; y++) {
bool row_harvested = (harvested_noc_rows >> y) & 0x1;
if (row_harvested) {
Expand Down
8 changes: 0 additions & 8 deletions tt_metal/llrt/tt_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,6 @@ CoreCoord Cluster::get_logical_ethernet_core_from_virtual(chip_id_t chip, CoreCo
return soc_desc.get_logical_ethernet_core_from_physical(phys_eth_core);
}

uint32_t Cluster::get_harvested_rows(chip_id_t chip) const {
if (this->target_type_ == TargetDevice::Simulator) {
return 0;
} else {
return this->driver_->harvested_rows_per_target.at(chip);
}
}

int Cluster::get_device_aiclk(const chip_id_t &chip_id) const {
if (this->arch_ == tt::ARCH::BLACKHOLE) {
// For Blackhole bring up remove AICLK query due to lack of ARC message support
Expand Down

0 comments on commit 971671a

Please sign in to comment.