Skip to content

Commit

Permalink
Merge branch 'main' into nkpatel/maxpool_YoloV4_support
Browse files Browse the repository at this point in the history
  • Loading branch information
nkpatel-tt authored Sep 7, 2024
2 parents 2a49aba + c0287f2 commit 15a1881
Show file tree
Hide file tree
Showing 135 changed files with 4,311 additions and 1,171 deletions.
46 changes: 25 additions & 21 deletions .github/actions/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,49 @@ inputs:
docker_opts:
description: 'Docker options'
required: false

device:
description: "Description of Device as it is used in docker run command."
type: string
required: false
default: |
-v /dev/hugepages-1G:/dev/hugepages-1G
--device /dev/tenstorrent
runs:
using: "composite"
steps:
- name: Set up dynamic env vars for build
shell: bash
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV
- name: Create correct Docker Tag
steps:
- name: Determine Docker Tag to use
shell: bash
run: |
# if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
# else
# echo "IMAGE_TAG=dev-${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
# fi
- name: Docker login
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
- name: Pull the latest version of the image
shell: bash
run: |
docker pull ghcr.io/${{ github.repository }}/${{ inputs.docker_image }}:${{ env.IMAGE_TAG }}
- uses: addnab/docker-run-action@v3
with:
shell: bash
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
registry: ghcr.io
image: ghcr.io/${{ github.repository }}/${{ inputs.docker_image }}/${{ inputs.docker_image_arch }}:${{ env.OUTPUT_IMAGE_TAG }}
image: ghcr.io/${{ github.repository }}/${{ inputs.docker_image }}:${{ env.IMAGE_TAG }}
# The most important option below is `--rm`. The machines will fill up with containers.
options: |
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
-v ${{ github.workspace }}:/app/mtl
-v /home/ubuntu/.cache/huggingface:/home/ubuntu/.cache/huggingface
-v /home/ubuntu/.cache/matplotlib:/home/ubuntu/.cache/matplotlib
-v /home/ubuntu/.cache/pre-commit:/home/ubuntu/.cache/pre-commit
-v /home/ubuntu/.cache/torch:/home/ubuntu/.cache/torch
--rm
-v ${{ github.workspace }}:/github_workspace:ro
--net=host
${{ inputs.docker_opts }}
-e LOGURU_LEVEL=${{ env.LOGURU_LEVEL }}
-e PYTHONPATH=/usr/app
-e ARCH_NAME=${{ inputs.docker_image_arch }}
${{ inputs.device }}
run: |
${{ inputs.run_args }}
cp -r /github_workspace/* /usr/app/
cd /usr/app/
rm -rf tt_metal tt_eager
${{ inputs.run_args }}
15 changes: 8 additions & 7 deletions .github/workflows/all-post-commit-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ permissions:
contents: read
pages: write
id-token: write
packages: write

jobs:
static-checks:
uses: ./.github/workflows/all-static-checks.yaml
secrets: inherit
build-wheels:
needs: build-artifact
uses: ./.github/workflows/eager-package-main.yaml
secrets: inherit
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
Expand Down Expand Up @@ -57,7 +62,7 @@ jobs:
runner-label: ${{ matrix.test-group.runner-label }}
# Fast Dispatch Unit Tests
fast-dispatch-unit-tests:
needs: build-artifact
needs: build-wheels
secrets: inherit
strategy:
fail-fast: false
Expand All @@ -73,7 +78,7 @@ jobs:
runner-label: ${{ matrix.test-group.runner-label }}
# TTNN FD Unit tests
ttnn-unit-tests:
needs: build-artifact
needs: build-wheels
secrets: inherit
strategy:
fail-fast: false
Expand All @@ -89,7 +94,7 @@ jobs:
runner-label: ${{ matrix.test-group.runner-label }}
# FD Model Tests
models-unit-tests:
needs: build-artifact
needs: build-wheels
secrets: inherit
strategy:
fail-fast: false
Expand Down Expand Up @@ -119,14 +124,10 @@ jobs:
with:
arch: ${{ matrix.test-group.arch }}
runner-label: ${{ matrix.test-group.runner-label }}

profiler-regression:
needs: build-artifact-profiler
uses: ./.github/workflows/run-profiler-regression.yaml
secrets: inherit
eager-package-main:
uses: ./.github/workflows/eager-package-main.yaml
secrets: inherit
build-docs:
needs: build-artifact
uses: ./.github/workflows/docs-latest-public.yaml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
timeout:
required: false
type: number
default: 15
default: 25
workflow_dispatch:
inputs:
arch:
Expand All @@ -33,7 +33,7 @@ on:
timeout:
required: false
type: number
default: 15
default: 25
jobs:
unit-tests-slow-dispatch:
name: ${{ inputs.arch }} ${{ inputs.runner-label }}
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/build-docker-artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
name: "Build tt-metal docker artifact"

on:
workflow_call:
workflow_dispatch:

push:
branches:
- main
paths:
- dockerfile/ubuntu-20.04-amd64.Dockerfile
- scripts/docker/requirements*
- pyproject.toml
- scripts/docker/install_test_deps.sh
- tt_metal/python_env/requirements-dev.txt
jobs:
build-docker-image:
env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
CONFIG: ci
SILENT: 0
VERBOSE: 1
TT_METAL_DOCKER_IMAGE: tt-metalium/ubuntu-20.04-amd64
TT_METAL_DOCKER_IMAGE_TAG: ${{ github.sha }}
IMAGE: tt-metalium/ubuntu-20.04-amd64
DOCKERFILE: ubuntu-20.04-amd64
environment: dev
runs-on:
- build-docker
Expand All @@ -25,19 +32,19 @@ jobs:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
./scripts/docker/build_docker_image.sh ${{ env.TT_METAL_DOCKER_IMAGE }}:${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
- name: Determine Docker Image Tag
id: set-image
run: |
if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=dev-${GITHUB_ACTOR}" >> $GITHUB_ENV
echo "IMAGE_TAG=dev-${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
fi
- name: Build Docker image
run: |
./scripts/docker/build_docker_image.sh ${{ env.DOCKERFILE}} ${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
- name: Push Docker image to GitHub Container Registry
run: |
GITHUB_REPO_DOCKER_IMAGE_TAG=ghcr.io/${{ github.repository }}/${{ env.TT_METAL_DOCKER_IMAGE }}:${{ env.IMAGE_TAG }}
docker tag ${{ env.TT_METAL_DOCKER_IMAGE }}:${{ env.TT_METAL_DOCKER_IMAGE_TAG }} $GITHUB_REPO_DOCKER_IMAGE_TAG
GITHUB_REPO_DOCKER_IMAGE_TAG=ghcr.io/${{ github.repository }}/${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
docker tag ${{ env.IMAGE }}:${{ env.IMAGE_TAG }} $GITHUB_REPO_DOCKER_IMAGE_TAG
docker push $GITHUB_REPO_DOCKER_IMAGE_TAG
2 changes: 2 additions & 0 deletions .github/workflows/cpp-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
matrix:
test-group: [
{name: C++, cmd: ./tests/scripts/run_cpp_unit_tests.sh},
{name: ttnn cpp tests, cmd: ./build/test/ttnn/unit_tests_ttnn},
{name: ttnn ccl cpp unit tests, cmd: ./build/test/ttnn/unit_tests_ttnn_ccl},
]
name: ${{ matrix.test-group.name }} ${{ inputs.arch }} ${{ inputs.runner-label }}
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docs-latest-public-wrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
workflow_dispatch:

jobs:
build-docker-artifact:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
build-artifact:
needs: build-docker-artifact
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
build-docs:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/eager-package-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
arch: [grayskull, wormhole_b0]
runs-on: ${{ matrix.os }}
runner-hw-info: [
{arch: grayskull, type: E150},
{arch: wormhole_b0, type: N150}
]
runs-on: ["cloud-virtual-machine", "${{ matrix.runner-hw-info.type }}", "in-service"]
environment: production
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-metal-deps
with:
os: ${{ matrix.os }}
- uses: actions/download-artifact@v4
with:
name: eager-dist-${{ matrix.os }}-${{ matrix.arch }}
name: eager-dist-${{ matrix.os }}-${{ matrix.runner-hw-info.arch }}
- name: Set up end-to-end tests environment
run: ./tests/scripts/set_up_end_to_end_tests_env.sh
- name: Activate env and run release tests - host
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/eager-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ jobs:
if: ${{ inputs.os == 'ubuntu-22.04' }}
run: |
echo "DEVICE_CXX=g++" >> $GITHUB_ENV
- uses: ./.github/actions/prepare-metal-run
with:
arch: ${{ inputs.arch }}
- name: Build Python package distribution
run: python -m build
run: |
TT_FROM_PRECOMPILED=True python -m build
# TT_FROM_PRECOMPILED env variable allows us to not re-run `make install` and instead
# rely on the artifact that was already compiled.
- name: Upload distribution as artifact
uses: actions/upload-artifact@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
workflow_dispatch:

jobs:
build-docker-artifact:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
build-artifact:
needs: build-docker-artifact
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
# FD Unit Tests
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/fast-dispatch-build-and-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ jobs:
# so we try not to get hanging machines
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
test-group: [
{name: eager unit tests 1, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 1 },
{name: eager unit tests 2, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 2 },
{name: eager unit tests 3, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 3 },
{name: eager unit tests 4, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 4 },
{name: eager unit tests 5, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 5 },
{name: eager unit tests 6, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 6 },
{name: eager unit tests 7, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 7 },
{name: eager trace tests, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/trace_testing/ -xvvv},
{name: sweep, cmd: pytest $TT_METAL_HOME/tests/tt_eager/python_api_testing/sweep_tests/pytests/ -xvvv},
{name: eager unit tests 1, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 1 },
{name: eager unit tests 2, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 2 },
{name: eager unit tests 3, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 3 },
{name: eager unit tests 4, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 4 },
{name: eager unit tests 5, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 5 },
{name: eager unit tests 6, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 6 },
{name: eager unit tests 7, cmd: pytest tests/tt_eager/python_api_testing/unit_testing/ -xvvv --splits 7 --group 7 },
{name: eager trace tests, cmd: pytest tests/tt_eager/python_api_testing/trace_testing/ -xvvv},
{name: sweep, cmd: pytest tests/tt_eager/python_api_testing/sweep_tests/pytests/ -xvvv},
]
name: ${{ matrix.test-group.name }} ${{ inputs.arch }} ${{ inputs.runner-label }}
env:
Expand All @@ -68,16 +69,21 @@ jobs:
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- uses: ./.github/actions/prepare-metal-run
echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
with:
arch: ${{ inputs.arch }}
name: eager-dist-${{ matrix.os }}-${{ inputs.arch }}
- name: ${{ matrix.test-group.name }} tests
timeout-minutes: ${{ inputs.timeout }}
run: |
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
${{ matrix.test-group.cmd }}
uses: ./.github/actions/docker-run
with:
docker_username: ${{ github.actor }}
docker_password: ${{ secrets.GITHUB_TOKEN }}
docker_image_arch: ${{ inputs.arch }}
run_args: |
WHEEL_FILENAME=$(ls -1 *.whl)
pip3 install --user $WHEEL_FILENAME
${{ matrix.test-group.cmd }}
- uses: ./.github/actions/slack-report
if: ${{ failure() }}
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/models-post-commit-wrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ jobs:
static-checks:
uses: ./.github/workflows/all-static-checks.yaml
secrets: inherit
build-docker-artifact:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
build-artifact:
needs: build-docker-artifact
uses: ./.github/workflows/build-artifact.yaml
secrets: inherit
models-unit-tests:
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/models-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
# so we try not to get hanging machines
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
test-group: [
{name: model, cmd: ./tests/scripts/run_python_model_tests.sh},
]
Expand All @@ -57,19 +58,20 @@ jobs:
- cloud-virtual-machine
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
- uses: ./.github/actions/prepare-metal-run
- uses: actions/download-artifact@v4
with:
arch: ${{ inputs.arch }}
- name: ${{ inputs.runner-label }} tests
name: eager-dist-${{ matrix.os }}-${{ inputs.arch }}
- name: ${{ matrix.test-group.name }} tests
timeout-minutes: ${{ inputs.timeout }}
run: |
source ${{ github.workspace }}/python_env/bin/activate
cd $TT_METAL_HOME
export PYTHONPATH=$TT_METAL_HOME
${{ matrix.test-group.cmd }}
uses: ./.github/actions/docker-run
with:
docker_username: ${{ github.actor }}
docker_password: ${{ secrets.GITHUB_TOKEN }}
docker_image_arch: ${{ inputs.arch }}
run_args: |
WHEEL_FILENAME=$(ls -1 *.whl)
pip3 install --user $WHEEL_FILENAME
${{ matrix.test-group.cmd }}
- uses: ./.github/actions/slack-report
if: ${{ failure() }}
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/t3000-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
{ name: "t3k falcon40b tests", arch: wormhole_b0, cmd: run_t3000_falcon40b_tests, timeout: 30, owner_id: U053W15B6JF}, #Djordje Ivanovic
{ name: "t3k mixtral tests", arch: wormhole_b0, cmd: run_t3000_mixtral_tests, timeout: 30, owner_id: U03PUAKE719}, #Miguel Tairum Cruz
{ name: "t3k grok tests", arch: wormhole_b0, cmd: run_t3000_grok_tests, timeout: 30, owner_id: U03HY7MK4BT}, #Mark O'Connor
{ name: "t3k unet shallow tests", arch: wormhole_b0, cmd: run_t3000_unet_shallow_tests, timeout: 30, owner_id: U06ECNVR0EN}, #Evan Smal
]
name: ${{ matrix.test-group.name }}
env:
Expand Down
Loading

0 comments on commit 15a1881

Please sign in to comment.