-
Notifications
You must be signed in to change notification settings - Fork 237
cuda-core experimental namespace deprecation (attempt v0) #1298
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
Changes from all commits
f16dc1b
77445b3
3c79ca6
b54bf6a
411bbd7
29e31df
b7cb72b
55a50e6
b2f28e9
45c92f5
b7c0cc0
d47b29d
2e0da66
c414b7d
d582448
3cc287c
a040505
4f34fdd
6718a70
506b912
dfa0f0e
64a2b52
5328873
11f52c7
4307b5d
4b9796b
798ce3d
09a78cc
516e088
475a1df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,59 @@ | |
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from cuda.core._version import __version__ | ||
|
|
||
| try: | ||
| from cuda import bindings | ||
| except ImportError: | ||
| raise ImportError("cuda.bindings 12.x or 13.x must be installed") from None | ||
| else: | ||
| cuda_major, cuda_minor = bindings.__version__.split(".")[:2] | ||
| if cuda_major not in ("12", "13"): | ||
| raise ImportError("cuda.bindings 12.x or 13.x must be installed") | ||
|
|
||
| import importlib | ||
|
|
||
| subdir = f"cu{cuda_major}" | ||
| try: | ||
| versioned_mod = importlib.import_module(f".{subdir}", __package__) | ||
| # Import all symbols from the module | ||
| globals().update(versioned_mod.__dict__) | ||
| except ImportError: | ||
| # This is not a wheel build, but a conda or local build, do nothing | ||
| pass | ||
| else: | ||
| del versioned_mod | ||
| finally: | ||
| del bindings, importlib, subdir, cuda_major, cuda_minor | ||
|
|
||
| from cuda.core import utils # noqa: E402 | ||
| from cuda.core._device import Device # noqa: E402 | ||
| from cuda.core._event import Event, EventOptions # noqa: E402 | ||
| from cuda.core._graph import ( # noqa: E402 | ||
| Graph, | ||
| GraphBuilder, | ||
| GraphCompleteOptions, | ||
| GraphDebugPrintOptions, | ||
| ) | ||
| from cuda.core._launch_config import LaunchConfig # noqa: E402 | ||
| from cuda.core._launcher import launch # noqa: E402 | ||
| from cuda.core._layout import StridedLayout # noqa: E402 | ||
| from cuda.core._linker import Linker, LinkerOptions # noqa: E402 | ||
| from cuda.core._memory import ( # noqa: E402 | ||
| Buffer, | ||
| DeviceMemoryResource, | ||
| DeviceMemoryResourceOptions, | ||
| GraphMemoryResource, | ||
| LegacyPinnedMemoryResource, | ||
| MemoryResource, | ||
| VirtualMemoryResource, | ||
| VirtualMemoryResourceOptions, | ||
| ) | ||
|
Comment on lines
+44
to
+53
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list needs to be updated to capture a few new things. |
||
| from cuda.core._module import Kernel, ObjectCode # noqa: E402 | ||
| from cuda.core._program import Program, ProgramOptions # noqa: E402 | ||
| from cuda.core._stream import Stream, StreamOptions # noqa: E402 | ||
| from cuda.core._system import System # noqa: E402 | ||
|
|
||
| system = System() | ||
| __import__("sys").modules[__spec__.name + ".system"] = system | ||
| del System | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cython needs an exact filename
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably an accident. I had to git merge main already several times, a likely cause of accidents. The merges are messy. I'm using Cursor and it seems to miss some details sometimes. This PR has become much more complex than it looked like initially (tests passed a couple weeks ago). E.g. I don't understand why ci/tools/merge_cuda_core_wheels.py (last changed in Oct) worked before but now needs a change (it makes sense that it needs a change). Testing it locally isn't easy because the input wheels only live on the runners and disappear when the jobs finish. So I'd have to figure out how to build them locally (currently I'm not trying to). I'll keep beating on it until I'll get all tests to pass again. Maybe I'll start over fresh. LLMs seems to be less successful when working incrementally. Thanks for the hints.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! Leaving a quick note before signing off... The merge script can be tested locally easily. Create two conda envs, one with CUDA 13 and another with CUDA 12, and build cuda.core wheels in each env via cuda-python/.github/workflows/build-wheel.yml Lines 430 to 439 in 83eaec1
Once this PR (#1085) is revived/merged, we will be able to build cuda-core in a pure-wheel env and no need to use conda. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Why is this needed? We do not keep any headers under
cuda/coreorcuda/core/experimental. If without adding this Cython runs into compilation errors, I suspect this has to do with the__init_experimental.pxdfile below.