"torchvision/tv_tensors/_image.py" did not exist on "4d4711d970f5cbd0a9e1adb465dca2703c8efbfd"
pyproject.toml 7.85 KB
Newer Older
1
2
3
[project]
name = "tilelang"
description = "A tile level programming language to generate high performance code."
4
readme = "README.md"
5
requires-python = ">=3.9"
6
7
authors = [{ name = "TileLang Contributors" }, { name = "Tile-AI" }]
maintainers = [{ name = "Lei Wang", email = "leiwang1999@outlook.com" }]
8
9
10
license = "MIT"
keywords = ["BLAS", "CUDA", "HIP", "Code Generation", "TVM"]
classifiers = [
11
    "Development Status :: 4 - Beta",
12
13
14
    "Environment :: GPU",
    "Operating System :: POSIX :: Linux",
    "Operating System :: MacOS",
15
16
    "Programming Language :: C++",
    "Programming Language :: Python :: 3",
17
18
19
20
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
21
22
23
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    "Programming Language :: Python :: Implementation :: CPython",
24
25
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
26
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
27
28
29
]
dynamic = ["version"]
dependencies = [
30
31
32
33
    "apache-tvm-ffi~=0.1.0",
    # Extra constraint to tvm-ffi for abi issue,
    # should be removed after our tvm's update.
    # See discussion in tilelang#1373 and apache/tvm-ffi#307
34
    "apache-tvm-ffi>=0.1.3",
35
36
37
    # torch-c-dlpack-ext provides prebuilt torch extensions.
    # Without it, TVM FFI may require JIT compilation on first import.
    "torch-c-dlpack-ext",
38
    "cloudpickle",
39
40
    "ml-dtypes",
    "numpy>=1.23.5",
41
42
    "psutil",
    "torch",
43
44
45
    "torch>=2.7; platform_system == 'Darwin'",
    "tqdm>=4.62.3",
    "typing-extensions>=4.10.0",
46
    "z3-solver>=4.13.0",
47
48
49
50
51
]

[project.optional-dependencies]
# mldtypes should be greater than 0.5.1
# if you want to enable fp4
52
fp4 = ["ml-dtypes>=0.5.1"]
53
54
# if you want to enable layout inference visualization
vis = ["matplotlib"]
55

56
[build-system]
57
58
59
60
61
62
63
64
requires = [
    "cython>=3.0.0",
    "scikit-build-core",
    "z3-solver>=4.13.0",
    # Not for auditwheel, explicitly add patchelf for repairing libz3.so.
    # See tvm's CMakeLists.txt for more information.
    "patchelf>=0.17.2; platform_system == 'Linux'",
]
65
66
67
68
69
70
71
72
73
74
75
76
77
78
build-backend = "scikit_build_core.build"

[tool.scikit-build]
wheel.py-api = "cp38"
cmake.version = ">=3.26.1"
build-dir = "build"

# editable.rebuild = true

# Include backend and git info in version
metadata.version.provider = "version_provider"
metadata.version.provider-path = "."
experimental = true

79
80
81
# build.verbose = true
# logging.level = "DEBUG"

82
83
[tool.scikit-build.sdist]
include = [
84
85
86
    "./VERSION",
    ".git_commit.txt",
    "./LICENSE",
87
88
89
90
91
92
93
    "THIRDPARTYNOTICES.txt",
    "version_provider.py",
    "requirements*.txt",
    "tilelang/jit/adapter/cython/cython_wrapper.pyx",
    "CMakeLists.txt",
    "src/**",
    "cmake/**",
94
95
96
97
98
99
100
101
102
    # The vendored 3rdparty contents in sdist should be same as wheel.
    # Need full TVM to build from source.
    "3rdparty/tvm",
    # CUTLASS
    "3rdparty/cutlass/include",
    "3rdparty/cutlass/tools",
    # Composable Kernel
    "3rdparty/composable_kernel/include",
    "3rdparty/composable_kernel/library",
103
104
105
106
107
108
109
110
    "testing/**",
    "examples/**",
]
exclude = [
    ".git",
    ".github",
    "**/.git",
    "**/.github",
111
    "3rdparty/**",
112
113
114
    "build",
]

115
116
117
[tool.scikit-build.wheel.packages]
tilelang = "tilelang"
"tilelang/src" = "src"
118
119
# NOTE: The mapping below places the contents of '3rdparty' inside 'tilelang/3rdparty' in the wheel.
# This is necessary to find TVM shared libraries at runtime.
120
# The vendored 3rdparty contents in wheel should be same as sdist.
121
122
123
# TVM
"tilelang/3rdparty/tvm/src" = "3rdparty/tvm/src"
"tilelang/3rdparty/tvm/python" = "3rdparty/tvm/python"
124
"tilelang/3rdparty/tvm/include" = "3rdparty/tvm/include"
125
126
127
128
129
130
131
"tilelang/3rdparty/tvm/version.py" = "3rdparty/tvm/version.py"
# CUTLASS
"tilelang/3rdparty/cutlass/include" = "3rdparty/cutlass/include"
"tilelang/3rdparty/cutlass/tools" = "3rdparty/cutlass/tools"
# Composable Kernel
"tilelang/3rdparty/composable_kernel/include" = "3rdparty/composable_kernel/include"
"tilelang/3rdparty/composable_kernel/library" = "3rdparty/composable_kernel/library"
132

