Skip to content

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

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

rwgk wants to merge 3 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.*. The planned retained CUDA 12 milestone is then excluded from CUDA 13 version derivation.

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).
  • Selectors follow the CUDA major, so toolkit-minor updates need no selector edit. Layer 7 (ci: retire legacy branch-based bindings maintenance #3322) adds the metadata consistency check.

Where to look

All changes (10 files, +213 / -25)
  • 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.*.
Validation
  • Full CI passed at the pre-rebase head 1142000b (run 41171069718, 104 jobs).
  • Local validation at 77981309e15bed0531b4ca595acf89d4095c90af: 309 CI-tool tests and configured workflow lint passed. Full-stack CI on #3322 passed at 126ed74fb5bbfbc91a04e50557cf936efef4da7f (105 successful jobs; one expected skip).
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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

Changed the tooling jobs to Python 3.11, exercising the supported lower bound. implementation.

Comment thread .github/workflows/ci.yml Outdated
- 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

Removed --noconftest and the stale explanation; these tests now use normal pytest collection. implementation.


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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

#3315 extends this check to the CUDA 12 bindings root. implementation.

Comment thread cuda_bindings_13/pyproject.toml Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

Changed the selector to v13.*, so toolkit-minor changes need no selector edit. The metadata check and documentation now follow that contract. implementation; metadata check.

Comment thread cuda_python/setup.py Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

The metapackage uses the same v13.* selector. implementation.

Comment thread .github/workflows/ci.yml Outdated

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

As noted in the edit, #3315 supplies ci/pyproject.toml. implementation.

Comment thread ci/tools/check_pixi_cuda_version.py Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

Removed the duplicate path constant and delegated loading to bindings_config. implementation.

Comment thread ci/tools/check_pixi_cuda_version.py Outdated
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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

Removed the check; the configuration loader reports a missing file. implementation.

Comment thread ci/tools/check_pixi_cuda_version.py Outdated
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")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

The caller uses the loader's default configuration path. implementation.

Comment thread ci/tools/check_pixi_cuda_version.py Outdated
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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

The diagnostic refers to bindings_config.DEFAULT_CONFIG. implementation.

rwgk added 3 commits November 3, 2026 21:37
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@rwgk
rwgk force-pushed the rwgk/cb12-staged-01-config branch from 98ed2a6 to 7798130 Compare November 4, 2026 06:08

@rwgk rwgk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

— codex GPT-6 on behalf of Ralf —

The blocker in your review is addressed: the bindings and metapackage selectors use v13.*, with matching tests and guidance. Toolkit-minor updates no longer require a selector edit.

All 15 inline comments now have direct replies with source links. The smaller tooling/configuration changes are applied; the CUDA 12 Pixi check and CI package are supplied by #3315. This corrected layer can serve as the common prerequisite for the retained-tag/bootstrap cleanup discussed there.

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