Skip to content

Commit

Permalink
Merge branch 'main' into atulk/13593-PCC-PR
Browse files Browse the repository at this point in the history
  • Loading branch information
yugi957 authored Nov 5, 2024
2 parents 5b3497d + e7e4517 commit 55ac54e
Show file tree
Hide file tree
Showing 1,058 changed files with 35,878 additions and 9,306 deletions.
12 changes: 2 additions & 10 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
Checks: >
bugprone-*,
performance-*,
modernize-*,
readability-*,
cppcoreguidelines-*
-modernize-use-trailing-return-type
CheckOptions:
- key: readability-identifier-length.IgnoredVariableNames
value: 'x|y|z|i|j|k|t|it|ix|itr|a|b'
-*,
google-build-using-namespace
9 changes: 7 additions & 2 deletions .github/actions/docker-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
uses: ./.github/actions/generate-docker-tag
with:
image: ${{ inputs.docker_os_arch }}
- name: Set
- name: Set
shell: bash
run: |
echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
Expand All @@ -63,8 +63,12 @@ runs:
# The most important option below is `--rm`. Otherwise, the machines will fill up with undeleted containers.
# The mounting of /etc/passwd, /etc/shadow, and /etc/bashrc is required in order for the correct file permissions
# for newly created files.
# Passing HOME variable is necessary to avoid Python lib installation into /home/ubuntu/.local folder which
# Passing HOME variable is necessary to avoid Python lib installation into /home/ubuntu/.local folder which
# may not be writable by the RUNNER_UID user.
# --log-driver none: Do not save logs to disk by default as we're printing them to GitHub Actions UI already
# and it takes up space on the runner. What can happen is that we can eat up all the space of a runner while it's
# spitting our endless logs, causing the runner being unable to call home, resulting in job failures / runner
# offline status on GitHub. Issue tt-metal/#12626
options: |
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
--rm
Expand All @@ -73,6 +77,7 @@ runs:
-v /etc/bashrc:/etc/bashrc:ro
-v ${{ github.workspace }}:${{ github.workspace }}
--net=host
--log-driver none
${{ inputs.docker_opts }}
-e LOGURU_LEVEL=${{ env.LOGURU_LEVEL }}
-e PYTHONPATH=${{ github.workspace }}
Expand Down
88 changes: 78 additions & 10 deletions .github/workflows/all-static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,38 @@ on:
- "main"

jobs:
pre-commit:
name: Run Pre-commit Hooks
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history so 'origin/main' is available
fetch-refs: true # Ensure all refs are fetched

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Run Pre-commit
uses: pre-commit/[email protected]
with:
extra_args: |
--from-ref ${{ github.event_name == 'pull_request' && format('refs/remotes/origin/{0}', github.event.pull_request.base.ref) || 'HEAD^' }} \
--to-ref HEAD
continue-on-error: false
check-black:
runs-on: ubuntu-latest
steps:
- name: Do Nothing
run: echo "Black is covered by pre-commit. This is a placeholder to be removed after updating branch restrictions."


