Skip to content

cuda.core: carry the cuda-bindings floors through minimal-sysctk12/13 extras - #3460

Open
leofang wants to merge 3 commits into
NVIDIA:mainfrom
leofang:cuda-core-minimal-sysctk
Open

leofang wants to merge 3 commits into
NVIDIA:mainfrom
leofang:cuda-core-minimal-sysctk

Conversation

@leofang

@leofang leofang commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Description

Part of #3459.

Moves the cuda-bindings floors from the cu12/cu13 extras into new minimal-sysctk12/minimal-sysctk13 extras, which cu12/cu13 include by self-reference. A package that depends on cuda-core[minimal-sysctk12] (or [cu12]) now passes the floor to pip and uv.

The floor readers (floors_from_extras and the CI wheel-floor reader) still read the floor of each cu<N> extra; they now follow a cuda-core[...] self-reference and skip an unversioned cuda-bindings[all]. The existing tests of the cu<N> form are unchanged, and new tests cover the self-reference.

Two additions beyond the issue:

  • The check-cuda-core-bindings-floor hook also checks that each cu<N> extra lists cuda-core[minimal-sysctk<N>], so the floor is written only in minimal-sysctk<N>.
  • [tool.uv].conflicts declares the new extras as conflicting across majors; without it uv lock fails.

A CUDA 12 wheel built from this branch carries the floors under extra == "minimal-sysctk12"/"minimal-sysctk13", and pip install --dry-run "cuda-core[cu12] @ <wheel>" cuda-bindings==12.9.3 (likewise [minimal-sysctk12]) is now rejected at resolve time instead of failing at import.

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

-- Leo's bot

