Skip to content

Commit

Permalink
Separate runners for each test.
Browse files Browse the repository at this point in the history
  • Loading branch information
uazizTT committed Nov 15, 2024
1 parent f71ec73 commit b97aee8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ jobs:
needs: [pre-commit, spdx]
uses: ./.github/workflows/run-build.yml
secrets: inherit
collect_dirs:
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.dirs.outputs.dirs }}
steps:
- uses: actions/checkout@v2
- id: dirs
run: echo "dirs=$(ls -d tests/models/*/ | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}
test:
needs: build
needs: [build, collect_dirs]
strategy:
matrix:
dir: ${{ fromJson(needs.collect_dirs.outputs.dirs) }}
uses: ./.github/workflows/run-tests.yml
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/run-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
shell: bash
run: |
source env/activate
apt-get install jq -y
cmake --build ${{ steps.strings.outputs.build-output-dir }}
cmake --install ${{ steps.strings.outputs.build-output-dir }}
Expand Down
46 changes: 32 additions & 14 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ jobs:
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
build: [
{runs-on: n150, name: "run"},
]

runs-on:
- in-service
- ${{ matrix.build.runs-on }}
- n150

container:
image: ghcr.io/tenstorrent/tt-torch/tt-torch-ci-ubuntu-22-04:latest
Expand All @@ -45,6 +40,32 @@ jobs:
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=$(pwd)/install" >> "$GITHUB_OUTPUT"
- name: Get Job ID from GH API
id: get-job-id
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
apt-get install gh -y
apt-get install jq -y
apt-get install curl -y
jobs=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id}}/attempts/${{ github.run_attempt }}/jobs)
job_id=$(echo $jobs | jq -r '.jobs[] | select(.runner_name=="${{ runner.name }}") | .id')
job_name=$(echo $jobs | jq -r '.jobs[] | select(.runner_name=="${{ runner.name }}") | .name')
echo "job_id=$job_id"
echo "job_name=$job_name"
echo "runner_name=${{ runner.name }}"
echo "all_jobs=$jobs"
- name: Display Job ID
run: |
echo $${{ runner.name }}
echo Job ID: ${{ steps.get-job-id.outputs.job_id }}
echo My full job URL is ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ steps.get-job-id.outputs.job_id }}
echo ${{ runner.name }}
echo ${{ steps.get-job-id.outputs.job_id }}
echo ${{ steps.get-job-id.outputs.all_jobs }}
echo ${{ steps.get-job-id.outputs.test_report_path }}
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}

Expand Down Expand Up @@ -73,13 +94,10 @@ jobs:
- name: Run PyTorch tests
shell: bash
run: |
echo ${{ steps.strings.outputs.work-dir }}
echo ${{ steps.strings.outputs.test-dir }}
echo ${{ steps.strings.outputs.build-output-dir }}
echo ${{ steps.strings.outputs.install-output-dir }}
source env/activate
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${{ steps.strings.outputs.build-output-dir }}/lib:./lib/:${LD_LIBRARY_PATH}"
pytest -v tests/torch
- name: Run ONNX tests
shell: bash
run: |
source env/activate
export LD_LIBRARY_PATH="/opt/ttmlir-toolchain/lib/:${{ steps.strings.outputs.install-output-dir }}/lib:${{ steps.strings.outputs.build-output-dir }}/lib:./lib/:${LD_LIBRARY_PATH}"
pytest -v tests/onnx
pytest -v ${{ steps.strings.outputs.test-dir }}

0 comments on commit b97aee8

Please sign in to comment.