# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # GH actions. # We use it to cover windows and mac builds # Jenkins is still the primary CI name: CI on: push: branches: - main pull_request: branches: - main workflow_dispatch: permissions: contents: read concurrency: group: CI-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true jobs: MacOS: if: ${{ github.repository == 'apache/tvm' }} runs-on: macOS-latest steps: - uses: actions/checkout@v6.0.2 with: submodules: 'recursive' - name: Set up environment uses: ./.github/actions/setup - name: Detect environment variables uses: ./.github/actions/detect-env-vars id: env_vars - name: Build TIRx and TVM wheels shell: bash -l {0} env: CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }} run: | set -euxo pipefail pip install "scikit-build-core>=0.11" "setuptools-scm>=8" export CMAKE_ARGS="-DTVM_TIRX_USE_LLVM=ON -DTVM_TIRX_USE_METAL=ON -DTVM_TIRX_BUILD_TESTS=OFF" pip wheel --no-deps -w dist ./3rdparty/tvm-tirx -v pip install --no-deps --force-reinstall dist/apache_tvm_tirx-*.whl export CMAKE_ARGS="-DBUILD_TESTING=OFF" pip wheel --no-deps --no-build-isolation -w dist . -v - name: Install TIRx and TVM from wheels shell: bash -l {0} run: | set -euxo pipefail pip install ml_dtypes # Preserve the source-matched tvm-ffi installed by the setup action. pip install --no-deps apache-tvm-ffi-orcjit==0.1.3 # Keep the source-matched tvm-ffi installed by the setup action. pip install --no-deps dist/*.whl - name: Test shell: bash -l {0} run: >- python -m pytest -v 3rdparty/tvm-tirx/tests/python/codegen/llvm/test_minimal.py 3rdparty/tvm-tirx/tests/python/runtime/test_validate_wheel_library.py 3rdparty/tvm-tirx/tests/python/script - name: Minimal Metal Compile-Only shell: bash -l {0} run: | set -euxo pipefail python -m pytest -v -s '3rdparty/tvm-tirx/tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum_compile' python -m pytest -v -s '3rdparty/tvm-tirx/tests/python/backend/metal/codegen/test_basic.py::test_func_with_trailing_pod_params' - name: Minimal Metal Compile-and-Run shell: bash -l {0} run: | set -euxo pipefail python -m pytest -v -s 3rdparty/tvm-tirx/tests/python/backend/metal python -m pytest -v -s '3rdparty/tvm-tirx/tests/python/codegen/gpu_common/test_intrinsics.py' python -m pytest -v -s '3rdparty/tvm-tirx/tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum[dims0-metal]' Windows: if: ${{ github.repository == 'apache/tvm' }} runs-on: windows-latest steps: - uses: actions/checkout@v6.0.2 with: submodules: 'recursive' - name: Set up environment uses: ./.github/actions/setup - name: Detect environment variables uses: ./.github/actions/detect-env-vars id: env_vars - name: Build and install TIRx and TVM shell: cmd /C call {0} env: CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }} run: | pip install "scikit-build-core>=0.11" "setuptools-scm>=8" || exit /b 1 set CMAKE_ARGS=-DTVM_TIRX_USE_LLVM=ON -DTVM_TIRX_BUILD_TESTS=OFF pip wheel --no-deps -w dist ./3rdparty/tvm-tirx -v || exit /b 1 for %%w in (dist\apache_tvm_tirx-*.whl) do ( pip install --no-deps --force-reinstall "%%w" || exit /b 1 ) set CMAKE_ARGS=-DBUILD_TESTING=OFF pip wheel --no-deps --no-build-isolation -w dist . -v || exit /b 1 for %%w in (dist\*.whl) do ( pip install --no-deps "%%w" || exit /b 1 ) - name: Install test dependencies shell: cmd /C call {0} run: | pip install psutil cloudpickle ml_dtypes numpy packaging scipy tornado typing_extensions || exit /b 1 rem Preserve the source-matched tvm-ffi installed by the setup action. pip install --no-deps apache-tvm-ffi-orcjit==0.1.3 - name: Test shell: cmd /C call {0} run: >- python -m pytest -v 3rdparty/tvm-tirx/tests/python/codegen/llvm/test_minimal.py 3rdparty/tvm-tirx/tests/python/runtime/test_validate_wheel_library.py 3rdparty/tvm-tirx/tests/python/script