Model Analysis Weekly #18
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: Model Analysis Weekly | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 23 * * 5' # 11:00 PM UTC Friday (12:00 AM Saturday Serbia) | |
jobs: | |
docker-build: | |
uses: ./.github/workflows/build-image.yml | |
secrets: inherit | |
model-analysis: | |
needs: docker-build | |
runs-on: runner | |
timeout-minutes: 10080 # Set job execution time to 7 days(default: 6 hours) | |
container: | |
image: ${{ needs.docker-build.outputs.docker-image }} | |
options: --device /dev/tenstorrent/0 | |
volumes: | |
- /dev/hugepages:/dev/hugepages | |
- /dev/hugepages-1G:/dev/hugepages-1G | |
- /etc/udev/rules.d:/etc/udev/rules.d | |
- /lib/modules:/lib/modules | |
- /opt/tt_metal_infra/provisioning/provisioning_env:/opt/tt_metal_infra/provisioning/provisioning_env | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
steps: | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT" | |
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT" | |
- name: Git safe dir | |
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # Fetch all history and tags | |
token: ${{ env.GITHUB_TOKEN }} | |
# Clean everything from submodules (needed to avoid issues | |
# with cmake generated files leftover from previous builds) | |
- name: Cleanup submodules | |
run: | | |
git submodule foreach --recursive git clean -ffdx | |
git submodule foreach --recursive git reset --hard | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
create-symlink: true | |
key: model-analysis-${{ runner.os }} | |
- name: Build | |
shell: bash | |
run: | | |
source env/activate | |
cmake -G Ninja \ | |
-B ${{ steps.strings.outputs.build-output-dir }} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_C_COMPILER=clang \ | |
-DCMAKE_CXX_COMPILER=clang++ \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
cmake --build ${{ steps.strings.outputs.build-output-dir }} | |
- name: Run Model Analysis Script | |
shell: bash | |
run: | | |
source env/activate | |
apt-get update | |
apt install -y libgl1 libglx-mesa0 | |
set -o pipefail # Ensures that the exit code reflects the first command that fails | |
python scripts/model_analysis.py \ | |
--test_directory_or_file_path forge/test/models/pytorch \ | |
--dump_failure_logs \ | |
--markdown_directory_path ./model_analysis_docs \ | |
--unique_ops_output_directory_path ./models_unique_ops_output \ | |
2>&1 | tee model_analysis.log | |
- name: Upload Model Analysis Script Logs | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: model-analysis-outputs | |
path: model_analysis.log | |
- name: Upload Models Unique Ops test Failure Logs | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: unique-ops-logs | |
path: ./models_unique_ops_output | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
branch: model_analysis | |
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
base: main | |
commit-message: "Update model analysis docs" | |
title: "Update model analysis docs" | |
body: "This PR will update model analysis docs" | |
labels: automatic_model_analysis | |
delete-branch: true | |
token: ${{ env.GITHUB_TOKEN }} | |
add-paths: | | |
model_analysis_docs/ |