Skip to content

Commit

Permalink
Remove some CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
kmabeeTT committed Dec 5, 2024
1 parent 02daac6 commit a937907
Showing 1 changed file with 0 additions and 358 deletions.
358 changes: 0 additions & 358 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,364 +213,6 @@ jobs:
# Run tests on TT hardware

run-tests:

timeout-minutes: 30
needs:
- build-image
- build-ttmlir
strategy:
fail-fast: false
matrix:
build: [
{runs-on: n150, enable_perf: OFF, name: "run", ttrt_flags: "--non-zero"},
{runs-on: n150, enable_perf: ON, name: "perf"},
{runs-on: n300, enable_perf: OFF, name: "run", ttrt_flags: "--non-zero"},
{runs-on: n300, enable_perf: ON, name: "perf"},
]
name: "run-tests (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.name }})"

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

container:
image: ${{ needs.build-image.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

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set reusable strings
id: strings
shell: bash
env:
job-name: "run-tests (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.name }})"
run: |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=$(pwd)/install" >> "$GITHUB_OUTPUT"
# Github job context unfortunately doesn't contain job_id, this is the workaround how to fetch it using GH API
echo "Expected job name: ${{ env.job-name }}"
JOB_ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}/jobs" | \
jq -r '.jobs[] | select(.name | contains("${{ env.job-name }}")) | .id ')
echo "Current job id: $JOB_ID"
echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT"
echo "test_report_path=report_$JOB_ID.xml" >> "$GITHUB_OUTPUT"
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}

- name: Use build artifacts
uses: actions/download-artifact@v4
with:
name: install-artifacts-${{ matrix.build.name }}
path: ${{ steps.strings.outputs.install-output-dir }}

# This is needed to preserve file permissions
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
- name: 'Untar install directory'
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: tar xvf artifact.tar

- name: Remove existing whls files
shell: bash
run: |
rm -f *.whl
- name: Download ttrt run whls
uses: actions/download-artifact@v4
with:
name: ttrt-whl-${{ matrix.build.name }}

- name: Install ttrt run whls
shell: bash
run: |
source env/activate
pip show ttrt && pip uninstall -y ttrt
pip install ttrt-${{ env.version }}*.whl --force-reinstall
- name: Generate system descriptor
shell: bash
run: |
source env/activate
ttrt query --save-artifacts
- name: Generate tests
shell: bash
run: |
source env/activate
export LD_LIBRARY_PATH="${TTMLIR_TOOLCHAIN_DIR}/lib:${LD_LIBRARY_PATH}"
export SYSTEM_DESC_PATH="${GITHUB_WORKSPACE}/ttrt-artifacts/system_desc.ttsys"
ln -sf ${{ steps.strings.outputs.install-output-dir }} ${{ steps.strings.outputs.build-output-dir }}
llvm-lit -sv ${{ steps.strings.outputs.build-output-dir }}/test
- name: Run functional tests
shell: bash
if: matrix.build.enable_perf == 'OFF'
run: |
source env/activate
ttrt ${{ matrix.build.name }} ${{ matrix.build.ttrt_flags }} ${{ steps.strings.outputs.build-output-dir }}/test/ttmlir/Silicon
- name: Run perf tests
shell: bash
if: matrix.build.enable_perf == 'ON'
run: |
source env/activate
ttrt ${{ matrix.build.name }} ${{ matrix.build.ttrt_flags }} ${{ steps.strings.outputs.build-output-dir }}/test/ttmlir/Silicon/TTNN/perf_unit
cp ttrt_report.xml ${{ steps.strings.outputs.test_report_path }}
- name: Upload ttrt test report json
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build.runs-on }}_${{ matrix.build.name }}_results.json
path: ${{ matrix.build.name }}_results.json

- name: Upload Test Report xml
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-reports-${{ matrix.build.runs-on }}-${{ matrix.test_group_id }}
path: ${{ steps.strings.outputs.test_report_path }}

- name: Show Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: ${{ steps.strings.outputs.test_report_path }}
check_name: TTRT ${{ matrix.build.runs-on }} ${{ matrix.build.name }} Tests

run-ttrt-tests:

timeout-minutes: 30
needs:
- build-image
- build-ttmlir
strategy:
fail-fast: false
matrix:
build: [
{runs-on: n150, enable_perf: ON, name: "perf"},
]

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

