Repository navigation
Studio: name the quant a diffusion GGUF pick actually loaded, instead of the compute dtype - #8241
Conversation
Picking a GGUF at Q8_0 showed "BF16" in the loaded models row. Nothing on /images/status named the quant: dtype is the pipeline COMPUTE dtype and reads bf16 for every CUDA load, so the row had nothing sharper to print. The chat runtime has published gguf_variant all along. The status payload gains gguf_quant, the quant of the GGUF that is actually backing the transformer. It is null whenever the GGUF is not what ran: a pipeline or single_file load, and a GGUF pick the dense fast path replaced with a torchao build, which transformer_quant already describes. The row then reads the build in the order it is decided: the dense scheme when one engaged, else the GGUF quant, else the pipeline dtype. Video already did this for the first and last of those. It also stops calling a row GGUF when the fast path replaced the GGUF, since that names a file the pipeline never opened. A backend without the field falls back to the dtype, so an older wheel keeps the line it has always shown.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15fe8e4ea3
ℹ️ 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".
| precisionLabel(status.gguf_quant) ?? | ||
| precisionLabel(status.dtype), |
There was a problem hiding this comment.
Populate the quant for native diffusion loads
When a GGUF image load is routed to the native sd.cpp engine (the normal CPU path, enabled MPS, or forced native), SdCppDiffusionBackend.status() in studio/backend/core/inference/sd_cpp_backend.py still supplies only dtype: "gguf" and supplies neither gguf_quant nor model_kind. Consequently this fallback renders only family · GGUF · device, so a selected Q4_K_M or Q8_0 remains unnamed despite the new status contract. Populate both the quant derived from the native state's gguf_filename and the GGUF model kind, or otherwise account for the native status here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and fixed in 3c40093. The native path was the hole: SdCppDiffusionBackend.status() sends dtype "gguf" and no model_kind, so gating the row on model_kind === "gguf" would have dropped both the GGUF chip and the quant for every sd.cpp load.
Resolved by merging rather than by adding a second field. main's #8238 landed the same label fix under gguf_variant, and it already populates it in the native status (sd_cpp_backend.py: extract_quant_token(state.gguf_filename)) and in video.py. So this branch drops gguf_quant and _resident_gguf_quant entirely and keeps its one genuine addition on top of that field: the row keeps the isGguf test, which reads dtype === "gguf" and gguf_variant as well as model_kind, and only suppresses the GGUF chip and prefers transformer_quant when the dense fast path replaced the picked file.
Covered by loaded-models-sources.test.ts: 'a native GGUF image row names its selected quant without model_kind' (no model_kind, dtype gguf -> z-image GGUF Q8_0 cpu) and 'a GGUF pick the dense fast path replaced names that build instead'.
main's #8238 landed the same label fix under gguf_variant, including the native sd.cpp status. Fold this branch's refinement onto that one field instead of adding a second: drop gguf_quant and _resident_gguf_quant, and let the row prefer transformer_quant when the dense fast path replaced the picked GGUF.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
Picking a GGUF at Q8_0 showed "BF16" in the loaded models row. Nothing on /images/status named the quant: dtype is the pipeline COMPUTE dtype and reads bf16 for every CUDA load, so the row had nothing sharper to print. The chat runtime has published gguf_variant all along. The status payload gains gguf_quant, the quant of the GGUF that is actually backing the transformer. It is null whenever the GGUF is not what ran: a pipeline or single_file load, and a GGUF pick the dense fast path replaced with a torchao build, which transformer_quant already describes. The row then reads the build in the order it is decided: the dense scheme when one engaged, else the GGUF quant, else the pipeline dtype. Video already did this for the first and last of those. It also stops calling a row GGUF when the fast path replaced the GGUF, since that names a file the pipeline never opened. A backend without the field falls back to the dtype, so an older wheel keeps the line it has always shown.
|
Post-merge evidence, since this one is easy to mis-state. Two isolated Studio installs, merge base
Worth writing down for anyone reading this back: a PLAIN GGUF load looks identical on both sides. The int8 rather than fp8 is not incidental either: the published Z-Image fp8 artifact predates the activation scale floor, so the loader refuses it and the load fails before reaching this state. |

