-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathpyproject.toml
More file actions
193 lines (169 loc) · 6.14 KB
/
pyproject.toml
File metadata and controls
193 lines (169 loc) · 6.14 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
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel", "numpy"]
[project]
name = "numba-cuda"
dynamic = ["version"]
description = "CUDA target for Numba"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [{ name = "Anaconda Inc." }, { name = "NVIDIA Corporation" }]
license = "BSD-2-Clause"
license-files = ["LICENSE", "LICENSE.numba"]
requires-python = ">=3.9"
dependencies = [
"numba>=0.60.0",
"cuda-bindings>=12.9.1,<14.0.0",
"cuda-core>=0.5.1,<1.0.0",
"cuda-pathfinder>=1.4.0,<2.0.0",
"packaging",
]
[project.optional-dependencies]
cu12 = [
"cuda-bindings>=12.9.1,<13.0.0",
# install nvcc for libNVVM
"cuda-toolkit[cudart,nvcc,nvrtc,cccl]==12.*",
# Older nvjitlink is not supported by cuda-bindings. It is okay to be out
# of sync with cuda-toolkit here, as long as the version compatibilty rules
# are followed. See the compatibility rules for nvjitlink below.
# The nvJitLink library is compatible across minor versions in a release,
# but may not be compatible across major versions. The library version
# itself must be >= the maximum version of the inputs, and the shared
# library version must be >= the version that was linked with.
# https://docs.nvidia.com/cuda/archive/12.9.1/nvjitlink/index.html#compatibility
"nvidia-nvjitlink-cu12>=12.3.0,<13.0.0",
]
cu13 = [
"cuda-bindings==13.*",
"cuda-toolkit[cudart,nvvm,nvrtc,cccl]==13.*",
# It is okay to be out of sync with cuda-toolkit here, as long as the
# version compatibilty rules are followed. See the compatibility rules for
# nvjitlink below.
# The nvJitLink library is compatible across minor versions in a release,
# but may not be compatible across major versions. The library version
# itself must be >= the maximum version of the inputs, and the shared
# library version must be >= the version that was linked with.
# https://docs.nvidia.com/cuda/nvjitlink/index.html#compatibility
"nvidia-nvjitlink>=13.0.0,<14.0.0",
]
[dependency-groups]
test = [
"pre-commit",
"psutil",
"cffi",
"pytest>=8,<9",
"pytest-xdist",
"pytest-benchmark",
"filecheck",
"ml_dtypes",
"statistics",
]
test-cu12 = ["cuda-toolkit[curand,cublas]==12.*", { include-group = "test" }, "cupy-cuda12x !=14.0.0"]
test-cu13 = ["cuda-toolkit[curand,cublas]==13.*", { include-group = "test" }, "cupy-cuda13x !=14.0.0"]
[project.urls]
Homepage = "https://nvidia.github.io/numba-cuda/"
Documentation = "https://nvidia.github.io/numba-cuda/"
Repository = "https://github.com/NVIDIA/numba-cuda"
License = "https://github.com/NVIDIA/numba-cuda/blob/main/LICENSE"
Issues = "https://github.com/NVIDIA/numba-cuda/issues"
[tool.setuptools.dynamic]
version = { attr = "numba_cuda.__version__" }
[tool.setuptools.packages.find]
include = ["numba_cuda*"]
[tool.setuptools.package-data]
"*" = ["*.cu", "*.h", "*.hpp", "*.ptx", "*.cuh", "VERSION", "Makefile"]
[tool.ruff]
line-length = 80
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 80
[tool.ruff.lint.pycodestyle]
max-doc-length = 80
max-line-length = 80
[tool.ruff.lint]
ignore = [
# Extra space in brackets
"E20",
# Multiple spaces around ","
"E231",
"E241",
# Comments
"E26",
# Assigning lambda expression
"E731",
# Ambiguous variable names
"E741",
"B028",
"B904",
"B905",
"B019",
]
select = ["B"]
extend-select = ["PERF"]
fixable = ["ALL"]
exclude = [
"__pycache__",
".git",
"*.pyc",
"*~",
"*.o",
"*.so",
"*.cpp",
"*.c",
"*.h",
"cuda_bf16.py",
"cuda_fp16.py",
"cuda_fp8.py",
]
[tool.ruff.lint.per-file-ignores]
# Slightly long line in the standard version file
"**/test*.py" = ["PERF", "B007", "B018", "B023"]
"**/simulator/*" = ["PERF"]
"numba_cuda/_version.py" = ["E501"]
# "Unused" imports / potentially undefined names in init files
"numba_cuda/numba/cuda/__init__.py" = ["F401", "F403", "F405", "E402"]
"numba_cuda/numba/cuda/simulator/__init__.py" = ["F401", "F403"]
"numba_cuda/numba/cuda/simulator/cudadrv/__init__.py" = ["F401"]
# Ignore star imports", " unused imports", " and "may be defined by star imports"
# errors in device_init because its purpose is to bring together a lot of
# the public API to be star-imported in numba.cuda.__init__
"numba_cuda/numba/cuda/device_init.py" = ["F401", "F403", "F405"]
# Ignore star imports", " unused imports", " and "may be defined by star imports"
# errors in types init files.
"numba_cuda/numba/cuda/types/__init__.py" = ["F401", "F403", "F405"]
"numba_cuda/numba/cuda/types/__init__.pyi" = ["F401", "F403", "F405"]
# Ignore "unused" imports in datamodel init file.
"numba_cuda/numba/cuda/datamodel/__init__.py" = ["F401"]
# libdevice.py is an autogenerated file containing stubs for all the device
# functions. Some of the lines in docstrings are a little over-long", " as they
# contain the URLs of the reference pages in the online libdevice
# documentation.
"numba_cuda/numba/cuda/libdevice.py" = ["E501"]
# Ignore too-long lines in the doc examples", " prioritising readability
# in the docs over line length in the example source (especially given that
# the test code is already indented by 8 spaces)
"numba_cuda/numba/cuda/tests/doc_examples/test_random.py" = ["E501"]
"numba_cuda/numba/cuda/tests/doc_examples/test_cg.py" = ["E501"]
"numba_cuda/numba/cuda/tests/doc_examples/test_matmul.py" = ["E501"]
"numba_cuda/numba/tests/doc_examples/test_interval_example.py" = ["E501"]
[tool.pyrefly]
search-path = ["./numba_cuda"]
[tool.cibuildwheel]
skip = "*-musllinux_*"
enable = "cpython-freethreading"
build-verbosity = 1
[tool.cibuildwheel.linux]
archs = "native"
before-build = "pip install twine"
repair-wheel-command = [
"auditwheel repair -w {dest_dir} {wheel}",
"twine check --strict {dest_dir}/*",
]
[tool.cibuildwheel.windows]
archs = "AMD64"
before-build = "pip install delvewheel twine"
repair-wheel-command = [
"delvewheel repair --custom-patch -w {dest_dir} {wheel}",
"twine check --strict {dest_dir}/*",
]