Skip to content

Test Sharktank Models #170

Test Sharktank Models

Test Sharktank Models #170

# Copyright 2024 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: Test Sharktank Models
on:
push:
branches:
- main
paths:
- ".github/workflows/test_sharktank_models.yml"
- "sharktank_models/**"
pull_request:
paths:
- ".github/workflows/test_sharktank_models.yml"
- "sharktank_models/**"
workflow_dispatch:
schedule:
# Runs at 3:00 PM UTC, which is 8:00 AM PST
- cron: "0 15 * * *"
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
test-sharktank-models:
if: ${{ github.repository_owner == 'iree-org' || github.event_name != 'schedule' }}
runs-on: ubuntu-24.04
env:
VENV_DIR: ${{ github.workspace }}/.venv
HTML_REPORT_PATH: sharktank_models/sharktank_models_test_report_cpu_llvm_task.html
TEST_OUTPUT_ARTIFACTS: ${{ github.workspace }}/model_output_artifacts
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
lfs: true
# Install Python packages.
- name: Setup Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: "3.11"
- name: Setup Python venv
run: python3 -m venv ${VENV_DIR}
- name: Install IREE nightly release Python packages
run: |
source ${VENV_DIR}/bin/activate
python3 -m pip install -e sharktank_models/
python3 -m pip install -r sharktank_models/requirements-iree.txt
# Run tests.
- name: Run Sharktank models test suite
run: |
source ${VENV_DIR}/bin/activate
pytest sharktank_models/ \
-rA \
-m "target_cpu" \
--timeout=300 \
--durations=0 \
--log-cli-level=info \
--ignore=sharktank_models/benchmarks \
--ignore=sharktank_models/quality_tests
- name: Run regression quality tests
run: |
source ${VENV_DIR}/bin/activate
pytest \
sharktank_models/quality_tests \
-rpFe \
--log-cli-level=info \
--durations=0 \
--timeout=1200 \
--capture=no \
--test-file-directory=sharktank_models/quality_tests
env:
BACKEND: "cpu"
# Since the benchmark tests require compiled model files, this step must run after the quality tests
- name: Run regression benchmark tests
run: |
source ${VENV_DIR}/bin/activate
pytest \
sharktank_models/benchmarks \
--log-cli-level=info \
--retries=7 \
--timeout=600 \
--test-file-directory=sharktank_models/benchmarks
echo "$(<${JOB_SUMMARY_PATH}/job_summary.md )" >> $GITHUB_STEP_SUMMARY
env:
BACKEND: "cpu"
SKU: "cpu"
JOB_SUMMARY_PATH: ${{ github.workspace }}