The bug
Pick
unsloth/Z-Image-Turbo-GGUFatQ8_0. The picker chip readsGGUF · Q8_0. The Loaded models row beside it reads:The two disagree, and the row is the one that is wrong.
What is actually resident, since the label cannot be trusted to say
Loaded through the real backend on a B200, then inspected the module rather than the payload. Isolated, empty cache root;
unsloth/Z-Image-Turbo-GGUF,z-image-turbo-Q8_0.gguf, everything else left on auto:The Q8_0 GGUF is what ran. The transformer is 7.22 GB of uint8 Q8_0 blocks, not a 12.3 GB bf16 tensor in sight. So this is a display bug, not a substitution: nothing bf16 was loaded, and the row simply had nothing better to print.
dtypeis the pipeline's COMPUTE dtype. It isbfloat16for every CUDA diffusion load, GGUF or not, because that is what the GGUF blocks dequantise INTO per matmul. Reading it as a precision reports "BF16" for a Q6_K pick, a Q8_0 pick and a BF16 pick alike. Nothing on/images/statusnamed the quant at all, so the row could not have shown it.The chat runtime has published
gguf_variantall along, which is why a chat row saysGGUF · Q4_K_Mand an image row does not.The fix
Backend.
/images/statusgainsgguf_quant: the quant of the GGUF that is actually backing the transformer. It is null whenever the GGUF is not what ran, so the field can never contradict the build:pipeline/single_fileload carries no GGUF;transformer_quantalready describes that one (its contract is "null = the GGUF ran as-is");Frontend. The row reads the build in the order it is decided: the dense scheme when one engaged, else the GGUF quant, else the pipeline dtype. Video already did the first and last of those; this is the missing middle, applied to images.
It also stops calling a row
GGUFwhen the dense fast path replaced the GGUF, because that names a file the pipeline never opened. That case is real and measured: with the hosted pre-quant checkpoint already cached, the sameQ8_0pick loadsunsloth/Z-Image-Turbo-FP8instead,pipe.transformerholds 239Float8Tensorweights and zeroGGUFParameter, and the row saidGGUF · BF16 · cudafor it too. It now saysz-image · FP8 · cuda.A backend without the field falls back to the dtype, so an older wheel keeps the line it has always shown.
Verification
Both rows driven through the real UI against a real load, picker chip and panel captured together:
main:Image · z-image · GGUF · BF16 · cudabeside a chip readingGGUF · Q8_0;Image · z-image · GGUF · Q8_0 · cuda, and/images/statuscarries"gguf_quant": "Q8_0".Tests: 5 added to
studio/backend/tests/test_diffusion_backend.py, 2 tostudio/frontend/tests/loaded-models-sources.test.ts, 1 toloaded-models-backcompat.test.ts.Mutation tested on a committed copy, 9 mutants, each caught by the named test, suite green after restoring:
gguf_quantalways nulltest_status_names_the_gguf_quant_that_actually_rantest_status_drops_the_gguf_quant_when_the_dense_path_replaced_the_gguftest_resident_gguf_quant_only_answers_for_a_gguf_it_can_nametest_resident_gguf_quant_only_answers_for_a_gguf_it_can_nametest_status_carries_no_gguf_quant_when_nothing_is_loadedtest_diffusion_status_response_declares_the_gguf_quantstudio/backend/tests: 19130 -> 19135 passing, FAILED/ERROR line set byte-identical to the merge base (85 lines, all pre-existing environment failures).studio/frontend: 1086 -> 1089 passing, failing set identical (37, all pre-existing).npm run typecheckandnpm run buildclean.