Repository navigation
Studio: official image picks default to the hosted FP8 or INT8 checkpoint - #10883
Conversation
…family refuses it
…ry bf16 blocker in the picker
…wo picker blind spots
A dense-quant host does not load an official BF16 image pipeline in BF16, and it no longer downloads the BF16 shards either: the backend resolves an auto load to the hosted pre-quantised transformer in unsloth/<Model>-FP8. The rows said neither. Every eligible row read a bare "Fast", and MiniMax H3, which used to say "Fast FP8", had been flattened to match. /api/system now reports dense_quant_schemes beside dense_quant_supported: the schemes this host can actually run, best first, so fp8 on Ada and up, int8 on Ampere, empty where the path is unsupported. Read it and say so. - src/lib/dense-quant-schemes.ts normalizes the field. Absent or malformed is [], never a guessed fp8: an older backend sends only the boolean, and a guess would put FP8 on a row an Ampere card runs at INT8. - densePerfSuffix names the scheme, so a row reads "Fast FP8" or "Fast INT8", and "Fast" only where the host named none. h3PerfSuffix reads the same list, which restores H3's own precision without hard-coding it. - The catalog carries prequantRepo and per-scheme prequantSizeGb for the four families with hosted artifacts, and the fit rules size a dense-quant host's rows by the quantised checkpoint plus the companions the quant leaves alone. A 40 GB card fits Z-Image-Turbo at 24.4 GB where it does not at 30, so pickDefaultArtifact routes it to the official row rather than down the quant ladder. The two schemes are sized apart, since they are different artifacts: Qwen-Image is 19.06 GB at fp8 and 31.73 at int8. The qualifier's dedup now matches on its first word, or a variant already called Fast would read "HiDream I1 (Fast (distilled)) (Fast FP8)". Chips are untouched: they state the precision the artifact is PUBLISHED at, which is what tells two rows of one group apart, and the host cannot rewrite that. npm test 7299 pass / 0 fail, typecheck clean, catalog:check passes.
An official kind == "pipeline" pick with the precision left to us always ran the released bf16 denoiser, even where the family table already names a hosted FP8 or INT8 checkpoint of those same weights. MiniMax-H3 has resolved an unset precision to its hosted denoiser for a while now, and the video loader seeds a conventional pipeline the same way; this is the image half of that rule. The decision has to be settled before a byte moves, because it changes what is pulled: taken inside the loader, the plan stages the released shards the load never opens and the replacement arrives inline, outside the load's progress, cancel and disk preflight. So _pipeline_planned_denoiser_scheme resolves auto to a concrete scheme against the card this load lands on, requires a usable hosted source, sizes the artifact with resolve_dense_quant_candidate and judges an artifact-sized _plan_memory against the card's CAPACITY, which is the one reading a pre-download plan can trust while the previous pipeline is still resident. It returns the scheme, None (no artifact: the released shards stay and the loader's in-memory quantise handles it) or a declined sentinel when the artifact-sized plan would still offload, since torchao tensors reject offload hooks. speed_mode="off" and transformer_quant="none"/"off" keep the released weights, a LoRA bake keeps the dense path, and the per-component assemblers (krea, ideogram) are refused because their loaders never see pipe_kwargs. The plan then drops transformer/*.safetensors through is_prequant_covered_weight and keeps transformer/config.json, which the seeding loader meta-inits from; the artifact is counted, staged as its own entry and carries the denoiser's share of the unified-memory verdict. _dit_prequant_plan_source confirms the checkpoint on the Hub first, so only a file that really resolves earns the right to drop those shards. A GGUF pick is unchanged: there the artifact is a second denoiser beside one already on disk, so an auto quant still only uses a cached one.
…g it later The load half of the same change. _run_load threads the settled scheme through the staging phase: the released shards are dropped from the pull, the exact names dropped are recorded so a seed that does not land can top them up, the artifact's bytes join the progress estimate and its repo is claimed against the delete-cached guard, and the checkpoint is fetched under this load's cancel event rather than under the load lock after eviction. The plan's answer is PINNED into the load, decline included: the pull was scoped on it, so the loader must not re-take the decision against post-eviction free memory. load_pipeline re-plans against the artifact's size before the unified-memory refusal, then hands from_pretrained a transformer= built by load_prequantized_transformer, beside the pre-cast text encoder it already injects. The quantised weights are what gets built, so the build peak is the artifact rather than the bf16 shards it stands in for, and the in-memory quantize_transformer below is a no-op for this load. Seeding stays best-effort. An empty injection re-plans at bf16, re-runs the refusal and restores the skipped shards before assembly, since from_pretrained treats a local snapshot as terminal and would otherwise raise on a directory with no denoiser in it. A live free reading smaller than the capacity the plan used takes the same path. An explicit scheme that cannot be honoured still fails closed exactly where it did before. resolved.transformer_quant names the file that produced the pixels: the scheme alone cannot tell the hosted artifact from a runtime quantise of the released weights, and the two do not render the same image. It goes in a new "artifact" key rather than in "source", which says whether the caller or the backend chose the precision and is what renders the "Auto: FP8" badge.
One bit cannot tell an Ampere host (int8) from an Ada one (fp8), and both have hosted checkpoints an official pick now defaults to, so a picker row that wants to name the precision it is offering has nothing to read. dense_quant_schemes carries the auto ladder for this host, best first, from auto_scheme_candidates: the same ladder, deny list and smoke probe the loader's own selector reads, so the row and the load cannot disagree about what auto allows. A mixed host answers with the intersection, since the picker cannot see which card a load will land on, and an incapable host answers with an empty list. Resolved in the same pass as the capability bit and read from that cache, so the polled route imports neither torch nor torchao and walks the visible cards once, not twice.
Hermetic, torch and diffusers stubbed, the Hub a fixture. The plan drops the released shards while keeping transformer/config.json and counts the artifact as its own entry; an unplanned or declined pick plans exactly as before; a GGUF pick still never sizes an uncached checkpoint. The settle is exercised across the tri-state, speed=off, a baked LoRA, a definite-offload request, a family and a base with no hosted artifact, the per-component assemblers and an artifact-sized plan that still offloads. The pin is checked in both directions: a checkpoint that did not resolve on the Hub keeps the shards, and a decline survives into the load. At the load, a seeded denoiser engages the quant with no second conversion and the resolved record names the hosted file; an empty injection and an offloading re-plan both restore the shards and fall back to the in-memory quantise; a direct call with no plan phase behaves as it did before. The capability suite's "one bit, not a scheme list" rule is replaced by the contract that supersedes it, plus per-host coverage of the published ladder.
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. |
|
@codex review |
|
@codex security review |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
…ain (#10988) * Say which unsloth_zoo revision Core tested, and warn when it is not main resolve-zoo-ref pins the unsloth_zoo sha in a separate gating job. A re-run with --failed re-runs only the failed jobs and reuses the successful ones, so a re-run of a red Core zoo job keeps the sha it was handed on the first attempt, however long ago that was. That makes re-running to confirm a landed unsloth_zoo fix actively misleading. It re-tests the revision from before the fix, fails with the same errors, and says nothing about why. Observed on #10883: the Core zoo jobs started at 05:32 on the 15th and failed on gemma4 and flashinfer tests that unsloth_zoo #1219 and #1220 had fixed hours earlier, because the resolve job on that run had started at 19:29 the previous day and pinned 055c049. The only way to see it was to read the resolve job's log from the first attempt and notice the timestamp. So record the revision in the job, and warn when it is behind main, naming both shas and saying that a full re-run is what picks up main. Checked both directions against the live repo: silent when the pinned sha is main, warns on 055c049. * Stop the revision notice failing the step it reports on The lookup was written as head="$(git ls-remote ... | cut -f1)" and the step runs under `set -euxo pipefail`. pipefail hands git's status to the pipeline, the pipeline's status becomes the assignment's, and -e ends the step. So a DNS blip on a diagnostic would fail a Core cell whose clone, install and whole suite had already passed. That is the opposite of what this change is for, and the PR description claimed it could not happen. It can: `set -euxo pipefail; head="$(false | cut -f1)"` exits 1 before the next line runs. Absorb the failure inside the substitution, so an unanswerable lookup leaves head empty and the check stays quiet. Guarded behaviourally rather than by reading: the new test extracts the block from the action and runs it under the same shell flags against a stubbed git, covering a lookup that fails, one that answers nothing, a revision behind main and a revision that matches. Restoring the unguarded form fails two of them. The structural assertion is there because the behavioural ones also pass if the guard is moved outside the substitution, which silences the assignment but not the pipeline. * Bound the revision lookup in time as well as in status The previous round stopped a failing lookup from ending the step. A lookup that HANGS is the same hazard by another route, and || true cannot reach it: nothing has exited, so there is nothing to absorb. git applies no timeout to ls-remote and no low-speed limit is configured, so a connection that opens and then stalls would hold this step until the job's own 25 or 35 minute limit killed the cell. Again after the clone, the install and the whole suite had already passed, which is the outcome this block must never cause. An external timeout bounds it. timeout exits 124, which the existing guard absorbs like any other failure, and both jobs using this action run on ubuntu-24.04 where timeout is coreutils. The new test reads the bound out of the action, stubs git to sleep six times that, and fails if the block does not come back inside it. Removing the timeout fails it. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Word the warning for a pinned ref as well as a stale re-run The remedy was stated unconditionally: re-run ALL jobs to pick up main. That is right for the case this warning was added for and wrong for the other one. A workflow_dispatch run that pinned unsloth_zoo_ref on purpose reaches the same code, because resolve-zoo-ref hands over a sha either way and the action cannot tell the two apart. Re-running preserves the original inputs, so that run resolves the same non-main ref again and warns again, having been told to do something that cannot work. Say both readings instead. I did not plumb a flag through from the workflow to distinguish them: that means a new action input kept in sync at two call sites, which is a fresh way for this to rot, and the message is short enough to hold both cases. A test pins the contract, and restoring the unconditional wording fails it. * Run the action guards on action-only changes, and stop misreading a moving main Two holes, both found in review. The guard could be absent for the change it guards. This test reads .github/actions/core-cpu-setup/action.yml and runs under tests/studio, which is Backend CI's Repo tests (CPU, studio). Backend CI is path-filtered and did not list .github/actions, so a PR touching only the action ran Core -- which does list the action in its own filter, but does not execute tests/studio -- and skipped Backend CI, which does. Nothing would have run against the change. That is not specific to this file: nine tests under tests/studio assert properties of composite actions, covering cache naming, install phase timing, uv and pip cache discipline. None of them ran on an action-only change. Adding .github/actions to the filter covers all nine, and follows the reasoning the file already applies to install.sh. tests/studio/test_local_actions_are_in_path_filters.py enforces the neighbouring rule, that a workflow lists the actions it uses. The new test is the other direction: a workflow must also list the actions its TESTS read. Separately, the warning blamed a --failed re-run for every mismatch. A first attempt can mismatch too: resolve-zoo-ref pins main in the gating job and this step asks again only after the whole install, so main advancing in between is enough. That was a wrong diagnosis rather than a vague one, and it now names both causes. Both mutation-checked: removing the path entry and dropping the clause each fail their test. * Skip this file where GNU timeout is not there to run it The marker only asked for bash. Stock macOS has bash and no GNU timeout -- it is gtimeout, from coreutils -- which tests/sh/test_llama_build_jobs.sh already records for the same reason. There the bounded lookup fails, the guard absorbs it exactly as designed, head comes back empty, and the two tests that expect a warning fail. So a developer running the suite on a Mac gets two red tests describing nothing about their change. Reproduced by hiding timeout from PATH: head comes back empty and no warning is emitted. The marker now asks for both tools and names whichever is missing. The PATH handed to the subprocess was hardcoded to /usr/bin:/bin, which could disagree with that check in the other direction: a Mac WITH coreutils has timeout on PATH, shutil.which finds it, the marker does not skip, and the fixed PATH still would not find it. It now takes the caller's PATH with the stub directory in front, so the check and the run see the same tools. The action only ever runs on ubuntu-24.04, so skipping gives up no coverage that exists. Verified both ways: 9 pass with timeout present, 9 skip without it. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Tighten the comments this PR added One block accrued per review round. Verified comment-only two ways, since the shared gate cannot lex YAML: the action's executable lines are identical with comment lines stripped, and the test file's AST is identical ignoring docstrings. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…F as Slow Three picker changes, all in the row suffix and the Precision control. The dense row named whichever scheme the host reported first, so the same model read as "Fast INT8" on one card and "Fast FP8" on another, and it renamed itself whenever the auto ladder was reordered. The suffix now names the TIER: int8, fp8 and mxfp8 all render as "Fast FP8", the name users know for the 8-bit fast path. A 4-bit scheme still names itself, since it is a different quality tier. What actually loaded is unchanged and still reported by the resolved record on the loaded-models card. Only unsloth/MiniMax-H3-GGUF carried the "(Slow)" tag, though every diffusion GGUF is in the same position: the native engine has no low-precision tensor-core path and no compiled dense transformer, so it is the slow row wherever a dense row sits beside it. The tag now comes from the artifact format rather than the repo id, for image and video groups. Audio GGUFs are left alone, since their whisper.cpp and llama.cpp rows have no dense sibling to be slow against. Off an accelerator (Mac, or a CPU-only host) the GGUF is the only thing that runs, so the tag is dropped there: it would compare the user's one option to something they cannot pick. For the same reason the Precision control on the image and video pages no longer lists FP8, INT8, NVFP4 and MXFP8 on such a host, since the loader refuses them. A host whose backend reports no capability yet keeps the full list rather than losing controls it may well honour.
…-default # Conflicts: # studio/frontend/src/features/images/images-page.tsx # studio/frontend/tests/resolved-precision.test.ts
…-default # Conflicts: # studio/backend/core/inference/diffusion.py # studio/backend/tests/test_diffusion_backend.py # studio/backend/tests/test_diffusion_routes.py
…-default # Conflicts: # studio/backend/core/inference/diffusion.py
The media picker memoises its option list on `denseQuantSchemes`, and this branch gives the GGUF rows a host-dependent `(Slow)` suffix. `refresh_memory=true` re-probes free host RAM behind every footprint estimate, so the GPU snapshot is legitimately new on nearly every poll and the schemes array was rebuilt with it, even though the list itself is a hardware capability that never moves. That rebuilt the whole option list per probe, detaching and re-creating every row it had just drawn, which is a visible flicker and made the image model footprint Playwright run time out clicking a row that kept vanishing. Carry the previous array forward when its contents are unchanged. The refreshed RAM reading is still published; a host that really changes its ladder still gets the new array.
…-default # Conflicts: # studio/frontend/src/features/images/images-page.tsx
…ntises main added images-precision-gate-native.test.ts to stop the Precision control being offered to native sd.cpp, which runs no torchao path. Two of its assertions encode the old rule that only a GGUF pick can be quantised, which is the rule this branch changes: an official pipeline pick now resolves to the hosted FP8 or INT8 checkpoint and is quantised in place. The engine invariant it was written to protect is kept and still asserted. The source-string check now pins the native-engine exclusion rather than the kind test beside it, because that kind test widened to sendsTransformerQuant.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
Reconcile the reordered accelerated-backend check with the dense-quant class main added in unslothai#10883. The early check now returns the capability answer, so a resolved accelerated backend still outranks a provisional device type while dense quant keeps following capability over name. The mac + cuda assertion moves to mps, a backend a Mac can actually resolve to, and mac + cuda is asserted as a remote dense-quant host.
…ain (unslothai#10988) * Say which unsloth_zoo revision Core tested, and warn when it is not main resolve-zoo-ref pins the unsloth_zoo sha in a separate gating job. A re-run with --failed re-runs only the failed jobs and reuses the successful ones, so a re-run of a red Core zoo job keeps the sha it was handed on the first attempt, however long ago that was. That makes re-running to confirm a landed unsloth_zoo fix actively misleading. It re-tests the revision from before the fix, fails with the same errors, and says nothing about why. Observed on unslothai#10883: the Core zoo jobs started at 05:32 on the 15th and failed on gemma4 and flashinfer tests that unsloth_zoo unslothai#1219 and unslothai#1220 had fixed hours earlier, because the resolve job on that run had started at 19:29 the previous day and pinned 055c049. The only way to see it was to read the resolve job's log from the first attempt and notice the timestamp. So record the revision in the job, and warn when it is behind main, naming both shas and saying that a full re-run is what picks up main. Checked both directions against the live repo: silent when the pinned sha is main, warns on 055c049. * Stop the revision notice failing the step it reports on The lookup was written as head="$(git ls-remote ... | cut -f1)" and the step runs under `set -euxo pipefail`. pipefail hands git's status to the pipeline, the pipeline's status becomes the assignment's, and -e ends the step. So a DNS blip on a diagnostic would fail a Core cell whose clone, install and whole suite had already passed. That is the opposite of what this change is for, and the PR description claimed it could not happen. It can: `set -euxo pipefail; head="$(false | cut -f1)"` exits 1 before the next line runs. Absorb the failure inside the substitution, so an unanswerable lookup leaves head empty and the check stays quiet. Guarded behaviourally rather than by reading: the new test extracts the block from the action and runs it under the same shell flags against a stubbed git, covering a lookup that fails, one that answers nothing, a revision behind main and a revision that matches. Restoring the unguarded form fails two of them. The structural assertion is there because the behavioural ones also pass if the guard is moved outside the substitution, which silences the assignment but not the pipeline. * Bound the revision lookup in time as well as in status The previous round stopped a failing lookup from ending the step. A lookup that HANGS is the same hazard by another route, and || true cannot reach it: nothing has exited, so there is nothing to absorb. git applies no timeout to ls-remote and no low-speed limit is configured, so a connection that opens and then stalls would hold this step until the job's own 25 or 35 minute limit killed the cell. Again after the clone, the install and the whole suite had already passed, which is the outcome this block must never cause. An external timeout bounds it. timeout exits 124, which the existing guard absorbs like any other failure, and both jobs using this action run on ubuntu-24.04 where timeout is coreutils. The new test reads the bound out of the action, stubs git to sleep six times that, and fails if the block does not come back inside it. Removing the timeout fails it. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Word the warning for a pinned ref as well as a stale re-run The remedy was stated unconditionally: re-run ALL jobs to pick up main. That is right for the case this warning was added for and wrong for the other one. A workflow_dispatch run that pinned unsloth_zoo_ref on purpose reaches the same code, because resolve-zoo-ref hands over a sha either way and the action cannot tell the two apart. Re-running preserves the original inputs, so that run resolves the same non-main ref again and warns again, having been told to do something that cannot work. Say both readings instead. I did not plumb a flag through from the workflow to distinguish them: that means a new action input kept in sync at two call sites, which is a fresh way for this to rot, and the message is short enough to hold both cases. A test pins the contract, and restoring the unconditional wording fails it. * Run the action guards on action-only changes, and stop misreading a moving main Two holes, both found in review. The guard could be absent for the change it guards. This test reads .github/actions/core-cpu-setup/action.yml and runs under tests/studio, which is Backend CI's Repo tests (CPU, studio). Backend CI is path-filtered and did not list .github/actions, so a PR touching only the action ran Core -- which does list the action in its own filter, but does not execute tests/studio -- and skipped Backend CI, which does. Nothing would have run against the change. That is not specific to this file: nine tests under tests/studio assert properties of composite actions, covering cache naming, install phase timing, uv and pip cache discipline. None of them ran on an action-only change. Adding .github/actions to the filter covers all nine, and follows the reasoning the file already applies to install.sh. tests/studio/test_local_actions_are_in_path_filters.py enforces the neighbouring rule, that a workflow lists the actions it uses. The new test is the other direction: a workflow must also list the actions its TESTS read. Separately, the warning blamed a --failed re-run for every mismatch. A first attempt can mismatch too: resolve-zoo-ref pins main in the gating job and this step asks again only after the whole install, so main advancing in between is enough. That was a wrong diagnosis rather than a vague one, and it now names both causes. Both mutation-checked: removing the path entry and dropping the clause each fail their test. * Skip this file where GNU timeout is not there to run it The marker only asked for bash. Stock macOS has bash and no GNU timeout -- it is gtimeout, from coreutils -- which tests/sh/test_llama_build_jobs.sh already records for the same reason. There the bounded lookup fails, the guard absorbs it exactly as designed, head comes back empty, and the two tests that expect a warning fail. So a developer running the suite on a Mac gets two red tests describing nothing about their change. Reproduced by hiding timeout from PATH: head comes back empty and no warning is emitted. The marker now asks for both tools and names whichever is missing. The PATH handed to the subprocess was hardcoded to /usr/bin:/bin, which could disagree with that check in the other direction: a Mac WITH coreutils has timeout on PATH, shutil.which finds it, the marker does not skip, and the fixed PATH still would not find it. It now takes the caller's PATH with the stub directory in front, so the check and the run see the same tools. The action only ever runs on ubuntu-24.04, so skipping gives up no coverage that exists. Verified both ways: 9 pass with timeout present, 9 skip without it. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Tighten the comments this PR added One block accrued per review round. Verified comment-only two ways, since the shared gate cannot lex YAML: the action's executable lines are identical with comment lines stripped, and the test file's AST is identical ignoring docstrings. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…oint (unslothai#10883) * Studio: run official image pipelines on the dense quant fast path * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Make the pipeline quant re-plan, capability and row labels describe the real load * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Record that the pipeline quant runs before placement and is safe there * Report dense quant capability per scheme so the picker does not advertise a refusal * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Narrow the advertised quant schemes by any smoke verdict already cached * Keep pipeline weights dense when the quant cannot be compiled or the family refuses it * Refuse an uncompilable pipeline precision at preflight and mirror every bf16 blocker in the picker * Separate the auto-selectable schemes from the explicit ones and fix two picker blind spots * State the dense quant path as a host capability instead of predicting the precision * Recover a widened low-precision source from the shard header before quantising * Fold the compile prerequisite into the advertised capability and stop pinning it * Scan every denoiser shard for a narrow stored precision * Resolve the dense quant capability off the polled system route * Keep the capability refresh behind the torch warm kill switch * Name the precision an official image row will run A dense-quant host does not load an official BF16 image pipeline in BF16, and it no longer downloads the BF16 shards either: the backend resolves an auto load to the hosted pre-quantised transformer in unsloth/<Model>-FP8. The rows said neither. Every eligible row read a bare "Fast", and MiniMax H3, which used to say "Fast FP8", had been flattened to match. /api/system now reports dense_quant_schemes beside dense_quant_supported: the schemes this host can actually run, best first, so fp8 on Ada and up, int8 on Ampere, empty where the path is unsupported. Read it and say so. - src/lib/dense-quant-schemes.ts normalizes the field. Absent or malformed is [], never a guessed fp8: an older backend sends only the boolean, and a guess would put FP8 on a row an Ampere card runs at INT8. - densePerfSuffix names the scheme, so a row reads "Fast FP8" or "Fast INT8", and "Fast" only where the host named none. h3PerfSuffix reads the same list, which restores H3's own precision without hard-coding it. - The catalog carries prequantRepo and per-scheme prequantSizeGb for the four families with hosted artifacts, and the fit rules size a dense-quant host's rows by the quantised checkpoint plus the companions the quant leaves alone. A 40 GB card fits Z-Image-Turbo at 24.4 GB where it does not at 30, so pickDefaultArtifact routes it to the official row rather than down the quant ladder. The two schemes are sized apart, since they are different artifacts: Qwen-Image is 19.06 GB at fp8 and 31.73 at int8. The qualifier's dedup now matches on its first word, or a variant already called Fast would read "HiDream I1 (Fast (distilled)) (Fast FP8)". Chips are untouched: they state the precision the artifact is PUBLISHED at, which is what tells two rows of one group apart, and the host cannot rewrite that. npm test 7299 pass / 0 fail, typecheck clean, catalog:check passes. * Settle an official image pick's hosted denoiser before the download An official kind == "pipeline" pick with the precision left to us always ran the released bf16 denoiser, even where the family table already names a hosted FP8 or INT8 checkpoint of those same weights. MiniMax-H3 has resolved an unset precision to its hosted denoiser for a while now, and the video loader seeds a conventional pipeline the same way; this is the image half of that rule. The decision has to be settled before a byte moves, because it changes what is pulled: taken inside the loader, the plan stages the released shards the load never opens and the replacement arrives inline, outside the load's progress, cancel and disk preflight. So _pipeline_planned_denoiser_scheme resolves auto to a concrete scheme against the card this load lands on, requires a usable hosted source, sizes the artifact with resolve_dense_quant_candidate and judges an artifact-sized _plan_memory against the card's CAPACITY, which is the one reading a pre-download plan can trust while the previous pipeline is still resident. It returns the scheme, None (no artifact: the released shards stay and the loader's in-memory quantise handles it) or a declined sentinel when the artifact-sized plan would still offload, since torchao tensors reject offload hooks. speed_mode="off" and transformer_quant="none"/"off" keep the released weights, a LoRA bake keeps the dense path, and the per-component assemblers (krea, ideogram) are refused because their loaders never see pipe_kwargs. The plan then drops transformer/*.safetensors through is_prequant_covered_weight and keeps transformer/config.json, which the seeding loader meta-inits from; the artifact is counted, staged as its own entry and carries the denoiser's share of the unified-memory verdict. _dit_prequant_plan_source confirms the checkpoint on the Hub first, so only a file that really resolves earns the right to drop those shards. A GGUF pick is unchanged: there the artifact is a second denoiser beside one already on disk, so an auto quant still only uses a cached one. * Assemble the pipeline around the hosted denoiser instead of quantising it later The load half of the same change. _run_load threads the settled scheme through the staging phase: the released shards are dropped from the pull, the exact names dropped are recorded so a seed that does not land can top them up, the artifact's bytes join the progress estimate and its repo is claimed against the delete-cached guard, and the checkpoint is fetched under this load's cancel event rather than under the load lock after eviction. The plan's answer is PINNED into the load, decline included: the pull was scoped on it, so the loader must not re-take the decision against post-eviction free memory. load_pipeline re-plans against the artifact's size before the unified-memory refusal, then hands from_pretrained a transformer= built by load_prequantized_transformer, beside the pre-cast text encoder it already injects. The quantised weights are what gets built, so the build peak is the artifact rather than the bf16 shards it stands in for, and the in-memory quantize_transformer below is a no-op for this load. Seeding stays best-effort. An empty injection re-plans at bf16, re-runs the refusal and restores the skipped shards before assembly, since from_pretrained treats a local snapshot as terminal and would otherwise raise on a directory with no denoiser in it. A live free reading smaller than the capacity the plan used takes the same path. An explicit scheme that cannot be honoured still fails closed exactly where it did before. resolved.transformer_quant names the file that produced the pixels: the scheme alone cannot tell the hosted artifact from a runtime quantise of the released weights, and the two do not render the same image. It goes in a new "artifact" key rather than in "source", which says whether the caller or the backend chose the precision and is what renders the "Auto: FP8" badge. * Publish the dense quant scheme ladder on /api/system One bit cannot tell an Ampere host (int8) from an Ada one (fp8), and both have hosted checkpoints an official pick now defaults to, so a picker row that wants to name the precision it is offering has nothing to read. dense_quant_schemes carries the auto ladder for this host, best first, from auto_scheme_candidates: the same ladder, deny list and smoke probe the loader's own selector reads, so the row and the load cannot disagree about what auto allows. A mixed host answers with the intersection, since the picker cannot see which card a load will land on, and an incapable host answers with an empty list. Resolved in the same pass as the capability bit and read from that cache, so the polled route imports neither torch nor torchao and walks the visible cards once, not twice. * Cover the hosted image denoiser end to end Hermetic, torch and diffusers stubbed, the Hub a fixture. The plan drops the released shards while keeping transformer/config.json and counts the artifact as its own entry; an unplanned or declined pick plans exactly as before; a GGUF pick still never sizes an uncached checkpoint. The settle is exercised across the tri-state, speed=off, a baked LoRA, a definite-offload request, a family and a base with no hosted artifact, the per-component assemblers and an artifact-sized plan that still offloads. The pin is checked in both directions: a checkpoint that did not resolve on the Hub keeps the shards, and a decline survives into the load. At the load, a seeded denoiser engages the quant with no second conversion and the resolved record names the hosted file; an empty injection and an offloading re-plan both restore the shards and fall back to the in-memory quantise; a direct call with no plan phase behaves as it did before. The capability suite's "one bit, not a scheme list" rule is replaced by the contract that supersedes it, plus per-host coverage of the published ladder. * Tighten comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Studio: list the rebuilt Qwen-Image fp8 denoiser artifact * Studio: the plan-time seed walks auto's ladder below a rung whose artifact does not fit * Format to the ruff fixed point * Studio: auto transformer precision walks int8 first on every GPU tier * Studio: an explicit scheme under Speed Off still seeds the hosted denoiser * Tighten comments * Studio: an offline reload seeds the hosted denoiser from the cache it already holds * Studio: an operator's local checkpoint is seeded online too, and the polled ladder reads the smoke cache only * Studio: a restore that spans cache roots assembles from the hub id, never a snapshot missing its shards * Studio: Qwen-Image 2512 seeds its own hosted checkpoint, HiDream Dev and Fast inherit none, and a forced fp8 accumulate the artifact cannot bake declines at plan time * Studio: the Qwen-Image 2512 row is sized by the checkpoint the backend seeds for it * Studio: the picker walks the reported dense-quant ladder, and load progress counts only the prequant file it fetches * Studio: the module summary states the ladder that ships * Studio: the Precision hint and the request schema name the int8-first ladder * Studio: a dropped seed re-plans once the dense shards are restored, and the group fit filter sizes a row by the artifact it would load * Studio: the image download plan reads the forced fp8 accumulate the load will run with * Studio: the status schema declares the prequant artifact so API clients see the provenance * Studio: the prequant provenance names the checkpoint file that really loaded * Tests: the video status passthrough reads the additive artifact field * Studio: one FP8 label for the 8-bit tier, and tag every diffusion GGUF as Slow Three picker changes, all in the row suffix and the Precision control. The dense row named whichever scheme the host reported first, so the same model read as "Fast INT8" on one card and "Fast FP8" on another, and it renamed itself whenever the auto ladder was reordered. The suffix now names the TIER: int8, fp8 and mxfp8 all render as "Fast FP8", the name users know for the 8-bit fast path. A 4-bit scheme still names itself, since it is a different quality tier. What actually loaded is unchanged and still reported by the resolved record on the loaded-models card. Only unsloth/MiniMax-H3-GGUF carried the "(Slow)" tag, though every diffusion GGUF is in the same position: the native engine has no low-precision tensor-core path and no compiled dense transformer, so it is the slow row wherever a dense row sits beside it. The tag now comes from the artifact format rather than the repo id, for image and video groups. Audio GGUFs are left alone, since their whisper.cpp and llama.cpp rows have no dense sibling to be slow against. Off an accelerator (Mac, or a CPU-only host) the GGUF is the only thing that runs, so the tag is dropped there: it would compare the user's one option to something they cannot pick. For the same reason the Precision control on the image and video pages no longer lists FP8, INT8, NVFP4 and MXFP8 on such a host, since the loader refuses them. A host whose backend reports no capability yet keeps the full list rather than losing controls it may well honour. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Studio: keep the dense-quant scheme list stable across memory probes The media picker memoises its option list on `denseQuantSchemes`, and this branch gives the GGUF rows a host-dependent `(Slow)` suffix. `refresh_memory=true` re-probes free host RAM behind every footprint estimate, so the GPU snapshot is legitimately new on nearly every poll and the schemes array was rebuilt with it, even though the list itself is a hardware capability that never moves. That rebuilt the whole option list per probe, detaching and re-creating every row it had just drawn, which is a visible flicker and made the image model footprint Playwright run time out clicking a row that kept vanishing. Carry the previous array forward when its contents are unchanged. The refreshed RAM reading is still published; a host that really changes its ladder still gets the new array. * Tighten the comments and docstrings across the prequant-first change * Let the Precision gate test follow the pipeline picks this branch quantises main added images-precision-gate-native.test.ts to stop the Precision control being offered to native sd.cpp, which runs no torchao path. Two of its assertions encode the old rule that only a GGUF pick can be quantised, which is the rule this branch changes: an official pipeline pick now resolves to the hosted FP8 or INT8 checkpoint and is quantised in place. The engine invariant it was written to protect is kept and still asserted. The source-string check now pins the native-engine exclusion rather than the kind test beside it, because that kind test widened to sendsTransformerQuant. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: oobabooga <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary
Official BF16 image picks now default to the hosted INT8 or FP8 checkpoint, the way MiniMax H3 defaults to its hosted denoiser. Built on top of #10697, whose branch lives on a fork, so this PR targets
mainand carries #10697's commits until it merges; the changes of this PR are everything after 8fbdbfd (git diff 8fbdbfd51c..HEAD). It also carries #10888 (int8 first on every GPU tier), so the unset default settles on the hosted INT8 file wherever it exists and fits, and on FP8 next. Once #10697 and #10888 land the diff shrinks to this PR's own range on its own.#10697 opened the dense fast path to
kind == "pipeline"picks by quantising the downloaded BF16 shards in memory. That path never looked atDiffusionFamily.prequant_repos, so a Z-Image-Turbo pick fetched 32.8 GB of BF16 shards, peaked at 19.8 GB on the card and re-quantised on every load, whileunsloth/Z-Image-Turbo-FP8(transformer FP8 and INT8 files, same rows the GGUF path already resolves) sat unused and the download plan kept advertising the BF16 size. This PR makes the hosted checkpoint the default and keeps #10697's in-memory conversion as the fallback.What changed
Backend
_pipeline_planned_denoiser_scheme,diffusion.py). An unsettransformer_quanton an official pipeline pick is resolved to a concrete scheme before any download, inside the device scope: ladder scheme, hosted artifact present for that scheme, artifact-sized memory plan resident. It returns the scheme,Nonewhen the family has no hosted artifact (fall through to Studio: run official image pipelines on the dense quant fast path #10697's in-memory path) or a declined sentinel when the artifact-sized plan would still offload, because torchao tensors reject the offload hooks. Under auto the ladder is walked below the winner first: Qwen-Image's INT8 file is 12 GB larger than its FP8 file, so on a card where the INT8-sized plan offloads the FP8 artifact is seeded instead of a decline. The decision is pinned into the load so plan and load never disagree, exactly as the video loader does.transformer/*.safetensorsand keepstransformer/config.json; the artifact is counted and staged; skipped shards leave the resident-size figure; the artifact bytes enter the disk shortfall check.diffusion_denoiser_prequant.py, image twin ofvideo_denoiser_prequant.py). The pipeline is assembled around the hosted transformer throughload_prequantized_transformerbeside the existing text-encoder injection. On successtransformer_quant_engagedis set, so Studio: run official image pipelines on the dense quant fast path #10697's in-memory block is a no-op. On a refused or missing artifact the load re-plans at BF16, re-runs the unified-memory refusal, restores the skipped shards and continues down Studio: run official image pipelines on the dense quant fast path #10697's path. The resolved record names the artifact in a newartifactkey (prequant:<repo>/<file>);sourcestaysautoorexplicitbecause the picker branches on it.local_files_onlyload (the media auto-switch) settles the same scheme and keeps it only when the artifact is already on disk, answered by a refs read plus a stat and never a Hub call, the swap the video loader makes. Without it a reload of a repo whose first load had left the released shards out would assemble BF16 from a snapshot that holds none.transformer_prequant_pathhas no Hub entry, so the plan skips no shards; the settled seed is still pinned for it (present and baked for the scheme) on an online load as well as offline, and the released shards stay staged as the fallback.unsloth/Qwen-Image-2512-FP8, INT8 and FP8 files) instead of inheriting the Qwen-Image artifact the loader's base check would refuse; HiDream Dev and Fast are excluded from the Full artifact the same way the undistilled Z-Image already was.transformer_quant_fast_accumthe hosted fp8 file cannot bake declines the seed at plan time (auto walks to the next rung, an explicit fp8 takes the dense path), so plan and load never disagree on it.speed_mode="off"with an unset precision, andtransformer_quantnoneoroff, keep the released BF16 weights; an explicit scheme under Speed Off is still seeded, because the loader honours it and upgrades the speed todefaulteither way. An active LoRA keeps the dense path (the bake needs dense weights). An explicit scheme with no artifact still fails closed as in Studio: run official image pipelines on the dense quant fast path #10697. Krea 2 and Ideogram 4 are excluded because their per-component assemblers never seepipe_kwargs./api/systemgainsdense_quant_schemes, the ladder this host would engage for an auto pick (intersection across visible cards, best first). The polled route never imports the ML stack and never probes: the ladder is answered from the smoke cache alone (auto_scheme_candidates_cached, unprobed schemes counted usable, the ruledense_quant_host_capablefollows), so it sharpens as loads record verdicts instead of paying for them per poll.Frontend
Fast INT8orFast FP8fromdense_quant_schemes(first rung the host runs), plainFastonly when the list is empty. MiniMax H3 reads the same suffix, which now names the rung it actually settles on.prequantRepoand per-schemeprequantSizeGb(real Hub blob sizes), so device fit and default routing judge the quantised resident size on a dense-quant host instead of the BF16 figure.Measurements
B200, Tongyi-MAI/Z-Image-Turbo, 1024x1024, 9 steps, fixed seed, both repos already cached. Measured before #10888 was merged in, so the unset row settled on fp8; with int8 first the unset default takes the
int8row's path.offfp8, the default on this host)fp8,prequant:unsloth/Z-Image-Turbo-FP8/Z-Image-Turbo-FP8.ptint8, artifact seededint8,prequant:unsloth/Z-Image-Turbo-FP8/Z-Image-Turbo-INT8.ptfp8in memory, artifact refused)fp8, dense fast pathint8prequantint8The seeded pipeline pick and the GGUF pick of the same
int8file give a bit-identical final latent (torch.equal, max abs 0), and the seededfp8pick is bit-identical to the in-memoryfp8fallback of the same weights.The fallback row was recorded before the artifact swap: the previously published
Z-Image-Turbo-FP8.ptpredated torchao's activation scale floor and the loader refused it ("fp8 checkpoint has no activation scale floor"), so the load restored the three skipped shards and quantised in memory, which is what the fallback promises. The FP8 denoiser files for Z-Image-Turbo, FLUX.1-schnell, Qwen-Image and Krea-2-Turbo have since been rebuilt with the floor (two independent builds compared tensor for tensor, validator accepted, sha256 round trip after upload) and replaced in their repos; thefp8seeded row above is the unset default against the replaced file. LPIPS of the rebuilt fp8 render against the bf16 render at 1024, one fixed seed: Z-Image-Turbo 0.138, FLUX.1-schnell 0.072, Qwen-Image 0.044, Krea-2-Turbo 0.174.Tests
test_diffusion_pipeline_prequant.py(52): plan drops the shards and counts the artifact; the artifact is downloaded for a pipeline pick while the GGUF cached-only rule is unchanged; the seed markstransformer_quant_engagedand skips the in-memory block; a refused artifact re-plans at BF16 and restores the shards; the declined sentinel is pinned across plan and load; a too-large first rung yields to the next hosted rung and an explicit scheme is never swapped; an explicit scheme under Speed Off still seeds; an offline reload seeds from the cached artifact and never probes the Hub; a local checkpoint is seeded online too; the polled ladder never runs the smoke probe; LoRA bake, speed off andnone/offkeep BF16; explicit scheme with no artifact reaches #10697's refusal.test_dense_quant_capability.py(21): the scheme ladder per host class and the route never importing torch. Backend suites touchingdiffusion.py: 862 passed. Frontend: 7299 passed, typecheck and catalog check clean; newdense-quant-prequant-routing.test.tscovers the suffix per scheme, H3 restored, fit by quantised size and the router.Known limits
Evidence
The Images model picker on a B200, from two isolated installs driven by one Playwright scene. These are not this PR's own merge base: it is stacked on #10697, so BEFORE is that branch's head (
8fbdbfd51c) and AFTER is this PR's head, which also carries #10888. Re-shot at8fbdbfd51cagainst the current head68f6854f63after the latest review round, and the composites below came out byte identical to the first run, so they are this head's evidence and not an older one's./api/systemdense_quant_schemes: absent before,["int8", "fp8", "mxfp8"]after.Z-Image-Turbo, Qwen-Image 2512, Qwen-Image and FLUX.1 schnell go from the bare
(Fast)to the scheme the host actually runs,(Fast INT8): the row reads the reported ladder instead of thedense_quant_supportedbit. The bnb-4bit and GGUF rows are untouched, which is the control.What this surface does NOT show, stated so the picture is not read for more than it says: the chip beside a row is the parameter count (6.2B, 20.4B), not a byte size, and it is identical on both sides by design. The hosted-checkpoint sizing is consumed by
curatedArtifactFitsDevice,pickDefaultArtifactandcatalogGroupFitsDevice, which decide the fit verdict, the routing and the "Fits on device" group filter rather than the label, and are covered bymodel-catalog.check.ts. The group filter only differs on a card between the quantised and the dense size (Krea-2-Turbo: 12 GB against 18 GB), so the B200 the pair was captured on keeps every group either way and the screenshots above are unchanged by it. MiniMax H3 is not in the picker's default Recommended tab, so its row is absent from both halves.