Skip to content

Commit 0eb576b

Browse files
authored
Package TT-NN and establish Smoke tests (#22971)
### Ticket #7915 ### Problem description * We have no .deb packages for TT-NN's C++ API * We have no (good) way to consume TT-Metalium / TT-NN as a subproject * We have no Smoke or Basic tests for TT-NN ### What's changed * Created a runtime and a validation .deb package for TT-NN * Created the start of a Smoke and Basic tests for TT-NN * Moved Metalium's Smoke test in PR Gate over to N300's which are keeping up with demand better than the N150's Consumption as a subproject is a future effort, but this is a stepping stone towards it. ### Checklist - [x] [All post commit](https://github.com/tenstorrent/tt-metal/actions/workflows/all-post-commit-workflows.yaml) CI [passes](https://github.com/tenstorrent/tt-metal/actions/runs/15427357452) - [ ] [Blackhole Post commit](https://github.com/tenstorrent/tt-metal/actions/workflows/blackhole-post-commit.yaml) CI with demo tests [passes](https://github.com/tenstorrent/tt-metal/actions/runs/15447345214) (essentially passed - Metalium Smoke was broken && this PR is TTNN-only)
1 parent 953b7ad commit 0eb576b

File tree

62 files changed

+761
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+761
-288
lines changed

.github/workflows/blackhole-post-commit.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
docker-image: ${{ needs.build-artifact.outputs.dev-docker-image }}
196196
build-artifact-name: ${{ needs.build-artifact.outputs.build-artifact-name }}
197197
wheel-artifact-name: ${{ needs.build-artifact.outputs.wheel-artifact-name }}
198-
smoke-tests:
198+
metalium-smoke-tests:
199199
needs: build-artifact
200200
strategy:
201201
fail-fast: false
@@ -209,6 +209,22 @@ jobs:
209209
docker-image: ${{ needs.build-artifact.outputs.dev-docker-image }}
210210
package-artifact-name: ${{ needs.build-artifact.outputs.packages-artifact-name }}
211211
runner: ${{ matrix.platform }}
212+
product: tt-metalium
213+
ttnn-smoke-tests:
214+
needs: build-artifact
215+
strategy:
216+
fail-fast: false
217+
matrix:
218+
platform: [
219+
"P100",
220+
"P150",
221+
]
222+
uses: ./.github/workflows/smoke.yaml
223+
with:
224+
docker-image: ${{ needs.build-artifact.outputs.dev-docker-image }}
225+
package-artifact-name: ${{ needs.build-artifact.outputs.packages-artifact-name }}
226+
runner: ${{ matrix.platform }}
227+
product: tt-nn
212228
# build-and-test-wheels:
213229
# uses: Check all-post-commit yaml for directions
214230
# secrets: inherit

.github/workflows/merge-gate.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
docs-changed: ${{ steps.find-changes.outputs.docs-changed }}
5555
cmake-changed: ${{ steps.find-changes.outputs.cmake-changed }}
5656
tt-metalium-changed: ${{ steps.find-changes.outputs.tt-metalium-changed }}
57+
tt-nn-changed: ${{ steps.find-changes.outputs.tt-nn-changed }}
5758
tt-metalium-or-tt-nn-tests-changed: ${{ steps.find-changes.outputs.tt-metalium-or-tt-nn-tests-changed }}
5859
steps:
5960
- id: find-changes
@@ -104,7 +105,7 @@ jobs:
104105
skip-tt-train: false
105106
publish-artifact: false
106107

107-
smoke-tests:
108+
metalium-smoke-tests:
108109
needs: [find-changes, build-tsan]
109110
if: ${{ github.ref_name == 'main' ||
110111
needs.find-changes.outputs.cmake-changed == 'true' ||
@@ -124,6 +125,29 @@ jobs:
124125
package-artifact-name: ${{ needs.build-tsan.outputs.packages-artifact-name }}
125126
runner: ${{ matrix.platform }}
126127
per-test-timeout: 10 # TSan can be slow; relax the timeout somewhat
128+
product: tt-metalium
129+
130+
ttnn-smoke-tests:
131+
needs: [find-changes, build-tsan]
132+
if: ${{ github.ref_name == 'main' ||
133+
needs.find-changes.outputs.cmake-changed == 'true' ||
134+
needs.find-changes.outputs.tt-nn-changed == 'true' ||
135+
needs.find-changes.outputs.tt-metalium-or-tt-nn-tests-changed == 'true'
136+
}}
137+
strategy:
138+
fail-fast: false
139+
matrix:
140+
platform: [
141+
"N300",
142+
"N300-llmbox",
143+
]
144+
uses: ./.github/workflows/smoke.yaml
145+
with:
146+
docker-image: ${{ needs.build-tsan.outputs.dev-docker-image }}
147+
package-artifact-name: ${{ needs.build-tsan.outputs.packages-artifact-name }}
148+
runner: ${{ matrix.platform }}
149+
per-test-timeout: 10 # TSan can be slow; relax the timeout somewhat
150+
product: tt-nn
127151

128152
build-asan:
129153
if: ${{ github.ref_name == 'main' ||
@@ -173,13 +197,13 @@ jobs:
173197
contains(join(needs.*.result, ','), 'success') ||
174198
contains(join(needs.*.result, ','), 'failure')
175199
}}
176-
needs: [static-checks, code-analysis, find-changes, build, build-docs, build-tsan, smoke-tests]
200+
needs: [static-checks, code-analysis, find-changes, build, build-docs, build-tsan, metalium-smoke-tests, ttnn-smoke-tests]
177201
runs-on: ubuntu-latest
178202
steps:
179203
- name: Check if all jobs passed
180204
uses: tenstorrent/tt-metal/.github/actions/workflow-status@main
181205
with:
182206
required-jobs: "static-checks, code-analysis, find-changes"
183-
optional-jobs: "build, build-docs, build-tsan, smoke-tests"
207+
optional-jobs: "build, build-docs, build-tsan, metalium-smoke-tests, ttnn-smoke-tests"
184208
env:
185209
NEEDS_CONTEXT: '${{ toJSON(needs) }}'

.github/workflows/pr-gate.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ jobs:
7171
outputs:
7272
cmake-changed: ${{ steps.find-changes.outputs.cmake-changed }}
7373
tt-metalium-changed: ${{ steps.find-changes.outputs.tt-metalium-changed }}
74+
tt-nn-changed: ${{ steps.find-changes.outputs.tt-nn-changed }}
7475
tt-metalium-or-tt-nn-tests-changed: ${{ steps.find-changes.outputs.tt-metalium-or-tt-nn-tests-changed }}
7576
steps:
7677
- id: find-changes
7778
uses: tenstorrent/tt-metal/.github/actions/find-changed-files@main
7879

79-
smoke-tests:
80+
metalium-smoke-tests:
8081
needs: [ asan-build, find-changed-files ]
8182
if: ${{
8283
needs.find-changed-files.outputs.cmake-changed == 'true' ||
@@ -94,6 +95,27 @@ jobs:
9495
docker-image: ${{ needs.asan-build.outputs.dev-docker-image }}
9596
package-artifact-name: ${{ needs.asan-build.outputs.packages-artifact-name }}
9697
runner: ${{ matrix.platform }}
98+
product: tt-metalium
99+
100+
ttnn-smoke-tests:
101+
needs: [ asan-build, find-changed-files ]
102+
if: ${{
103+
needs.find-changed-files.outputs.cmake-changed == 'true' ||
104+
needs.find-changed-files.outputs.tt-nn-changed == 'true' ||
105+
needs.find-changed-files.outputs.tt-metalium-or-tt-nn-tests-changed == 'true'
106+
}}
107+
strategy:
108+
fail-fast: false
109+
matrix:
110+
platform: [
111+
"N300",
112+
]
113+
uses: ./.github/workflows/smoke.yaml
114+
with:
115+
docker-image: ${{ needs.asan-build.outputs.dev-docker-image }}
116+
package-artifact-name: ${{ needs.asan-build.outputs.packages-artifact-name }}
117+
runner: ${{ matrix.platform }}
118+
product: tt-nn
97119

98120
build:
99121
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
@@ -143,13 +165,13 @@ jobs:
143165
contains(join(needs.*.result, ','), 'success') ||
144166
contains(join(needs.*.result, ','), 'failure')
145167
}}
146-
needs: [asan-build, smoke-tests, build, metalium-examples]
168+
needs: [asan-build, metalium-smoke-tests, ttnn-smoke-tests, build, metalium-examples]
147169
runs-on: ubuntu-latest
148170
steps:
149171
- name: Check if all jobs passed
150172
uses: tenstorrent/tt-metal/.github/actions/workflow-status@main
151173
with:
152174
required-jobs: "asan-build, build"
153-
optional-jobs: "smoke-tests, metalium-examples"
175+
optional-jobs: "metalium-smoke-tests, ttnn-smoke-tests, metalium-examples"
154176
env:
155177
NEEDS_CONTEXT: '${{ toJSON(needs) }}'

.github/workflows/smoke.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ on:
1616
required: false
1717
type: string
1818
default: 3.5
19+
product:
20+
required: true
21+
type: string # tt-metalium or tt-nn
1922

2023
jobs:
21-
metalium-smoke:
24+
smoke:
2225
runs-on: >-
2326
${{
2427
((inputs.runner == 'N150' || inputs.runner == 'N300' || inputs.runner == 'N300-llmbox') && format('tt-beta-ubuntu-2204-{0}-large-stable', inputs.runner))
@@ -47,7 +50,8 @@ jobs:
4750

4851
- name: Install packages
4952
run: |
50-
apt install ./pkgs/tt-metalium_*.deb ./pkgs/tt-metalium-jit_*.deb ./pkgs/tt-metalium-validation_*.deb
53+
# Ideally only ${{ inputs.product }}-validation, but APT doesn't resolve dependencies from files on disk without being told about them.
54+
apt install -y ./pkgs/tt-metalium_*.deb ./pkgs/tt-metalium-jit_*.deb ./pkgs/${{ inputs.product }}_*.deb ./pkgs/${{ inputs.product }}-validation_*.deb
5155
5256
- name: Run a test
5357
id: test
@@ -59,9 +63,10 @@ jobs:
5963
TT_METAL_WATCHER: 5
6064
TT_METAL_WATCHER_TEST_MODE: 1
6165
run: |
62-
/usr/bin/tt-metalium-validation-smoke
66+
/usr/bin/${{ inputs.product }}-validation-smoke
6367
6468
- name: workaround
69+
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
6570
run: |
6671
# The test-reporting action runs git ls-files with no way to opt-out.
6772
# Give it a dummy repo so it doesn't fail.
@@ -72,7 +77,7 @@ jobs:
7277
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
7378
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # v15
7479
with:
75-
name: Metalium ${{ inputs.runner }} smoke tests (${{ github.workflow }}, attempt ${{ github.run_attempt }})
80+
name: ${{ inputs.product }} ${{ inputs.runner }} smoke tests (${{ github.workflow }}, attempt ${{ github.run_attempt }})
7681
path: /work/test-reports/*.xml
7782
reporter: jest-junit
7883
working-directory: /work

cmake/packaging.cmake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ set(CPACK_DEBIAN_METALIUM-DEV_PACKAGE_SECTION "libs")
1010
set(CPACK_DEBIAN_METALIUM-JIT_PACKAGE_SECTION "libs")
1111
set(CPACK_DEBIAN_METALIUM-EXAMPLES_PACKAGE_SECTION "doc")
1212
set(CPACK_DEBIAN_METALIUM-VALIDATION_PACKAGE_SECTION "utils")
13+
set(CPACK_DEBIAN_NN_PACKAGE_SECTION "libs")
14+
set(CPACK_DEBIAN_NN-VALIDATION_PACKAGE_SECTION "utils")
1315

1416
set(CPACK_DEB_COMPONENT_INSTALL YES)
1517
set(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION_DEB}")
@@ -110,4 +112,19 @@ cpack_add_component(
110112
)
111113
cpack_add_component(gtest GROUP metalium-validation)
112114

115+
cpack_add_component_group(nn)
116+
cpack_add_component(nn DEPENDS metalium GROUP nn DESCRIPTION "TT-NN runtime library")
117+
cpack_add_component(ttnn-runtime GROUP nn)
118+
119+
cpack_add_component_group(nn-validation)
120+
cpack_add_component(
121+
nn-validation
122+
DEPENDS
123+
nn
124+
metalium
125+
GROUP nn-validation
126+
DESCRIPTION "TT-NN validation tools"
127+
)
128+
cpack_add_component(ttnn-validation GROUP nn-validation)
129+
113130
include(CPack)

tests/ttnn/CMakeLists.txt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
# Common function to set up target properties for TTNN tests
2-
function(setup_ttnn_test_target target_name)
3-
target_link_libraries(
4-
${target_name}
5-
PUBLIC
6-
test_common_libs
7-
ttnn
8-
Metalium::Metal
9-
GTest::gmock_main
10-
Python3::Python
11-
)
12-
target_include_directories(
13-
${target_name}
14-
PRIVATE
15-
${UMD_HOME}
16-
${PROJECT_SOURCE_DIR}
17-
${PROJECT_SOURCE_DIR}/tt_metal
18-
${PROJECT_SOURCE_DIR}/tests
19-
${CMAKE_CURRENT_SOURCE_DIR}
20-
"$<TARGET_PROPERTY:TT::NN::CPP,INCLUDE_DIRECTORIES>"
21-
)
22-
set_target_properties(
23-
${target_name}
24-
PROPERTIES
25-
RUNTIME_OUTPUT_DIRECTORY
26-
${PROJECT_BINARY_DIR}/test/ttnn
27-
)
28-
endfunction()
29-
301
set(Python3_FIND_STRATEGY LOCATION)
312
find_package(Python3 REQUIRED COMPONENTS Development)
323

0 commit comments

Comments
 (0)