You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Migrate cuda.core.experimental to cuda.core
This commit migrates all code from cuda.core.experimental to cuda.core,
completing the deprecation of the experimental namespace.
Changes:
- Move all files from cuda/core/experimental/ to cuda/core/
- Move include/ directory to _include/ (with leading underscore for
implementation detail)
- Update all imports from cuda.core.experimental.* to cuda.core.*
- Update build_hooks.py to use cuda.core instead of cuda.core.experimental
- Update pyproject.toml package-data paths
- Update cuda/core/__init__.py to export all symbols
- Update cuda/core/experimental/__init__.py for backward compatibility
with deprecation warnings
- Update Cython extern declarations to use _include/ instead of include/
- Fix import paths for _memory_pool (cuda.core._memory._memory_pool)
- Update test files and test helpers to use new import paths
All tests pass (1499 passed, 79 skipped).
* Remove experimental namespace from examples and test files
Update all example files and test Cython files to use cuda.core instead
of cuda.core.experimental:
- Update all example imports from cuda.core.experimental.* to cuda.core.*
- Update example utils imports from cuda.core.experimental.utils to cuda.core.utils
- Update test Cython file imports
- Update build_tests.sh include path from experimental/include to _include
All example files now use the non-experimental import paths.
* Update .spdx-ignore for cuda_core/cuda/core/_include/dlpack.h
* Update documentation to reflect migration from experimental to core
Update all documentation files to reference cuda.core instead of
cuda.core.experimental:
- api.rst: Change module from cuda.core.experimental to cuda.core
- getting-started.rst: Update currentmodule and example imports
- interoperability.rst: Update currentmodule
- api_private.rst: Update currentmodule
- conf.py: Update system import paths and excluded_dirs paths
All documentation now reflects the new non-experimental API paths.
Release notes files are left unchanged as they are historical.
* Update issue templates and wheel merge script for cuda.core migration
Update GitHub issue templates and wheel merge script to reference
cuda.core instead of cuda.core.experimental:
- bug_report.yml: Update example references from cuda.core.experimental
to cuda.core
- feature_request.yml: Update example references from cuda.core.experimental
to cuda.core
- merge_cuda_core_wheels.py: Update to merge cuda/core/ instead of
cuda/core/experimental/, and adopt logic that copies only binaries
into versioned subdirectories while keeping Python modules in cuda/core/
* chore: bump pixi version
* test: handle deprecated calls
* build: remove unnecessary `local_include_dirs`
* chore: try reverting to the original merge wheel script
* revert: chore: try reverting to the original merge wheel script
This reverts commit e0f784d.
* test: try removing unnecessary utils import
* chore: copy everything
* Fix merge script to selectively copy files to versioned directories
Fix the wheel merge script to copy files selectively instead of copying
everything, which was causing import errors:
- Copy binaries (.so, .pyd, .dll) to versioned directories (version-specific)
- Copy Python files (.py) to versioned directories (needed for imports like utils.py)
- Do NOT copy Cython files (.pyx, .pxd) to versioned directories
The previous "copy everything" approach caused failures when testing CUDA 12.9.1
because CUDA 13 .pyx files (which reference version-specific C functions like
cuMemGetMemPool) were being copied into cu12/ directories, causing import errors.
This selective approach fixes both:
- Original issue: utils.py import failures (now .py files are copied)
- Current issue: cuMemGetMemPool errors (now .pyx files are NOT copied)
* Add debugging output to show wheel directory structures
Add debugging output to show the directory structure of input and output
wheels for troubleshooting. This will help diagnose issues with the
wheel merge process.
- Use Python's zipfile module (standard library) to list wheel contents
- Add debugging output showing cuda/core/ directory structure for:
* Each input wheel before merging
* The output merged wheel after merging
- Format output similar to unzip -l for readability
- Filter output to show only cuda/core/ entries
* Fix merge script to match main branch's working approach
Based on analysis of main branch's merge script and CI logs, updated the
merge logic to:
1. Use shutil.copytree() to copy entire directory trees into versioned
subdirectories (cu12/, cu13/), matching main's approach for experimental/
2. Clean up main cuda/core/ directory to only keep:
- __init__.py
- _include/ directory
- Versioned subdirectories (cu12/, cu13/)
This ensures Python imports from versioned directories instead of
main directory, which may contain binaries from a different CUDA version.
3. Add DRY helper function print_wheel_directory_structure() for debugging
output, refactored from duplicate code.
4. Update docstring to reference cuda/core instead of experimental namespace.
This fixes the ImportError issues where Python was loading CUDA 13 binaries
when running on CUDA 12.9.1, because the main directory still contained
.so files from the base wheel.
* Fix merge script: keep _version.py and __init__.pxd in main directory
The merge script was removing _version.py and __init__.pxd from the main
cuda/core/ directory, but these files are required:
- _version.py: imported by __init__.py at module initialization
- __init__.pxd: kept for Cython compatibility (matches main branch behavior)
Updated the cleanup logic to preserve these files along with __init__.py,
_include/, and versioned subdirectories (cu12/, cu13/).
The code was also manually cleaned up for better readability and
maintainability.
* Rework top-level into in cuda_core/docs/source/api.rst
* Bug fix in ci/tools/merge_cuda_core_wheels.py: replace AI-generated .touch() with os.truncate()
* Add backward compatibility tests for experimental namespace
- Add test_experimental_backward_compat.py from v0 branch
- Remove __getattr__ from experimental/__init__.py per reviewer feedback
(underscored modules are not public APIs)
- Update test to expect AttributeError when accessing underscored modules
- Document in module docstring that underscored modules are intentionally
not accessible through experimental namespace
- Move note about underscored modules to module docstring (per pre-commit)
* Remove __init__.pxd from items_to_keep list in ci/tools/merge_cuda_core_wheels.py
* Combine experimental backward compat tests into single function
- Combine all test functions into test_experimental_backward_compatibility()
to avoid race conditions when tests run in parallel
- Add defensive sys.modules cleanup at start of test function
- Remove test for underscored module access (not needed per reviewer feedback)
* Remove StridedMemoryView from experimental namespace
Remove StridedMemoryView and args_viewable_as_strided_memory from
experimental namespace. These should be imported from cuda.core.utils
instead.
* Specify v1.0.0 as removal target for experimental namespace
Update deprecation warning and docstring to specify that the
experimental namespace will be removed in v1.0.0, rather than
the vague 'future release'. This provides users with a clear
timeline for migration.
* Apply suggestions from code review
* [pre-commit.ci] auto code formatting
* make linter happy
* [pre-commit.ci] auto code formatting
* revert the utils change
---------
Co-authored-by: Phillip Cloud <417981+cpcloud@users.noreply.github.com>
Co-authored-by: Leo Fang <leof@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/feature_request.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ body:
36
36
attributes:
37
37
label: Is your feature request related to a problem? Please describe.
38
38
description: A clear and concise description of what the problem is, e.g., "I would like to be able to..."
39
-
placeholder: I would like to be able to use the equivalent of `cuda.core.experimental.Program.compile(...)` to compile my code to PTX.
39
+
placeholder: I would like to be able to use the equivalent of `cuda.core.Program.compile(...)` to compile my code to PTX.
40
40
validations:
41
41
required: true
42
42
@@ -46,7 +46,7 @@ body:
46
46
label: Describe the solution you'd like
47
47
description: A clear and concise description of what you want to happen.
48
48
placeholder: |
49
-
Support a `ptx` target_type in the `cuda.core.experimental.Program.compile(...)` function.
49
+
Support a `ptx` target_type in the `cuda.core.Program.compile(...)` function.
50
50
validations:
51
51
required: true
52
52
@@ -57,7 +57,7 @@ body:
57
57
description:
58
58
If applicable, please add a clear and concise description of any alternative solutions or features you've
59
59
considered.
60
-
placeholder: The alternatives to using `cuda.core.experimental.Program.compile(...)` are unappealing. They usually involve using lower level bindings to something like nvRTC or invoking the nvcc executable.
60
+
placeholder: The alternatives to using `cuda.core.Program.compile(...)` are unappealing. They usually involve using lower level bindings to something like nvRTC or invoking the nvcc executable.
0 commit comments