Skip to content

Commit

Permalink
Test checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Dec 24, 2024
1 parent 7ad0dbd commit 9ffdda9
Showing 1 changed file with 73 additions and 67 deletions.
140 changes: 73 additions & 67 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:
description: 'Git SHA of commit in tenstorrent/tt-mlir or branch name'
required: false
type: string
push:

permissions:
checks: write
Expand Down Expand Up @@ -98,37 +99,41 @@ jobs:
create-symlink: true
key: ${{ matrix.build.runs-on }}-runtime-${{ matrix.build.enable_runtime }}-${{ env.SDK_VERSION }}

- name: Build (creates tvm and tt-forge-fe wheels)
shell: bash
run: |
source env/activate
python3 setup.py bdist_wheel
cd third_party/tvm/python
python3 setup.py bdist_wheel
cd ../../..
cp third_party/tvm/python/dist/*.whl dist/
# - name: Build (creates tvm and tt-forge-fe wheels)
# shell: bash
# run: |
# source env/activate
# python3 setup.py bdist_wheel
# cd third_party/tvm/python
# python3 setup.py bdist_wheel
# cd ../../..
# cp third_party/tvm/python/dist/*.whl dist/

# - name: Run Unit Tests
# shell: bash
# run: |
# source env/activate
# cmake --build ${{ steps.strings.outputs.build-output-dir }} -- run_unit_tests
#
- name: Upload Build
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: build-forge-ubuntu-latest
path: dist/*.whl

# - name: Upload Build
# uses: actions/upload-artifact@v4
# if: success() || failure()
# with:
# name: build-forge-ubuntu-latest
# path: dist/*.whl

run-tests:
needs: forge-build
needs:
- forge-build
- docker-build

strategy:
fail-fast: false
matrix:
build: [
{runs-on: n150 },
{runs-on: n300 },
{runs-on: n150 },
{runs-on: n300 },
]
test_group_id: [1,2]

Expand All @@ -145,6 +150,7 @@ jobs:
- /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:
- name: Set reusable strings
id: strings
Expand Down Expand Up @@ -181,54 +187,54 @@ jobs:
git submodule foreach --recursive git clean -ffdx
git submodule foreach --recursive git reset --hard
- name: Use build artifacts
uses: actions/download-artifact@v4
with:
name: build-forge-ubuntu-latest

- name: Install wheel
shell: bash
run: |
source env/activate
pip install dist/*tvm*.whl
pip install dist/*tt_forge_fe*.whl
- name: Run Test
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_HUB_DISABLE_PROGRESS_BARS: 1
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
pip install pytest-split
pytest -m push --splits 2 \
--group ${{ matrix.test_group_id }} \
--splitting-algorithm least_duration \
-m "${{ inputs.test_mark }}" \
--junit-xml=${{ steps.strings.outputs.test_report_path }} \
2>&1 | tee pytest.log
- name: Upload Test Log
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-log-${{ matrix.build.runs-on }}-${{ matrix.test_group_id }}
path: pytest.log
# - name: Use build artifacts
# uses: actions/download-artifact@v4
# with:
# name: build-forge-ubuntu-latest

- name: Upload Test Report
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: Install wheel
# shell: bash
# run: |
# source env/activate
# pip install dist/*tvm*.whl
# pip install dist/*tt_forge_fe*.whl

- name: Show Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: ${{ steps.strings.outputs.test_report_path }}
check_name: TT-Forge-FE Tests
comment: true
# - name: Run Test
# env:
# HF_TOKEN: ${{ secrets.HF_TOKEN }}
# HF_HUB_DISABLE_PROGRESS_BARS: 1
# 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
# pip install pytest-split
# pytest -m push --splits 2 \
# --group ${{ matrix.test_group_id }} \
# --splitting-algorithm least_duration \
# -m "${{ inputs.test_mark }}" \
# --junit-xml=${{ steps.strings.outputs.test_report_path }} \
# 2>&1 | tee pytest.log

# - name: Upload Test Log
# uses: actions/upload-artifact@v4
# if: success() || failure()
# with:
# name: test-log-${{ matrix.build.runs-on }}-${{ matrix.test_group_id }}
# path: pytest.log

# - name: Upload Test Report
# 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: TT-Forge-FE Tests
# comment: true

0 comments on commit 9ffdda9

Please sign in to comment.