container:
image: ${{ needs.build-image.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

steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set reusable strings
id: strings
shell: bash
env:
job-name: "${{ github.job }} (${{ matrix.build.runs-on }}, ${{ matrix.build.enable_perf }}, ${{ matrix.build.name }})"
run: |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=$(pwd)/install" >> "$GITHUB_OUTPUT"
# Github job context unfortunately doesn't contain job_id, this is the workaround how to fetch it using GH API
echo "Expected job name: ${{ env.job-name }}"
JOB_ID=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}/jobs" | \
jq -r '.jobs[] | select(.name | contains("${{ env.job-name }}")) | .id ')
echo "Current job id: $JOB_ID"
echo "job-id=$JOB_ID" >> "$GITHUB_OUTPUT"
echo "test_report_path=report_$JOB_ID.xml" >> "$GITHUB_OUTPUT"
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}

- name: Use build artifacts
uses: actions/download-artifact@v4
with:
name: install-artifacts-${{ matrix.build.name }}
path: ${{ steps.strings.outputs.install-output-dir }}

# This is needed to preserve file permissions
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
- name: 'Untar install directory'
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: tar xvf artifact.tar

- name: Remove existing whls files
shell: bash
run: |
rm -f *.whl
- name: Download ttrt run whls
uses: actions/download-artifact@v4
with:
name: ttrt-whl-${{ matrix.build.name }}

- name: Install ttrt run whls
shell: bash
run: |
source env/activate
pip show ttrt && pip uninstall -y ttrt
pip install ttrt-${{ env.version }}*.whl --force-reinstall
pip install pytest
- name: Generate system descriptor
shell: bash
run: |
source env/activate
ttrt query --save-artifacts
- name: Generate tests
shell: bash
run: |
source env/activate
export LD_LIBRARY_PATH="${TTMLIR_TOOLCHAIN_DIR}/lib:${LD_LIBRARY_PATH}"
export SYSTEM_DESC_PATH="${GITHUB_WORKSPACE}/ttrt-artifacts/system_desc.ttsys"
ln -sf ${{ steps.strings.outputs.install-output-dir }} ${{ steps.strings.outputs.build-output-dir }}
llvm-lit -sv ${{ steps.strings.outputs.build-output-dir }}/test
- name: ttrt read tests
shell: bash
run: |
source env/activate
pytest -ssv runtime/tools/python/test \
--junit-xml=${{ steps.strings.outputs.test_report_path }}
- name: Upload Test Report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-reports-${{ matrix.build.runs-on }}-${{ matrix.build.name }}
path: ${{ steps.strings.outputs.test_report_path }}

- name: Show Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: ${{ steps.strings.outputs.test_report_path }}
check_name: Run ttrt tests

run-runtime-api-tests:

timeout-minutes: 30
needs:
- build-image
- build-ttmlir
strategy:
fail-fast: false
matrix:
build: [
{runs-on: n150, enable_perf: OFF, name: "run"},
]

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

container:
image: ${{ needs.build-image.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

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set reusable strings
id: strings
shell: bash
run: |
echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
echo "install-output-dir=$(pwd)/install" >> "$GITHUB_OUTPUT"
- name: Git safe dir
run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}

- name: Use build artifacts
uses: actions/download-artifact@v4
with:
name: install-artifacts-${{ matrix.build.name }}
path: ${{ steps.strings.outputs.install-output-dir }}

# This is needed to preserve file permissions
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
- name: 'Untar install directory'
shell: bash
working-directory: ${{ steps.strings.outputs.install-output-dir }}
run: tar xvf artifact.tar

- name: Remove existing whls files
shell: bash
run: |
rm -f *.whl
- name: Download ttrt run whls
uses: actions/download-artifact@v4
with:
name: ttrt-whl-${{ matrix.build.name }}

# Runtime tests currently require ttrt whls to be installed
- name: Install ttrt run whls
shell: bash
run: |
source env/activate
pip show ttrt && pip uninstall -y ttrt
pip install ttrt-${{ env.version }}*.whl --force-reinstall
pip install pytest
- name: Generate system descriptor
shell: bash
run: |
source env/activate
ttrt query --save-artifacts
- name: Generate tests
shell: bash
run: |
source env/activate
export LD_LIBRARY_PATH="${TTMLIR_TOOLCHAIN_DIR}/lib:${LD_LIBRARY_PATH}"
export SYSTEM_DESC_PATH="${GITHUB_WORKSPACE}/ttrt-artifacts/system_desc.ttsys"
ln -sf ${{ steps.strings.outputs.install-output-dir }} ${{ steps.strings.outputs.build-output-dir }}
llvm-lit -sv ${{ steps.strings.outputs.build-output-dir }}/test
- name: ttnn api tests
shell: bash
run: |
source env/activate
pytest -ssv runtime/test/python/ttnn/test_runtime_api.py
build-and-test-explorer:
needs: build-image
timeout-minutes: 60
Expand Down

0 comments on commit a937907

Please sign in to comment.