blob: 2eb82012e5cb6edc3d4c14cfad309d3ee42b0601 [file] [log] [blame]
# 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 Sharktank Tests
on:
workflow_call:
inputs:
artifact_run_id:
type: string
default: ""
workflow_dispatch:
inputs:
artifact_run_id:
type: string
default: ""
jobs:
tests:
name: "sharktank_tests :: ${{ matrix.name }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
# CPU
- name: cpu_task
target: target_cpu
rocm-chip: none
models-config-file: models_cpu_llvm_task.json
backend: cpu
iree_test_files: /home/nod/iree_tests_cache
sku: cpu
runs-on:
- self-hosted # must come first
- persistent-cache
- Linux
- X64
# AMD GPU
- name: amdgpu_rocm_mi250_gfx90a
rocm-chip: gfx90a
backend: rocm
iree_test_files: /groups/aig_sharks/iree-tests-cache
sku: mi250
target: target_hip
runs-on: nodai-amdgpu-mi250-x86-64
- name: amdgpu_rocm_mi300_gfx942
rocm-chip: gfx942
backend: rocm
iree_test_files: /shark-cache/data/iree-regression-cache
sku: mi300
target: target_hip
runs-on: linux-mi325-1gpu-ossci-iree-org
- name: amdgpu_rocm_mi308_gfx942
rocm-chip: gfx942
backend: rocm
iree_test_files: /home/esaimana/iree_tests_cache
sku: mi308
target: target_hip
runs-on: nodai-amdgpu-mi308-x86-64
env:
VENV_DIR: ${{ github.workspace }}/venv
PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages
TEST_OUTPUT_ARTIFACTS: ${{ github.workspace }}/model_output_artifacts
IREE_TEST_FILES: ${{ matrix.iree_test_files }}
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: 615c14ea2dd082d132cd64cd92806bcc7fdb5c75
path: iree-test-suites
lfs: true
- 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 -e ${{ github.workspace }}/iree-test-suites/sharktank_models
- name: Run sharktank model tests
run: |
source ${VENV_DIR}/bin/activate
pytest iree-test-suites/sharktank_models \
-rA \
--log-cli-level=info \
--override-ini=xfail_strict=false \
-m ${{ matrix.target }} \
--timeout=120 \
--durations=0 \
--ignore=iree-test-suites/sharktank_models/benchmarks \
--ignore=iree-test-suites/sharktank_models/quality_tests
env:
HIP_TARGET: ${{ matrix.rocm-chip }}
ASSET_PATH: ${{ github.workspace }}/iree-test-suites/sharktank_models
- name: Run quality tests
run: |
source ${VENV_DIR}/bin/activate
pytest \
iree-test-suites/sharktank_models/quality_tests \
-rpFe \
--log-cli-level=info \
--durations=0 \
--timeout=1200 \
--capture=no \
--test-file-directory=${{ github.workspace }}/tests/external/iree-test-suites/sharktank_models/quality_tests \
--external-file-directory=${{ github.workspace }}/tests/external/iree-test-suites/test_suite_files
env:
ROCM_CHIP: ${{ matrix.rocm-chip }}
SKU: ${{ matrix.sku }}
IREE_TEST_FILES: ${{ env.IREE_TEST_FILES }}
BACKEND: ${{ matrix.backend }}
# Since the benchmark tests require compiled model files, this step must run after the quality tests
- name: Run benchmark tests
run: |
source ${VENV_DIR}/bin/activate
pytest \
iree-test-suites/sharktank_models/benchmarks \
--log-cli-level=info \
--retries=7 \
--timeout=600 \
--test-file-directory=${{ github.workspace }}/tests/external/iree-test-suites/sharktank_models/benchmarks \
--external-file-directory=${{ github.workspace }}/tests/external/iree-test-suites/test_suite_files
echo "$(<${JOB_SUMMARY_PATH}/job_summary.md )" >> $GITHUB_STEP_SUMMARY
env:
ROCM_CHIP: ${{ matrix.rocm-chip }}
SKU: ${{ matrix.sku }}
IREE_TEST_FILES: ${{ env.IREE_TEST_FILES }}
BACKEND: ${{ matrix.backend }}
JOB_SUMMARY_PATH: ${{ github.workspace }}/iree-test-suites
# These temporary tests are designed for targets who do not have cached
# artifacts and unable to run quality and benchmark tests
# TODO (geomin12): add cached artifact support for w7900
model-test:
name: "sharktank_model_tests :: ${{ matrix.name }}"
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- name: rocm_hip_w7900
rocm-chip: gfx1100
target: target_hip
runs-on: nodai-amdgpu-w7900-x86-64
env:
VENV_DIR: ${{ github.workspace }}/venv
PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages
TEST_OUTPUT_ARTIFACTS: ${{ github.workspace }}/model_output_artifacts
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: 615c14ea2dd082d132cd64cd92806bcc7fdb5c75
path: iree-test-suites
lfs: true
- 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 -e ${{ github.workspace }}/iree-test-suites/sharktank_models
- name: Run sharktank model tests
run: |
source ${VENV_DIR}/bin/activate
pytest iree-test-suites/sharktank_models \
-rA \
--log-cli-level=info \
--override-ini=xfail_strict=false \
-m ${{ matrix.target }} \
--timeout=120 \
--durations=0 \
--ignore=iree-test-suites/sharktank_models/benchmarks \
--ignore=iree-test-suites/sharktank_models/quality_tests
env:
HIP_TARGET: ${{ matrix.rocm-chip }}
ASSET_PATH: ${{ github.workspace }}/iree-test-suites/sharktank_models