Skip to content

Commit

Permalink
#4833: Create initial ttnn sweeps pipeline with csv upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tt-rkim committed Jan 19, 2024
1 parent e08d60e commit 651147d
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ttnn-run-sweeps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "ttnn - Run sweeps"

on:
schedule:
- cron: "0 1,7,13,19 * * *"
workflow_dispatch:
workflow_call:

jobs:
run-ttnn-sweeps:
strategy:
# Do not fail-fast because we need to ensure all tests go to completion
# so we try not to get hanging machines
fail-fast: false
matrix:
arch: [grayskull]
env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
ARCH_NAME: ${{ matrix.arch }}
environment: dev
runs-on: model-runner-${{ matrix.arch }}
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/checkout-with-submodule-lfs@main
with:
token: ${{ secrets.CHECKOUT_TOKEN }}
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal and libs
run: make build
- name: Run ttnn sweeps
timeout-minutes: 30
run: ./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
uses: actions/upload-artifact@v3
with:
name: ttnn-sweeps-report-csv-${{ matrix.arch }}
path: tests/ttnn/sweep_tests/results/*.csv
10 changes: 10 additions & 0 deletions tests/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ run_microbenchmarks_pipeline_tests() {
pytest -svv tests/tt_metal/microbenchmarks
}

run_ttnn_sweeps_pipeline_tests() {
local tt_arch=$1
local pipeline_type=$2
local dispatch_mode=$3

./tests/scripts/run_ttnn_sweeps.sh
}

run_pipeline_tests() {
local tt_arch=$1
local pipeline_type=$2
Expand All @@ -203,6 +211,8 @@ run_pipeline_tests() {
run_post_commit_multi_device_pipeline_tests "$tt_arch" "$pipeline_type" "$dispatch_mode"
elif [[ $pipeline_type == "microbenchmarks" ]]; then
run_microbenchmarks_pipeline_tests "$tt_arch" "$pipeline_type" "$dispatch_mode"
elif [[ $pipeline_type == "ttnn_sweeps" ]]; then
run_ttnn_sweeps_pipeline_tests "$tt_arch" "$pipeline_type" "$dispatch_mode"
else
echo "Unknown pipeline: $pipeline_type"
exit 1
Expand Down
21 changes: 21 additions & 0 deletions tests/scripts/run_ttnn_sweeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -eo pipefail

run_ttnn_sweeps() {
if [[ -z "$ARCH_NAME" ]]; then
echo "Must provide ARCH_NAME in environment" 1>&2
exit 1
fi

if [[ -z "$TT_METAL_HOME" ]]; then
echo "Must provide TT_METAL_HOME in environment" 1>&2
exit 1
fi

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

python tests/ttnn/sweep_tests/run_all_tests.py
}

run_ttnn_sweeps

0 comments on commit 651147d

Please sign in to comment.