The floors lived only in the cu12/cu13 extras, so a package that depends
on plain cuda-core never passed them to pip or uv, and an older
cuda-bindings failed only at import (NVIDIA#3459).

Declare the floors in new minimal-sysctk12/13 extras, include them from
cu12/cu13, and depend on cuda-bindings without a version. The floor
parser, the CI wheel-floor reader, the pre-commit hook and the docs read
the new extras.
@copy-pr-bot

copy-pr-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang
leofang requested a review from Andy-Jost November 13, 2026 19:23
@leofang leofang added cuda.core Everything related to the cuda.core module packaging Anything related to wheels or Conda packages labels Nov 13, 2026
@github-actions github-actions Bot added the CI/CD CI/CD infrastructure label Nov 13, 2026
Drop the unversioned cuda-bindings from the base dependencies, so a
plain cuda-core install keeps asking for an extra.

Keep the floor readers on the cu<N> extras, as before, and teach them
to follow a cuda-core[...] self-reference and to skip an unversioned
cuda-bindings[all]. The cu<N> layout then yields the floor written in
minimal-sysctk<N>, and the existing tests of the cu<N> form stay as
they are. New tests cover the self-reference.

@mdboom mdboom 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.

Not reviewing either way (I think @Andy-Jost should probably weigh in) -- just sharing one note my agent found:

Stale wording in build_hooks.py. The docstrings near lines 136 and 256 still say the floor is "the cu extra in pyproject.toml". The issue listed these as optional, so the code works unchanged.

@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.

Thanks @leofang, I went through this in detail. I'm on board with the approach and don't see any blockers.

Please leave #3459 open. I will close it after yanking 1.3.0.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added minimal-sysctk12 and minimal-sysctk13 installation options for using CUDA bindings with a system-installed toolkit. The cu12 and cu13 options now include the corresponding bindings version requirements alongside CUDA Toolkit wheels.
  • Documentation
    • Updated installation and support guidance on selecting compatible bindings, including for packages that depend on cuda-core, and clarified that installing cuda-core without a CUDA extra does not communicate the bindings version requirement to package installers.
    • Added guidance about the resolver fallback risk associated with the yanked cuda-core 1.3.0 release.

The PR moves CUDA binding version floors into minimal-sysctk12 and minimal-sysctk13 extras. The CUDA extras include those floor declarations. Floor readers, consistency checks, installation instructions, and maintainer guidance now reflect this structure.

Changes: CUDA binding floor extras

Layer / File(s) Summary
Declare extras and resolve floors
cuda_core/pyproject.toml, cuda_core/cuda/core/_bindings_floor.py, cuda_core/tests/test_bindings_floor.py
The minimal extras declare the CUDA binding floors, and cu12 and cu13 include their matching minimal extras. Floor resolution follows self-references and tests cover cycles and invalid requirements.
Update floor readers and consistency checks
ci/tools/cuda_core_bindings_floor.py, ci/tools/tests/test_cuda_core_bindings_floor.py, toolshed/check_cuda_core_bindings_floor.py, cuda_core/tests/test_bindings_floor.py
The CI metadata reader and repository checker follow and validate extra references. Tests cover floor extraction and missing or invalid declarations.
Document installation and floor maintenance
cuda_core/AGENTS.md, cuda_core/DESCRIPTION.rst, cuda_core/docs/source/install.rst, cuda_core/docs/source/release/1.3.1-notes.rst, cuda_core/docs/source/support.rst
The documentation describes the minimal extras, their relationship to the CUDA extras, and the floor limitations of plain cuda-core requirements.

Possibly related issues

Suggested reviewers: rwgk, mdboom

Change: Other · Severity of issue fixed: Medium

Merge Risk: Moderate · up to 22349

The change moves the CUDA binding floors into new minimal-sysctk12 and minimal-sysctk13 extras. The install guidance may still let pip resolve an older cuda-core that has neither the extra nor the floor, so import fails. The release notes also claim a yank that was not visible on PyPI. Fix the guidance and confirm the yank before merging.

Security architecture risk: Minimal · up to 22349

The inspected change preserves the existing binding-version floors and major-version bounds while making them available through minimal installation extras. No introduced or worsened security, failure-containment, rollback, or ownership risk was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The supported exposure is dependency selection for consumers requesting these extras and floor interpretation during project validation or CI wheel inspection. The inspected self-reference traversal remains within the supplied configuration or metadata rather than fetching or executing referenced requirements.

Trust Boundaries and Controls

  • observed — The project reader still rejects missing or duplicate versioned binding requirements, malformed floor constraints, and mismatched CUDA-major bounds. The consistency hook additionally requires each cu extra to name its matching minimal extra.

Resilience and Maintainability Implications

  • observed — Both recursive readers track visited extras along each traversal path, preventing cycles from recursing indefinitely. Their traversal state is local to the invocation; the inspected expansion logic does not update shared persistent state.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c41e079 and 223499a.

Files selected for processing: 4

  • ci/tools/cuda_core_bindings_floor.py
  • cuda_core/cuda/core/_bindings_floor.py
  • cuda_core/docs/source/release/1.3.1-notes.rst
  • cuda_core/tests/test_bindings_floor.py
Files skipped from review as they are similar to previous changes: 1

  • cuda_core/docs/source/release/1.3.1-notes.rst

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Nitpick comments: 1

ci/tools/tests/test_cuda_core_bindings_floor.py: 1

100-104: Trivial · Maintainability & Code Quality · Quick win

suggestion: Remove the loud-validation-failure test.

This case checks that malformed metadata raises SystemExit. It does not cover a silently incorrect floor. Remove this case and retain the successful floor-extraction coverage.

As per coding guidelines, “Keep a test only when wrong behavior would be silent.”

Source: Coding guidelines

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7de298b and c41e079.

Files selected for processing: 11

  • ci/tools/cuda_core_bindings_floor.py
  • ci/tools/tests/test_cuda_core_bindings_floor.py
  • cuda_core/AGENTS.md
  • cuda_core/DESCRIPTION.rst
  • cuda_core/cuda/core/_bindings_floor.py
  • cuda_core/docs/source/install.rst
  • cuda_core/docs/source/release/1.3.1-notes.rst
  • cuda_core/docs/source/support.rst
  • cuda_core/pyproject.toml
  • cuda_core/tests/test_bindings_floor.py
  • toolshed/check_cuda_core_bindings_floor.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

or ``cu13`` extra, and let ``cuda-core`` choose the ``cuda-bindings`` version. A pin of your own
can conflict with the floor of a later ``cuda-core`` release.
Do not pin ``cuda-bindings`` in your own requirements. In a package that depends on
``cuda-core``, request ``cuda-core[minimal-sysctk12]`` or ``cuda-core[minimal-sysctk13]`` from

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Major · Data Integrity & Integration · Quick win

important: Require a version that provides the minimal extras.

With cuda-bindings==12.9.3, pip can select cuda-core 1.3.0 instead of 1.3.1. That release lacks minimal-sysctk12, so pip warns but installs it without the floor; import then fails. (raw.githubusercontent.com)

Recommend cuda-core[minimal-sysctk12]>=1.3.1 and the equivalent CUDA 13 requirement.

See :ref:`cuda-core-bindings-floor`.
(`#3459 <https://github.com/NVIDIA/cuda-python/issues/3459>`__)

- ``cuda-core`` 1.3.0 is yanked from PyPI. It declared its floors only in the ``cu12`` and

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor · Functional Correctness · Quick win

important: Confirm the yank before publishing this statement.

As of November 17, 2026, PyPI lists 1.3.0 without a yank notice. (pypi.org) Readers could assume resolvers will avoid that release. Yank it before publishing these notes, or update the statement.

"""`cu<N>` extras that do not include `minimal-sysctk<N>`. pip and uv would not see the floor through them."""
extras = read_extras(repo_root)
problems = []
for major in floors:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor · Functional Correctness · Quick win

important: Detect missing CUDA extras independently of parsed floors.

If cu13 is deleted while cu12 and both minimal extras remain, read_floors() returns only major 12. This loop never checks cu13, so check() can pass despite the missing CUDA 13 extra.

Derive the expected majors from the minimal extras, then validate each matching cu<N> extra. Add coverage through check(). The current None test injects major 13 directly and misses this failure.

# Conflicts:
#	cuda_core/docs/source/release/1.3.1-notes.rst
@Andy-Jost

Copy link
Copy Markdown
Contributor

/ok to test 223499a

@github-actions

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure cuda.core Everything related to the cuda.core module packaging Anything related to wheels or Conda packages to-be-backported Trigger the bot to raise a backport PR upon merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants