This is an automated email from the ASF dual-hosted git repository. tqchen pushed a commit to branch tirx/standalone-package-cleanup in repository https://gitbox.apache.org/repos/asf/tvm.git
commit 350ea906a3031261179fe25ba46d6697955c264e Author: Tianqi Chen <[email protected]> AuthorDate: Thu Oct 15 01:36:39 2026 +0000 [REFACTOR][CI] Exercise both partitions and publish standalone core wheels --- .github/actions/build-wheel-for-publish/action.yml | 12 +++--- .github/workflows/main.yml | 45 +++++++++++++++------- .github/workflows/publish_wheel.yml | 10 ++--- .pre-commit-config.yaml | 4 +- ci/jenkins/data.py | 8 +++- ci/jenkins/generated/common.groovy | 1 + .../package/manylinux_build_libtvm_runtime_cuda.sh | 5 ++- .../package/windows_build_libtvm_runtime_cuda.bat | 4 +- ci/wheel/manylinux_build_libtvm_runtime_cuda.sh | 5 ++- ci/wheel/windows_build_libtvm_runtime_cuda.bat | 4 +- docker/bash.sh | 2 +- tests/scripts/release/test_release_package.sh | 2 +- tests/scripts/setup-pytest-env.sh | 2 +- tests/scripts/task_cpp_unittest.sh | 1 + tests/scripts/task_java_unittest.sh | 2 +- tests/scripts/task_python_docs.sh | 4 +- tests/scripts/task_python_unittest.sh | 4 +- tests/scripts/task_python_unittest_gpuonly.sh | 6 +-- tests/scripts/task_web_wasm.sh | 2 +- .../tvm_tirx/backend/cuda/launch/generate.py | 2 +- 20 files changed, 76 insertions(+), 49 deletions(-) diff --git a/.github/actions/build-wheel-for-publish/action.yml b/.github/actions/build-wheel-for-publish/action.yml index d4a3ca14c2..9039669e48 100644 --- a/.github/actions/build-wheel-for-publish/action.yml +++ b/.github/actions/build-wheel-for-publish/action.yml @@ -15,9 +15,9 @@ # specific language governing permissions and limitations # under the License. -name: Build TVM Wheel +name: Build TIRx Wheel description: > - Build and test the LLVM-enabled TVM wheel for a given OS/architecture + Build and test the standalone LLVM-enabled apache-tvm-tirx wheel for a given OS/architecture combination using cibuildwheel. inputs: @@ -59,7 +59,7 @@ runs: id: llvm-cache with: path: ${{ runner.os == 'Windows' && 'C:/opt/llvm' || '/opt/llvm' }} - key: tvm-wheel-llvm-${{ env.LLVM_VERSION }}-${{ runner.os }}-${{ inputs.arch }}-v6 + key: tirx-wheel-llvm-${{ env.LLVM_VERSION }}-${{ runner.os }}-${{ inputs.arch }}-v6 # ---- Install LLVM via conda (cache miss only) ---- - name: Setup conda @@ -107,10 +107,10 @@ runs: run: echo "TVM_CUDA_EXTRA_LIB=$(cygpath -m "$(pwd)")/build-wheel-cuda/lib/tvm_runtime_cuda.dll" >> "$GITHUB_ENV" # ---- Build and test wheels ---- - - name: Build and test wheels + - name: Build and test TIRx core wheel uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 with: - package-dir: . + package-dir: tirx output-dir: wheelhouse env: CIBW_BUILD: ${{ inputs.build }} @@ -139,7 +139,7 @@ runs: PATH="C:/opt/llvm/Library/bin;$PATH" CMAKE_ARGS="-DUSE_LLVM='C:/opt/llvm/Library/bin/llvm-config.exe --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=C:/opt/llvm/Library ${{ inputs.cmake_defines }} -DTVM_PACKAGE_EXTRA_LIBS=${{ env.TVM_CUDA_EXTRA_LIB }}" # Turns the wheel-specific assertions in - # tests/python/all-platform-minimal-test/test_validate_runtime_library.py + # tirx/tests/python/all-platform-minimal-test/test_validate_runtime_library.py # ON (they skip unless these are set). Every published wheel is LLVM-enabled, # so TVM_WHEEL_EXPECT_LLVM is always "1"; the CUDA runtime is only bundled on # the CUDA wheels, so TVM_WHEEL_EXPECT_CUDA_RUNTIME is "0" for CPU wheels. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6840582eed..31d8bb8e03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,17 +50,22 @@ jobs: - name: Detect environment variables uses: ./.github/actions/detect-env-vars id: env_vars - - name: Build TVM wheel + - 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 - export CMAKE_ARGS="-DUSE_LLVM=ON -DBUILD_TESTING=OFF" + export CMAKE_ARGS="-DUSE_LLVM=ON -DUSE_METAL=ON -DBUILD_TESTING=OFF" + pip wheel --no-deps -w dist ./tirx -v + export PIP_FIND_LINKS="$(pwd)/dist" + export CMAKE_ARGS="-DBUILD_TESTING=OFF" pip wheel --no-deps -w dist . -v - - name: Install TVM from wheel + - name: Install TIRx and TVM from wheels shell: bash -l {0} run: | + set -euxo pipefail export TVM_FFI_VERSION="$(python -c 'from importlib.metadata import version; print(version("apache-tvm-ffi"))')" pip install ml_dtypes # --no-deps: this package requires apache-tvm-ffi>=0.1.14.post1, and the source-built core @@ -74,25 +79,30 @@ jobs: from importlib.metadata import requires, version assert version("apache-tvm-ffi") == os.environ["TVM_FFI_VERSION"] - assert "apache-tvm-ffi>=0.1.14.post1" in requires("apache-tvm") - assert "apache-tvm-ffi-orcjit==0.1.2" in requires("apache-tvm") + assert version("apache-tvm-tirx") == "0.1.0a0" + assert "apache-tvm-tirx==0.1.0a0" in requires("apache-tvm") + assert "apache-tvm-ffi>=0.1.14.post1" in requires("apache-tvm-tirx") + assert "apache-tvm-ffi-orcjit==0.1.2" in requires("apache-tvm-tirx") PY - name: Test shell: bash -l {0} run: >- python -m pytest -v tests/python/all-platform-minimal-test tests/python/script + tirx/tests/python/all-platform-minimal-test tirx/tests/python/script - name: Minimal Metal Compile-Only shell: bash -l {0} run: | - python -m pytest -v -s 'tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum_compile' - python -m pytest -v -s 'tests/python/backend/metal/codegen/test_metal.py::test_func_with_trailing_pod_params' + set -euxo pipefail + python -m pytest -v -s 'tirx/tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum_compile' + python -m pytest -v -s 'tirx/tests/python/backend/metal/codegen/test_metal.py::test_func_with_trailing_pod_params' - name: Minimal Metal Compile-and-Run shell: bash -l {0} run: | - python -m pytest -v -s tests/python/backend/metal - python -m pytest -v -s 'tests/python/codegen/gpu_common/test_gpu_intrinsics.py' - python -m pytest -v -s 'tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum[dims0-metal]' + set -euxo pipefail + python -m pytest -v -s tirx/tests/python/backend/metal + python -m pytest -v -s 'tirx/tests/python/codegen/gpu_common/test_gpu_intrinsics.py' + python -m pytest -v -s 'tirx/tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum[dims0-metal]' Windows: if: ${{ github.repository == 'apache/tvm' }} @@ -106,18 +116,24 @@ jobs: - name: Detect environment variables uses: ./.github/actions/detect-env-vars id: env_vars - - name: Install TVM + - 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 + pip install scikit-build-core || exit /b 1 set CMAKE_ARGS=-DUSE_LLVM=ON -DBUILD_TESTING=OFF - pip install --no-deps . -v + pip wheel --no-deps -w dist ./tirx -v || exit /b 1 + set PIP_FIND_LINKS=%CD%\dist + set CMAKE_ARGS=-DBUILD_TESTING=OFF + pip wheel --no-deps -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 + pip install psutil cloudpickle ml_dtypes numpy packaging scipy tornado typing_extensions || exit /b 1 rem --no-deps keeps the source-built apache-tvm-ffi (versioned below 0.1.14.post1 from the rem shallow checkout) from being replaced by a PyPI build. pip install --no-deps apache-tvm-ffi-orcjit==0.1.2 @@ -125,3 +141,4 @@ jobs: shell: cmd /C call {0} run: >- python -m pytest -v tests/python/all-platform-minimal-test tests/python/script + tirx/tests/python/all-platform-minimal-test tirx/tests/python/script diff --git a/.github/workflows/publish_wheel.yml b/.github/workflows/publish_wheel.yml index f972d96339..45fcf9c598 100644 --- a/.github/workflows/publish_wheel.yml +++ b/.github/workflows/publish_wheel.yml @@ -110,7 +110,7 @@ jobs: - name: Upload CUDA runtime sidecar uses: actions/[email protected] with: - name: tvm-cuda-runtime-${{ matrix.arch }} + name: tirx-cuda-runtime-${{ matrix.arch }} path: ${{ matrix.lib }} if-no-files-found: error @@ -166,10 +166,10 @@ jobs: if: ${{ matrix.include_cuda_runtime == '1' }} uses: actions/[email protected] with: - name: tvm-cuda-runtime-${{ matrix.arch }} + name: tirx-cuda-runtime-${{ matrix.arch }} path: build-wheel-cuda/lib - - name: Build TVM wheel + - name: Build TIRx wheel uses: ./.github/actions/build-wheel-for-publish with: arch: ${{ matrix.arch }} @@ -180,7 +180,7 @@ jobs: - name: Upload wheel artifact uses: actions/[email protected] with: - name: tvm-wheel-${{ matrix.artifact_suffix }} + name: tirx-wheel-${{ matrix.artifact_suffix }} path: wheelhouse/*.whl if-no-files-found: error @@ -196,7 +196,7 @@ jobs: steps: - uses: actions/[email protected] with: - pattern: tvm-wheel-* + pattern: tirx-wheel-* path: dist merge-multiple: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f38e1cb858..c76f80bf57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,11 +25,11 @@ repos: hooks: - id: cuda-launch-generated name: check CUDA launch generated files - entry: python python/tvm/backend/cuda/launch/generate.py --check + entry: python tirx/python/tvm_tirx/backend/cuda/launch/generate.py --check language: python additional_dependencies: [ruff==0.12.3, clang-format==20.1.8] pass_filenames: false - files: ^(python/tvm/backend/cuda/launch/|src/backend/cuda/launch/|docs/tirx/api/cuda_launch.rst) + files: ^(tirx/python/tvm_tirx/backend/cuda/launch/|tirx/src/backend/cuda/launch/|docs/tirx/api/cuda_launch.rst) - id: check-asf-header name: check ASF Header entry: python tests/lint/check_asf_header.py --check diff --git a/ci/jenkins/data.py b/ci/jenkins/data.py index fd75107e7d..74f7ccc96d 100644 --- a/ci/jenkins/data.py +++ b/ci/jenkins/data.py @@ -32,12 +32,18 @@ import sys files_to_stash = { # Executables and build files needed to run c++ tests - "cpptest": ["build/cpptest", "build/build.ninja", "build/CMakeFiles/rules.ninja"], + "cpptest": [ + "build/cpptest", + "build/tirx_cpptest", + "build/build.ninja", + "build/CMakeFiles/rules.ninja", + ], # runtime files "tvm_runtime": ["build/lib/libtvm_runtime.so", "build/config.cmake"], # compiler files "tvm_lib": [ "build/lib/libtvm_compiler.so", + "build/lib/libtvm_tirx.so", "build/lib/libtvm_runtime.so", "build/lib/libtvm_ffi.so", "build/lib/libtvm_runtime_cuda.so", diff --git a/ci/jenkins/generated/common.groovy b/ci/jenkins/generated/common.groovy index cd8324b5f2..a22b9b218d 100644 --- a/ci/jenkins/generated/common.groovy +++ b/ci/jenkins/generated/common.groovy @@ -298,6 +298,7 @@ def make_cpp_tests(image, build_dir) { --sccache-bucket tvm-sccache-prod \ --sccache-region us-west-2 \ --cmake-target cpptest \ + --cmake-target tirx_cpptest \ --build-dir ${build_dir} """, label: 'Make C++ tests', diff --git a/ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh b/ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh index d0d847ae83..f1a43b27c2 100755 --- a/ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh +++ b/ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh @@ -39,6 +39,7 @@ dnf -y install cuda-driver-devel-13-1 # generator (no Ninja), so no build tools are installed here. Put the bundled # CPython and CUDA toolchain on PATH for the CMake configure and nvcc. export PATH="/opt/python/cp310-cp310/bin:/usr/local/cuda/bin:${PATH}" +python -m pip install "apache-tvm-ffi>=0.1.14.post1" nvcc --version rm -rf "${build_dir}" @@ -48,13 +49,13 @@ rm -rf "${build_dir}" # intentionally not set: it would be a no-op here for the same reason (verified -- # the .so is byte-identical across arch values and carries no device code), and # modern CMake fills in a default so configure does not fail without it. -cmake -S "${repo_root}" -B "${build_dir}" \ +cmake -S "${repo_root}/tirx" -B "${build_dir}" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=OFF \ -DTVM_BUILD_PYTHON_MODULE=ON \ -DUSE_CUDA=/usr/local/cuda \ -DUSE_LLVM=OFF \ - -DUSE_CUBLAS=OFF -DUSE_CUDNN=OFF -DUSE_CUTLASS=OFF -DUSE_NCCL=OFF -DUSE_NVTX=OFF \ + -DUSE_NVTX=OFF \ -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc cmake --build "${build_dir}" --target tvm_runtime tvm_runtime_cuda --parallel "${parallel}" diff --git a/ci/scripts/package/windows_build_libtvm_runtime_cuda.bat b/ci/scripts/package/windows_build_libtvm_runtime_cuda.bat index 4864c18a80..f541af389b 100644 --- a/ci/scripts/package/windows_build_libtvm_runtime_cuda.bat +++ b/ci/scripts/package/windows_build_libtvm_runtime_cuda.bat @@ -62,7 +62,7 @@ set "cuda_root=%CD%" popd set "CUDA_PATH=%cuda_root%" -python -m pip install -U pip cmake ninja || exit /b 1 +python -m pip install -U pip cmake ninja "apache-tvm-ffi>=0.1.14.post1" || exit /b 1 "%nvcc_exe%" --version || exit /b 1 rem nvcc needs the MSVC host compiler (cl.exe), so locate VS via vswhere and run the @@ -90,7 +90,7 @@ set "cuda_root_fwd=%cuda_root:\=/%" set "nvcc_fwd=%nvcc_exe:\=/%" call "%vcvars%" || exit /b 1 -cmake -S "%repo_root_fwd%" -B "%build_dir_fwd%" -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DTVM_BUILD_PYTHON_MODULE=ON -DUSE_CUDA="%cuda_root_fwd%" -DUSE_LLVM=OFF -DUSE_CUBLAS=OFF -DUSE_CUDNN=OFF -DUSE_CUTLASS=OFF -DUSE_NCCL=OFF -DUSE_NVTX=OFF -DCMAKE_CUDA_COMPILER="%nvcc_fwd%" -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler" || exit /b 1 +cmake -S "%repo_root_fwd%/tirx" -B "%build_dir_fwd%" -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DTVM_BUILD_PYTHON_MODULE=ON -DUSE_CUDA="%cuda_root_fwd%" -DUSE_LLVM=OFF -DUSE_NVTX=OFF -DCMAKE_CUDA_COMPILER="%nvcc_fwd%" -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler" || exit /b 1 cmake --build "%build_dir_fwd%" --target tvm_runtime tvm_runtime_cuda --config Release || exit /b 1 if not exist "%build_dir%\lib\tvm_runtime_cuda.dll" ( echo tvm_runtime_cuda.dll was not produced & exit /b 1 ) diff --git a/ci/wheel/manylinux_build_libtvm_runtime_cuda.sh b/ci/wheel/manylinux_build_libtvm_runtime_cuda.sh index 4f793ccfd7..a53ee8b1d0 100755 --- a/ci/wheel/manylinux_build_libtvm_runtime_cuda.sh +++ b/ci/wheel/manylinux_build_libtvm_runtime_cuda.sh @@ -39,6 +39,7 @@ dnf -y install cuda-driver-devel-13-1 # generator (no Ninja), so no build tools are installed here. Put the bundled # CPython and CUDA toolchain on PATH for the CMake configure and nvcc. export PATH="/opt/python/cp310-cp310/bin:/usr/local/cuda/bin:${PATH}" +python -m pip install "apache-tvm-ffi>=0.1.14.post1" nvcc --version rm -rf "${build_dir}" @@ -48,13 +49,13 @@ rm -rf "${build_dir}" # intentionally not set: it would be a no-op here for the same reason (verified -- # the .so is byte-identical across arch values and carries no device code), and # modern CMake fills in a default so configure does not fail without it. -cmake -S "${repo_root}" -B "${build_dir}" \ +cmake -S "${repo_root}/tirx" -B "${build_dir}" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=OFF \ -DTVM_BUILD_PYTHON_MODULE=ON \ -DUSE_CUDA=/usr/local/cuda \ -DUSE_LLVM=OFF \ - -DUSE_CUBLAS=OFF -DUSE_CUDNN=OFF -DUSE_CUTLASS=OFF -DUSE_NCCL=OFF -DUSE_NVTX=OFF \ + -DUSE_NVTX=OFF \ -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc cmake --build "${build_dir}" --target tvm_runtime tvm_runtime_cuda --parallel "${parallel}" diff --git a/ci/wheel/windows_build_libtvm_runtime_cuda.bat b/ci/wheel/windows_build_libtvm_runtime_cuda.bat index 0c375b441a..e53c2b9281 100644 --- a/ci/wheel/windows_build_libtvm_runtime_cuda.bat +++ b/ci/wheel/windows_build_libtvm_runtime_cuda.bat @@ -62,7 +62,7 @@ set "cuda_root=%CD%" popd set "CUDA_PATH=%cuda_root%" -python -m pip install -U pip cmake ninja || exit /b 1 +python -m pip install -U pip cmake ninja "apache-tvm-ffi>=0.1.14.post1" || exit /b 1 "%nvcc_exe%" --version || exit /b 1 rem nvcc needs the MSVC host compiler (cl.exe), so locate VS via vswhere and run the @@ -90,7 +90,7 @@ set "cuda_root_fwd=%cuda_root:\=/%" set "nvcc_fwd=%nvcc_exe:\=/%" call "%vcvars%" || exit /b 1 -cmake -S "%repo_root_fwd%" -B "%build_dir_fwd%" -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DTVM_BUILD_PYTHON_MODULE=ON -DUSE_CUDA="%cuda_root_fwd%" -DUSE_LLVM=OFF -DUSE_CUBLAS=OFF -DUSE_CUDNN=OFF -DUSE_CUTLASS=OFF -DUSE_NCCL=OFF -DUSE_NVTX=OFF -DCMAKE_CUDA_COMPILER="%nvcc_fwd%" -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler" || exit /b 1 +cmake -S "%repo_root_fwd%/tirx" -B "%build_dir_fwd%" -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DTVM_BUILD_PYTHON_MODULE=ON -DUSE_CUDA="%cuda_root_fwd%" -DUSE_LLVM=OFF -DUSE_NVTX=OFF -DCMAKE_CUDA_COMPILER="%nvcc_fwd%" -DCMAKE_CUDA_FLAGS="-allow-unsupported-compiler" || exit /b 1 cmake --build "%build_dir_fwd%" --target tvm_runtime tvm_runtime_cuda --config Release || exit /b 1 if not exist "%build_dir%\lib\tvm_runtime_cuda.dll" ( echo tvm_runtime_cuda.dll was not produced & exit /b 1 ) diff --git a/docker/bash.sh b/docker/bash.sh index 86ba2c33ea..fe0b1eeb2b 100755 --- a/docker/bash.sh +++ b/docker/bash.sh @@ -541,7 +541,7 @@ fi # Set TVM import path inside the docker image if [[ "${DOCKER_IMAGE_NAME}" == *"ci"* ]]; then - DOCKER_ENV+=( --env PYTHONPATH="${REPO_MOUNT_POINT}"/python ) + DOCKER_ENV+=( --env PYTHONPATH="${REPO_MOUNT_POINT}/tirx/python:${REPO_MOUNT_POINT}/python" ) fi diff --git a/tests/scripts/release/test_release_package.sh b/tests/scripts/release/test_release_package.sh index c16564d825..9effdd40ca 100644 --- a/tests/scripts/release/test_release_package.sh +++ b/tests/scripts/release/test_release_package.sh @@ -119,5 +119,5 @@ python3 -m pip install ${deps} echo "[10/10] Import TVM and print path ..." export TVM_HOME=$(pwd) -export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH:-} +export PYTHONPATH=$TVM_HOME/tirx/python:$TVM_HOME/python:${PYTHONPATH:-} python3 -c "import tvm; print(tvm.__path__)" diff --git a/tests/scripts/setup-pytest-env.sh b/tests/scripts/setup-pytest-env.sh index c62b770baf..e335b7903a 100755 --- a/tests/scripts/setup-pytest-env.sh +++ b/tests/scripts/setup-pytest-env.sh @@ -27,7 +27,7 @@ fi set -ux export TVM_PATH=`pwd` -export PYTHONPATH="${TVM_PATH}/python" +export PYTHONPATH="${TVM_PATH}/tirx/python:${TVM_PATH}/python" export TVM_PYTEST_RESULT_DIR="${TVM_PATH}/build/pytest-results" mkdir -p "${TVM_PYTEST_RESULT_DIR}" diff --git a/tests/scripts/task_cpp_unittest.sh b/tests/scripts/task_cpp_unittest.sh index bd526db185..424642673b 100755 --- a/tests/scripts/task_cpp_unittest.sh +++ b/tests/scripts/task_cpp_unittest.sh @@ -35,4 +35,5 @@ export OMP_NUM_THREADS=1 pushd "${BUILD_DIR}" # run cpp test executable ./cpptest +./tirx_cpptest popd diff --git a/tests/scripts/task_java_unittest.sh b/tests/scripts/task_java_unittest.sh index 35621a5a13..29342c70c8 100755 --- a/tests/scripts/task_java_unittest.sh +++ b/tests/scripts/task_java_unittest.sh @@ -18,7 +18,7 @@ set -euxo pipefail -export PYTHONPATH=python +export PYTHONPATH=tirx/python:python export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" # to avoid CI CPU thread throttling. diff --git a/tests/scripts/task_python_docs.sh b/tests/scripts/task_python_docs.sh index e45d439929..0a4b88df96 100755 --- a/tests/scripts/task_python_docs.sh +++ b/tests/scripts/task_python_docs.sh @@ -18,7 +18,7 @@ set -euxo pipefail -export PYTHONPATH="$(pwd)/python" +export PYTHONPATH="$(pwd)/tirx/python:$(pwd)/python" # to avoid CI CPU thread throttling. export TVM_BIND_THREADS=0 @@ -137,7 +137,7 @@ uv pip install --no-deps apache-tvm-ffi-orcjit==0.1.2 cd docs -PYTHONPATH=$(pwd)/../python make htmldepoly SPHINXOPTS='-j auto' |& tee /tmp/$$.log.txt +PYTHONPATH=$(pwd)/../tirx/python:$(pwd)/../python make htmldepoly SPHINXOPTS='-j auto' |& tee /tmp/$$.log.txt if grep -E "failed to execute|Segmentation fault" < /tmp/$$.log.txt; then echo "Some of sphinx-gallery item example failed to execute." exit 1 diff --git a/tests/scripts/task_python_unittest.sh b/tests/scripts/task_python_unittest.sh index 511b3ec2a5..c6c578cc5b 100755 --- a/tests/scripts/task_python_unittest.sh +++ b/tests/scripts/task_python_unittest.sh @@ -18,7 +18,7 @@ set -euxo pipefail -export PYTHONPATH="$(pwd)/python" +export PYTHONPATH="$(pwd)/tirx/python:$(pwd)/python" export PYTEST_ADDOPTS="${CI_PYTEST_ADD_OPTIONS:-} ${PYTEST_ADDOPTS:-}" # setup tvm-ffi into python folder @@ -29,4 +29,4 @@ uv pip install -v --target=python ./3rdparty/tvm-ffi/ # --no-deps keeps the submodule-built tvm-ffi above from being replaced by a PyPI build. uv pip install --no-deps apache-tvm-ffi-orcjit==0.1.2 -python3 -m pytest -vvs -n auto -m "${TVM_TEST_MARKER:-not gpu}" tests/python +python3 -m pytest -vvs -n auto -m "${TVM_TEST_MARKER:-not gpu}" tests/python tirx/tests/python diff --git a/tests/scripts/task_python_unittest_gpuonly.sh b/tests/scripts/task_python_unittest_gpuonly.sh index ac9e112b84..c025bd6675 100755 --- a/tests/scripts/task_python_unittest_gpuonly.sh +++ b/tests/scripts/task_python_unittest_gpuonly.sh @@ -31,9 +31,9 @@ export TVM_TEST_TARGETS='cuda;metal;rocm;nvptx' # only minimal functionality of Vulkan runtime. export TVM_TEST_TARGETS='{"kind":"vulkan","from_device":0}' -export PYTHONPATH="$(pwd)/python" +export PYTHONPATH="$(pwd)/tirx/python:$(pwd)/python" export PYTEST_ADDOPTS="${CI_PYTEST_ADD_OPTIONS:-} ${PYTEST_ADDOPTS:-}" python3 -m pytest -vvs -n auto -m "${TVM_TEST_MARKER}" \ - tests/python/backend/vulkan/codegen/test_vulkan.py \ - tests/python/backend/vulkan/test_vulkan_module_export.py + tirx/tests/python/backend/vulkan/codegen/test_vulkan.py \ + tirx/tests/python/backend/vulkan/test_vulkan_module_export.py diff --git a/tests/scripts/task_web_wasm.sh b/tests/scripts/task_web_wasm.sh index 5f4d8d309e..aed91a371b 100755 --- a/tests/scripts/task_web_wasm.sh +++ b/tests/scripts/task_web_wasm.sh @@ -18,7 +18,7 @@ set -euxo pipefail -export PYTHONPATH=`pwd`/python +export PYTHONPATH="$(pwd)/tirx/python:$(pwd)/python" # setup tvm-ffi into python folder uv pip install -v --target=python ./3rdparty/tvm-ffi/ diff --git a/tirx/python/tvm_tirx/backend/cuda/launch/generate.py b/tirx/python/tvm_tirx/backend/cuda/launch/generate.py index 029e80a582..381ac5c913 100644 --- a/tirx/python/tvm_tirx/backend/cuda/launch/generate.py +++ b/tirx/python/tvm_tirx/backend/cuda/launch/generate.py @@ -318,7 +318,7 @@ def main(): DIRECTORY / "_generated.py": python_api(), ROOT / "src/backend/cuda/launch/launch_fields.h": native_fields(), ROOT / "src/backend/cuda/launch/launch_attributes.h": native_attributes(), - ROOT / "docs/tirx/api/cuda_launch.rst": documentation(), + ROOT.parent / "docs/tirx/api/cuda_launch.rst": documentation(), } for path in list(outputs): outputs[path] = format_output(path, outputs[path])
