[diffusion] Restrict request-level quality to two validated tiers: lossless (default) and high (#33453)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Xiaoyu Zhang
2026-08-04 11:43:16 +08:00
committed by GitHub
co-authored by Claude Fable 5
parent 614825fd38
commit c6f2a9c1d4
10 changed files with 122 additions and 106 deletions
+32 -52
View File
@@ -410,12 +410,19 @@ for variant in 0 1; do
done
```
### Choose a quality profile
### Choose the quality level
`quality` is a request-scoped sampling parameter. One resident server can
switch between all four profiles; an approximate request mounts its audited
Cache-DiT policy at the batch boundary, and a later `lossless` request removes
the hooks before denoising.
`quality` is a request-scoped sampling parameter with two validated levels:
- `"lossless"` (default): the exact reference path. Output is bit-exact
against the reference implementation and the CI ground truth.
- `"high"`: the audited accelerated path. Quality is guaranteed (the audited
Cache-DiT configuration measures SSIM 0.931 / PSNR 28.16 dB against
`lossless`), but output is no longer bit-identical to the reference.
One resident server serves both levels; a `quality: "high"` request mounts
its audited Cache-DiT policy at the batch boundary, and a later
`quality: "lossless"` request removes the hooks before denoising.
Start the validated server once:
@@ -434,13 +441,14 @@ sglang serve \
--port 30010
```
Then choose a request tag:
Then choose a request level:
<Tabs>
<Tab title="lossless">
<Tab title="lossless (default)">
Native denoising with no feature-cache approximation. This is the default.
Native denoising with no feature-cache approximation. This is the default;
omitting the field is equivalent.
```json Request field
{
@@ -452,8 +460,8 @@ Native denoising with no feature-cache approximation. This is the default.
<Tab title="high">
The least aggressive approximate profile. Use it when output should stay
closest to the same-seed lossless trajectory.
The audited accelerated path. Use it when you can trade bit-exactness for
latency while keeping output closest to the same-seed lossless trajectory.
```json Request field
{
@@ -463,32 +471,6 @@ closest to the same-seed lossless trajectory.
</Tab>
<Tab title="medium">
The balanced profile: substantially lower latency with a larger change from
the same-seed lossless output.
```json Request field
{
"quality": "medium"
}
```
</Tab>
<Tab title="low">
The fastest validated profile and the largest visual deviation. Use it for
latency-sensitive previews and high-throughput generation.
```json Request field
{
"quality": "low"
}
```
</Tab>
</Tabs>
The measured trade-off is:
@@ -497,8 +479,6 @@ The measured trade-off is:
| --- | ---: | ---: | ---: | ---: | --- |
| `lossless` | 75.10 s | 1.00× | 1.000 | exact | Native reference path |
| `high` | 53.70 s | 1.40× | 0.931 | 28.16 dB | Smallest same-seed visual change |
| `medium` | 30.23 s | 2.48× | 0.818 | 20.40 dB | Balanced latency and visual deviation |
| `low` | 25.81 s | 2.91× | 0.794 | 19.25 dB | Largest deviation; fastest preview path |
These numbers use 1344×768, 124-frame, 24 fps T2VA with 50 inference steps,
video flow shift 12, audio flow shift 3, and three fixed prompt/seed pairs on
@@ -506,26 +486,26 @@ video flow shift 12, audio flow shift 3, and three fixed prompt/seed pairs on
and a moving close-up portrait. `inference_time_s` is averaged across the three
prompts; the quiet-scene point is itself the mean of two repeats.
SSIM and PSNR compare decoded, frame-aligned output with the `lossless` result
for the same prompt and seed. They measure trajectory deviation, not absolute
perceptual quality: an approximate profile can produce a different but still
plausible realization. The profiles also change the joint audio-video denoise
SSIM and PSNR compare decoded, frame-aligned output with the `lossless`
result for the same prompt and seed. They measure trajectory deviation, not
absolute perceptual quality: the `high` path can produce a different but
still plausible realization. It also changes the joint audio-video denoise
trajectory, while these two metrics cover video only.
Approximate profiles currently accept only the exact workload and 4×H200
`quality: "high"` currently accepts only the exact workload and 4×H200
deployment above; other hardware, task modes, request shapes, step counts, or
flow shifts fail before denoising. Offline generation uses the same profile
name, for example `sglang generate --quality medium`.
flow shifts fail before denoising. Offline generation uses the same level
name, for example `sglang generate --quality high`.
<Note>
`quality` selects a model sampling profile and can change generated content.
`quality` selects a model sampling level and can change generated content.
`output_quality` controls only output-file compression; it is a separate field.
</Note>
For manually tuned Cache-DiT experiments outside that validated profile, omit
For manually tuned Cache-DiT experiments outside that validated path, omit
the request `quality` field and set the process-wide environment controls
directly. An explicit `quality: lossless` request overrides those controls and
restores native denoising:
directly. An explicit `quality: "lossless"` request overrides those controls
and restores native denoising:
```bash Command
SGLANG_CACHE_DIT_ENABLED=true \
@@ -548,8 +528,8 @@ Cache-DiT skips selected block computation and is approximate. It cannot be
combined with FSDP inference or DiT layerwise offload. Breakable CUDA graph
execution takes precedence and leaves Cache-DiT disabled. Tune the cache
thresholds only after comparing both video and audio quality on the target
task profile. A real B200 request has completed, but the named profiles above
remain fail-closed to the audited 4×H200 workload.
task profile. A real B200 request has completed, but the `quality: "high"`
path above remains fail-closed to the audited 4×H200 workload.
</Warning>
## 6. Runtime feature recipes
@@ -646,7 +626,7 @@ real H3 validation runs.
- MiniMax-H3 produces the canonical 24 fps output; request duration is expressed through `target.duration_seconds`.
- `target.duration_seconds` must be between 4 and 15 seconds, inclusive. The command picker defaults to the verified 5-second profile.
- Use a 768-pixel short edge for the released quality profile. The aligned output dimensions are derived from `target.aspect_ratio`.
- Use a 768-pixel short edge for the released quality recipe. The aligned output dimensions are derived from `target.aspect_ratio`.
- `flow_shift` controls video diffusion and `audio_flow_shift` controls audio diffusion.
- V2V uses `task: "ref2va"` with a `video` or `video_audio` reference; it is served by the `Ref2VA` partition and is not a separate public task value.
- `conditions[].start_time_seconds` selects a non-negative offset for a video reference. Its visual and audio streams are always sought together.