#13404: Add data parallel support for lenet model- WIP #30435
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[post-commit] all - Static checks, linters etc." | |
on: | |
workflow_dispatch: | |
workflow_call: | |
pull_request: | |
branches: | |
- "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: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
cache: 'pip' | |
cache-dependency-path: infra/requirements-infra.txt | |
python-version: '3.10' | |
- name: Install infra deps | |
run: python -m pip install -r infra/requirements-infra.txt | |
- name: Check SPDX licenses | |
run: python -m check_copyright --verbose --dry-run --config ./check_copyright_config.yaml . | |
check-metal-kernel-count: | |
runs-on: ubuntu-latest | |
steps: | |
- 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-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ASPELL | |
run: sudo apt-get install -y aspell | |
- name: Run checks on docs | |
run: TT_METAL_HOME=$(pwd) docs/spellcheck.sh | |
check-forbidden-imports: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check ttnn is not used in tt_metal tests | |
run: if (( $(grep -Rnw 'tests/tt_metal' -e 'ttnn' | wc -l ) > 11 )); then exit 1; fi | |
- name: Check tt_eager constructs is not used in tt_metal tests | |
run: | | |
if (( $(grep -Rnw 'tests/tt_metal' -e 'tt_lib' | wc -l ) > 0 )); then exit 1; fi | |
if (( $(grep -Rnw 'tests/tt_metal' -e 'tt_eager' | wc -l ) > 10 )); then exit 1; fi | |
check-sweeps-workflow: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
python-version: '3.10' | |
- name: Check sweeps workflow option count against sweep file count | |
run: | | |
pip install pyyaml | |
python tests/sweep_framework/framework/sweeps_workflow_verification.py | |
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 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
submodules: "recursive" | |
- name: Set safe directory for Git | |
run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
- name: Fetch base branch | |
run: | | |
git remote add upstream "https://github.com/${{ github.event.pull_request.base.repo.full_name }}" | |
git fetch --no-tags upstream "${{ github.event.pull_request.base.ref }}" | |
- name: Install clang-tidy | |
run: | | |
sudo apt-get update | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y clang-tidy-17 python3.11 python3.11-venv python3.11-dev | |
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 | |
- 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: 5 | |
continue-on-error: true | |
- name: Run clang-tidy-pr-comments action | |
uses: platisd/clang-tidy-pr-comments@1b7395ce6f5a4186acabbba24cdd1e846f001aa8 | |
with: | |
# The GitHub token (or a personal access token) | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# The path to the clang-tidy fixes generated above | |
clang_tidy_fixes: clang-tidy-result/fixes.yml | |
# Optionally set to true if you want the Action to request | |
# changes in case warnings are found | |
request_changes: false | |
# Optionally set the number of comments per review | |
# to avoid GitHub API timeouts for heavily loaded | |
# pull requests | |
suggestions_per_comment: 10 | |
continue-on-error: true | |
- name: Final step to signal success | |
run: echo "The job passes even if 3rd party action fails." |