From 84ebdd1de25ff35575d8c19b4fd9fe60235b7b7a Mon Sep 17 00:00:00 2001 From: pjanevski Date: Tue, 12 Nov 2024 13:15:16 +0000 Subject: [PATCH] Potential fix for CI tests --- .github/workflows/build-tests.yml | 4 +++- common/utils.hpp | 3 ++- device/tt_device.h | 1 - device/tt_silicon_driver.cpp | 6 ++---- tests/api/test_cluster.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 5edd35eb..76af9925 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -33,6 +33,7 @@ env: LIB_OUTPUT_DIR: ./build/lib DEPS_OUTPUT_DIR: ./build/_deps TEST_OUTPUT_DIR: ./build/test + DEVICE_DIR: ./build/device jobs: build: @@ -74,7 +75,8 @@ jobs: run: | tar cvf artifact.tar ${{ env.TEST_OUTPUT_DIR }} \ ${{ env.LIB_OUTPUT_DIR }} \ - ${{ env.DEPS_OUTPUT_DIR }} + ${{ env.DEPS_OUTPUT_DIR }} \ + ${{ env.DEVICE_DIR }} - name: Upload build artifacts archive uses: actions/upload-artifact@v4 diff --git a/common/utils.hpp b/common/utils.hpp index 658d229c..b8cba9f5 100644 --- a/common/utils.hpp +++ b/common/utils.hpp @@ -7,6 +7,7 @@ #pragma once #include +#include #include namespace tt::umd::utils { @@ -20,7 +21,7 @@ std::string get_abs_path(std::string path) { umd_root = current_file_path.parent_path().parent_path(); } else { std::filesystem::path umd_root_relative = - std::filesystem::relative(std::filesystem::path(__FILE__).parent_path().parent_path().parent_path(), "../"); + std::filesystem::relative(std::filesystem::path(__FILE__).parent_path().parent_path(), "../"); umd_root = std::filesystem::canonical(umd_root_relative); } std::filesystem::path abs_path = umd_root / path; diff --git a/device/tt_device.h b/device/tt_device.h index a3e7fd69..d6cd8399 100644 --- a/device/tt_device.h +++ b/device/tt_device.h @@ -716,7 +716,6 @@ class tt_SiliconDevice: public tt_device virtual tt_version get_ethernet_fw_version() const; // TODO: This should be accessible through public API, probably to be moved to tt_device. PCIDevice *get_pci_device(int device_id) const; - const tt_ClusterDescriptor* get_cluster_desc(); // Destructor virtual ~tt_SiliconDevice (); diff --git a/device/tt_silicon_driver.cpp b/device/tt_silicon_driver.cpp index d597c0e0..e4f6f405 100644 --- a/device/tt_silicon_driver.cpp +++ b/device/tt_silicon_driver.cpp @@ -169,10 +169,6 @@ std::unordered_map& tt_SiliconDevice::get_virtual_s return soc_descriptor_per_chip; } -const tt_ClusterDescriptor* tt_SiliconDevice::get_cluster_desc() { - return ndesc.get(); -} - void tt_SiliconDevice::initialize_interprocess_mutexes(int pci_interface_id, bool cleanup_mutexes_in_shm) { // These mutexes are intended to be based on physical devices/pci-intf not logical. Set these up ahead of time here (during device init) // since its unsafe to modify shared state during multithreaded runtime. @@ -434,6 +430,7 @@ void tt_SiliconDevice::construct_tt_silicon_device(const uint32_t &num_host_mem_ tt_SiliconDevice::tt_SiliconDevice(const uint32_t &num_host_mem_ch_per_mmio_device, const bool skip_driver_allocs, const bool clean_system_resources, bool perform_harvesting, std::unordered_map simulated_harvesting_masks) : tt_device() { + // TODO: this should be fetched through ClusterDescriptor auto available_device_ids = detect_available_device_ids(); m_num_pci_devices = available_device_ids.size(); @@ -466,6 +463,7 @@ tt_SiliconDevice::tt_SiliconDevice(const uint32_t &num_host_mem_ch_per_mmio_devi tt_SiliconDevice::tt_SiliconDevice(const std::string &sdesc_path, const std::string &ndesc_path, const std::set &target_devices, const uint32_t &num_host_mem_ch_per_mmio_device, const bool skip_driver_allocs, const bool clean_system_resources, bool perform_harvesting, std::unordered_map simulated_harvesting_masks) : tt_device() { + // TODO: this should be fetched through ClusterDescriptor auto available_device_ids = detect_available_device_ids(); m_num_pci_devices = available_device_ids.size(); diff --git a/tests/api/test_cluster.cpp b/tests/api/test_cluster.cpp index 968e7147..d277256a 100644 --- a/tests/api/test_cluster.cpp +++ b/tests/api/test_cluster.cpp @@ -60,7 +60,7 @@ TEST(ApiClusterTest, OpenAllChips) { std::unique_ptr umd_cluster = get_ TEST(ApiClusterTest, SimpleIOAllChips) { std::unique_ptr umd_cluster = get_cluster(); - const tt_ClusterDescriptor* cluster_desc = umd_cluster->get_cluster_desc(); + const tt_ClusterDescriptor* cluster_desc = umd_cluster->get_cluster_description(); if (umd_cluster == nullptr || umd_cluster->get_all_chips_in_cluster().empty()) { std::cout << "No chips found. Skipping test." << std::endl; @@ -119,7 +119,7 @@ TEST(ApiClusterTest, SimpleIOAllChips) { TEST(ApiClusterTest, RemoteFlush) { std::unique_ptr umd_cluster = get_cluster(); - const tt_ClusterDescriptor* cluster_desc = umd_cluster->get_cluster_desc(); + const tt_ClusterDescriptor* cluster_desc = umd_cluster->get_cluster_description(); if (umd_cluster == nullptr || umd_cluster->get_all_chips_in_cluster().empty()) { std::cout << "No chips found. Skipping test." << std::endl;