GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Stop add_cpu_torch_hashes failing on a universal torch split by haoxu0 · Pull Request #6959 · feast-dev/feast

Conversation

@haoxu0

@haoxu0 haoxu0 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

What is broken

make lock-python-dependencies-all cannot complete on master. It aborts after compiling the first file:

ValueError: Missing CPU hashes for torch==2.14.1+cpu
make: *** [lock-python-dependencies-all] Error 1

Because the target begins with rm -rf sdk/python/requirements/*, a run leaves the tree with 14 of the 15 requirements files deleted and nothing regenerated.

Why

uv pip compile --universal --torch-backend cpu splits torch by marker, so the lock holds two pins per package. This is the shape in all three committed py3.*-ci-requirements.txt today:

torch==2.14.0 ; sys_platform == 'darwin'
torch==2.14.0+cpu ; sys_platform != 'darwin'
torchvision==0.29.0 ; sys_platform == 'darwin'
torchvision==0.29.0+cpu ; sys_platform != 'darwin'

add_hashes looked every entry up by appending +cpu to its version:

hashes = cpu_hashes.get((name, f"{version}+cpu"))

For the second pin of each pair that asks for 2.14.0+cpu+cpu, which no resolve can produce, so the lookup missed and the script raised.

Why the tests did not catch it

test_cpu_hashes_preserve_pypi_hashes_and_pins feeds in a bare torch==2.13.0 and nothing else, so the +cpu pin that a real --universal resolve emits is never exercised. The script and its tests landed together in #6188, and the requirements files were last regenerated before that, so the target appears not to have been run since.

The change

The +cpu pin is already the CPU wheel, so it needs no hashes added and is now returned untouched.

Returning it, rather than normalising the lookup key to version.removesuffix("+cpu") + "+cpu", is deliberate: both stop the crash, but normalising would union the CPU resolve's hashes into that entry and could widen the set of artifacts the pin accepts. Returning it leaves the hash set exactly as the resolver wrote it, so no lock can start accepting an artifact it did not accept before.

A genuine version mismatch still raises, which the existing third test covers unchanged.

Verification

Two tests added, for a single marker split and for the torch + torchvision pair the lock actually contains, both asserting idempotency. sdk/python/tests/unit/infra/scripts/test_cpu_torch_hashes.py: 4 passed.

Checked against real data — add_cpu_hashes run over each committed file with the CPU pins a --torch-backend cpu --no-deps resolve would return:

file before after
py3.10-ci-requirements.txt raised OK, idempotent
py3.11-ci-requirements.txt raised OK, idempotent
py3.12-ci-requirements.txt raised OK, idempotent

ruff check and ruff format --check clean.

I found this trying to satisfy a review on #6958, which asks for regenerated locks and cannot be done until this is fixed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@haoxu0
fix: Stop add_cpu_torch_hashes failing on a universal torch split
0140f54
`make lock-python-dependencies-all` aborts before it writes a single
requirements file:

    ValueError: Missing CPU hashes for torch==2.14.1+cpu
    make: *** [lock-python-dependencies-all] Error 1

`uv pip compile --universal --torch-backend cpu` splits torch by marker,
so the lock it produces holds two pins per package:

    torch==2.14.1 ; sys_platform == 'darwin'
    torch==2.14.1+cpu ; sys_platform != 'darwin'

`add_hashes` looked each entry up by appending `+cpu` to its version. For
the second pin that asks for `2.14.1+cpu+cpu`, which cannot exist, so the
lookup missed and the script raised.

The `+cpu` pin is already the CPU wheel and so needs nothing added, and it
is now returned untouched. Returning it rather than normalising the lookup
key keeps its hash set exactly as the resolver wrote it, so this cannot
alter any artifact a lock already accepts.

The existing tests passed because their input carries only a bare
`torch==2.13.0`, never the split a real `--universal` resolve emits. Two
tests are added for that shape, including the torch and torchvision pair
the lock actually contains, and both assert idempotency. Checked against
all three committed `py3.*-ci-requirements.txt`: each now runs clean and is
idempotent, where each raised before.

The genuine mismatch case still raises, which the untouched third test
covers.

Signed-off-by: hao-xu5 <[email protected]>
@haoxu0
haoxu0 requested a review from a team as a code owner October 7, 2026 07:04
@haoxu0 haoxu0 mentioned this pull request Oct 7, 2026
feat: Add Lance optional dependencies #6958
Merged
@codecov-commenter

codecov-commenter commented Oct 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.32%. Comparing base (9d42729) to head (2cded3e).
⚠️ Report is 1 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6959      +/-   ##
==========================================
- Coverage   49.32%   49.32%   -0.01%     
==========================================
  Files         443      443              
  Lines       55094    55094              
  Branches     8017     8017              
==========================================
- Hits        27176    27175       -1     
  Misses      26035    26035              
- Partials     1883     1884       +1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 50.71% <ø> (-0.01%) ⬇️
see 1 file with indirect coverage changes

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf930e5...2cded3e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@haoxu0
Merge branch 'master' into fix/cpu-torch-hashes-local-version
a1a289f
@haoxu0 haoxu0 added the ok-to-test label Oct 8, 2026
@haoxu0
Merge branch 'master' into fix/cpu-torch-hashes-local-version
2cded3e
@haoxu0

haoxu0 commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: #6906 merged the same fix (identical approach -- return match[0] for a +cpu pin) and additionally normalises pins in main(), which this PR did not.

The regression tests from here are still missing on master, so I have reopened just that part as #6980. Closing this to avoid proposing a change that is already in.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@haoxu0 haoxu0 mentioned this pull request Oct 8, 2026
test: Cover the universal torch split in add_cpu_torch_hashes #6980
Merged
@haoxu0 haoxu0 closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ok-to-test

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@haoxu0 @codecov-commenter
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.