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

Remove cluster descriptor API from public #578

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 2 additions & 1 deletion device/api/umd/device/tt_cluster_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class tt_ClusterDescriptor {

void fill_chips_grouped_by_closest_mmio();

static std::unique_ptr<tt_ClusterDescriptor> create();

std::map<chip_id_t, uint32_t> dram_harvesting_masks = {};
std::map<chip_id_t, uint32_t> eth_harvesting_masks = {};

Expand All @@ -98,7 +100,6 @@ class tt_ClusterDescriptor {
// get_cluster_descriptor_file_path will create ethernet map in the background.
static std::string get_cluster_descriptor_file_path();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't merge the PR until this is also moved to private. We have alternative for that in Cluster as well

static std::unique_ptr<tt_ClusterDescriptor> create_from_yaml(const std::string &cluster_descriptor_file_path);
static std::unique_ptr<tt_ClusterDescriptor> create();
static tt::ARCH detect_arch(const chip_id_t chip_id);

// This function is used to create mock cluster descriptor yaml files, for example for simulation.
Expand Down
7 changes: 5 additions & 2 deletions tests/api/test_cluster_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

#include "disjoint_set.hpp"
#include "tests/test_utils/generate_cluster_desc.hpp"
#include "umd/device/cluster.h"
#include "umd/device/pci_device.hpp"
#include "umd/device/tt_cluster_descriptor.h"

using namespace tt::umd;

TEST(ApiClusterDescriptorTest, DetectArch) {
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();

if (cluster_desc->get_number_of_chips() == 0) {
// Expect it to be invalid if no devices are found.
Expand Down Expand Up @@ -46,7 +49,7 @@ TEST(ApiClusterDescriptorTest, DetectArch) {
}

TEST(ApiClusterDescriptorTest, BasicFunctionality) {
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();

if (cluster_desc == nullptr) {
GTEST_SKIP() << "No chips present on the system. Skipping test.";
Expand Down
8 changes: 4 additions & 4 deletions tests/blackhole/test_cluster_bh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std::int32_t get_static_tlb_index(tt_xy_pair target) {

std::set<chip_id_t> get_target_devices() {
std::set<chip_id_t> target_devices;
std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq = tt_ClusterDescriptor::create();
std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq = Cluster::create_cluster_descriptor();
for (int i = 0; i < cluster_desc_uniq->get_number_of_chips(); i++) {
target_devices.insert(i);
}
Expand Down Expand Up @@ -104,7 +104,7 @@ TEST(SiliconDriverBH, CreateDestroy) {

// {
// std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq =
// tt_ClusterDescriptor::create();
// Cluster::create_cluster_descriptor();
// if (cluster_desc_uniq->get_number_of_chips() != target_devices.size()) {
// GTEST_SKIP() << "SiliconDriverWH.Harvesting skipped because it can only be run on a two chip nebula
// system";
Expand Down Expand Up @@ -136,7 +136,7 @@ TEST(SiliconDriverBH, CreateDestroy) {
// std::unordered_map<chip_id_t, uint32_t> simulated_harvesting_masks = {{0, 30}, {1, 60}};
// {
// std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq =
// tt_ClusterDescriptor::create();
// Cluster::create_cluster_descriptor();
// if (cluster_desc_uniq->get_number_of_chips() != target_devices.size()) {
// GTEST_SKIP() << "SiliconDriverWH.Harvesting skipped because it can only be run on a two chip nebula
// system";
Expand Down Expand Up @@ -166,7 +166,7 @@ TEST(SiliconDriverBH, CreateDestroy) {
// std::unordered_map<chip_id_t, uint32_t> simulated_harvesting_masks = {{0, 30}, {1, 60}};
// {
// std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq =
// tt_ClusterDescriptor::create();
// Cluster::create_cluster_descriptor();
// if (cluster_desc_uniq->get_number_of_chips() != target_devices.size()) {
// GTEST_SKIP() << "SiliconDriverWH.Harvesting skipped because it can only be run on a two chip nebula
// system";
Expand Down
6 changes: 3 additions & 3 deletions tests/galaxy/test_umd_concurrent_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static const std::string SOC_DESC_PATH = "tests/soc_descs/wormhole_b0_8x10.yaml"
TEST(GalaxyConcurrentThreads, WriteToAllChipsL1) {
// Galaxy Setup

std::shared_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
std::set<chip_id_t> target_devices_th1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
std::set<chip_id_t> target_devices_th2 = {17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
std::set<chip_id_t> all_devices = {};
Expand Down Expand Up @@ -122,7 +122,7 @@ TEST(GalaxyConcurrentThreads, WriteToAllChipsL1) {

TEST(GalaxyConcurrentThreads, WriteToAllChipsDram) {
// Galaxy Setup
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
std::set<chip_id_t> target_devices_th1 = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32};
std::set<chip_id_t> target_devices_th2 = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31};
std::set<chip_id_t> all_devices = {};
Expand Down Expand Up @@ -219,7 +219,7 @@ TEST(GalaxyConcurrentThreads, WriteToAllChipsDram) {

TEST(GalaxyConcurrentThreads, PushInputsWhileSignalingCluster) {
// Galaxy Setup
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
std::set<chip_id_t> target_devices = {0, 1, 2, 3, 4, 5, 6, 7, 8};
for (const auto& chip : target_devices) {
// Verify that selected chips are in the cluster
Expand Down
6 changes: 3 additions & 3 deletions tests/galaxy/test_umd_remote_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static const std::string SOC_DESC_PATH = "tests/soc_descs/wormhole_b0_8x10.yaml"

void run_remote_read_write_test(uint32_t vector_size, bool dram_write) {
// Galaxy Setup
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
std::set<chip_id_t> target_devices = {};
for (const auto& chip : cluster_desc->get_all_chips()) {
target_devices.insert(chip);
Expand Down Expand Up @@ -127,7 +127,7 @@ TEST(GalaxyBasicReadWrite, LargeRemoteDramBlockReadWrite) { run_remote_read_writ
void run_data_mover_test(
uint32_t vector_size, tt_multichip_core_addr sender_core, tt_multichip_core_addr receiver_core) {
// Galaxy Setup
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
std::set<chip_id_t> target_devices = {};
for (const auto& chip : cluster_desc->get_all_chips()) {
target_devices.insert(chip);
Expand Down Expand Up @@ -246,7 +246,7 @@ TEST(GalaxyDataMovement, TwoChipMoveData4) {
void run_data_broadcast_test(
uint32_t vector_size, tt_multichip_core_addr sender_core, std::vector<tt_multichip_core_addr> receiver_cores) {
// Galaxy Setup
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::shared_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
std::set<chip_id_t> target_devices = {};
for (const auto& chip : cluster_desc->get_all_chips()) {
target_devices.insert(chip);
Expand Down
2 changes: 1 addition & 1 deletion tests/galaxy/test_umd_remote_api_stability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WormholeGalaxyStabilityTestFixture : public WormholeTestFixture {
static uint32_t scale_number_of_tests;

static void SetUpTestSuite() {
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
detected_num_chips = cluster_desc->get_number_of_chips();
if (detected_num_chips < EXPECTED_MIN_CHIPS) {
skip_tests = true;
Expand Down
2 changes: 1 addition & 1 deletion tests/wormhole/test_cluster_wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ std::int32_t get_static_tlb_index(tt_xy_pair target) {

std::set<chip_id_t> get_target_devices() {
std::set<chip_id_t> target_devices;
std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq = tt_ClusterDescriptor::create();
std::unique_ptr<tt_ClusterDescriptor> cluster_desc_uniq = Cluster::create_cluster_descriptor();
for (int i = 0; i < cluster_desc_uniq->get_number_of_chips(); i++) {
target_devices.insert(i);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/wormhole/test_umd_remote_api_stability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WormholeNebulaX2TestFixture : public WormholeTestFixture {
static uint32_t scale_number_of_tests;

static void SetUpTestSuite() {
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = tt_ClusterDescriptor::create();
std::unique_ptr<tt_ClusterDescriptor> cluster_desc = Cluster::create_cluster_descriptor();
detected_num_chips = cluster_desc->get_number_of_chips();
if (detected_num_chips != EXPECTED_NUM_CHIPS) {
skip_tests = true;
Expand Down
Loading