Repository navigation
Studio: auto transformer precision walks int8 first on every GPU tier - #10888
danielhanchen wants to merge 11 commits into
Conversation
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: Didn't find any major issues. Swish! 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 |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75b3562842
ℹ️ 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".
| ((10, 0), (TQ_INT8, TQ_FP8, TQ_MXFP8)), # Blackwell sm_100+ (nvfp4 is explicit opt-in only) | ||
| # ((10, 0), (TQ_INT8, TQ_FP8, TQ_NVFP4, TQ_MXFP8)), # restore to re-enable nvfp4 under auto | ||
| ((8, 9), (TQ_INT8, TQ_FP8)), # Ada sm_89 / Hopper sm_90 |
There was a problem hiding this comment.
Update the documented auto preference order
With this ladder, auto now chooses int8 first on Ada, Hopper, and Blackwell, but the module-level documentation still says that Blackwell prefers nvfp4/mxfp8 and that Ada, Hopper, and Blackwell prefer fp8. Anyone consulting that documentation to understand or modify the precision policy will get the opposite ordering, so update it alongside the ladder.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b999df7. The module summary now reads: int8 leads every tier, then fp8 on Ada, Hopper and Blackwell (sm_89+) and mxfp8 on Blackwell (sm_100+), Ampere (sm_80+) has int8 alone, and nvfp4 is an explicit opt-in that is not in the auto ladder. It also says outright that _AUTO_LADDER is the ordering that ships and the paragraph is only its summary, so the next reader has one place to trust. Comment only, test_diffusion_transformer_quant.py 89 passed.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b999df780d
ℹ️ 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".
| ((10, 0), (TQ_INT8, TQ_FP8, TQ_MXFP8)), # Blackwell sm_100+ (nvfp4 is explicit opt-in only) | ||
| # ((10, 0), (TQ_INT8, TQ_FP8, TQ_NVFP4, TQ_MXFP8)), # restore to re-enable nvfp4 under auto | ||
| ((8, 9), (TQ_INT8, TQ_FP8)), # Ada sm_89 / Hopper sm_90 |
There was a problem hiding this comment.
Update user-facing descriptions for the INT8-first ladder
On Ada, Hopper, and Blackwell data-center GPUs where both schemes are supported, this now selects INT8, but the image/video request schema descriptions (studio/backend/models/inference.py:3605-3609 and 4537-4540) and both Precision UI hints (images-page.tsx:3420 and video-page.tsx:3265) still state that Auto selects FP8 on data-center cards. Update these exposed descriptions so users do not make precision or performance decisions based on the previous ladder.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3c9cb87. All four exposed descriptions now name the ladder that ships:
| file | was | now |
|---|---|---|
models/inference.py (image transformer_quant) |
data-center fp8, consumer/Ampere int8 | int8 first on every tier, then fp8 on sm_89+ |
models/inference.py (video transformer_quant) |
data-center fp8, consumer/Ampere int8 | int8 first on every tier, then fp8 on sm_89+ |
images-page.tsx Precision hint |
at least INT8 on a capable GPU; FP8 on data-center cards | INT8 on every capable GPU, then FP8 where the card has it |
video-page.tsx Precision hint |
at least INT8 on a capable GPU; FP8 on data-center cards | INT8 on every capable GPU, then FP8 where the card has it |
test_diffusion_transformer_quant.py 89 passed, formatter fixed point green. The same wording lands on #10883 through a merge of this branch (ec486c7), where the images hint had also gained the pipeline sentence.
|
Some of the red here is inherited rather than yours. That was a main breakage, fixed by #10826, and both pass on current main. Merging main in should clear those three and leave only what actually belongs to this branch. |
Collapse the multi-line prose the int8-first change left behind in diffusion_transformer_quant.py and its tests: the module scheme paragraph, the _AUTO_LADDER header, _is_consumer_gpu, select_transformer_quant_scheme, auto_scheme_candidates and the ladder tests. Comments and docstrings only, no code change.
|
Closing this as superseded. The int8-first ladder is already on main, so there is nothing left here to land, and merging the branch as it stands would regress the frontend. What I checked before deciding:
The three conflicts are not two different behaviours, they are two wordings of the same change, and main's is the newer one. The reason to close rather than merge: the only lines genuinely unique to this branch in which #10883 replaced when it landed. Merging this branch would put that back and undo #10883's precision gate. The measurement that motivated this PR stands and is unchanged, it just arrived on main by another route. |
Summary
autotransformer precision now walks int8 first on every GPU tier. Until now the ladder led with fp8 on data-center Ada, Hopper and Blackwell parts and moved int8 first only on consumer and workstation cards (_prefer_consumer_scheme, keyed on the device name). That split is gone: int8, then fp8, then mxfp8 on Blackwell; int8 then fp8 on Ada and Hopper; int8 alone on Ampere, as before. An explicitfp8request is honored exactly as it was, nvfp4 stays an explicit opt-in, and the family deny list is unchanged.Why int8 leads
unsloth/*-FP8carries both-INT8.ptand-FP8.pt), so the default rung is the one whose artifact always exists._h3_auto_denoiser_scheme: faster per generation and 45 GB less resident than the hosted fp8). The image path now agrees with it, and the picker'sFast INT8suffix, which reads the first scheme ofdense_quant_schemes, names the rung that actually runs.Accuracy from the 28-pair prequant gate on B200 (LPIPS mean against bf16, int8 / fp8; both rungs clear the gate wherever both are hosted): qwen-image 0.057 / 0.154, flux.1-schnell 0.151 / 0.157, flux1-dev 0.125 / 0.134, flux1-krea-dev 0.098 / 0.119, flux.2-dev 0.078 / 0.073, z-image 0.181 / 0.129, krea-2 0.223 / 0.172, lumina2 0.146 / 0.116, hidream 0.291 / 0.278. int8 is the better rung on the Qwen and FLUX.1 families and fp8 on Z-Image, Krea 2, Lumina 2 and HiDream; a user who wants the other rung picks it in Precision.
What changed
diffusion_transformer_quant.py:_AUTO_LADDERreordered,_prefer_consumer_schemeremoved (its two call sites walk the tier as listed)._is_consumer_gpustays for the fp8 fast-accumulate gate and the speed layer.auto_scheme_candidates, which the loader's lower-rung retry and/api/system'sdense_quant_schemesread, follows the same order, so the retry and the picker label cannot disagree with the selector.Tests
test_diffusion_transformer_quant.py: the Blackwell, Ada, Hopper, professional and consumer cases now assert int8 first and fp8 next, the Qwen deny case asserts int8 then fp8 then nothing, and the candidates test asserts the new order. Fullstudio/backend/testsandstudio/backend/hub/testsgreen.Evidence
The Images model picker on a B200, from two isolated installs driven by one Playwright scene. Every official image row reads its speed suffix off the first entry of
/api/system'sdense_quant_schemes, so this PR moves the label without touching a frontend file.These are not this PR's own merge base, and could not be: the field and the suffix that renders it are added by #10883, so against its own merge base the pair is byte identical. BEFORE is #10883's head with this ladder reverted, AFTER is #10883's head, which isolates the ladder alone. Re-shot against #10883's current head
68f6854f63, with_AUTO_LADDERreverted to fp8 first as the BEFORE side, after the latest review round; the composites below came out byte identical to the first run./api/systemdense_quant_schemes:["fp8", "mxfp8", "int8"]to["int8", "fp8", "mxfp8"].Z-Image-Turbo, Qwen-Image 2512, Qwen-Image and FLUX.1 schnell all move from
(Fast FP8)to(Fast INT8). The bnb-4bit and GGUF rows are untouched, which is the control.