Repository navigation
Studio: match hosted prequant files on the full base repo id, and stop retrying a failed portable VAE fold - #19012
Merged
Merged
Conversation
…quant checks _same_base_model matched on the repo name alone, so someone/Qwen-Image-2.1 counted as Qwen/Qwen-Image-2.1 and every hosted prequant reader could load the official prequantised weights instead of the fine-tune's own. Two Hub ids now have to be the same repo (case-insensitive, after folding the unsloth mirrors and the retired full copies onto their upstream). A local path keeps the name compare, as family_prequant_repo expects for a local copy of the base.
…s not retried every decode On the portable path (no fused kernels) a non-OOM failure with the fold engaged was raised to the tiles without marking the decoder, so every later decode tried the fold again first. Mark the decoder, retry this decode once without the fold, and skip it from then on, as the kernels path already does after a strip failure. OOM and failures outside the fold still go to the tiles.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
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.
Summary
Two small follow-ups on main for the diffusion stack.
1. A fine-tune named like the official repo no longer loads the official prequantised weights
_same_base_model(studio/backend/core/inference/diffusion_prequant.py) accepted any two ids whose last path segment matched. Sosomeone/Qwen-Image-2.1counted asQwen/Qwen-Image-2.1, and every hosted prequant reader that runs this check (the torchao prequant loader, the text encoder prequant check, the converted single-file check and the fp8 training seed) could load the official prequantised DiT in place of the fine-tune's own weights.Now:
canonical_base(theunsloth/*mirrors), and the retired full copies (unsloth/flux-3-image-klein[-base]) map to their upstream too./models/Qwen-Image-2.1,C:\models\Qwen-Image-2.1, or a relative directory that exists) still uses the name compare as before.family_prequant_repodepends on that for a local copy of the base, and so does its test.Every
base_model_idvalue I could find in the hosted files was checked against its official id, every case spelling, its declared mirror and its retired copy. These are the ids in theunsloth_metadataheader of each root.safetensorsin everyunsloth/*repo Studio names, read from the live Hub headers. All of them still match. The new test lists them, along with every pair in_ALL_MIRROR_PAIRSand_RETIRED_FULL_COPIES.2. A failed upsample fold on the portable VAE path is not retried on every decode
On the portable whole-map decode (no fused kernels: ROCm, MPS, CPU, or CUDA when the kernels are not usable), a non-OOM failure with the upsample fold engaged was re-raised to the tiles without marking the decoder. Every later decode tried the fold again before it fell back.
Now
full_map_decodemarks the decoder (_unsloth_vae_fold_failed) when a portable run fails while the fold is engaged. It then retries that decode once with the fold off, and later decodes skip the fold. This is the same pattern the kernels path already uses with_unsloth_vae_strips_failed. Since #18995, that strips mark also turns the fold off. Now both marks feed the samefoldswitch and every retry runs with the fold off, so the decoder has one fold-off path, not two. Other behaviour does not change:_unsloth_vae_strips_failedand retries on the torch ops without the fold, as in Studio ROCm: explicit W8A8 only on gfx1151, fold the VAE upsample in strips #18995._fold_full_max) until the fold fails on that decoder.Tests
tests/test_diffusion_prequant_same_base.py(new, 85 cases): on main, 7 fail (the same-name fine-tune cases and the text encoder / fp8 training readers). With the fix, all 85 pass. The 78 positive cases pass on both.tests/test_diffusion_vae_fold_failure.py(new, 3 cases): on main, the fold-failure case fails because the decode raises and the fold is tried on every call. With the fix, all 3 pass. The OOM case and the failure-outside-the-fold case pass on both.tests/test_video_h3_te_quant.py::test_the_index_compare_has_no_tail_name_tolerance: its precondition asserted thatte_base_equivalentacceptssomeone/MiniMax-H3, which was the hole being closed. It now asserts that the Hub fine-tune is refused and that a local path is still tolerated.get_cached_repo_tree, and diffusers 0.40 is older than some families need.get_cached_repo_treeimport reason.Not covered here
base_identity) still uses the repo name, so it is coarser than the new compare. Two bases share a key only when their dense source bytes are also identical, so the cached weights are the same either way. The key is left unchanged so existing local caches stay valid.