From 1ce74bb864560b89877d6e7f3c35911bc0541f8c Mon Sep 17 00:00:00 2001 From: Michael Chiou Date: Wed, 15 May 2024 15:04:38 -0700 Subject: [PATCH] #8535: update ttnn sweep workflow to use build artifacts --- .github/workflows/ttnn-run-sweeps.yaml | 49 +++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ttnn-run-sweeps.yaml b/.github/workflows/ttnn-run-sweeps.yaml index 649a6a518c9..fea5773c655 100644 --- a/.github/workflows/ttnn-run-sweeps.yaml +++ b/.github/workflows/ttnn-run-sweeps.yaml @@ -7,7 +7,41 @@ on: workflow_call: jobs: + build-artifact: + strategy: + matrix: + arch: ["grayskull"] + env: + TT_METAL_ENV: ${{ vars.TT_METAL_ENV }} + ARCH_NAME: ${{ matrix.arch }} + SILENT: 0 + VERBOSE: 1 + environment: dev + runs-on: build + steps: + - uses: tenstorrent-metal/metal-workflows/.github/actions/checkout-with-submodule-lfs@v2.0.0 + - name: Set up dynamic env vars for build + run: | + echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV + - name: Update submodules + run: | + git submodule update --init --recursive + - uses: ./.github/actions/install-python-deps + - name: Build tt-metal and libs + run: | + cmake -B build -G Ninja + cmake --build build --target tests -- -j`nproc` + cmake --build build --target install -- -j`nproc` + - name: 'Tar files' + run: tar -cvf ttm_${{ matrix.arch }}.tar build/hw build/lib tt_eager/tt_lib/*.so ttnn/ttnn/*.so build/programming_examples build/test build/tools + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: TTMetal_build_${{ matrix.arch }} + path: ttm_${{ matrix.arch }}.tar + 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 @@ -24,12 +58,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