Skip to content

Commit 4c9888a

Browse files
authored
Eagerly use all vended numba.cuda modules, Bump supported Numba-CUDA version to 0.21+ (#239)
This PR bumps Numbast compatible Numba-CUDA version to 0.21.0+. And properly documents each version's Numba-CUDA version pinning at FAQ section. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added guidance on numba-cuda compatibility and binding-generation requirements. * **Chores** * Raised and broadened numba-cuda version constraints to >=0.21.0,<0.23.0 across environment and manifest files. * Aligned project imports and build surfaces to CUDA-targeted APIs consistent with the updated constraint. * **Tests** * Updated test suites to import and use CUDA-specific types and datamodels. * **New Files** * Added a small CUDA header used by tests. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
1 parent e501c89 commit 4c9888a

26 files changed

+104
-56
lines changed

ci/test_conda_python.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rapids-mamba-retry create -n test \
2323
cuda-version=${RAPIDS_CUDA_VERSION%.*} \
2424
cuda-nvrtc \
2525
numba >=0.59 \
26-
"numba-cuda>=0.20.1,<0.21.0" \
26+
"numba-cuda>=0.21.0,<0.23.0" \
2727
cuda-cudart-dev \
2828
python=${RAPIDS_PY_VERSION} \
2929
cffi \

conda/environment-cu12.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- python>=3.10
1010
- cmake>=3.29 # Allow overriding CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX
1111
- clangdev >=18,<22.0
12-
- numba-cuda[cu12] >=0.20.1,<0.21.0
12+
- numba-cuda[cu12] >=0.21.0,<0.23.0
1313
- pybind11
1414
- pytest
1515
- pytest-benchmark

conda/environment-cu13.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- python>=3.10
1010
- cmake>=3.29 # Allow overriding CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX
1111
- clangdev >=18,<22.0
12-
- numba-cuda[cu13] >=0.20.1,<0.21.0
12+
- numba-cuda[cu13] >=0.21.0,<0.23.0
1313
- pybind11
1414
- pytest
1515
- pytest-benchmark

conda/environment_template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- python={{ python_version }}
1010
- cmake>=3.29 # Allow overriding CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX
1111
- clangdev >=18,<22.0
12-
- numba-cuda >=0.20.1,<0.21.0
12+
- numba-cuda >=0.21.0,<0.23.0
1313
- pybind11
1414
- pytest
1515
- pytest-benchmark

conda/recipes/numbast/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ requirements:
5252
- cuda-version >=12.5
5353
- numba >=0.59
5454
- python
55-
- numba-cuda >=0.20.1,<0.21.0
55+
- numba-cuda >=0.21.0,<0.23.0
5656
- pyyaml
5757
- click
5858
- jinja2

conda/recipes/numbast_extensions/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ requirements:
4343
- cuda-cudart-dev
4444
- python
4545
- numba >=0.59
46-
- numba-cuda >=0.20.1,<0.21.0
46+
- numba-cuda >=0.21.0,<0.23.0
4747
- numbast >=0.2.0
4848

4949
test:

docs/source/faq.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,48 @@ Notes
122122
libc++, ensure its headers are installed (e.g., ``/usr/include/c++/v1`` or Conda ``libcxx-devel``) and pass
123123
``-stdlib=libc++``; otherwise libstdc++ is typically selected by default on Linux.
124124
- AST Canopy is linked against Clang 20. For host resources, please use corresponding Clang version.
125+
126+
127+
Generated bindings and Numba-CUDA version requirements
128+
-------------------------------------------------------
129+
130+
**What version of numba-cuda do generated bindings require?**
131+
132+
Bindings generated by Numbast have specific version requirements for ``numba-cuda`` at runtime. The version of
133+
Numbast used to generate the bindings determines the compatible ``numba-cuda`` versions.
134+
135+
.. list-table:: Numbast to numba-cuda compatibility
136+
:header-rows: 1
137+
:widths: 30 70
138+
139+
* - Numbast Version
140+
- Required numba-cuda Version
141+
* - 0.6.0 (current dev)
142+
- ``>=0.21.0,<0.23.0``
143+
* - 0.5.x
144+
- ``>=0.20.1,<0.21.0``
145+
146+
**Why do generated bindings have version requirements?**
147+
148+
Numbast generates Python code that uses Numba-CUDA's internal APIs. These APIs can change between releases, so
149+
bindings generated with a specific version of Numbast are tested against a specific range of ``numba-cuda`` versions.
150+
151+
**How do I ensure compatibility?**
152+
153+
*For dynamic binding generation:*
154+
155+
- The correct ``numba-cuda`` version constraints are automatically enforced at the package dependency level
156+
and managed by your package manager (pip or conda). When you install Numbast, compatible versions of
157+
``numba-cuda`` are installed automatically via the dependencies specified in ``pyproject.toml`` and Conda
158+
environment files.
159+
160+
*For static binding generation:*
161+
162+
- When distributing generated bindings, document the required ``numba-cuda`` version range in your package
163+
dependencies so users can install a compatible version.
164+
- Generated static bindings (see :doc:`Static binding generation <static>`) can be regenerated with newer
165+
versions of Numbast if you need to support newer ``numba-cuda`` releases.
166+
167+
.. note::
168+
These version restrictions may be relaxed or removed once ``numba-cuda`` releases a stable 1.0 version with
169+
stabilized public APIs. Until then, bindings are tested against specific version ranges to ensure compatibility.

numbast/benchmarks/test_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numba.cuda as cuda
2+
from numba.cuda.types import float32
23
import numpy as np
3-
from numba import float32
44

55
import pytest
66

numbast/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers = [
1818
]
1919
dependencies = [
2020
"numba>=0.59.0",
21-
"numba-cuda>=0.20.1,<0.21.0",
21+
"numba-cuda>=0.21.0,<0.23.0",
2222
"ast_canopy>=0.5.0",
2323
"pyyaml",
2424
"click",
@@ -41,12 +41,12 @@ repository = "https://github.com/NVIDIA/numbast"
4141
[project.optional-dependencies]
4242
dev = ["ruff"]
4343
docs = ["sphinx>=7.0", "sphinx-copybutton>=0.5.2"]
44-
test-cu12 = ["pytest", "cffi", "numba-cuda[cu12]>=0.20.1,<0.21.0"]
44+
test-cu12 = ["pytest", "cffi", "numba-cuda[cu12]>=0.21.0,<0.23.0"]
4545
test-cu13 = [
4646
"pytest",
4747
"cffi",
4848
"cuda-toolkit[cudart,crt,curand,cccl,nvcc]==13.*",
49-
"numba-cuda[cu13]>=0.20.1,<0.21.0",
49+
"numba-cuda[cu13]>=0.21.0,<0.23.0",
5050
]
5151

5252

numbast/src/numbast/class_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from numba.cuda import declare_device
2525
from numba.cuda.cudadecl import register_global, register, register_attr
2626
from numba.cuda.cudaimpl import lower
27-
from numba.core.imputils import numba_typeref_ctor
27+
from numba.cuda.core.imputils import numba_typeref_ctor
2828
from numba.core.typing.npydecl import parse_dtype
2929
from numba.core.errors import RequireLiteralValue, TypingError
3030

0 commit comments

Comments
 (0)