Skip to content

build: switch to uv as build frontend - #2964

Merged
juenglin merged 3 commits into
NVIDIA:mainfrom
juenglin:uv-as-build-frontend
Sep 29, 2026
Merged

juenglin merged 3 commits into
NVIDIA:mainfrom
juenglin:uv-as-build-frontend

Conversation

@juenglin

@juenglin juenglin commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Switch the wheel CI cibuildwheel jobs to build[uv], and stop installing each built wheel only so echo "ok!" can run.

The dummy test stage existed so Linux could dump sccache stats in before-test. Those stats now run during Linux auditwheel repair. Windows never dumped sccache there, so the extra install was pure overhead. cibuildwheel 4 already installs delvewheel; the extra pip install delvewheel / pip>=25.3 before-build hooks are removed (build[uv] venvs do not include pip). Local pathfinder/bindings wheels stay pinned with UV_BUILD_CONSTRAINT and UV_CONSTRAINT.

That also avoids three throwaway wheel installs per matrix job (bindings + two cuda.core builds), which were a flake surface unrelated to the compile.

Median cibuildwheel step times (seconds) from a recent CI run and this PR's run (before -> after):

step linux-64 linux-aarch64 win-64 win-arm64
bindings 230 → 81 91.5 → 84 220.5 → 202 227 → 211
core (current) 35.5 → 27.5 59.5 → 27 118 → 91.5 117 → 98
core (prev) 70.5 → 42 75.5 → 41 110 → 91.5 skip

The core (current) row is the fairest comparison (tight clusters on both sides). linux-64 bindings 230 → 81 is not: the before cell was bimodal (warm 3.10/3.11 vs colder 3.12+). sccache reporting is unchanged.

Before: https://github.com/NVIDIA/cuda-python/actions/runs/36603697037
After: https://github.com/NVIDIA/cuda-python/actions/runs/36609564172

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Use build[uv] with UV_* constraint env vars so isolated builds pin the
local pathfinder/bindings wheels. Drop pip before-build hooks; uv venvs
do not include pip, and cibuildwheel 4 already installs delvewheel.
Dump sccache during Linux wheel repair instead of installing the wheel
just to echo ok. UV_CONSTRAINT is unused without that test install.
@copy-pr-bot

copy-pr-bot Bot commented Sep 29, 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.

@github-actions github-actions Bot added CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module labels Sep 29, 2026
@juenglin juenglin self-assigned this Sep 29, 2026
@juenglin juenglin added this to the cuda.bindings next milestone Sep 29, 2026
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test b574e83

build --installer=uv calls "uv pip install <build-requirements>", a
regular install where UV_CONSTRAINT applies, not UV_BUILD_CONSTRAINT.
cuda.core dynamically requires cuda-bindings==13.* as a build dep;
for py3.15 there is no cp315 wheel on PyPI, so the local-wheel
constraint is mandatory. Removing UV_CONSTRAINT broke all 3.15 builds.
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test 089b12b

@github-actions

This comment has been minimized.

@juenglin

Copy link
Copy Markdown
Contributor Author

pre-commit.ci run

@juenglin
juenglin requested a review from rwgk September 29, 2026 19:11
@juenglin
juenglin marked this pull request as ready for review September 29, 2026 19:16

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

Reviewed with codex GPT-6-sol ultra: no issues found.

@juenglin
juenglin merged commit e8d9075 into NVIDIA:main Sep 29, 2026
121 checks passed
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

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

Comment on lines +256 to +259
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
"/host/${{ env.SCCACHE_PATH }}" --show-adv-stats &&
"/host/${{ env.SCCACHE_PATH }}" --show-stats --stats-format=json > /host/${{ github.workspace }}/sccache_bindings.json
# force the test stage to be run (so that before-test is not skipped)
# TODO: we might want to think twice on adding this, it does a lot of
# things before reaching this command.
CIBW_TEST_COMMAND: >
echo "ok!"
"/host/${{ env.SCCACHE_PATH }}" --show-stats --stats-format=json > /host/${{ github.workspace }}/sccache_bindings.json &&
auditwheel repair -w {dest_dir} {wheel}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh this is... cute :P

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants