You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2026/10/15 02:38:55 UTC
(tvm) 03/16: [REFACTOR][Packaging] Package TIRx with an independent version and dependency boundary
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 3cdb284ca9edaa14d383d368b6050f8cc6cfce2a
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Thu Oct 15 01:20:54 2026 +0000
[REFACTOR][Packaging] Package TIRx with an independent version and dependency boundary
---
LICENSE | 20 ++---
pyproject.toml | 79 ++++++++-----------
LICENSE => tirx/LICENSE | 23 +-----
tirx/NOTICE | 5 ++
pyproject.toml => tirx/pyproject.toml | 141 +++++++---------------------------
5 files changed, 73 insertions(+), 195 deletions(-)
diff --git a/LICENSE b/LICENSE
index 94abb3512b..627aef16ea 100644
--- a/LICENSE
+++ b/LICENSE
@@ -201,10 +201,8 @@
limitations under the License.
------------------------------------------------------------------------------------
-This product bundles various third-party components under other open source licenses.
-This section summarizes those components and their licenses. See licenses/
-and 3rdparty/tvm-ffi/licenses/ for text of these licenses.
-
+This product bundles the following third-party components. See licenses/ and the
+respective component directories for their licenses.
Apache Software Foundation License 2.0
--------------------------------------
@@ -212,18 +210,14 @@ Apache Software Foundation License 2.0
3rdparty/OpenCL-Headers
3rdparty/cutlass_fpA_intB_gemm
3rdparty/tensorrt_llm
-3rdparty/tvm-ffi/3rdparty/dlpack
-
-
-MIT License
------------
-
-3rdparty/compiler-rt/builtin_fp16.h
-
BSD 3-Clause "New" or "Revised" License
---------------------------------------
3rdparty/cutlass
3rdparty/libflash_attn
-3rdparty/tvm-ffi/3rdparty/libbacktrace
+
+MIT License
+-----------
+
+src/runtime/extra/contrib/vllm
diff --git a/pyproject.toml b/pyproject.toml
index 19874f2051..5638f25f69 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -16,11 +16,11 @@
# under the License.
[build-system]
-# mlc-z3-static ships the PIC static libz3 + headers consumed by USE_Z3=ON.
+# The parent links against the separately installed core package.
requires = [
"scikit-build-core>=0.11",
"setuptools-scm>=8",
- "mlc-z3-static>=4.16.0",
+ "apache-tvm-tirx==0.1.0a0",
]
build-backend = "scikit_build_core.build"
@@ -49,13 +49,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
]
-dependencies = [
- "apache-tvm-ffi>=0.1.14.post1",
- "apache-tvm-ffi-orcjit==0.1.2",
- "ml_dtypes",
- "numpy",
- "typing_extensions",
-]
+dependencies = ["apache-tvm-tirx==0.1.0a0"]
[project.optional-dependencies]
torch = ["torch"]
@@ -104,51 +98,41 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
# Source distribution configuration
sdist.include = [
- # Build files
"/CMakeLists.txt",
"/pyproject.toml",
- "/cmake/**/*",
-
- # Source code
- "/src/**/*.cc",
- "/src/**/*.h",
- "/include/**/*.h",
-
- # Python source
- "/python/tvm/**/*.py",
- "/python/tvm/**/*.pyi",
-
- # Documentation and metadata
- "/docs/**/*",
+ "/cmake/**",
+ "/src/**",
+ "/include/**",
+ "/python/**",
+ "/licenses/**",
"/LICENSE",
- "/README.md",
"/NOTICE",
-
- # Tests
- "/tests/**/*",
-]
-
-sdist.exclude = [
- "**/.git",
- "**/.github",
- "**/__pycache__",
- "**/*.pyc",
- "build",
- "dist",
- "**/3rdparty/*/docs",
- "**/3rdparty/*/media",
- "**/3rdparty/*/examples",
- "**/3rdparty/*/test",
+ "/tests/**",
+ "/README.md",
+ "/apps/**",
+ "/web/**",
+ "/3rdparty/OpenCL-Headers/**",
+ "/3rdparty/cutlass/**",
+ "/3rdparty/cutlass_fpA_intB_gemm/**",
+ "/3rdparty/libflash_attn/**",
+ "/3rdparty/tensorrt_llm/**",
+ "!**/.git",
+ "!**/.git/**",
+ "!**/__pycache__/**",
+ "!**/*.pyc",
+ "!**/.pytest_cache/**",
+ "!**/build/**",
+ "!**/node_modules/**",
]
+sdist.exclude = ["**"]
# Logging
logging.level = "INFO"
[tool.scikit-build.cmake.define]
TVM_BUILD_PYTHON_MODULE = "ON"
+TVM_USE_INSTALLED_TIRX = "ON"
USE_CUDA = "OFF"
-# Statically link Z3 from the mlc-z3-static build dependency by default.
-USE_Z3 = "AUTO"
BUILD_TESTING = "OFF"
[tool.setuptools_scm]
@@ -176,6 +160,8 @@ markers = [
[tool.ruff]
include = [
"python/**/*.py",
+ "tirx/python/**/*.py",
+ "tirx/tests/**/*.py",
"tests/**/*.py",
"docs/**/*.py",
"apps/**/*.py",
@@ -217,9 +203,10 @@ unfixable = []
"python/tvm/relax/transform/legalize_ops/nn.py" = ["E501"]
# TIRx parser and lowering tests intentionally retain unused IR bindings.
"tests/python/tirx/**/*.py" = ["F841"]
+"tirx/tests/python/tirx/**/*.py" = ["F841"]
[tool.ruff.lint.isort]
-known-first-party = ["tvm"]
+known-first-party = ["tvm", "tvm_tirx"]
[tool.ruff.format]
quote-style = "double"
@@ -237,7 +224,7 @@ test-requires = ["pytest", "numpy"]
test-command = "pytest -vvs {project}/tests/python/all-platform-minimal-test"
[tool.cibuildwheel.linux]
-repair-wheel-command = "auditwheel repair --exclude libtvm_ffi.so --exclude libtvm_runtime_cuda.so --exclude 'libcuda.so.*' --exclude 'libcudart.so.*' --exclude 'libnvrtc.so.*' --exclude 'libnvrtc-builtins.so.*' -w {dest_dir} {wheel}"
+repair-wheel-command = "auditwheel repair --exclude libtvm_tirx.so --exclude libtvm_runtime.so --exclude libtvm_ffi.so --exclude libtvm_runtime_cuda.so --exclude 'libcuda.so.*' --exclude 'libcudart.so.*' --exclude 'libnvrtc.so.*' --exclude 'libnvrtc-builtins.so.*' -w {dest_dir} {wheel}"
[tool.cibuildwheel.macos]
# delocate breaks libtvm_runtime.dylib's ad-hoc signature (it links the excluded
@@ -245,7 +232,7 @@ repair-wheel-command = "auditwheel repair --exclude libtvm_ffi.so --exclude libt
repair-wheel-command = '''
set -euo pipefail
DELOCATE_TMP_DIR="$(mktemp -d)"
-delocate-wheel --ignore-missing-dependencies --exclude libtvm_ffi.dylib --require-archs {delocate_archs} -w "$DELOCATE_TMP_DIR" -v {wheel}
+delocate-wheel --ignore-missing-dependencies --exclude libtvm_tirx.dylib --exclude libtvm_runtime.dylib --exclude libtvm_ffi.dylib --require-archs {delocate_archs} -w "$DELOCATE_TMP_DIR" -v {wheel}
python -m pip install -q wheel
TMP_DIR="$(mktemp -d)"
python -m wheel unpack "$DELOCATE_TMP_DIR"/*.whl -d "$TMP_DIR"
@@ -256,4 +243,4 @@ rm -rf "$DELOCATE_TMP_DIR" "$TMP_DIR"
[tool.cibuildwheel.windows]
before-build = 'python -m pip install "delvewheel>=1.12.0"'
-repair-wheel-command = 'delvewheel repair --analyze-existing --ignore-existing --exclude "*tvm_ffi*.dll" --exclude tvm_runtime_cuda.dll --exclude nvcuda.dll --exclude cudart64_13.dll --exclude nvrtc64_130_0.dll -w {dest_dir} {wheel}'
+repair-wheel-command = 'delvewheel repair --analyze-existing --ignore-existing --exclude "*tvm_ffi*.dll" --exclude tvm_tirx.dll --exclude tvm_runtime.dll --exclude tvm_runtime_cuda.dll --exclude nvcuda.dll --exclude cudart64_13.dll --exclude nvrtc64_130_0.dll -w {dest_dir} {wheel}'
diff --git a/LICENSE b/tirx/LICENSE
similarity index 95%
copy from LICENSE
copy to tirx/LICENSE
index 94abb3512b..d959613f68 100644
--- a/LICENSE
+++ b/tirx/LICENSE
@@ -201,29 +201,10 @@
limitations under the License.
------------------------------------------------------------------------------------
-This product bundles various third-party components under other open source licenses.
-This section summarizes those components and their licenses. See licenses/
-and 3rdparty/tvm-ffi/licenses/ for text of these licenses.
-
-
-Apache Software Foundation License 2.0
---------------------------------------
-
-3rdparty/OpenCL-Headers
-3rdparty/cutlass_fpA_intB_gemm
-3rdparty/tensorrt_llm
-3rdparty/tvm-ffi/3rdparty/dlpack
-
+This product bundles the following third-party component. See licenses/ for its
+license text. External dependencies are distributed under their own licenses.
MIT License
-----------
3rdparty/compiler-rt/builtin_fp16.h
-
-
-BSD 3-Clause "New" or "Revised" License
----------------------------------------
-
-3rdparty/cutlass
-3rdparty/libflash_attn
-3rdparty/tvm-ffi/3rdparty/libbacktrace
diff --git a/tirx/NOTICE b/tirx/NOTICE
new file mode 100644
index 0000000000..35d3709888
--- /dev/null
+++ b/tirx/NOTICE
@@ -0,0 +1,5 @@
+Apache TVM
+Copyright 2019-2023 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/pyproject.toml b/tirx/pyproject.toml
similarity index 57%
copy from pyproject.toml
copy to tirx/pyproject.toml
index 19874f2051..c07ec984de 100644
--- a/pyproject.toml
+++ b/tirx/pyproject.toml
@@ -19,18 +19,15 @@
# mlc-z3-static ships the PIC static libz3 + headers consumed by USE_Z3=ON.
requires = [
"scikit-build-core>=0.11",
- "setuptools-scm>=8",
"mlc-z3-static>=4.16.0",
+ "apache-tvm-ffi>=0.1.14.post1",
]
build-backend = "scikit_build_core.build"
[project]
-name = "apache-tvm"
-# The version is derived from the most recent Git tag by setuptools_scm at build
-# time (see [tool.setuptools_scm]); no manual version stamping is required.
-dynamic = ["version"]
-description = "Apache TVM: An End-to-End Deep Learning Compiler Stack"
-readme = "README.md"
+name = "apache-tvm-tirx"
+version = "0.1.0a0"
+description = "TVM TIRx compiler and runtime"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
@@ -55,15 +52,14 @@ dependencies = [
"ml_dtypes",
"numpy",
"typing_extensions",
+ "packaging",
]
[project.optional-dependencies]
torch = ["torch"]
cuda = ["cuda-bindings"]
-meta-schedule = ["xgboost"]
popen-pool = ["psutil", "cloudpickle"]
-rpc = ["tornado", "psutil", "cloudpickle"]
-all = ["xgboost", "psutil", "cloudpickle", "tornado"]
+all = ["psutil", "cloudpickle"]
[project.urls]
Homepage = "https://tvm.apache.org/"
@@ -75,6 +71,8 @@ Repository = "https://github.com/apache/tvm"
torch = ["torch"]
popen-pool = ["psutil", "cloudpickle"]
test = [
+ "scipy",
+ "z3-solver",
"pytest",
"pytest-xdist",
"pytest-cov",
@@ -95,51 +93,31 @@ wheel.py-api = "py3"
build-dir = "build"
# Wheel configuration
-wheel.packages = ["python/tvm"]
-wheel.install-dir = "tvm"
-
-# Derive the project version from the Git tag via setuptools_scm
-# (configured under [tool.setuptools_scm]).
-metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
+wheel.packages = ["python/tvm_tirx"]
+wheel.install-dir = "tvm_tirx"
# Source distribution configuration
sdist.include = [
- # Build files
"/CMakeLists.txt",
"/pyproject.toml",
- "/cmake/**/*",
-
- # Source code
- "/src/**/*.cc",
- "/src/**/*.h",
- "/include/**/*.h",
-
- # Python source
- "/python/tvm/**/*.py",
- "/python/tvm/**/*.pyi",
-
- # Documentation and metadata
- "/docs/**/*",
+ "/cmake/**",
+ "/src/**",
+ "/include/**",
+ "/python/**",
+ "/licenses/**",
"/LICENSE",
- "/README.md",
"/NOTICE",
-
- # Tests
- "/tests/**/*",
-]
-
-sdist.exclude = [
- "**/.git",
- "**/.github",
- "**/__pycache__",
- "**/*.pyc",
- "build",
- "dist",
- "**/3rdparty/*/docs",
- "**/3rdparty/*/media",
- "**/3rdparty/*/examples",
- "**/3rdparty/*/test",
+ "/tests/**",
+ "/3rdparty/compiler-rt/builtin_fp16.h",
+ "!**/.git",
+ "!**/.git/**",
+ "!**/__pycache__/**",
+ "!**/*.pyc",
+ "!**/.pytest_cache/**",
+ "!**/build/**",
+ "!**/node_modules/**",
]
+sdist.exclude = ["**"]
# Logging
logging.level = "INFO"
@@ -151,17 +129,6 @@ USE_CUDA = "OFF"
USE_Z3 = "AUTO"
BUILD_TESTING = "OFF"
-[tool.setuptools_scm]
-# Version comes from the most recent Git tag (vMAJOR.MINOR.devN or vMAJOR.MINOR.PATCH).
-# guess-next-dev reproduces the previous version.py behaviour for vMAJOR.MINOR.devN
-# tags (e.g. v0.26.dev0 + N commits -> 0.26.devN). local_scheme = "no-local-version"
-# drops the +g<hash> local segment: PyPI rejects local versions on upload, and
-# this matches the public version the old version.py stamped.
-version_file = "python/tvm/_version.py"
-version_scheme = "guess-next-dev"
-local_scheme = "no-local-version"
-fallback_version = "0.28.dev0"
-
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --tb=short"
@@ -173,68 +140,12 @@ markers = [
"cuda_arch(*arches, device='cuda0'): Require one of the exact CUDA runtime architectures",
]
-[tool.ruff]
-include = [
- "python/**/*.py",
- "tests/**/*.py",
- "docs/**/*.py",
- "apps/**/*.py",
- "ci/scripts/**/*.py",
- "conftest.py",
- "jvm/**/*.py",
- "web/tests/**/*.py",
-]
-line-length = 100
-indent-width = 4
-target-version = "py310"
-exclude = ["3rdparty", "build", "dist", ".venv", ".ruff_cache", "node_modules"]
-
-[tool.ruff.lint]
-select = [
- "E", # pycodestyle errors, https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
- "F", # pyflakes, https://docs.astral.sh/ruff/rules/#pyflakes-f
- "I", # isort, https://docs.astral.sh/ruff/rules/#isort-i
- "UP", # pyupgrade, https://docs.astral.sh/ruff/rules/#pyupgrade-up
- "RUF", # ruff, https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
-]
-ignore = [
- # pyupgrade (style preference or low-value)
- "UP028", # yield-in-for-loop — sometimes clearer to keep
- "UP030", # format-literals — minor
- "UP031", # printf-string-formatting — style preference
- # ruff (preview rules, not yet stable)
- "RUF043", # pytest-raises-ambiguous-pattern
- "RUF059", # unused-unpacked-variable
-]
-fixable = ["ALL"]
-unfixable = []
-
-[tool.ruff.lint.per-file-ignores]
-"__init__.py" = ["E402", "F401", "F403", "F405"]
-"python/tvm/relax/op/nn/nn.py" = ["E501"]
-"docs/how_to/tutorials/mix_python_and_tvm_with_pymodule.py" = ["RUF003"]
-"python/tvm/relax/frontend/tflite/tflite_frontend.py" = ["E501"]
-"python/tvm/relax/transform/legalize_ops/nn.py" = ["E501"]
-# TIRx parser and lowering tests intentionally retain unused IR bindings.
-"tests/python/tirx/**/*.py" = ["F841"]
-
-[tool.ruff.lint.isort]
-known-first-party = ["tvm"]
-
-[tool.ruff.format]
-quote-style = "double"
-indent-style = "space"
-skip-magic-trailing-comma = false
-line-ending = "auto"
-docstring-code-format = false
-docstring-code-line-length = "dynamic"
-
[tool.cibuildwheel]
# Skip win32, i686 (32-bit), and musllinux wheels.
skip = "*-win32 *-manylinux_i686 *-musllinux*"
build-verbosity = 1
test-requires = ["pytest", "numpy"]
-test-command = "pytest -vvs {project}/tests/python/all-platform-minimal-test"
+test-command = "python -I -c \"import importlib.util; assert importlib.util.find_spec('tvm') is None\" && python -I -m pytest -vvs {package}/tests/python/all-platform-minimal-test {package}/tests/python/runtime/test_runtime_tensor.py {package}/tests/python/ir/test_ir_type.py {package}/tests/python/script/test_ir_builder.py {package}/tests/python/codegen/llvm/test_llvm.py::test_llvm_vadd_pipeline {package}/tests/python/codegen/gpu_common/test_allreduce.py::test_allreduce_sum_compile"
[tool.cibuildwheel.linux]
repair-wheel-command = "auditwheel repair --exclude libtvm_ffi.so --exclude libtvm_runtime_cuda.so --exclude 'libcuda.so.*' --exclude 'libcudart.so.*' --exclude 'libnvrtc.so.*' --exclude 'libnvrtc-builtins.so.*' -w {dest_dir} {wheel}"