Skip to content

ci: normalize toolkit configuration and isolate CUDA 13 versions - #3314

Draft
rwgk wants to merge 2 commits into
mainfrom
rwgk/cb12-staged-01-config
Draft

rwgk wants to merge 2 commits into
mainfrom
rwgk/cb12-staged-01-config

Conversation

@rwgk

@rwgk rwgk commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

— codex GPT-6 on behalf of Ralf —

Layer 1 of 7 of the staged "CUDA 12 bindings on main" stack. Next: #3315. Stack map at the bottom.

What this PR does

Two small preparations. Nothing CI does today changes.

  1. One reader for "which bindings roots exist." ci/tools/bindings_config.py (60 lines) turns the existing cuda.build.version / cuda.prev_build.version pins in ci/versions.yml into two records: cuda_bindings_13 is current (13.4.2), cuda_bindings_12 is maintenance (12.9.1). The pixi pin check is its first consumer. ci/ becomes an importable package, and detect-changes now runs the whole ci/tools/tests suite with pytest (before: only the planner test, via unittest).
  2. CUDA 13 versions stop matching CUDA 12 tags. cuda_bindings_13/pyproject.toml and cuda_python/setup.py narrow the setuptools-scm selector from v*[0-9]* to v13.4.*. Later layers make v12.9.* tags reachable from main; without this change git describe would hand those tags to the CUDA 13 packages.