check-spdx-licenses:
runs-on: ubuntu-latest
steps:
Expand All @@ -27,11 +59,6 @@ jobs:
- uses: actions/checkout@v4
- name: Check kernel count in base metal is less than maximum
run: if (( $(find tt_metal/kernels/ -type f | wc -l) > 7 )); then exit 1; fi
check-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/[email protected]
check-doc:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -61,15 +88,56 @@ jobs:
run: |
pip install pyyaml
python tests/sweep_framework/framework/sweeps_workflow_verification.py
cmake-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Check for changed CMake files
id: changed-cmake-files
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c
with:
files: |
**/*.cmake
**/CMakeLists.txt
- uses: lukka/get-cmake@b516803a3c5fac40e2e922349d15cdebdba01e60
if: steps.changed-cmake-files.outputs.any_changed == 'true'
with:
cmakeVersion: "~3.16.0"
- name: Check CMake version
if: steps.changed-cmake-files.outputs.any_changed == 'true'
run: cmake --version
- name: Install LLVM and Clang
if: steps.changed-cmake-files.outputs.any_changed == 'true'
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
- name: Install deps
if: steps.changed-cmake-files.outputs.any_changed == 'true'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt update
sudo xargs -a scripts/docker/requirements-22.04.txt apt install -y --no-install-recommends
- name: Check CMake compatibility
if: steps.changed-cmake-files.outputs.any_changed == 'true'
env:
ARCH_NAME: wormhole_b0
CMAKE_GENERATOR: Ninja
# TODO: Use a lukka/run-cmake with a preset after upgrading to a more modern CMake
run: |
echo "Checking compatibility with $(cmake --version)"
cmake -B build .
clang-tidy:
runs-on: ubuntu-latest
container: ghcr.io/tenstorrent/tt-metal/tt-metalium/ubuntu-22.04-amd64:latest
permissions:
pull-requests: write
# OPTIONAL: auto-closing conversations requires the `contents` permission
contents: write
# if: github.event_name == 'pull_request' # Only run this job on pull request events
if : false
if: github.event_name == 'pull_request' # Only run this job on pull request events
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -89,17 +157,17 @@ jobs:
sudo ln -s $(which clang-tidy-17) /usr/local/bin/clang-tidy
- name: Prepare compile_commands.json
run: |
ARCH_NAME=grayskull cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
ARCH_NAME=grayskull cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DTT_METAL_BUILD_TESTS=ON -DTTNN_BUILD_TESTS=ON -DTT_UMD_BUILD_TESTS=ON -DTT_UNITY_BUILDS=OFF
- name: Create results directory
run: |
mkdir clang-tidy-result
- name: Analyze
run: |
git diff -U0 "$(git merge-base HEAD "upstream/${{ github.event.pull_request.base.ref }}")" | clang-tidy-diff-17.py -p1 -path build -export-fixes clang-tidy-result/fixes.yml -j4
timeout-minutes: 10
timeout-minutes: 5
continue-on-error: true
- name: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@837ad8077b1f554dab31a8a43e8bb12c89d2f144
uses: platisd/clang-tidy-pr-comments@1b7395ce6f5a4186acabbba24cdd1e846f001aa8
with:
# The GitHub token (or a personal access token)
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/bisect-dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
env:
TT_METAL_ENV: ${{ vars.TT_METAL_ENV }}
ARCH_NAME: ${{ inputs.arch }}
environment: dev
runs-on:
- ${{ inputs.runner-label }}
- "in-service"
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: 25
default: 35
workflow_dispatch:
inputs:
arch:
Expand All @@ -33,7 +33,7 @@ on:
timeout:
required: false
type: number
default: 25
default: 35
jobs:
unit-tests-slow-dispatch:
name: ${{ inputs.arch }} ${{ inputs.runner-label }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
ARCH_NAME: ${{ matrix.arch }}
SILENT: 0
VERBOSE: 1
environment: dev
runs-on:
- build
- in-service
Expand Down Expand Up @@ -127,6 +126,8 @@ jobs:
-e ARCH_NAME=${{ matrix.arch }}
-w ${{ github.workspace }}
run: |
set -eu # basic shell hygiene
# /tmp is a tmpfs; more efficient than persisted storage
mkdir -p /tmp/ccache
export CCACHE_TEMPDIR=/tmp/ccache
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-docker-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
TT_METAL_DOCKER_IMAGE: ${{ inputs.os }}
IMAGE: tt-metalium/ubuntu-20.04-amd64
DOCKERFILE: ubuntu-20.04-amd64
environment: dev
runs-on:
- build-docker
- in-service
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cpp-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
timeout:
required: false
type: number
default: 45
default: 60
workflow_dispatch:
inputs:
arch:
Expand All @@ -33,7 +33,7 @@ on:
timeout:
required: false
type: number
default: 45
default: 60

jobs:
models:
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/cpp-ttnn-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build TTNN C++ project

on:
workflow_call:
workflow_dispatch:

jobs:

build-docker-image:
uses: ./.github/workflows/build-docker-artifact.yaml
secrets: inherit
with:
os: ubuntu-22.04-amd64

ttnn-project:
needs: build-docker-image
runs-on:
- ubuntu-22.04
env:
ARCH_NAME: wormhole_b0

steps:
# Metalium
- name: Clone Metalium
uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
- name: Generate docker tag
id: generate-docker-tag
uses: ./.github/actions/generate-docker-tag
with:
image: ubuntu-22.04-amd64
- name: Docker login
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image
run: docker pull ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
- name: Move Repo A to Subdirectory
run: |
mkdir metalium
mv * metalium || true
mv .git metalium/.git
- name: Build Metalium
uses: addnab/docker-run-action@v3
with:
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
options: |
--rm
--tmpfs /tmp
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
-v ${{ github.workspace }}/metalium:${{ github.workspace }}
-v /etc/passwd:/etc/passwd:ro
-v /etc/shadow:/etc/shadow:ro
-v /etc/bashrc:/etc/bashrc:ro
-e ARCH_NAME=${{ env.ARCH_NAME }}
-w ${{ github.workspace }}
run: |
set -eu # basic shell hygiene
./build_metal.sh --build-type Release
# TTNN project
- name: Checkout cpp-ttnn-project-template
uses: actions/checkout@v4
with:
repository: tenstorrent/cpp-ttnn-project-template
path: project
- name: Build TTNN Project
uses: addnab/docker-run-action@v3
with:
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }}
options: |
--rm
--tmpfs /tmp
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }}
-v ${{ github.workspace }}/metalium:${{ github.workspace }}/metalium
-v ${{ github.workspace }}/project:${{ github.workspace }}/project
-v /etc/passwd:/etc/passwd:ro
-v /etc/shadow:/etc/shadow:ro
-v /etc/bashrc:/etc/bashrc:ro
-e ARCH_NAME=${{ env.ARCH_NAME }}
-e TT_METAL_HOME=${{ github.workspace }}/metalium
-w ${{ github.workspace }}/project
run: |
set -eu # basic shell hygiene
mkdir -p build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
ninja
1 change: 0 additions & 1 deletion .github/workflows/docs-latest-public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
ARCH_NAME: ${{ matrix.arch }}
LOGURU_LEVEL: INFO
LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib
environment: dev
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/docs-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
ARCH_NAME: ${{ matrix.arch }}
LOGURU_LEVEL: INFO
LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib
environment: dev
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,6 @@ jobs:
cmd: tests/scripts/single_card/nightly/run_gs_only.sh,
timeout: 40
},
{
name: "API tests GS",
arch: grayskull,
runs-on: ["cloud-virtual-machine", "E150", "in-service"],
cmd: ./tests/scripts/run_tests.sh --tt-arch grayskull --pipeline-type frequent_api --dispatch-mode fast,
timeout: 10
},
{
name: "API tests N300 WH B0",
arch: wormhole_b0,
runs-on: ["cloud-virtual-machine", "N300", "in-service"],
cmd: ./tests/scripts/run_tests.sh --tt-arch wormhole_b0 --pipeline-type frequent_api --dispatch-mode fast,
timeout: 10
},
{
name: "API tests N150 WH B0",
arch: wormhole_b0,
runs-on: ["cloud-virtual-machine", "N150", "in-service"],
cmd: ./tests/scripts/run_tests.sh --tt-arch wormhole_b0 --pipeline-type frequent_api --dispatch-mode fast,
timeout: 10
},
{
name: "[Unstable] N150 models",
arch: wormhole_b0,
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/metal-run-microbenchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
# Use BM for microbenchmarks
ARCH_NAME: ${{ matrix.runner-info.arch }}
LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib
environment: dev
runs-on: ${{ matrix.runner-info.runs-on }}
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/models-post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
- cloud-virtual-machine
steps:
- uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected]
- uses: ./.github/actions/retry-command
with:
timeout-seconds: 100
max-retries: 10
backoff-seconds: 60
command: ./.github/scripts/cloud_utils/mount_weka.sh
- uses: actions/download-artifact@v4
with:
name: eager-dist-${{ matrix.os }}-${{ inputs.arch }}
Expand Down
Loading

0 comments on commit 55ac54e

Please sign in to comment.