133
 
134
135

[tool.codespell]
136
ignore-words = "docs/spelling_wordlist.txt"
137
138
139
140
141
142
143
skip = [
    "build",
    "3rdparty",
    "dist",
    ".venv"
]

144
[tool.ruff]
145
target-version = "py39"
146
line-length = 140
147
148
output-format = "full"

149
150
151
152
153
exclude = [
    "3rdparty",
    "examples/deepseek_v32/inference",
]

154
155
156
157
158
159
160
161
[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"

162
163
164
165
166
167
[tool.ruff.lint.per-file-ignores]
# Do not upgrade type hint in testing and examples.
# See https://github.com/tile-ai/tilelang/issues/1079 for more information.
"testing/**.py" = ["UP", "FA"]
"examples/**.py" = ["UP", "FA"]

168
169
170
[tool.ruff.lint]
select = [
    # pycodestyle
171
    "E", "W",
172
173
174
    # Pyflakes
    "F",
    # pyupgrade
175
    "UP", "FA",
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
    # flake8-bugbear
    "B",
    # flake8-simplify
    "SIM",
    # isort
    # "I",
]
ignore = [
    # Module level import not at top of file
    "E402",
    # star imports
    "F405", "F403",
    # ambiguous name
    "E741",
    # line too long
    "E501",
192
193
    # if-else-block instead of ternary
    "SIM108",
194
195
    # key in dict.keys()
    "SIM118",
196
197
    # open file w.o. ctx manager
    "SIM115",
198
199
    # memory leaks
    "B019",
200
201
    # zip without explicit strict
    "B905",
202
203
204
    # No such file or directory
    "E902",
]
205

206
207
208
209
[tool.pytest.ini_options]
verbosity_assertions = 3
filterwarnings = ["always"]

210
211
[tool.cibuildwheel]
archs = ["auto64"]
212
213
214
215
216
skip = "*musllinux*"
build-frontend = "build"
environment = { PYTHONDEVMODE = "1", PYTHONUNBUFFERED = "1" }
environment-pass = [
    "CUDA_VERSION",
217
218
219
    "NO_VERSION_LABEL",
    "NO_TOOLCHAIN_VERSION",
    "NO_GIT_VERSION",
220
    "COLUMNS",
221
222
    "CMAKE_GENERATOR",
    "CMAKE_BUILD_PARALLEL_LEVEL",
223
224
225
226
227
    "FORCE_COLOR",
    "CLICOLOR_FORCE",
]
before-build = "env -0 | sort -z | tr '\\0' '\\n'"
windows.before-build = "set"
228
229
230
test-command = [
    "python -c 'import tilelang; print(tilelang.__version__)'",
]
231
232

[tool.cibuildwheel.linux]
233
234
235
236
environment.PYTHONDEVMODE = "1"
environment.PYTHONUNBUFFERED = "1"
environment.PATH = "/usr/local/cuda/bin:$PATH"
environment.LD_LIBRARY_PATH = "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH"
237
manylinux-x86_64-image  = "manylinux_2_28"  # AlmaLinux 8
238
manylinux-aarch64-image = "manylinux_2_34"  # Z3 requires
239
# Install CUDA runtime and stub driver library
240
# manylinux_2_28 uses gcc 14, which needs CUDA >=12.8
241
242
243
before-all = """
set -eux

244
245
246
cat /etc/*-release
uname -a

247
case "$(uname -m)" in
248
    "x86_64")
249
250
        DEFAULT_CUDA_VERSION="12.8"
        dnf config-manager --add-repo https://developer.download.nvidia.cn/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
251
252
        ;;
    "aarch64")
253
        DEFAULT_CUDA_VERSION="12.8"
254
255
256
257
258
        dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/sbsa/cuda-rhel8.repo
        ;;
    *)
        exit 1
        ;;
259
260
esac

261
cudaver="$(echo "${CUDA_VERSION:-$DEFAULT_CUDA_VERSION}" | cut -d '.' -f-2)"
262
v="${cudaver//./-}"
263
yum install -y "cuda-minimal-build-${v}" "cuda-driver-devel-${v}" "cuda-nvrtc-devel-${v}" nvidia-driver-cuda-libs
264
yum clean all
265
"""
266
repair-wheel-command = [
267
    "auditwheel -v repair --exclude libtvm_ffi.so --exclude libz3.so --exclude libcuda.so.1 --exclude '/usr/local/cuda*' -w {dest_dir} {wheel}",
268
269
270
271
272
273
274
275
276
277
278
    "pipx run abi3audit --verbose --strict {wheel}",
]

[tool.cibuildwheel.macos]
repair-wheel-command = [
    "delocate-wheel --verbose --ignore-missing-dependencies --no-sanitize-rpaths --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
    "pipx run abi3audit --verbose --strict {wheel}",
]

[[tool.cibuildwheel.overrides]]
select = "*linux*x86_64*"
279
280
281
282
# x86_64 runners in GitHub Actions have limited storage,
# pre-install torch without caching to reduce disk usage during install tilelang.
before-test = [
    "pip install torch --no-cache-dir",
283
]