After this merges

  • main builds, tests, and releases exactly as before.
  • A v12.9.11a0 tag on main can no longer disturb CUDA 13 version derivation (covered by test_cuda12_milestone_does_not_change_current_package_versions, which derives its current release tag and expected line from the registry).
  • Watch out: the CUDA 13 selector must now follow CUDA 13 minor bumps (v13.5.* when the toolkit moves). Layer 7 (ci: retire legacy branch-based bindings maintenance #3322) adds the pre-commit check that enforces this; until then it is a manual step.

Where to look

All changes (10 files, +196 / -18)
  • ci/tools/bindings_config.py (new): BindingsPackage, BindingsConfig, load_config().
  • ci/__init__.py, ci/tools/__init__.py (new, empty): make python -m ci.tools.<module> work.
  • ci/tools/check_pixi_cuda_version.py: read pins through the registry; same checks.
  • ci/tools/tests/test_bindings_config.py (new): registry normalization, pixi-check drift, and the "CUDA 12 milestone does not change CUDA 13 versions" test (real git repository, real pyproject/setup.py).
  • .github/workflows/ci.yml: detect-changes installs pytest/pyyaml/setuptools-scm on hardened Python and runs pytest ci/tools/tests.
  • .github/workflows/ci-nightly.yml: the release-tooling test job installs setuptools-scm too.
  • .pre-commit-config.yaml: the pixi hook runs as python -m ci.tools.check_pixi_cuda_version and also triggers on the two tool files.
  • cuda_bindings_13/pyproject.toml, cuda_python/setup.py: --match v13.4.*.
Validation
  • Full CI passed at the pre-rebase head 1142000b (run 41171069718, 104 jobs).
  • Current head 98ed2a6c9d028ec0c28cc89b6e336c8c23579cf1 includes the follow-up fixes. Local validation: 296 CI-tool tests, actionlint passed. Full CI and native Pixi source/GPU checks have not been rerun for it.
Stack map: what main can do after each layer merges
Layer PR After it merges, main ...
1 #3314 behaves exactly as before; CI has one reader for the two bindings roots; CUDA 13 versions can no longer match a v12.* tag
2 #3315 lets a developer build, test, and document cuda_bindings_12/; the PR-time CPU source-build smoke covers both roots; three CUDA 12 runtime fixes are in
3 #3317 builds the CUDA 12 bindings wheel itself and runs its GPU tests; cuda.core and the metapackage still consume 12.9.x artifacts
4 #3318 uses same-run CUDA 12 wheels everywhere; PR CI no longer reads the 12.9.x branch
5 #3319 can release CUDA 12 from a v12.9.N tag on main; CUDA 13 releases are unchanged
6 #3321 builds and tests only what a change needs, per bindings root, reusing baseline artifacts
7 #3322 carries the schema-2 registry, a manual-only backport workflow, a metadata consistency hook, and the maintenance docs; 12.9.x is frozen

Every layer was designed to be mergeable on its own and had a green full CI run at its pre-rebase head on 2026-10-31. The stack is the "individually mergeable pieces" alternative to #3174-#3182; both stacks reach the same end state except that this one keeps compatibility routes for older artifact sources and retained CUDA 13 tags.

@copy-pr-bot

copy-pr-bot Bot commented Oct 31, 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.

@rwgk
rwgk added this pull request to stack #3316 October 31, 2026 05:02
@github-actions github-actions Bot added CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module labels Oct 31, 2026
@rwgk rwgk added this to the cuda.bindings next milestone Oct 31, 2026
@rwgk rwgk added the enhancement Any code-related improvements label Oct 31, 2026
@rwgk rwgk self-assigned this Oct 31, 2026
@rwgk

rwgk commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1142000

@github-actions

Copy link
Copy Markdown
Contributor

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

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

The most blocking thing here is hard-coding the minor version in the git describe glob. It means there is an extra step required before tagging and merging a release. My agent seems nothing wrong with making it v13.*, though it would require updating a test here.

Comment thread .github/workflows/ci.yml
- name: Set up Python for CI tool tests
uses: ./.github/actions/setup-hardened-python
with:
python-version: "3.12"

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.

Why Python 3.12? We could use the latest, but probably the right conservative thing here to avoid breaking any outside users who might want to compile cuda-python themselves is to use the oldest supported (currently 3.11).

Comment thread .github/workflows/ci.yml
- name: Test CI tools
run: |
python -m pip install pytest==9.1.0 pyyaml==6.0.3 setuptools-scm
python -m pytest -v --noconftest ci/tools/tests

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.

Is there an explicit reason for --noconftest? That will be confusing if we ever want a conftest in the future.


def main() -> int:
"""Verify cuda_bindings_13/cuda_core pixi pins match ci/versions.yml."""
"""Verify current bindings and cuda_core pixi pins match ci/versions.yml."""

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.

Makes total sense for now. Maybe it's already higher up in the stack, but we should make sure to come back and add this check to legacy (12) as well. If not already in the stack, let's create an issue or just add a TODO comment here so it doesn't fall through the cracks.

root = ".."
version_file = "cuda/bindings/_version.py"
git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v*[0-9]*"]
git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v13.4.*"]

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.

Note to me: this is a UNIX glob pattern not a regex.

Do we need v13.4.* here? It kind of defeats the purpose of "simply" tagging to make a release, as we would now require a bump to this number at each minor release.

If it /must/ be this way, we need to update the release TODO instructions to add this extra step. By the time we tag the release, it will be too late to update this number, so it shouldn't be forgotten.

Comment thread cuda_python/setup.py
root="..",
relative_to=__file__,
git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", "v*[0-9]*"],
git_describe_command=["git", "describe", "--dirty", "--tags", "--long", "--match", "v13.4.*"],

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.

Ditto as above.

Comment thread .github/workflows/ci.yml

- name: Test CI tools
run: |
python -m pip install pytest==9.1.0 pyyaml==6.0.3 setuptools-scm

@mdboom mdboom Nov 3, 2026 •

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: Since ci/tools is now a package, it should have a pyproject.toml and specify its dependencies there (making it easier to run the tests locally). That can be a "side quest", though. Maybe create an issue to come back to it.

EDIT: It looks like #3315 does this.

from .bindings_config import load_config

ROOT = Path(__file__).resolve().parents[2]
VERSIONS_FILE_PATH = ROOT / "ci" / "versions.yml"

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: Duplicated from bindings_config.py which should own knowing where the canonical location of this file is. Rather than checking for its existence here, bindings_config.py should (and already does) raise an exception when the file doesn't exist.

Comment on lines 20 to 22
if not VERSIONS_FILE_PATH.is_file():
print(f"error: {VERSIONS_FILE_PATH} not found", file=sys.stderr)
return 2

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.

Remove (see comment above).

build_version = yaml.safe_load(VERSIONS_FILE_PATH.read_text(encoding="utf-8"))["cuda"]["build"]["version"]
except (KeyError, TypeError):
print(f"error: cuda.build.version not found in {VERSIONS_FILE_PATH}", file=sys.stderr)
current = load_config(VERSIONS_FILE_PATH).package_for_release_status("current")

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.

Suggested change
current = load_config(VERSIONS_FILE_PATH).package_for_release_status("current")
current = load_config().package_for_release_status("current")

print(f"error: cuda.build.version not found in {VERSIONS_FILE_PATH}", file=sys.stderr)
current = load_config(VERSIONS_FILE_PATH).package_for_release_status("current")
except (KeyError, TypeError, ValueError) as exc:
print(f"error: invalid CUDA toolkit pins in {VERSIONS_FILE_PATH}: {exc}", file=sys.stderr)

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.

Suggested change
print(f"error: invalid CUDA toolkit pins in {VERSIONS_FILE_PATH}: {exc}", file=sys.stderr)
print(f"error: invalid CUDA toolkit pins in {bindings_config.DEFAULT_CONFIG}: {exc}", file=sys.stderr)

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.bindings Everything related to the cuda.bindings module enhancement Any code-related improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants