-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EPIC] RFC: cuda
namespace cleanup
#75
Labels
cuda.bindings
Everything related to the cuda.bindings module
enhancement
Any code-related improvements
P0
High priority - Must do!
RFC
Plans and announcements
Milestone
Comments
(Updated issue description.) |
leofang
added
enhancement
Any code-related improvements
P0
High priority - Must do!
and removed
triage
Needs the team's attention
labels
Sep 10, 2024
This was referenced Sep 11, 2024
jollylili
changed the title
RFC:
[EPIC] RFC: Sep 16, 2024
cuda
namespace cleanupcuda
namespace cleanup
Closed
With all 4 sub-issues closed, this issue is complete. Closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cuda.bindings
Everything related to the cuda.bindings module
enhancement
Any code-related improvements
P0
High priority - Must do!
RFC
Plans and announcements
Impact
Very little, except for those accessing
__version__
from thecuda
namespace, via, say,We'll offer a fallback (that would raise a warning) before the transition concludes. Semantically, this will be equivalent to
after the transition, so we do not expect to break any existing code. See below for further details.
Context
cuda-python
is currently tightly coupled to CTK releases (including its versioning scheme) which is problematic as we move higher in the stack (say by offering pythonic CUDA constructs that can be used across CTK major releases).cuda
, each of which is potentially separately versioned.cuda
is not yet a namespace module.cuda.cuda
for the CUDA driver API bindings is confusing (why is “cuda” = driver?)Existing module layout
cuda.cuda
(Python)cuda.ccuda
(Cython)cuda._cuda.ccuda
(internal)cuda.cudart
(Python)cuda.ccudart
(Cython)cuda._lib.ccudart.ccudart
(internal)cuda.nvrtc
(Python)cuda.cnvrtc
(Cython)cuda._cuda.cnvrtc
(internal)cuda/__init__.py
(only defines__version__
and nothing else)Solution
This proposal solves the problem by requiring the following changes to support namespace packages:
cuda/__init__.py
New module layout
cuda.bindings.driver
(Python)cuda.bindings.cydriver
(Cython)cuda.bindings._internal.driver
(internal)cuda.bindings.runtime
(Python)cuda.bindings.cyruntime
(Cython)cuda.bindings._internal.runtime
(internal)cuda.bindings.nvrtc
(Python)cuda.bindings.cynvrtc
(Cython)cuda.bindings._internal.nvrtc
(internal)cuda.bindings.nvjitlink
(Python)cuda.bindings.cynvjitlink
(Cython)cuda.bindings._internal.nvjitlink
(internal)cuda.bindings.libnvvm
(Python)cuda.bindings.cylibnvvm
(Cython)cuda.bindings._internal.libnvvm
(internal)Transition plan
The transition to namespace packages is meant to be a non-breaking change, at least within the CUDA minor releases.
cimport
’ing the Cython modules:cuda.ccuda
(driver)from cuda.bindings.driver cimport *
cuda.ccudart
(runtime)from cuda.bindings.runtime cimport *
cuda.cnvrtc
(NVRTC)from cuda.bindings.nvrtc cimport *
DeprecationWarning
for usersimport
’ing the Python modules:cuda.cuda
(driver)from cuda.bindings.driver import *
cuda.cudart
(runtime)from cuda.bindings.runtime import *
cuda.nvrtc
(NVRTC)from cuda.bindings.nvrtc import *
cuda._cuda
cuda._lib
DeprecationWarning
to user-visibleUserWarning
cuda.ccuda
(driver)cuda.ccudart
(runtime)cuda.cnvrtc
(NVRTC)cuda.cuda
(driver)cuda.cudart
(runtime)cuda.nvrtc
(NVRTC)The text was updated successfully, but these errors were encountered: