Add torchbench exports and benchmarks. #1219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Turbine Models | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
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-turbine-models: | |
strategy: | |
matrix: | |
version: [3.11] | |
os: [nodai-amdgpu-mi250-x86-64] | |
runs-on: ${{matrix.os}} | |
env: | |
E2E_VENV_DIR: ${{ github.workspace }}/test-suite_venv | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
AZ_PRIVATE_CONNECTION: ${{ secrets.ONNXPRIVATESTORAGE_AZ_PRIVATE_CONNECTION }} | |
ROCR_VISIBLE_DEVICES: ${{ matrix.visible-device }} | |
TORCH_HOME: /groups/aig_sharks/test-suite-ci-cache | |
HF_HOME: /groups/aig_sharks/test-suite-ci-cache | |
TURBINE_TANK_CACHE_DIR: /groups/aig_sharks/test-suite-ci-cache | |
steps: | |
# We are using a persistent Gentoo runner here, and this python action is not supported for the arch | |
# - name: "Setting up Python" | |
# uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3 | |
# with: | |
# python-version: ${{matrix.version}} | |
- name: "Checkout This Repo" | |
uses: actions/checkout@v4 | |
- name: "Checkout iree-turbine" | |
uses: actions/checkout@v4 | |
with: | |
repository: iree-org/iree-turbine | |
# TODO: Let the ref be passed as a parameter to run integration tests. | |
path: iree-turbine | |
- name: Sync source deps | |
# build IREE from source with -DIREE_BUILD_TRACY=ON if getting tracy profile | |
run: | | |
python3.11 -m venv turbine_venv | |
source turbine_venv/bin/activate | |
python3.11 -m pip install --upgrade pip | |
# Note: We install in three steps in order to satisfy requirements | |
# from non default locations first. Installing the PyTorch CPU | |
# wheels saves multiple minutes and a lot of bandwidth on runner setup. | |
pip install --no-compile -r ${{ github.workspace }}/iree-turbine/pytorch-cpu-requirements.txt | |
pip install --pre --upgrade -r ${{ github.workspace }}/iree-turbine/requirements.txt | |
pip install --no-compile --pre -e ${{ github.workspace }}/iree-turbine[testing] | |
pip install --upgrade --pre --no-cache-dir iree-compiler iree-runtime -f https://iree.dev/pip-release-links.html | |
pip install --no-compile --pre --upgrade -e models -r models/requirements.txt | |
- name: Show current free memory | |
run: | | |
free -mh | |
- name: Run stateless_llama tests | |
run: | | |
source turbine_venv/bin/activate | |
pytest -v models/turbine_models/tests/stateless_llama_test.py | |
- name: Run sd tests | |
run: | | |
source turbine_venv/bin/activate | |
pytest -v models/turbine_models/tests/sd_test.py | |
pytest -v models/turbine_models/tests/sdxl_test.py --device cpu --rt_device local-task --iree_target_triple x86_64-linux-gnu --num_inference_steps 5 | |
pytest -v models/turbine_models/tests/sdxl_test.py --device vulkan --rt_device vulkan --iree_target_triple rdna3-unknown-linux | |
pytest -v models/turbine_models/tests/sdxl_test.py --device rocm --rt_device hip --iree_target_triple gfx90a --precision fp16 --attn_spec default | |
pytest -v models/turbine_models/tests/sdxl_test.py --device rocm --rt_device hip --iree_target_triple gfx90a --precision fp16 --attn_spec default --batch_size 2 | |
pytest -v models/turbine_models/tests/sd3_test.py --device cpu --rt_device local-task --iree_target_triple x86_64-linux-gnu --num_inference_steps 5 |