Skip to content

Commit

Permalink
UMD create_mock_cluster and fix PhysicalCoordinate (#15411)
Browse files Browse the repository at this point in the history
This is PR similar to #15301. It previously broke CI pipelines, but this
PR has a fix for that.

### Ticket
Related to #13948

### Problem description
Tied to UMD change tenstorrent/tt-umd#310

### What's changed
- Rename and clear up create_for_grayskull_cluster to
create_mock_cluster
- For grayskull, the CEM already works, and the create_from_yaml path is
successfully used already
- eth_coord_t was updated in
tenstorrent/tt-umd#306 , there is a change on
how PhysicalCoordinate is created to reflect that.

### Checklist
- [x] All post-commit tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033347997
- [x] Blackhole post-commit tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033347995
- [ ] (Single-card) Model perf tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033439959
- [ ] (Single-card) Device perf regressions :
https://github.com/tenstorrent/tt-metal/actions/runs/12033442095
- [x] (T3K) T3000 unit tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033456773
- [x] (T3K) T3000 demo tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033517770
- [x] (TG) TG unit tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033520415
- [x] (TG) TG demo tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033522422
- [x] (TGG) TGG unit tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033524632
- [x] (TGG) TGG demo tests :
https://github.com/tenstorrent/tt-metal/actions/runs/12033526704
  • Loading branch information
broskoTT authored and gfengTT committed Nov 27, 2024
1 parent 69870bd commit f8f1042
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 113 deletions.
2 changes: 1 addition & 1 deletion tt_metal/distributed/mesh_configurations/N300.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"logical_to_physical_coordinates": [
[[0, 0], [0, 0, 0, 0]], [[0, 1], [0, 1, 0, 0]]
[[0, 0], [0, 0, 0, 0, 0]], [[0, 1], [0, 0, 1, 0, 0]]
]
}
4 changes: 2 additions & 2 deletions tt_metal/distributed/mesh_configurations/T3000.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"logical_to_physical_coordinates": [
[[0, 0], [0, 0, 0, 0]], [[0, 1], [0, 1, 0, 0]], [[0, 2], [0, 2, 0, 0]], [[0, 3], [0, 3, 0, 0]],
[[1, 0], [1, 0, 0, 0]], [[1, 1], [1, 1, 0, 0]], [[1, 2], [1, 2, 0, 0]], [[1, 3], [1, 3, 0, 0]]
[[0, 0], [0, 0, 0, 0, 0]], [[0, 1], [0, 0, 1, 0, 0]], [[0, 2], [0, 0, 2, 0, 0]], [[0, 3], [0, 0, 3, 0, 0]],
[[1, 0], [0, 1, 0, 0, 0]], [[1, 1], [0, 1, 1, 0, 0]], [[1, 2], [0, 1, 2, 0, 0]], [[1, 3], [0, 1, 3, 0, 0]]
]
}
64 changes: 32 additions & 32 deletions tt_metal/distributed/mesh_configurations/TG.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"logical_to_physical_coordinates": [
[[0, 0], [7, 3, 0, 1]],
[[0, 1], [7, 2, 0, 1]],
[[0, 2], [7, 1, 0, 1]],
[[0, 3], [7, 0, 0, 1]],
[[1, 0], [6, 3, 0, 1]],
[[1, 1], [6, 2, 0, 1]],
[[1, 2], [6, 1, 0, 1]],
[[1, 3], [6, 0, 0, 1]],
[[2, 0], [5, 3, 0, 1]],
[[2, 1], [5, 2, 0, 1]],
[[2, 2], [5, 1, 0, 1]],
[[2, 3], [5, 0, 0, 1]],
[[3, 0], [4, 3, 0, 1]],
[[3, 1], [4, 2, 0, 1]],
[[3, 2], [4, 1, 0, 1]],
[[3, 3], [4, 0, 0, 1]],
[[4, 0], [3, 3, 0, 1]],
[[4, 1], [3, 2, 0, 1]],
[[4, 2], [3, 1, 0, 1]],
[[4, 3], [3, 0, 0, 1]],
[[5, 0], [2, 3, 0, 1]],
[[5, 1], [2, 2, 0, 1]],
[[5, 2], [2, 1, 0, 1]],
[[5, 3], [2, 0, 0, 1]],
[[6, 0], [1, 3, 0, 1]],
[[6, 1], [1, 2, 0, 1]],
[[6, 2], [1, 1, 0, 1]],
[[6, 3], [1, 0, 0, 1]],
[[7, 0], [0, 3, 0, 1]],
[[7, 1], [0, 2, 0, 1]],
[[7, 2], [0, 1, 0, 1]],
[[7, 3], [0, 0, 0, 1]]
[[0, 0], [0, 7, 3, 0, 1]],
[[0, 1], [0, 7, 2, 0, 1]],
[[0, 2], [0, 7, 1, 0, 1]],
[[0, 3], [0, 7, 0, 0, 1]],
[[1, 0], [0, 6, 3, 0, 1]],
[[1, 1], [0, 6, 2, 0, 1]],
[[1, 2], [0, 6, 1, 0, 1]],
[[1, 3], [0, 6, 0, 0, 1]],
[[2, 0], [0, 5, 3, 0, 1]],
[[2, 1], [0, 5, 2, 0, 1]],
[[2, 2], [0, 5, 1, 0, 1]],
[[2, 3], [0, 5, 0, 0, 1]],
[[3, 0], [0, 4, 3, 0, 1]],
[[3, 1], [0, 4, 2, 0, 1]],
[[3, 2], [0, 4, 1, 0, 1]],
[[3, 3], [0, 4, 0, 0, 1]],
[[4, 0], [0, 3, 3, 0, 1]],
[[4, 1], [0, 3, 2, 0, 1]],
[[4, 2], [0, 3, 1, 0, 1]],
[[4, 3], [0, 3, 0, 0, 1]],
[[5, 0], [0, 2, 3, 0, 1]],
[[5, 1], [0, 2, 2, 0, 1]],
[[5, 2], [0, 2, 1, 0, 1]],
[[5, 3], [0, 2, 0, 0, 1]],
[[6, 0], [0, 1, 3, 0, 1]],
[[6, 1], [0, 1, 2, 0, 1]],
[[6, 2], [0, 1, 1, 0, 1]],
[[6, 3], [0, 1, 0, 0, 1]],
[[7, 0], [0, 0, 3, 0, 1]],
[[7, 1], [0, 0, 2, 0, 1]],
[[7, 2], [0, 0, 1, 0, 1]],
[[7, 3], [0, 0, 0, 0, 1]]
]
}
128 changes: 64 additions & 64 deletions tt_metal/distributed/mesh_configurations/TGG.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
{
"logical_to_physical_coordinates": [
[[0, 0], [0, 3, 0, 1]],
[[0, 1], [0, 2, 0, 1]],
[[0, 2], [0, 1, 0, 1]],
[[0, 3], [0, 0, 0, 1]],
[[1, 0], [1, 3, 0, 1]],
[[1, 1], [1, 2, 0, 1]],
[[1, 2], [1, 1, 0, 1]],
[[1, 3], [1, 0, 0, 1]],
[[2, 0], [2, 3, 0, 1]],
[[2, 1], [2, 2, 0, 1]],
[[2, 2], [2, 1, 0, 1]],
[[2, 3], [2, 0, 0, 1]],
[[3, 0], [3, 3, 0, 1]],
[[3, 1], [3, 2, 0, 1]],
[[3, 2], [3, 1, 0, 1]],
[[3, 3], [3, 0, 0, 1]],
[[4, 0], [4, 3, 0, 1]],
[[4, 1], [4, 2, 0, 1]],
[[4, 2], [4, 1, 0, 1]],
[[4, 3], [4, 0, 0, 1]],
[[5, 0], [5, 3, 0, 1]],
[[5, 1], [5, 2, 0, 1]],
[[5, 2], [5, 1, 0, 1]],
[[5, 3], [5, 0, 0, 1]],
[[6, 0], [6, 3, 0, 1]],
[[6, 1], [6, 2, 0, 1]],
[[6, 2], [6, 1, 0, 1]],
[[6, 3], [6, 0, 0, 1]],
[[7, 0], [7, 3, 0, 1]],
[[7, 1], [7, 2, 0, 1]],
[[7, 2], [7, 1, 0, 1]],
[[7, 3], [7, 0, 0, 1]],
[[0, 4], [0, 0, 0, 2]],
[[0, 5], [0, 1, 0, 2]],
[[0, 6], [0, 2, 0, 2]],
[[0, 7], [0, 3, 0, 2]],
[[1, 4], [1, 0, 0, 2]],
[[1, 5], [1, 1, 0, 2]],
[[1, 6], [1, 2, 0, 2]],
[[1, 7], [1, 3, 0, 2]],
[[2, 4], [2, 0, 0, 2]],
[[2, 5], [2, 1, 0, 2]],
[[2, 6], [2, 2, 0, 2]],
[[2, 7], [2, 3, 0, 2]],
[[3, 4], [3, 0, 0, 2]],
[[3, 5], [3, 1, 0, 2]],
[[3, 6], [3, 2, 0, 2]],
[[3, 7], [3, 3, 0, 2]],
[[4, 4], [4, 0, 0, 2]],
[[4, 5], [4, 1, 0, 2]],
[[4, 6], [4, 2, 0, 2]],
[[4, 7], [4, 3, 0, 2]],
[[5, 4], [5, 0, 0, 2]],
[[5, 5], [5, 1, 0, 2]],
[[5, 6], [5, 2, 0, 2]],
[[5, 7], [5, 3, 0, 2]],
[[6, 4], [6, 0, 0, 2]],
[[6, 5], [6, 1, 0, 2]],
[[6, 6], [6, 2, 0, 2]],
[[6, 7], [6, 3, 0, 2]],
[[7, 4], [7, 0, 0, 2]],
[[7, 5], [7, 1, 0, 2]],
[[7, 6], [7, 2, 0, 2]],
[[7, 7], [7, 3, 0, 2]]
[[0, 0], [0, 0, 3, 0, 1]],
[[0, 1], [0, 0, 2, 0, 1]],
[[0, 2], [0, 0, 1, 0, 1]],
[[0, 3], [0, 0, 0, 0, 1]],
[[1, 0], [0, 1, 3, 0, 1]],
[[1, 1], [0, 1, 2, 0, 1]],
[[1, 2], [0, 1, 1, 0, 1]],
[[1, 3], [0, 1, 0, 0, 1]],
[[2, 0], [0, 2, 3, 0, 1]],
[[2, 1], [0, 2, 2, 0, 1]],
[[2, 2], [0, 2, 1, 0, 1]],
[[2, 3], [0, 2, 0, 0, 1]],
[[3, 0], [0, 3, 3, 0, 1]],
[[3, 1], [0, 3, 2, 0, 1]],
[[3, 2], [0, 3, 1, 0, 1]],
[[3, 3], [0, 3, 0, 0, 1]],
[[4, 0], [0, 4, 3, 0, 1]],
[[4, 1], [0, 4, 2, 0, 1]],
[[4, 2], [0, 4, 1, 0, 1]],
[[4, 3], [0, 4, 0, 0, 1]],
[[5, 0], [0, 5, 3, 0, 1]],
[[5, 1], [0, 5, 2, 0, 1]],
[[5, 2], [0, 5, 1, 0, 1]],
[[5, 3], [0, 5, 0, 0, 1]],
[[6, 0], [0, 6, 3, 0, 1]],
[[6, 1], [0, 6, 2, 0, 1]],
[[6, 2], [0, 6, 1, 0, 1]],
[[6, 3], [0, 6, 0, 0, 1]],
[[7, 0], [0, 7, 3, 0, 1]],
[[7, 1], [0, 7, 2, 0, 1]],
[[7, 2], [0, 7, 1, 0, 1]],
[[7, 3], [0, 7, 0, 0, 1]],
[[0, 4], [0, 0, 0, 0, 2]],
[[0, 5], [0, 0, 1, 0, 2]],
[[0, 6], [0, 0, 2, 0, 2]],
[[0, 7], [0, 0, 3, 0, 2]],
[[1, 4], [0, 1, 0, 0, 2]],
[[1, 5], [0, 1, 1, 0, 2]],
[[1, 6], [0, 1, 2, 0, 2]],
[[1, 7], [0, 1, 3, 0, 2]],
[[2, 4], [0, 2, 0, 0, 2]],
[[2, 5], [0, 2, 1, 0, 2]],
[[2, 6], [0, 2, 2, 0, 2]],
[[2, 7], [0, 2, 3, 0, 2]],
[[3, 4], [0, 3, 0, 0, 2]],
[[3, 5], [0, 3, 1, 0, 2]],
[[3, 6], [0, 3, 2, 0, 2]],
[[3, 7], [0, 3, 3, 0, 2]],
[[4, 4], [0, 4, 0, 0, 2]],
[[4, 5], [0, 4, 1, 0, 2]],
[[4, 6], [0, 4, 2, 0, 2]],
[[4, 7], [0, 4, 3, 0, 2]],
[[5, 4], [0, 5, 0, 0, 2]],
[[5, 5], [0, 5, 1, 0, 2]],
[[5, 6], [0, 5, 2, 0, 2]],
[[5, 7], [0, 5, 3, 0, 2]],
[[6, 4], [0, 6, 0, 0, 2]],
[[6, 5], [0, 6, 1, 0, 2]],
[[6, 6], [0, 6, 2, 0, 2]],
[[6, 7], [0, 6, 3, 0, 2]],
[[7, 4], [0, 7, 0, 0, 2]],
[[7, 5], [0, 7, 1, 0, 2]],
[[7, 6], [0, 7, 2, 0, 2]],
[[7, 7], [0, 7, 3, 0, 2]]
]
}
2 changes: 1 addition & 1 deletion tt_metal/distributed/mesh_configurations/device.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"logical_to_physical_coordinates": [
[[0, 0], [0, 0, 0, 0]]
[[0, 0], [0, 0, 0, 0, 0]]
]
}
10 changes: 8 additions & 2 deletions tt_metal/distributed/mesh_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ static std::unordered_map<LogicalCoordinate, PhysicalCoordinate> load_translatio

std::unordered_map<LogicalCoordinate, PhysicalCoordinate> result;
for (const auto& mapping : j[key]) {
if (mapping.size() != 2 || mapping[0].size() != 2 || mapping[1].size() != 4) {
if (mapping.size() != 2 || mapping[0].size() != 2 || mapping[1].size() != 5) {
throw std::runtime_error("Invalid coordinate format in JSON file: " + filename);
}
result.emplace(LogicalCoordinate{mapping[0][0], mapping[0][1]}, PhysicalCoordinate{mapping[1][1], mapping[1][0], mapping[1][2], mapping[1][3]});
result.emplace(LogicalCoordinate{mapping[0][0], mapping[0][1]}, PhysicalCoordinate{
mapping[1][0], // cluster_id
mapping[1][2], // x
mapping[1][1], // y
mapping[1][3], // rack
mapping[1][4] // shelf
});
}

return result;
Expand Down
12 changes: 2 additions & 10 deletions tt_metal/llrt/tt_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,8 @@ void Cluster::generate_cluster_descriptor() {

// Cluster descriptor yaml not available for Blackhole bring up
if (this->target_type_ == TargetDevice::Simulator) {
// Cannot use tt::umd::Cluster::detect_available_device_ids because that returns physical device IDs
std::vector<chip_id_t> physical_mmio_device_ids;
std::set<chip_id_t> logical_mmio_device_ids;
physical_mmio_device_ids = tt_SimulationDevice::detect_available_device_ids();
for (chip_id_t logical_mmio_device_id = 0; logical_mmio_device_id < physical_mmio_device_ids.size();
logical_mmio_device_id++) {
logical_mmio_device_ids.insert(logical_mmio_device_id);
}
this->cluster_desc_ =
tt_ClusterDescriptor::create_for_grayskull_cluster(logical_mmio_device_ids, physical_mmio_device_ids);
// Passing simulator reported physical devices as logical devices.
this->cluster_desc_ = tt_ClusterDescriptor::create_mock_cluster(tt_SimulationDevice::detect_available_device_ids(), this->arch_);
} else {
this->cluster_desc_ = tt_ClusterDescriptor::create_from_yaml(this->cluster_desc_path_);
for (const auto &chip_id : this->cluster_desc_->get_all_chips()) {
Expand Down
2 changes: 1 addition & 1 deletion tt_metal/third_party/umd
Submodule umd updated 103 files

0 comments on commit f8f1042

Please sign in to comment.