Download code/models/common/tests/test_mesh_fixture_policy.py from tt-hous/clef: direct link, hf CLI and curl.
- Browser
- Download file 2.72 kB
-
https://huggingface.co/tt-hous/clef/resolve/main/code/models/common/tests/test_mesh_fixture_policy.py
- Command line
-
hf download hf://tt-hous/clef/code/models/common/tests/test_mesh_fixture_policy.py
-
curl -L -o test_mesh_fixture_policy.py https://huggingface.co/tt-hous/clef/resolve/main/code/models/common/tests/test_mesh_fixture_policy.py
2.72 kB
| # SPDX-FileCopyrightText: © 2026 Tenstorrent AI ULC | |
| # SPDX-License-Identifier: Apache-2.0 | |
| import pytest | |
| import ttnn | |
| from models.common.modules.tt_ccl import default_topology | |
| from models.common.tests.conftest import ( | |
| _allowed_req_shapes_for_system, | |
| _default_fabric_config, | |
| _is_physical_p150x4_cluster, | |
| _pick_parent_shape_for_submesh, | |
| ) | |
| def test_default_fabric_config(logical_shape, expected): | |
| assert _default_fabric_config(logical_shape) == expected | |
| def test_allowed_req_shapes_for_system(system_shape, expected): | |
| assert _allowed_req_shapes_for_system(system_shape) == expected | |
| def test_quietbox_square_system_uses_linear_full_device_view(): | |
| system_shape = (2, 2) | |
| allowed = _allowed_req_shapes_for_system(system_shape, blackhole_selected=True) | |
| assert (1, 4) in allowed | |
| assert (2, 2) not in allowed | |
| assert _pick_parent_shape_for_submesh(system_shape, (1, 4)) == (1, 4) | |
| def test_physical_four_die_bh_systems_admit_p150x4(cluster_type): | |
| assert _is_physical_p150x4_cluster(cluster_type) | |
| def test_default_ccl_topology(monkeypatch, cluster_type, num_devices, expected): | |
| class MeshDevice: | |
| def get_num_devices(self): | |
| return num_devices | |
| monkeypatch.setattr(ttnn.cluster, "get_cluster_type", lambda: cluster_type) | |
| assert default_topology(MeshDevice()) == expected | |