Skip to content

Commit

Permalink
add build artifacts to workflows (#8542)
Browse files Browse the repository at this point in the history
* #8535: let build-artifact to build artifacts with input or default archs

* #8535: update ttnn sweeps to use build artifacts

* #8535: use build-artifact in stress SD workflow

* #8535: Update ttnn_sweeps.sh to point to updated python_env

* #8535: FD Stress test with build artifacts

* #8535: Multi Device perf model use build-artifacts

* #8535: multi device e2e workflow uses build artifacts

* #8535: multi-device build and unit test uses build artifacts

* #8535: multi device build and unit test frequent uses build artifacts
  • Loading branch information
ttmchiou authored May 16, 2024
1 parent 09800db commit 925a14e
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 40 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ name: "Build tt-metal artifacts"

on:
workflow_call:
inputs:
arch:
required: false
type: string
default: '["grayskull", "wormhole_b0"]'
workflow_dispatch:

jobs:
build-artifact:
strategy:
matrix:
arch: ["grayskull", "wormhole_b0"]
arch: ${{ fromJson(inputs.arch || '["grayskull", "wormhole_b0"]') }}

env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
ARCH_NAME: ${{ matrix.arch }}
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/multi-device-build-and-unit-tests-frequent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
- cron: "0 */8 * * *" # This cron schedule runs the workflow every 8 hours

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
with:
arch: '["wormhole_b0"]'
secrets: inherit

multi-chip-nightly:
needs: build-artifact
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
# so we try not to get hanging machines
Expand All @@ -23,17 +30,19 @@ jobs:
runs-on: ${{ matrix.runner-info.runs-on }}
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
- name: Set up dyanmic env vars for build
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: |
PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- name: Build tt-metal CPP tests
run: cmake --build build --target tests -- -j`nproc`
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.runner-info.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.runner-info.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run frequent regression tests
timeout-minutes: 60
run: |
source build/python_env/bin/activate
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type frequent_multi_device --dispatch-mode ""
22 changes: 15 additions & 7 deletions .github/workflows/multi-device-build-and-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
- cron: "0 */3 * * *" # This cron schedule runs the workflow every 3 hours

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
with:
arch: '["wormhole_b0"]'
secrets: inherit

multi-chip-unit-tests:
needs: build-artifact
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
# so we try not to get hanging machines
Expand Down Expand Up @@ -35,17 +42,18 @@ jobs:
runs-on: ${{ matrix.test-group.runs-on }}
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
- name: Set up dyanmic env vars for build
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: |
PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- name: Build tt-metal CPP tests
run: cmake --build build --target tests -- -j`nproc`
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.test-group.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.test-group.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run pre/post regression tests
timeout-minutes: 120
run: |
source build/python_env/bin/activate
source ${{ github.workspace }}/python_env/bin/activate
export PYTHONPATH=$TT_METAL_HOME
${{ matrix.test-group.cmd }}
22 changes: 15 additions & 7 deletions .github/workflows/multi-device-end-to-end-demos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
- cron: '0 0 * * *' # This cron schedule runs the workflow every day at 12am UTC

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
with:
arch: '["wormhole_b0"]'
secrets: inherit

multi-chip-unit-tests:
needs: build-artifact
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
# so we try not to get hanging machines
Expand All @@ -30,17 +37,18 @@ jobs:
runs-on: ${{ matrix.test-group.runs-on }}
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
- name: Set up dyanmic env vars for build
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: |
PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- name: Build tt-metal CPP tests
run: cmake --build build --target tests -- -j`nproc`
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.test-group.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.test-group.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run pre/post regression tests
timeout-minutes: 180
run: |
source build/python_env/bin/activate
source ${{ github.workspace }}/python_env/bin/activate
export PYTHONPATH=$TT_METAL_HOME
${{ matrix.test-group.cmd }}
17 changes: 14 additions & 3 deletions .github/workflows/multi-device-perf-models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
- cron: "0 */12 * * *" # This cron schedule runs the workflow every 12 hours

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
with:
arch: '["wormhole_b0"]'
secrets: inherit

multi-device-models-perf:
needs: build-artifact
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
# so we try not to get hanging machines
Expand Down Expand Up @@ -41,12 +48,16 @@ jobs:
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.runner-info.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.runner-info.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run performance regressions
timeout-minutes: 60
run: |
source build/python_env/bin/activate
source python_env/bin/activate
./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type ${{ matrix.model-type }}_models_performance_${{ matrix.runner-info.machine-type }}_multi_device
- name: Check perf report exists
id: check-perf-report
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/stress-fast-dispatch-build-and-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ on:
- cron: "0 4 * * *"

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit

stress-build-and-unit-tests:
needs: build-artifact
timeout-minutes: 1440
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
Expand Down Expand Up @@ -36,13 +41,17 @@ jobs:
- name: Set up dyanmic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- name: Build tt-metal CPP tests
run: cmake --build build --target tests -- -j`nproc`
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.runner-info.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.runner-info.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run pre/post regression tests in a loop
run: |
source build/python_env/bin/activate
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type stress_post_commit --dispatch-mode fast
- name: Upload watcher log
if: always()
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/stress-slow-dispatch-build-and-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ on:
- cron: "0 4 * * *"

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit

stress-build-and-unit-tests:
needs: build-artifact
timeout-minutes: 1440
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
Expand Down Expand Up @@ -34,13 +39,15 @@ jobs:
- name: Set up dyanmic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- name: Build tt-metal CPP tests
run: cmake --build build --target tests -- -j`nproc`
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run pre/post regression tests in a loop
run: |
source build/python_env/bin/activate
source python_env/bin/activate
./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type stress_post_commit --dispatch-mode slow
- name: Upload watcher log
if: always()
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/ttnn-run-sweeps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ on:
workflow_call:

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
with:
arch: '["grayskull"]'
secrets: inherit

ttnn-sweeps:
needs: build-artifact
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
# so we try not to get hanging machines
Expand All @@ -24,12 +31,19 @@ jobs:
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: |
PYTHON_ENV_DIR=$(pwd)/build/python_env ./build_metal.sh
- uses: actions/download-artifact@v4
with:
name: TTMetal_build_${{ matrix.arch }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.arch }}.tar
- uses: ./.github/actions/install-python-deps
- name: Run ttnn sweeps
timeout-minutes: 30
run: ./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type ttnn_sweeps
run: |
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
./tests/scripts/run_tests.sh --tt-arch $ARCH_NAME --pipeline-type ttnn_sweeps
- name: Assert that csvs exist in expected ttnn results folder
run: ls -hal tests/ttnn/sweep_tests/results/*.csv
- name: Upload ttnn sweep reports csvs
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/run_ttnn_sweeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run_ttnn_sweeps() {
fi

export PYTHONPATH=$TT_METAL_HOME
source build/python_env/bin/activate
source python_env/bin/activate

python tests/ttnn/sweep_tests/run_sweeps.py
}
Expand Down

0 comments on commit 925a14e

Please sign in to comment.