Skip to content

CI: support CUDA Toolkit minor bumps before the bindings floor advances - #3375

Draft
rwgk wants to merge 6 commits into
mainfrom
rwgk/ctk-minor-floor-ci
Draft

rwgk wants to merge 6 commits into
mainfrom
rwgk/ctk-minor-floor-ci

Conversation

@rwgk

@rwgk rwgk commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

— codex GPT-6 on behalf of Ralf —

Description

A CUDA Toolkit minor bump builds cuda-core with newer headers before matching cuda-bindings are available on PyPI. Older-runtime CI rows then install the published bindings floor and fail cuda-core's header compatibility check.

Use the bindings wheel built in the same run while the floor trails the build Toolkit minor, and resume literal-floor testing after the floor advances. Cover standard core tests and PyTorch/Numba nightlies using the newly built core, while preserving the nightly job testing released core. The initial change is extracted from f00d958 in #3368.

The local Toolkit follow-up is isolated in c17a310 and c460771, so it can be reviewed or reverted separately. Local core jobs install bare CuPy without component wheels that shadow the selected Toolkit. The mini Toolkit supplies cuRAND, and the sample dependency check accepts native cuRAND for bare requirements while retaining distribution checks for version, extras and URL constraints. The native probe runs in a fresh interpreter because libraries loaded by PyTorch in pytest are not necessarily available to sample subprocesses. Existing wheel-job pins remain. Adding cuRAND refreshes shared mini-Toolkit caches and expands their downloads.

Commit 64107b7 adds CUDA 13.5's Windows CUPTI name, cupti64_13.dll, while preserving older names. CI exposed this when the post-core pathfinder tests installed the newly published 13.5 wheel extras.

Validation:

  • 38 routing/floor/redistrib tests and 78 sample-runner tests passed.
  • Full pathfinder suite: 1,616 passed, five skipped; the new CUPTI regression fails before the fix.
  • On an A10G, 849 core/CuPy tests and both cuRAND samples passed without component wheels installed; both samples still pass after the process-probe fix.
  • Full pre-commit passed; independent Fable reviews found no material blocker.
  • Regular CI is running at the corrected head; fresh nightly will use its artifacts.

This branch retains main's Toolkit matrix; #3368 supplies the CUDA 13.5 integration case.

Checklist

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

mdboom and others added 3 commits November 4, 2026 14:15
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
— codex GPT-6 on behalf of Ralf —

Separate local and wheel test dependency groups so CuPy test setup does
not install component wheels that shadow the local Toolkit. Keep the
existing pinned dependencies for wheel-based jobs.

Include cuRAND in the shared mini Toolkit and recognize a loadable native
cuRAND library for bare sample requirements. Versioned, extras and URL
requirements continue to use distribution metadata. The component-list
change refreshes the mini-Toolkit caches for all action consumers.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added CI/CD CI/CD infrastructure cuda.core Everything related to the cuda.core module labels Nov 4, 2026
@rwgk rwgk added this to the CI milestone Nov 4, 2026
@rwgk rwgk removed the cuda.core Everything related to the cuda.core module label Nov 4, 2026
@rwgk rwgk self-assigned this Nov 4, 2026
@rwgk

rwgk commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c17a310

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

— codex GPT-6 on behalf of Ralf —

PyTorch can load cuRAND into the pytest parent on Windows without making
that DLL discoverable by sample subprocesses. Probe with the current
interpreter in a fresh process so parent-only libraries do not admit
samples that cannot run. Preserve diagnostics for unexpected loader errors.

Cover the process boundary with real child imports and retain local
Toolkit sample execution.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Nov 5, 2026
— codex GPT-6 on behalf of Ralf —

The CUDA 13.5 CUPTI wheel uses cupti64_13.dll rather than the older
year-version names. Recognize it first while preserving the existing
fallback names. Local core jobs exposed this in their subsequent
pathfinder all_must_work phase after installing the latest wheel extras.

Extend the search regression to cover the new name and old-name fallback.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Nov 5, 2026
@rwgk

rwgk commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 64107b7

— codex GPT-6 on behalf of Ralf —

An editable pathfinder finder can locate the real module despite the
fixture's empty cuda package. Supply an explicit missing-module stub so
the test models absence independently of the developer's installation.

All 78 sample-runner tests now pass with both editable and wheel installs.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@rwgk

rwgk commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 413814c

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

I asked my klanker why we have a broad (major-only) pin for cuda-toolkit in the pyproject.toml and then we narrow it (in multiple places) in run-tests. It responded:

===

The pyproject groups can't carry the narrow pin, because the minor differs per CI row. ci/test-matrix.yml runs the same major at different minors. For example, CUDA_VER is 13.0.2 on some rows and 13.4.2 on others, and 12.9.1 is separate. A dependency group is static, so test-cu13 would have to say ==13.0.* and ==13.4.* at once. The only way to do that in pyproject is one group per minor (test-cu13-0, test-cu13-4, ...). Each Toolkit bump would then need a new group, a new [tool.uv] conflicts entry, and a new test-matrix reference. That is more churn than the one-line pin in run-tests. The broad ==13.* in pyproject is also correct for the other consumers: local dev, toolshed/collect_site_packages_*, and users running pip install --group test-cu13.

The duplication is real, though. run-tests repeats cuda-toolkit==${TEST_CUDA_MAJOR_MINOR}.* at lines 79, 131, 141, 186, 199 and 214. A cleaner version sets it once as a pip constraint, which is what cuda_core/third_party/cccl/ci/pyenv_helper.sh:113 already does:

echo "cuda-toolkit==${TEST_CUDA_MAJOR_MINOR}.*" > "${PIP_CONSTRAINT}"
export PIP_CONSTRAINT

That one line covers every pip install in the script, extras like [curand] included. It also removes the TOOLKIT_PIN array that this PR adds. Suggest it as a follow-up, or in this PR if the author is open to it.

===

I think we should make that simplification.

@@ -0,0 +1,176 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

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.

These tests are so monkeypatch'ed as to be useless. I would just remove this. If run-tests does the wrong thing, we will see it in CI anyway.

Comment thread ci/tools/run-tests
Comment on lines +148 to +149
# Local jobs get CuPy's headers and libraries from the mini CTK; installing
# component wheels would take precedence over those local libraries.

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.

Nit: Doesn't make sense to mention CuPy here -- it's true, but that's just an artifact of what our test dependencies are (which may change in the future).

Suggested change
# Local jobs get CuPy's headers and libraries from the mini CTK; installing
# component wheels would take precedence over those local libraries.
# Local jobs get cuda-core's test dependencies from the mini CTK; installing
# component wheels would take precedence over those local libraries.

Comment thread cuda_core/pyproject.toml
Comment on lines +96 to +99
test-cu12-local = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda12x; python_version < '3.15'"]
test-cu13-local = [ {include-group = "ml-dtypes" }, {include-group = "test" }, "cupy-cuda13x; python_version < '3.15'"]
test-cu12 = [ {include-group = "test-cu12-local" }, "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy
test-cu13 = [ {include-group = "test-cu13-local" }, "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy

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.

Consider a comment on the groups explaining why -local exists, because the pyproject has no hint of it.

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 cuda.pathfinder Everything related to the cuda.pathfinder module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants