pyproject.toml 6.64 KB
Newer Older
1
2
3
[project]
name = "tilelang"
description = "A tile level programming language to generate high performance code."
4
5
readme = "README.md"
requires-python = ">=3.8"
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
21
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
22
23
24
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
    "Programming Language :: Python :: Implementation :: CPython",
25
26
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
27
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
29
30
]
dynamic = ["version"]
dependencies = [
31
    "apache-tvm-ffi~=0.1.0",
32
    "cloudpickle",
33
34
    "ml-dtypes",
    "numpy>=1.23.5",
35
36
    "psutil",
    "torch",
37
38
39
    "torch>=2.7; platform_system == 'Darwin'",
    "tqdm>=4.62.3",
    "typing-extensions>=4.10.0",
40
41
42
43
44
]

[project.optional-dependencies]
# mldtypes should be greater than 0.5.1
# if you want to enable fp4
45
fp4 = ["ml-dtypes>=0.5.1"]
46

47
[build-system]
48
requires = ["cython>=3.0.0", "scikit-build-core"]
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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

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
[tool.scikit-build.sdist]
# See MANIFEST.in for details
include = [
    "VERSION",
    "LICENSE",
    "THIRDPARTYNOTICES.txt",
    "version_provider.py",
    "requirements*.txt",
    "tilelang/jit/adapter/cython/cython_wrapper.pyx",
    "CMakeLists.txt",
    "src/**",
    "cmake/**",
    "3rdparty/**",
    "testing/**",
    "examples/**",
]
exclude = [
    ".git",
    ".github",
    "**/.git",
    "**/.github",
    "3rdparty/clang**",
    "3rdparty/llvm**",
    "build",
]

89
90
91
[tool.scikit-build.wheel.packages]
tilelang = "tilelang"
"tilelang/src" = "src"
92
93
# 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.
94
95
96
97
98
99
100
101
102
103
104
# Restrict 3rdparty contents in wheel to the same allowlist as sdist
# TVM
"tilelang/3rdparty/tvm/src" = "3rdparty/tvm/src"
"tilelang/3rdparty/tvm/python" = "3rdparty/tvm/python"
"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"
105

106
107
108
109
110
111
[tool.yapf]
based_on_style = "yapf"
column_limit = 100
indent_width = 4

[tool.codespell]
112
ignore-words = "docs/spelling_wordlist.txt"
113
114
115
116
117
118
119
skip = [
    "build",
    "3rdparty",
    "dist",
    ".venv"
]

120
121
122
123
124
[tool.ruff]
target-version = "py38"
line-length = 100
output-format = "full"

125
126
127
128
129
130
131
132
133
134
135
exclude = [
    "3rdparty",
    "examples/deepseek_v32/inference",
]

[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"]

136
137
138
[tool.ruff.lint]
select = [
    # pycodestyle
139
    "E", "W",
140
141
142
    # Pyflakes
    "F",
    # pyupgrade
143
    "UP", "FA",
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
    # 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",
160
161
    # if-else-block instead of ternary
    "SIM108",
162
163
    # key in dict.keys()
    "SIM118",
164
165
    # open file w.o. ctx manager
    "SIM115",
166
167
    # memory leaks
    "B019",
168
169
    # zip without explicit strict
    "B905",
170
171
172
    # No such file or directory
    "E902",
]
173

174
175
176
177
[tool.pytest.ini_options]
verbosity_assertions = 3
filterwarnings = ["always"]

178
179
[tool.cibuildwheel]
archs = ["auto64"]
180
181
182
183
184
skip = "*musllinux*"
build-frontend = "build"
environment = { PYTHONDEVMODE = "1", PYTHONUNBUFFERED = "1" }
environment-pass = [
    "CUDA_VERSION",
185
186
187
    "NO_VERSION_LABEL",
    "NO_TOOLCHAIN_VERSION",
    "NO_GIT_VERSION",
188
    "COLUMNS",
189
190
    "CMAKE_GENERATOR",
    "CMAKE_BUILD_PARALLEL_LEVEL",
191
192
193
194
195
    "FORCE_COLOR",
    "CLICOLOR_FORCE",
]
before-build = "env -0 | sort -z | tr '\\0' '\\n'"
windows.before-build = "set"
196
197
198
test-command = [
    "python -c 'import tilelang; print(tilelang.__version__)'",
]
199
200

[tool.cibuildwheel.linux]
201
202
203
204
205
206
207
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"
# Pin to glibc 2.17 for x86 and 2.28 for aarch64 for now
manylinux-x86_64-image = "manylinux2014"   # CentOS 7
manylinux-aarch64-image = "manylinux_2_28" # AlmaLinux 8
208
209
210
211
212
# Install CUDA runtime and stub driver library
# manylinux_2_28 uses gcc 14, which needs CUDA 12.8
before-all = """
set -eux

213
214
215
cat /etc/*-release
uname -a

216
case "$(uname -m)" in
217
218
219
220
221
222
223
224
225
    "x86_64")
        yum-config-manager --add-repo https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
        ;;
    "aarch64")
        dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/sbsa/cuda-rhel8.repo
        ;;
    *)
        exit 1
        ;;
226
227
esac

228
229
cudaver="$(echo "${CUDA_VERSION:-"12.4"}" | cut -d '.' -f-2)"
v="${cudaver//./-}"
230
yum install -y "cuda-minimal-build-${v}" "cuda-driver-devel-${v}" "cuda-nvrtc-devel-${v}" nvidia-driver-cuda-libs
231
"""
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
repair-wheel-command = [
    "auditwheel -v repair --exclude libtvm_ffi.so --exclude libcuda.so.1 --exclude '/usr/local/cuda*' -w {dest_dir} {wheel}",
    "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*"
# CentOS 7 is too old to run import test. Do wheel installation test only.
test-command = [
    "echo 'Wheel is installed successfully'",
]