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

UMD bump: Remove usage of create-ethernet-map #14718

Merged
merged 3 commits into from
Nov 6, 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
39 changes: 4 additions & 35 deletions tt_metal/llrt/tt_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "third_party/umd/device/tt_soc_descriptor.h"
#include "third_party/umd/device/tt_xy_pair.h"
#include "third_party/umd/device/xy_pair.h"
#include "third_party/umd/device/hugepage.h"

// TODO: ARCH_NAME specific, must remove
#include "eth_l1_address_map.h"
Expand Down Expand Up @@ -127,38 +128,6 @@ void Cluster::detect_arch_and_target() {
this->target_type_);
}

std::filesystem::path get_cluster_desc_yaml() {
namespace fs = std::filesystem;

// TODO: The interface into create-ethernet-map should be through an API rather a
// subprocess call to the binary
const fs::path tt_metal_dir = fs::path(tt::llrt::OptionsG.get_root_dir()) / "tt_metal";
const fs::path umd_path = fs::path(tt::llrt::OptionsG.get_root_dir()) / ".umd";
fs::create_directory(umd_path);
const fs::path cluster_desc_path = umd_path / "cluster_desc.yaml";
if (!fs::exists(cluster_desc_path)) {
auto val = system(("touch " + cluster_desc_path.string()).c_str());
if (val != 0)
throw std::runtime_error("YAML Cluster folder and file before create-ethernet-map failed!");
}

// Generates the cluster descriptor in the CWD

#if defined(__x86_64__) || defined(__i386__)
const fs::path eth_fpath = tt_metal_dir / "third_party/umd/device/bin/silicon/x86/create-ethernet-map";
#elif defined(__aarch64__) || defined(_M_ARM64)
const fs::path eth_fpath = tt_metal_dir / "third_party/umd/device/bin/silicon/aarch64/create-ethernet-map";
#else
#error "Unsupported host architecture"
#endif
std::string cmd = eth_fpath.string() + " " + cluster_desc_path.string();
int val = system(cmd.c_str());
if (val != 0)
throw std::runtime_error("Cluster Generation with create-ethernet-map Failed!");

return fs::absolute(cluster_desc_path);
}

bool Cluster::is_galaxy_cluster() const {
return this->is_tg_cluster_;
}
Expand All @@ -169,10 +138,10 @@ BoardType Cluster::get_board_type(chip_id_t chip_id) const {

void Cluster::generate_cluster_descriptor() {
this->cluster_desc_path_ = (this->target_type_ == TargetDevice::Silicon and this->arch_ == tt::ARCH::WORMHOLE_B0)
? get_cluster_desc_yaml().string()
? tt_ClusterDescriptor::get_cluster_descriptor_file_path()
: "";

// create-eth-map not available for Blackhole bring up
// Cluster descriptor yaml not available for Blackhole bring up
if (this->arch_ == tt::ARCH::GRAYSKULL or this->arch_ == tt::ARCH::BLACKHOLE or this->target_type_ == TargetDevice::Simulator) {
// Cannot use tt_SiliconDevice::detect_available_device_ids because that returns physical device IDs
std::vector<chip_id_t> physical_mmio_device_ids;
Expand Down Expand Up @@ -212,7 +181,7 @@ void Cluster::generate_cluster_descriptor() {
}
}

uint32_t total_num_hugepages = get_num_hugepages();
uint32_t total_num_hugepages = tt::umd::get_num_hugepages();
if (this->is_tg_cluster_) {
// TODO: don't think this check is correct, we want to have total num hugepages == num chips even for Galaxy
TT_FATAL(
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/third_party/umd
Submodule umd updated 36 files
+1 −0 .gitattributes
+1 −0 .github/docker_install_common.sh
+16 −0 .github/pull_request_template.md
+1 −0 .github/workflows/build-device.yml
+3 −0 .github/workflows/build-image.yml
+2 −3 .github/workflows/build-tests.yml
+3 −1 device/CMakeLists.txt
+ device/bin/silicon/aarch64/create-ethernet-map
+ device/bin/silicon/x86/create-ethernet-map
+2 −0 device/coordinate_manager.h
+179 −0 device/hugepage.cpp
+30 −0 device/hugepage.h
+9 −0 device/libs/README.md
+3 −0 device/libs/aarch64/libcreate_ethernet_map.a
+4 −0 device/libs/create_ethernet_map.h
+3 −0 device/libs/x86_64/libcreate_ethernet_map.a
+110 −1 device/pcie/pci_device.cpp
+16 −0 device/pcie/pci_device.hpp
+20 −0 device/tt_cluster_descriptor.cpp
+4 −0 device/tt_cluster_descriptor.h
+1 −0 device/tt_cluster_descriptor_types.h
+0 −11 device/tt_device.h
+48 −343 device/tt_silicon_driver.cpp
+14 −2 tests/api/test_chip.cpp
+2 −2 tests/api/test_cluster.cpp
+1 −1 tests/api/test_cluster_descriptor.cpp
+1 −1 tests/blackhole/test_bh_common.h
+6 −6 tests/blackhole/test_silicon_driver_bh.cpp
+3 −3 tests/galaxy/test_umd_concurrent_threads.cpp
+3 −3 tests/galaxy/test_umd_remote_api.cpp
+1 −1 tests/galaxy/test_umd_remote_api_stability.cpp
+0 −36 tests/test_utils/generate_cluster_desc.cpp
+0 −25 tests/test_utils/generate_cluster_desc.hpp
+13 −13 tests/wormhole/test_silicon_driver_wh.cpp
+1 −1 tests/wormhole/test_umd_remote_api_stability.cpp
+1 −1 tests/wormhole/test_wh_common.h
Loading