Skip to content

Studio: read the prequant source etag from the repo blob under the shared Hub blob store - #14819

Merged
danielhanchen merged 1 commit into
mainfrom
dh/s3-diff-prequant-shared-blob
Oct 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/s3-diff-prequant-shared-blob

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

huggingface_hub 1.32 and later store Xet downloads once per cache, in <cache>/blobs/<xx>/<xet hash>, and turn each <repo>/blobs/<etag> entry into a relative link to that store. This is on by default, and Studio requires huggingface-hub>=1.32.0.

The prequant cache took the realpath basename of a snapshot file as the source ETag. Under the new layout that basename is the 64-hex Xet hash, which also passes the content-hash check, so every online lookup compared it against the real ETag and reported the cache stale: the first load wrote a checkpoint that later loads never used, and every load re-read and re-quantized the dense weights.

The fix follows the snapshot link chain only until it enters <repo>/blobs and uses that name. The legacy layout and the copied-file layout (Windows without symlinks) resolve exactly as before.

Tests: the new cases in test_diffusion_prequant_cache.py build the shared layout with the hub's own publish_blob_to_shared_store (or by hand on older hubs). They fail on main and pass here (55 passed).

…ared Hub blob store

huggingface_hub 1.32+ links <repo>/blobs/<etag> on to a cache-wide
<cache>/blobs/<xx>/<xet hash> store, so the realpath basename of a snapshot
file is the Xet hash, not the etag, and every online lookup was reported
stale. Follow the link chain only until it enters <repo>/blobs. Legacy and
copied (no symlink) layouts are unchanged.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T23:07:48.670268Z ed813a8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: ed813a874c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit ae01302 into main Oct 23, 2026
2 of 35 checks passed
@danielhanchen
danielhanchen deleted the dh/s3-diff-prequant-shared-blob branch October 23, 2026 02:46
danielhanchen added a commit that referenced this pull request Oct 23, 2026
… (#14878)

Two files merged at 02:46 UTC without the repo formatter, so
pre-commit.ci's `ruff-format-with-kwargs` hook (which runs on all files)
will rewrite them on every PR queued after that:

- `studio/install_python_stack.py` from #14834
- `studio/backend/tests/test_diffusion_prequant_cache.py` from #14819

Same class as #14817 and #14852. `python scripts/run_ruff_format.py`
(the hook's entry point, `ruff==0.6.9`) applied to those two files. Both
parse to identical ASTs before and after, `ruff check` passes, and a
full run of the hook over every tracked Python file on this branch
changes nothing else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant