Skip to content

refactor: remove unneeded import from cuda/core/__init__.py - #1463

Merged
cpcloud merged 1 commit into
NVIDIA:mainfrom
cpcloud:remove-eager-resource-handles-module-loading
Jan 13, 2026
Merged

cpcloud merged 1 commit into
NVIDIA:mainfrom
cpcloud:remove-eager-resource-handles-module-loading

Conversation

@cpcloud

@cpcloud cpcloud commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Noticed that this import was not necessary given that the module will be importable as is without this code.

@copy-pr-bot

copy-pr-bot Bot commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

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.

@cpcloud

cpcloud commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test

@cpcloud
cpcloud requested a review from Andy-Jost January 12, 2026 19:34
@github-actions

This comment has been minimized.

@Andy-Jost Andy-Jost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@cpcloud
cpcloud merged commit f060d15 into NVIDIA:main Jan 13, 2026
80 checks passed
@cpcloud
cpcloud deleted the remove-eager-resource-handles-module-loading branch January 13, 2026 17:11
@github-actions

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

@leofang leofang added this to the cuda.core beta 12 milestone Jan 13, 2026
Andy-Jost added a commit to Andy-Jost/cuda-python that referenced this pull request Sep 10, 2026
… copy from the merged wheel

build_hooks.py maps a Cython module to its C++ by name. It now also accepts
a directory: every .cpp under cuda/core/_cpp/<stem>/ compiles into the one
extension for _<stem>.pyx, with the legacy single file _cpp/<stem>.cpp kept
as the fallback (tensor_map is unchanged). With no such directory in the
tree yet, the sources are exactly today's, so this part is inert on its own.
The cuda.core._cpp package-data globs become recursive so headers in nested
directories ship, and .gitignore stops ignoring .cpp files under
cuda/core/_cpp/ so new sources are visible to git.

ci/tools/merge_cuda_core_wheels.py stops retaining a third, top-level copy
of _resource_handles and the top-level _cpp/ and _include/ headers in the
merged cu12+cu13 wheel. cuda/core/__init__.py rewrites __path__ to the
versioned subpackage before any import reaches them, so that copy (about
308 KB uncompressed in the 1.2.0 wheel) was never imported; the comment
defending it referred to an import removed in NVIDIA#1463. A step in
build-wheel.yml now asserts that the merged wheel's top level holds only
__init__.py, _version.py and the two versioned trees.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Andy-Jost added a commit that referenced this pull request Sep 14, 2026
… copy from the merged wheel (#2799)

* cuda.core: directory-aware C++ build rule and drop the dead top-level copy from the merged wheel

build_hooks.py maps a Cython module to its C++ by name. It now also accepts
a directory: every .cpp under cuda/core/_cpp/<stem>/ compiles into the one
extension for _<stem>.pyx, with the legacy single file _cpp/<stem>.cpp kept
as the fallback (tensor_map is unchanged). With no such directory in the
tree yet, the sources are exactly today's, so this part is inert on its own.
The cuda.core._cpp package-data globs become recursive so headers in nested
directories ship, and .gitignore stops ignoring .cpp files under
cuda/core/_cpp/ so new sources are visible to git.

ci/tools/merge_cuda_core_wheels.py stops retaining a third, top-level copy
of _resource_handles and the top-level _cpp/ and _include/ headers in the
merged cu12+cu13 wheel. cuda/core/__init__.py rewrites __path__ to the
versioned subpackage before any import reaches them, so that copy (about
308 KB uncompressed in the 1.2.0 wheel) was never imported; the comment
defending it referred to an import removed in #1463. A step in
build-wheel.yml now asserts that the merged wheel's top level holds only
__init__.py, _version.py and the two versioned trees.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* cuda.core: keep the merged-wheel layout check in the merge script; use pathlib

Review follow-up. The top-level layout assertion moves from build-wheel.yml
into ci/tools/merge_cuda_core_wheels.py, which now derives the kept cuNN
directories from its input wheels and raises if anything else remains under
cuda/core/ after the removal. _extension_sources uses pathlib.

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

3 participants