ci: Pin CPU-only torch through the uv torch-backend setting - #6825
Open
patelchaitany wants to merge 2 commits into
Open
ci: Pin CPU-only torch through the uv torch-backend setting#6825patelchaitany wants to merge 2 commits into
patelchaitany wants to merge 2 commits into
Conversation
The CI requirement files are compiled without a torch backend, so their
hashes describe PyPI wheels, but Makefile:110 syncs them on Linux with
--torch-backend cpu, which serves torch==2.13.0+cpu and
torchvision==0.28.0+cpu from download.pytorch.org. Those are different
builds with different hashes:
Failed to download `torchvision==0.28.0+cpu`
Hash mismatch for `torchvision==0.28.0+cpu`
The divergence has existed since feast-dev#6588 added the flag. Both the old and
the new uv redirect to the CPU index; what changed is verification. uv
0.12.11 began to "apply hashes from public-version pins to matching
local versions when no exact local-version hash is provided", so the
PyPI hashes recorded for torchvision==0.28.0 are now checked against the
+cpu wheel. Earlier releases found no hash for the local version and
skipped the check. uv is unpinned in the workflows, so CI moved from
0.12.7 to 0.12.11 and every job began failing in the install step.
Set torch-backend in [tool.uv] rather than passing it on the command
line. The setting is read by every uv pip command, so compile and sync
can no longer disagree about where torch comes from. An explicit index
with [tool.uv.sources] would not serve, because the pip interface
applies sources only at compile time and sync would then fail to find
the +cpu builds at all.
Compile the CI locks universally so that one file can serve both the
Linux and macOS runners, pinning each variant with its own hashes:
torch==2.14.0+cpu ; sys_platform != 'darwin'
torch==2.14.0 ; sys_platform == 'darwin'
The install-time override is then redundant and comes out, and pixi
raises its uv floor to a release that understands the setting.
Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6825 +/- ##
=======================================
Coverage 47.08% 47.08%
=======================================
Files 419 419
Lines 51877 51877
Branches 7525 7525
=======================================
Hits 24428 24428
Misses 25700 25700
Partials 1749 1749
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
patelchaitany
force-pushed
the
ci/pytorch-cpu-index
branch
2 times, most recently
from
September 10, 2026 11:31
36c6951 to
2ec44b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Every CI job currently fails in the install step:
The CI requirement files are compiled without a torch backend, so their hashes describe PyPI wheels, but
install-python-dependencies-cisynced them on Linux with--torch-backend cpu, which servestorch==2.13.0+cpuandtorchvision==0.28.0+cpufromdownload.pytorch.org. Those are different builds with different hashes.The divergence has existed since #6588 added the flag; what changed is verification. uv 0.12.11 began applying hashes from public-version pins to matching local versions when no exact local-version hash is provided, so the PyPI hashes recorded for
torchvision==0.28.0are now checked against the+cpuwheel. Earlier releases found no hash for the local version and skipped the check. uv is unpinned in the workflows, so CI moved from 0.12.7 to 0.12.11 and every job began failing.Approach
Set
torch-backendin[tool.uv]rather than passing it on the command line. The setting is read by everyuv pipcommand, so compile and sync can no longer disagree about where torch comes from, and the install-time override is then redundant and comes out.An explicit index with
[tool.uv.sources]does not serve here. The pip interface applies sources only at compile time;uv pip syncignores them, so the+cpubuilds would not be found at all:The CI locks are compiled with
--universalso one file can serve both the Linux and macOS runners, pinning each variant with its own hashes:Without
--universalthe lock pins an unmarkedtorch==2.14.0carrying PyPI hashes. Linux still resolves that to2.14.0+cpu, because==2.14.0matches the local version under PEP 440, and the download then fails verification — the original breakage in a different guise.Finally, pixi raises its uv floor. The environment was locked to uv 0.6.14, which does not know the field: it emits
unknown field torch-backendas a warning during settings discovery, exits 0, and resolves the CUDA build anyway. Compiling under it produced plaintorch==2.14.0and fifteennvidia-*pins, so the setting was silently inert. The field is rejected through 0.9.13 and accepted from 0.9.18; pixi now provides uv 0.12.12, matching the version CI installs.No
nvidia-*package remains in any CI requirements file, which is what #6588 set out to achieve.Which issue(s) this PR fixes:
None filed; this repairs CI on master.
Checks
git commit -s)Testing Strategy
Verified locally, on a macOS host, so the full Linux install was not exercised end to end:
uv pip sync --dry-run --python-platform x86_64-unknown-linux-gnuagainstpy3.10-ci-requirements.txtresolves all 440 packages and selectstorch==2.14.0+cpuandtorchvision==0.29.0+cpu.download.pytorch.organd verifies clean — the specific artifact that was failing.--universalis load-bearing rather than cosmetic.CI on this PR is the actual proof.