Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
230 lines (209 loc) · 7.2 KB
/
Copy pathpyproject.toml
File metadata and controls
230 lines (209 loc) · 7.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# 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.
[project]
name = "apache-tvm-tirx"
version = "0.1.0a3"
description = "TVM TIRx"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
authors = [{ name = "Apache TVM Community", email = "dev@tvm.apache.org" }]
keywords = ["machine learning", "compiler", "deep learning", "inference"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"apache-tvm-ffi>=0.1.15.post1",
"apache-tvm-ffi-orcjit>=0.1.3",
"ml_dtypes",
"numpy",
"packaging",
]
[project.urls]
Homepage = "https://tvm.apache.org/"
Documentation = "https://tvm.apache.org/tirx/"
Repository = "https://github.com/apache/tvm"
"Bug Tracker" = "https://github.com/apache/tvm/issues"
[project.optional-dependencies]
# The release preparation script pins the matching LLVM targets wheel.
all-targets = []
torch = ["torch"]
cuda = ["cuda-bindings"]
popen-pool = ["psutil", "cloudpickle"]
all = ["psutil", "cloudpickle"]
[dependency-groups]
build = [
"cmake>=3.26",
"ninja",
"scikit-build-core>=0.11,!=1.1.0",
"setuptools-scm>=8",
"cython>=3.2.8",
"mlc-llvm-static[all]==23.1.1.post0",
"mlc-z3-static==5.3.1.post1",
]
torch = [
"torch",
"setuptools", # setuptools is needed by torch jit for best perf
"ninja",
"numpy",
"ml_dtypes",
]
cuda = ["cuda-bindings"]
popen-pool = ["psutil", "cloudpickle"]
test = [
{ include-group = "torch" },
{ include-group = "popen-pool" },
"pytest",
"pytest-xdist",
"z3-solver",
"packaging",
]
lint = ["ruff", "pre-commit"]
dev = [{ include-group = "test" }, { include-group = "lint" }]
docs = [
"sphinx>=7",
"sphinx-book-theme",
"sphinx-autobuild",
"pytest",
"breathe!=5.0.0",
"exhale",
]
[project.scripts]
tvm-tirx-config = "tvm_tirx.config:__main__"
[build-system]
# Static development SDKs are build requirements, not runtime dependencies.
requires = [
"scikit-build-core>=0.11",
"mlc-llvm-static[all]==23.1.1.post0",
"mlc-z3-static==5.3.1.post1",
]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
cmake.build-type = "Release"
wheel.py-api = "py3"
build-dir = "build"
# Wheel configuration
install.components = ["tvm_tirx", "tvm_tirx_llvm_backend"]
wheel.packages = ["python/tvm_tirx"]
wheel.install-dir = "tvm_tirx"
# Source distribution configuration
sdist.include = [
"/CMakeLists.txt",
"/pyproject.toml",
"/cmake/**",
"/src/**",
"/include/**",
"/python/tvm_tirx/**",
"/licenses/**",
"/LICENSE",
"/NOTICE",
"/tests/**",
"/3rdparty/compiler-rt/builtin_fp16.h",
"/3rdparty/tvm-ffi/**",
"!**/.git",
"!**/.git/**",
"!**/__pycache__/**",
"!**/*.pyc",
"!**/.pytest_cache/**",
"!**/build/**",
"!**/node_modules/**",
]
sdist.exclude = ["**"]
# Logging
logging.level = "INFO"
[tool.scikit-build.cmake.define]
TVM_TIRX_BUILD_PYTHON_MODULE = "ON"
TVM_TIRX_BUILD_TESTS = "OFF"
TVM_TIRX_LLVM_NATIVE_ONLY = "OFF"
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --tb=short"
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"gpu: Mark a test as requiring a GPU",
"cuda_arch(*arches, device='cuda0'): Require one of the exact CUDA runtime architectures",
]
[tool.cibuildwheel]
# Skip win32, i686 (32-bit), and musllinux wheels.
skip = "*-win32 *-manylinux_i686 *-musllinux*"
build-verbosity = 1
test-requires = ["pytest", "numpy"]
test-command = "python -I -c \"import importlib.util; assert importlib.util.find_spec('tvm') is None\" && python -I -m pytest -vvs {package}/tests/python/runtime/test_validate_wheel_library.py {package}/tests/python/runtime/test_tensor.py {package}/tests/python/ir/test_type.py {package}/tests/python/script/test_ir_builder.py {package}/tests/python/codegen/llvm/test_basic.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}"
[tool.cibuildwheel.macos]
# delocate breaks libtvm_runtime.dylib's ad-hoc signature (it links the excluded
# libtvm_ffi.dylib) and arm64 dyld kills an unsigned Mach-O, so re-sign + repack.
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}
python -m pip install -q wheel
TMP_DIR="$(mktemp -d)"
python -m wheel unpack "$DELOCATE_TMP_DIR"/*.whl -d "$TMP_DIR"
find "$TMP_DIR" -type f \( -name "*.dylib" -o -name "*.so" \) -exec codesign --force --sign - {} +
python -m wheel pack "$TMP_DIR"/*/ -d {dest_dir}
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}'
[tool.ruff]
include = [
"python/**/*.py",
"tests/**/*.py",
"docs/**/*.py",
"ci/**/*.py",
"conftest.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
]
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.ruff.lint.isort]
known-first-party = ["tvm_tirx"]
[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"