Skip to content

Conversation

@brandon-b-miller
Copy link
Contributor

This PR drops the experimental part of the cuda.core namespace.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 18, 2025

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller brandon-b-miller changed the title drop experimental namespace Drop experimental from cuda.core namespace imports Dec 18, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 18, 2025

Greptile Summary

This PR introduces a backward-compatible transition from cuda.core.experimental to cuda.core namespace by implementing a compatibility layer.

Key Changes:

  • Created numba_cuda/numba/cuda/_compat.py that conditionally imports from cuda.core.experimental (for cuda-core <0.5.0) or cuda.core (for >=0.5.0)
  • Updated all direct imports of cuda.core.experimental across production code and tests to use numba.cuda._compat
  • Added packaging dependency to support version parsing
  • Pinned pixi to v0.61.0 in CI workflows

Implementation Quality:

  • Clean abstraction that centralizes version-specific logic in one file
  • All imports consistently updated across the codebase
  • No remaining direct references to cuda.core.experimental outside the compatibility layer

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-structured with a clean compatibility layer that handles both old and new cuda-core versions. All imports are systematically updated, dependencies properly added, and the approach is non-breaking for existing users.
  • No files require special attention

Important Files Changed

Filename Overview
numba_cuda/numba/cuda/_compat.py New compatibility layer added to conditionally import from cuda.core.experimental (<0.5.0) or cuda.core (>=0.5.0)
numba_cuda/numba/cuda/cudadrv/driver.py Updated imports to use numba.cuda._compat instead of direct cuda.core.experimental imports
numba_cuda/numba/cuda/dispatcher.py Updated imports to use numba.cuda._compat for launch and LaunchConfig
pyproject.toml Added packaging dependency to support version parsing in compatibility layer
conda/recipes/numba-cuda/meta.yaml Added packaging to runtime dependencies

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. numba_cuda/numba/cuda/dispatcher.py, line 44 (link)

    syntax: Missed import: LaunchConfig still imported from cuda.core.experimental

8 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@brandon-b-miller
Copy link
Contributor Author

/ok to test

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (2)

  1. numba_cuda/numba/cuda/_compat.py, line 8-11 (link)

    logic: empty if/else blocks cause all imports from _compat to fail - nothing is re-exported. Add imports in each branch:

  2. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_driver.py, line 19 (link)

    style: inconsistent with other test files - test_events.py imports Device from _compat while this imports directly from cuda.core

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

11 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@brandon-b-miller
Copy link
Contributor Author

/ok to test

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (4)

  1. numba_cuda/numba/cuda/_compat.py, line 31-41 (link)

    logic: ObjectCode and LaunchConfig are missing from this compatibility module but are imported from it in several files (driver.py, dispatcher.py, nrt.py, test_module_callbacks.py, test_compiler.py). This will cause ImportError at runtime.

  2. numba_cuda/numba/cuda/_compat.py, line 8-18 (link)

    logic: ObjectCode and LaunchConfig need to be imported in both version branches since they're used by downstream modules.

  3. numba_cuda/numba/cuda/_compat.py, line 19-29 (link)

    logic: ObjectCode and LaunchConfig need to be imported in both version branches since they're used by downstream modules.

  4. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_driver.py, line 19 (link)

    logic: Importing Device directly from cuda.core bypasses the version compatibility layer. This will break with cuda-core < 0.5.0 where Device is only available in cuda.core.experimental.

14 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

/ok to test ec8d388

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right to me!

Comment on lines 61 to 62
Stream as ExperimentalStream,
Device as ExperimentalDevice,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could drop "Experimental" from these names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this, however there's some broader work to be done to disambiguate the cuda.core classes with the ones defined later in this file, so I'm going to leave it for a follow up for now.

@brandon-b-miller brandon-b-miller merged commit 5ad2291 into NVIDIA:main Dec 18, 2025
169 of 170 checks passed
brandon-b-miller added a commit that referenced this pull request Dec 19, 2025
rapids-bot bot pushed a commit to rapidsai/cuml that referenced this pull request Dec 19, 2025
mani-builds pushed a commit to mani-builds/cuml that referenced this pull request Jan 11, 2026
gmarkall added a commit to gmarkall/numba-cuda that referenced this pull request Jan 12, 2026
- Add arch specific target support (NVIDIA#549)
- chore: disable `locked` flag to bypass prefix-dev/pixi#5256 (NVIDIA#714)
- ci: relock pixi (NVIDIA#712)
- ci: remove redundant conda build in ci (NVIDIA#711)
- chore(deps): bump numba-cuda version and relock pixi (NVIDIA#707)
- Dropping bits in the old CI & Propagating recent changes from cuda-python (NVIDIA#683)
- Fix `test_wheel_deps_wheels.sh` to actually uninstall `nvvm` and `nvrtc` packages for CUDA 13 (NVIDIA#701)
- perf: remove some exception control flow and buffer-exception penalization for arrays (NVIDIA#700)
- perf: let CAI fall through instead of calling from_cuda_array_interface (NVIDIA#694)
- chore: perf lint (NVIDIA#697)
- chore(deps): bump deps in pixi lockfile (NVIDIA#693)
- fix: use freethreading-supported `_PySet_NextItemRef` where possible (NVIDIA#682)
- Support python `3.14` (NVIDIA#599)
- Remove customized address space tracking and address class emission in debug info (NVIDIA#669)
- Drop `experimental` from cuda.core namespace imports (NVIDIA#676)
- Remove dangling references to NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY (NVIDIA#675)
- Use `rapidsai/sccache` in CI (NVIDIA#674)
- chore(dev-deps): remove ipython and pyinstrument (NVIDIA#670)
- Set up a new VM-based CI infrastructure  (NVIDIA#604)
@gmarkall gmarkall mentioned this pull request Jan 12, 2026
gmarkall added a commit that referenced this pull request Jan 12, 2026
- Add arch specific target support (#549)
- chore: disable `locked` flag to bypass
prefix-dev/pixi#5256 (#714)
- ci: relock pixi (#712)
- ci: remove redundant conda build in ci (#711)
- chore(deps): bump numba-cuda version and relock pixi (#707)
- Dropping bits in the old CI & Propagating recent changes from
cuda-python (#683)
- Fix `test_wheel_deps_wheels.sh` to actually uninstall `nvvm` and
`nvrtc` packages for CUDA 13 (#701)
- perf: remove some exception control flow and buffer-exception
penalization for arrays (#700)
- perf: let CAI fall through instead of calling
from_cuda_array_interface (#694)
- chore: perf lint (#697)
- chore(deps): bump deps in pixi lockfile (#693)
- fix: use freethreading-supported `_PySet_NextItemRef` where possible
(#682)
- Support python `3.14` (#599)
- Remove customized address space tracking and address class emission in
debug info (#669)
- Drop `experimental` from cuda.core namespace imports (#676)
- Remove dangling references to
NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY (#675)
- Use `rapidsai/sccache` in CI (#674)
- chore(dev-deps): remove ipython and pyinstrument (#670)
- Set up a new VM-based CI infrastructure  (#604)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants