| # 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: PkgCI Unit Test | |
| on: | |
| workflow_call: | |
| inputs: | |
| artifact_run_id: | |
| type: string | |
| default: "" | |
| workflow_dispatch: | |
| inputs: | |
| artifact_run_id: | |
| type: string | |
| default: "" | |
| jobs: | |
| linux_x86_64: | |
| name: Linux (x86_64) | |
| runs-on: ubuntu-24.04 | |
| env: | |
| PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages | |
| VENV_DIR: ${{ github.workspace }}/.venv | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - name: Checking out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: false | |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| # Must match the subset of versions built in pkgci_build_packages. | |
| python-version: "3.11" | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| if: ${{ inputs.artifact_run_id == '' }} | |
| with: | |
| name: linux_x86_64_release_packages | |
| path: ${{ env.PACKAGE_DOWNLOAD_DIR }} | |
| - name: Setup base venv | |
| 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 runtime/bindings/python/iree/runtime/build_requirements.txt | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Validate runtime wheel | |
| run: | | |
| source ${VENV_DIR}/bin/activate | |
| echo "Testing default runtime package:" | |
| python -m iree.runtime._package_test | |
| echo "Testing tracy runtime package:" | |
| # GH runners don't expose the TSC but we want to make sure the basic packaging | |
| # works, so override the check with TRACY_NO_INVARIANT_CHECK=1 (per instructions | |
| # if this is left off). | |
| TRACY_NO_INVARIANT_CHECK=1 IREE_PY_RUNTIME=tracy \ | |
| python -m iree.runtime._package_test | |
| - name: Validate compiler wheel | |
| run: | | |
| source ${VENV_DIR}/bin/activate | |
| echo "Testing compiler package:" | |
| python -m iree.compiler._package_test | |
| # Test tools and importers that require additional deps. | |
| - name: Test ONNX importer | |
| run: | | |
| source ${VENV_DIR}/bin/activate | |
| python -m pip install onnx>=1.16.0 | |
| python compiler/bindings/python/test/tools/import_onnx_test.py | |
| python compiler/bindings/python/test/extras/onnx_importer_test.py | |
| - name: Test FX (PyTorch) importer | |
| run: | | |
| source ${VENV_DIR}/bin/activate | |
| python -m pip install torch>=2.3.0 | |
| python compiler/bindings/python/test/extras/fx_importer_test.py | |
| - name: Test TensorFlow importer | |
| run: | | |
| source ${VENV_DIR}/bin/activate | |
| bash ./build_tools/scripts/setup_tf_python.sh | |
| # TODO: reenable. Temporarily disabled due to a breaking change in | |
| # tosa.mul. This can be reenabled after the TensorFlow tools are | |
| # rebuilt with a newer llvm-project with the new tosa.mul. | |
| # python compiler/bindings/python/test/tools/compiler_tflite_test.py | |
| python compiler/bindings/python/test/tools/compiler_tf_test.py |