Repository navigation
Studio video: MiniMax-H3 offline loads reuse hash-matched VAEs cached under the old names - #14698
danielhanchen wants to merge 7 commits into
Conversation
…d conditioner A cache-only load (offline, or an API load that may not download) looked up the post-#14003 vae/official/ and text_encoders/official/ names, missed, and failed with huggingface_hub's bare cache-miss message, although an install staged before the move holds the same bytes under the old names. On a cache miss only, reuse a cached copy whose sha256 matches the unsloth file (the unsloth repo's pre-move path first, then the Comfy-Org repack it was copied from), accept a pre-move local bundle the same way, and otherwise raise an error naming the file, the repo and how to fetch it. Network fetches still go only to unsloth repos.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…e file keeps the Hub source The download plans (native and conditioner) and the loaders now ask one question, h3_pre_move_copy_if_uncached: when the official-path file is not cached and a hash-identical pre-move copy is, the plan stages nothing and the load reads that copy, online or offline. The bundle request builder now hash-checks a pre-move file before routing the load to it, so a same-size file with other bytes keeps the Hub repo instead of failing at load. [skip ci]
…nores unreachable official caches, honours cancel while hashing - A conditioner cached only under its pre-move name stages no entry but still counts in required_bytes. - Only roots the fetch can resolve (live and huggingface_hub's import-time root) let an official-path hit suppress the pre-move copy. - The copied-entry hash loop checks the load's cancel event between chunks; the native load and the conditioner stager surface it as a cancel. [skip ci]
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…ed size instead of hashing it On a cache without symlinks (e.g. Windows) the download plan and the conditioner footprint hashed the 27 GB pre-move conditioner and the VAEs synchronously, with no cancel, inside the first size request of a process. Planners now pass verify=False: the pinned size decides unless a sha256 is already known (blob name or this process's memo). Loads keep the full, cancellable hash check. [skip ci]
… the staged file list When the H3 VAEs are cached only under their pre-move names and another component is missing, the plan already left the VAEs out of the byte count but still listed their official names in the staged entry. snapshot_download only reuses the target repo's cache, so the staged load fetched about 5.8 GB the native loader would never read. Remove those files from the entry so files and bytes agree. [skip ci]
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Closing in favour of #15547. Only installs from before #14003 hit this, and one online load fixes their cache. This PR adds sha256 matching and cache snapshot scans to every H3 load and size request, and it reverses #14003's rule that a load never reads Comfy-cached bytes. That is too much to carry for that case. #15547 keeps the #14003 policy and fixes the part that actually hurts: a cache-only load (offline, or an auto-switch) now names the missing file and says to load once online, instead of a bare |
…ow to fix it (unslothai#15547) Replaces unslothai#14698 with a much smaller change. ## Problem Users who installed MiniMax-H3 before unslothai#14003 have the VAEs cached under the old names. Since unslothai#14003 the native H3 load looks them up under `vae/official/...`, so a cache-only load fails with huggingface_hub's bare `LocalEntryNotFoundError`. That message does not say which file is missing or how to recover. Cache-only loads are offline hosts and API-triggered auto-switch loads (`media_auto_switch.py` loads with `local_files_only = not user_initiated`, passed through `routes/video.py`). A single online, user-started load fixes the cache. ## Fix In the native H3 download loop (`_run_load_h3_native`), when the load is cache-only and the fetch fails with a local cache miss (detected with the existing `VideoBackend._te_fetch_miss`), raise a clear error instead: ``` MiniMax-H3 needs its video VAE (vae/official/minimax_h3_video_vae_fp16.safetensors) from unsloth/MiniMax-H3-GGUF, and it is not in the local Hugging Face cache. This load may only use cached files (offline, or a load Studio started on its own), so it could not download it. Load MiniMax-H3 once while online (or reconnect) so Studio can fetch it; after that it loads offline. ``` The component name comes from the same file to role map `h3_download_error` already uses (now a small shared helper). The original exception is kept as `__cause__`. The load worker stores `str(exc)` as the load progress error, so this text is what the UI and API show. Not changed: the unslothai#14003 policy (no reuse of old names or Comfy-cached bytes, no hashing, no snapshot scans), online loads, and every other error, which still goes through `h3_download_error` as before. ## Tests New tests in `studio/backend/tests/test_sd_cpp_h3_matrix.py` drive `_run_load_h3_native` with the video VAE fetch failing: - cache-only load, `LocalEntryNotFoundError`: raises the new message naming the file, and the text survives the load worker's error handling unchanged (fails on main, passes here) - online load, `LocalEntryNotFoundError`: the same exception object propagates - cache-only load, unrelated `OSError`: the same exception object propagates `pytest -n 4` over `test_sd_cpp_h3_matrix.py`, `test_video_backend.py`, `test_video_offline_load.py`, `test_h3_native_{server,resident,memory_fit,nonfinite}.py`: | | failed | passed | |---|---|---| | main + new tests | 1 (`test_h3_cache_only_load_names_the_missing_vae_and_the_fix`) | 890 | | this branch | 0 | 891 |
Studio: MiniMax-H3 offline loads reuse the identical pre-move VAEs and conditioner
#14003 moved the MiniMax-H3 native VAEs to
vae/official/inunsloth/MiniMax-H3-GGUFand the hosted int8 conditioner totext_encoders/official/inunsloth/MiniMax-H3-FP8. It also dropped the cache aliases to the Comfy-Org repack. Online that costs little: the new paths have the same sha256 as the old ones in the same repo, so huggingface_hub links the existing blob and nothing is downloaded again. A cache-only load is a different story. That covers an offline host, and an API load that may only open cached files. It looks the new filename up in the snapshot, finds nothing, and fails, even though the exact bytes are on disk under the old name.Repro on main, using a seeded HF cache that holds the two VAEs at their pre-move paths (real sha256 blob names, sparse files) and
HF_HUB_OFFLINE=1:unsloth/MiniMax-H3-GGUFvae/...LocalEntryNotFoundErrorComfy-Org/MiniMax-H3vae/...LocalEntryNotFoundErrorThe user sees huggingface_hub's message, which says nothing about why a model that loaded yesterday fails today:
h3_download_erroronly rewords access errors, so this message passes straight through.Change
video_minimax_h3.H3_PRE_MOVE_COPIESpins the sha256 and size of each file this build reads: the two VAEs and the int8 conditioner. It also lists where an older install may hold the same bytes, in order: the unsloth repo's own pre-move path first, then the Comfy-Org repack it was copied from.LocalEntryNotFoundError). Even then a cached copy is used only when its sha256 matches the unsloth file. For a symlinked HF cache entry that is theblobs/<sha256>content address. A copied entry (no symlinks, e.g. Windows) gets hashed, once per process. This is a cache read and never a download. Every network fetch still goes only to the unsloth repos;h3_component_sourceandh3_te_quant_sourceare unchanged.vae/) is accepted the same way. The request builder routes on name and size, and the load checks the hash.Not changed
unsloth/*, as Studio: fetch every video component from unsloth repos #14003 intended.Tests
New tests in
tests/test_video_backend.pydrive_run_load_h3_nativewith the VAE fetch raising a cache miss:They fail on main and pass here.