Repository navigation
Studio loads: recheck fixes for klein 9B KV identity, pinned FLUX.3 cache reads, OOM tile probe, ConvRot-only hosted int8 video - #18982
Conversation
…mpanion remap _resolve_base_repo swaps the KV base (black-forest-labs/FLUX.2-klein-9b-kv) for the stock 9B it borrows its text encoder, VAE and scheduler from. The queued load then wrote that 9B back into base_repo before load_pipeline picked the pipeline class, and a card-only base never reached it at all. A generically named KV GGUF or single file (no "KV" in the repo or file name) therefore ran through the stock Flux2KleinPipeline, advertised the stock inpaint / outpaint workflows, and passed the guard that keeps the base's dense transformer from replacing the KV DiT. _resolve_base_repo now records the base the caller or the trusted card named when the companion remap replaces it (_checkpoint_base_of). The queued load hands it to load_pipeline as _checkpoint_base, and the pipeline class, the dense-substitution guard, the dense prefetch widening and the load state's checkpoint_base read it. Companion fetches still use the stock 9B.
….3 classes The loader fixture patched diffusers.Flux3Transformer2DModel.from_pretrained, so on a diffusers that meets the declared floor (>= 0.39) but predates the FLUX.3 classes all four loader tests failed with AttributeError before running. A class the installed library lacks now gets a stand-in; a present one is patched as before.
…lidated current_snapshot returns the commit it validated, but the loader kept only a bool, and every cache-only component read resolved refs/main again. A concurrent download that moved the shared cache's refs/main between the check and a read handed this load another snapshot's files, one the check never validated, without the cache-miss fallback. The loader keeps the commit and passes it as revision to every cache-only read: model_index.json, the processor, the text encoder, the transformer, the VAE and the stored-dtype probes. A read that falls back to the Hub stays unpinned, as before.
The tile verdict persists a failure only when it repeats and the allocator's num_ooms did not move. Under PYTORCH_CUDA_ALLOC_CONF=backend:cudaMallocAsync that count stays 0 (the async allocator fills none of the native allocator's stats), so a probe on a full card that failed twice with OutOfMemoryError persisted an empty tile list, and every later process on that card skipped the CUTLASS int8 tiles. _probe_tile now counts its own out-of-memory failures, and a probe that saw one does not persist. Editing this module also invalidates the verdicts already stored.
…Rot file With no usable torchao (the Windows ROCm stub), the source check that drops the dense LTX-2.5 DiT shards accepted any hosted .safetensors name. The native read accepts only the ConvRot file, so with UNSLOTH_DIFFUSION_INT8_CONVROT=0 (which resolves the unrotated LTX-2.5-INT8.safetensors), or a listing without the ConvRot file, the load staged 25 GB that the reader then refused before the dense re-plan. The torchao-free commit now counts only the -ConvRot.safetensors file, and with ConvRot turned off the ROCm hosted int8 route (plan, price and torchao-free commit) does not apply, so the load keeps the dense shards and the runtime build, as before that route.
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 |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
[skip ci]
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
Summary
Four fixes found while re-checking recent Studio image and video load changes, one commit each, plus one test-compat fix.
_resolve_base_reposwaps the KV base (black-forest-labs/FLUX.2-klein-9b-kv) for the stock 9B it borrows its text encoder, VAE and scheduler from. The queued load then wrote that 9B back intobase_repobeforeload_pipelinepicked the pipeline class, and a base taken from the model card never reached it at all. A KV GGUF or single file with a generic name (no "KV" in the repo or file name) ran through the stockFlux2KleinPipeline, advertised inpaint / outpaint, and passed the guard that keeps the base's dense transformer from replacing the KV DiT._resolve_base_reponow records the base the caller or the card named (_checkpoint_base_of), the queued load passes it toload_pipelineas_checkpoint_base, and the pipeline class, that guard, the dense prefetch widening and the load state read it. Companion fetches still use the stock 9B.current_snapshotreturns the commit it validated, but the loader only kept a bool. Every cache-only read then resolvedrefs/mainagain. If another download moved that ref in between, the load read files from a snapshot nobody had validated. The commit is now passed asrevisionto every cache-only read (index, processor, text encoder, transformer, VAE, stored-dtype probes). A read that falls back to the Hub is unpinned, as before.num_oomsdid not move. UnderPYTORCH_CUDA_ALLOC_CONF=backend:cudaMallocAsyncthat count stays 0, because the async allocator fills none of the native allocator's stats (CUDAMallocAsyncAllocator.cpp,getDeviceStats). A probe on a full card therefore persisted an empty tile list, and every later process on that card skipped the CUTLASS int8 tiles._probe_tilenow counts its own out-of-memory failures, and a probe that hit one does not persist. Editing the module also invalidates the verdicts already stored..safetensorsname. The native read only accepts the ConvRot file. So withUNSLOTH_DIFFUSION_INT8_CONVROT=0(which resolves the unrotatedLTX-2.5-INT8.safetensors), or with a listing that has no ConvRot file, the load staged 25 GB and the reader then refused it. Now only the-ConvRot.safetensorsfile counts. With ConvRot off, the ROCm hosted int8 route (plan, price, commit) does not apply, so the load uses the dense shards and runtime build as before. This matches the ConvRot gate the image route already has.diffusers.Flux3Transformer2DModel.from_pretrained, so its four loader tests failed withAttributeErroron a diffusers that meets the declared floor (>= 0.39) but predates the FLUX.3 classes. A missing class now gets a stand-in.Tests
New tests fail on the merge base and pass on this branch (base arm = the merge base with the new test files copied in):
test_diffusion_flux2_klein_kv.pyload_pipelinethe KV identity,load_pipelinewiringtest_diffusion_hub_snapshot.pyhf_hub_downloadcache read afterrefs/mainmovestest_diffusion_int8_cutlass_probe_persist.pyok: [])test_video_hosted_int8_fit.pyRelated suites (klein KV, FLUX.3 loader / storage / manual cast, hub snapshot, CUTLASS, gated base, compat preflight, video hosted int8 / native hosted / families, refactor guard): 1676 passed. The 8 failures are the same 8 test IDs on the merge base: 5 MiniMax H3 download-plan tests and 2 FLUX.3 retired-copy tests from a
huggingface_hubwithoutget_cached_repo_tree/ diffusers 0.40, and 1 causal-mask patch test.Not covered
OutOfMemoryErrorwithnum_oomsfixed at 0, which is what the upstream allocator source reports. It was not run on a real card withbackend:cudaMallocAsync.