-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dvartanians/fix_yolov4_faster_webdemo
- Loading branch information
Showing
87 changed files
with
1,023 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,12 +50,12 @@ on: | |
required: true | ||
type: string | ||
description: "Timeout (eg: 5m, 1h)" | ||
description: | ||
type: string | ||
default: "Git bisect dispatch" | ||
patch: | ||
required: false | ||
type: string | ||
description: "Commit-ish to cherry-pick for each step" | ||
|
||
run-name: ${{ inputs.description }} | ||
run-name: "Bisect on ${{ inputs.runner-label }}" | ||
jobs: | ||
build-artifact: | ||
uses: ./.github/workflows/build-artifact.yaml | ||
|
@@ -88,8 +88,11 @@ jobs: | |
- uses: ./.github/actions/install-python-deps | ||
- name: Run Git Bisect | ||
shell: bash | ||
env: | ||
GIT_COMMITTER_NAME: "GitHub Actions" | ||
GIT_COMMITTER_EMAIL: "[email protected]" | ||
run: | | ||
source ${{ github.workspace }}/python_env/bin/activate | ||
cd $TT_METAL_HOME | ||
export PYTHONPATH=$TT_METAL_HOME | ||
./tests/scripts/tt_bisect.sh -t ${{ inputs.timeout }} -f "${{ inputs.command }}" -b ${{ inputs.bad-commit }} -g ${{ inputs.good-commit }} | ||
./tests/scripts/tt_bisect.sh -t ${{ inputs.timeout }} -f "${{ inputs.command }}" -b ${{ inputs.bad-commit }} -g ${{ inputs.good-commit }} -p "${{ inputs.patch }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// SPDX-FileCopyrightText: © 2024 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include <gtest/gtest.h> | ||
#include <gmock/gmock.h> | ||
|
||
#include "mesh_device.hpp" | ||
#include "system_mesh.hpp" | ||
|
||
#include "tests/tt_metal/tt_metal/common/multi_device_fixture.hpp" | ||
|
||
namespace tt::tt_metal::distributed { | ||
namespace { | ||
|
||
using ::testing::IsEmpty; | ||
using ::testing::SizeIs; | ||
using ::tt::tt_metal::distributed::MeshContainer; | ||
|
||
TEST(MeshDeviceInitTest, Init1x1Mesh) { | ||
auto& sys = SystemMesh::instance(); | ||
|
||
auto config = tt::tt_metal::distributed::MeshDeviceConfig{.mesh_shape = MeshShape(1, 1)}; | ||
|
||
EXPECT_NO_THROW({ | ||
auto mesh = tt::tt_metal::distributed::MeshDevice::create( | ||
config, DEFAULT_L1_SMALL_SIZE, DEFAULT_TRACE_REGION_SIZE, 1, tt::tt_metal::DispatchCoreType::WORKER); | ||
mesh->close(); | ||
}); | ||
} | ||
|
||
using MeshDeviceTest = T3000MeshDeviceFixture; | ||
|
||
TEST_F(MeshDeviceTest, SystemMeshTearDownWithoutClose) { | ||
auto& sys = SystemMesh::instance(); | ||
|
||
const auto system_shape = sys.get_shape(); | ||
ASSERT_EQ(system_shape.dims(), 2); | ||
EXPECT_EQ(system_shape[0], 2); | ||
EXPECT_EQ(system_shape[1], 4); | ||
} | ||
|
||
TEST_F(MeshDeviceTest, MemoryAllocationStatistics) { | ||
auto stats = mesh_device_->allocator()->get_statistics(tt::tt_metal::BufferType::DRAM); | ||
for (auto* device : mesh_device_->get_devices()) { | ||
auto device_stats = device->allocator()->get_statistics(tt::tt_metal::BufferType::DRAM); | ||
EXPECT_EQ(stats.total_allocatable_size_bytes, device_stats.total_allocatable_size_bytes); | ||
} | ||
} | ||
|
||
TEST_F(MeshDeviceTest, NumDramChannels) { | ||
EXPECT_EQ(mesh_device_->num_dram_channels(), 96); // 8 devices * 12 channels | ||
} | ||
|
||
TEST_F(MeshDeviceTest, ViewIs2D) { | ||
std::vector<IDevice*> devices = mesh_device_->get_devices(); | ||
|
||
MeshContainer<IDevice*> container_1d(SimpleMeshShape(8), devices); | ||
MeshDeviceView view_1d(container_1d); | ||
EXPECT_FALSE(view_1d.is_mesh_2d()); | ||
|
||
MeshContainer<IDevice*> container_2d(SimpleMeshShape(2, 4), devices); | ||
MeshDeviceView view_2d(container_2d); | ||
EXPECT_TRUE(view_2d.is_mesh_2d()); | ||
|
||
MeshContainer<IDevice*> container_3d(SimpleMeshShape(2, 2, 2), devices); | ||
MeshDeviceView view_3d(container_3d); | ||
EXPECT_FALSE(view_3d.is_mesh_2d()); | ||
} | ||
|
||
TEST_F(MeshDeviceTest, Submesh) { | ||
EXPECT_EQ(mesh_device_->shape().num_rows, 2); | ||
EXPECT_EQ(mesh_device_->shape().num_cols, 4); | ||
EXPECT_THAT(mesh_device_->get_devices(), SizeIs(8)); | ||
EXPECT_TRUE(mesh_device_->is_parent_mesh()); | ||
EXPECT_THAT(mesh_device_->get_submeshes(), IsEmpty()); | ||
|
||
auto submesh = mesh_device_->create_submesh(MeshShape{1, 2}, MeshOffset{1, 1}); | ||
EXPECT_THAT(mesh_device_->get_submeshes(), SizeIs(1)); | ||
EXPECT_EQ(submesh->shape().num_rows, 1); | ||
EXPECT_EQ(submesh->shape().num_cols, 2); | ||
EXPECT_THAT(submesh->get_devices(), SizeIs(2)); | ||
EXPECT_FALSE(submesh->is_parent_mesh()); | ||
EXPECT_THAT(submesh->get_submeshes(), IsEmpty()); | ||
|
||
// Verify coordinates are correct. | ||
EXPECT_EQ(mesh_device_->get_device(MeshCoordinate{1, 1})->id(), submesh->get_device(MeshCoordinate{0, 0})->id()); | ||
EXPECT_EQ(mesh_device_->get_device(MeshCoordinate{1, 2})->id(), submesh->get_device(MeshCoordinate{0, 1})->id()); | ||
EXPECT_EQ(submesh->get_device(1, 1), nullptr); | ||
} | ||
|
||
} // namespace | ||
} // namespace tt::tt_metal::distributed |
Oops, something went wrong.