blob: 05e130a9ced16fc942739cd5155ea337ac0647cc [file]
# Copyright 2025 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: PkgCI Torch Tests
permissions:
contents: read
on:
workflow_call:
inputs:
artifact_run_id:
type: string
default: ""
workflow_dispatch:
inputs:
artifact_run_id:
type: string
default: ""
jobs:
tests:
name: "torch_models tests :: ${{ matrix.name }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
# CPU
- name: cpu_task
markers: "cpu"
cache-dir: /home/nod/iree_tests_cache
summary-file: torch_models_cpu_task_summary.json
runs-on:
- self-hosted # must come first
- persistent-cache
- Linux
- X64
# MI325
- name: amdgpu_mi325_gfx942
markers: "gfx942 or mi325"
cache-dir: /shark-cache/data/iree-regression-cache
summary-file: torch_models_amdgpu_mi325_summary.json
runs-on: linux-mi325-1gpu-ossci-iree-org
env:
VENV_DIR: ${{ github.workspace }}/.venv
PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages
steps:
- name: Checking out IREE repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5.4.0
with:
# Must match the subset of versions built in pkgci_build_packages.
python-version: "3.11"
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
if: ${{ inputs.artifact_run_id == '' }}
with:
name: linux_x86_64_release_packages
path: ${{ env.PACKAGE_DOWNLOAD_DIR }}
- name: Checkout test suites repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: iree-org/iree-test-suites
ref: 6407d0c7573c4f76ce0aaea3c6a642475713c68a
path: iree-test-suites
# Don't need lfs for torch models yet.
lfs: false
- name: Setup Python virtual environment
run: |
./build_tools/pkgci/setup_venv.py ${VENV_DIR} \
--artifact-path=${PACKAGE_DOWNLOAD_DIR} \
--fetch-gh-workflow=${{ inputs.artifact_run_id }}
source ${VENV_DIR}/bin/activate
pip install -r ${{ github.workspace }}/iree-test-suites/torch_models/requirements.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Torch Model tests
run: |
source ${VENV_DIR}/bin/activate
pytest \
iree-test-suites/torch_models \
-rpFe \
--log-cli-level=info \
-o log_cli=True \
--durations=0 \
--timeout=1200 \
--capture=no \
--test-file-directory=${{ github.workspace }}/tests/external/iree-test-suites/torch_models \
--external-file-directory=${{ github.workspace }}/tests/external/iree-test-suites/test_suite_files \
--module-directory=${{ github.workspace }}/tests/external/iree-test-suites/torch_models \
--artifact-directory=${{ matrix.cache-dir }}/torch_models/artifacts \
--job-summary-path=${{ github.workspace }}/iree-test-suites \
-m "${{ matrix.markers }}"
- name: Upload Torch Model Job Summary
if: always()
run: |
cat ${{ github.workspace }}/iree-test-suites/job_summary.md >> $GITHUB_STEP_SUMMARY
- name: Upload Torch Models JSON Summary
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ matrix.summary-file }}
path: ${{ github.workspace }}/iree-test-suites/job_summary.json