Skip to content

[diffusion] Qwen-Image 2.1 VAE decoder fast paths: bit-exact norm/bias fusions by default, channels_last decode under quality=extra-high - #41340

Merged
mickqian merged 22 commits into
sgl-project:mainfrom
triple-mu:pr/qwen-image21-vae-decoder-fast-paths
Oct 14, 2026
Merged

mickqian merged 22 commits into
sgl-project:mainfrom
triple-mu:pr/qwen-image21-vae-decoder-fast-paths

Conversation

@triple-mu

@triple-mu triple-mu commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Independent of the attention PR; both add entries to kernels/ops/diffusion/__init__.py, the kernel README and the fast-paths inventory (adjacent lines, trivial to rebase; the inventory section is numbered 18 assuming the attention PR's 17 lands first).

Motivation

The Qwen-Image 2.1 VAE decode of a 1024x1024 image takes 186 ms on one SM120 GPU. Its decoder (dims 1152/1152/1152/576/288/144, five up blocks that run three residual blocks at their own resolution and then upsample) spends that time on cuDNN convs, but also on work that is pure data movement: cuDNN's NCHW/NHWC transposes around every conv (25 ms), aten's channel RMSNorm chain (fp32 copy + reduce + four pointwise passes + SiLU), a separate bias-add pass after every conv (46 launches, 10 ms) and nearest-2x upsampling that quadruples the pixels before a 3x3 conv.

This PR removes that overhead in two tiers, following the existing VAE fast-path conventions (VaeFastPathGate for quality-gated paths, BitExactFusionGate first-sight verification for default-on paths):

  • default (quality=lossless): bit-exact fusions only; the output PNG is unchanged;
  • quality=extra-high / high: the decoder switches to channels_last and uses an NHWC norm kernel with its own reduction order plus fp32-folded upsampler weights; documented as close, not bit-exact.

Modifications

One commit per optimization (runtime/models/vaes/qwen_image21_vae_cuda_opt.py, mounted from platforms/cuda.py::optimize_vae; parameter names are preserved so checkpoints load unchanged):

  1. a99db03979 Lossless fast paths (default on): channel_rmsnorm_finish_silu JIT kernel keeps aten's fp32 norm(dim=1) reduction and fuses the pointwise finish (max(norm, 1e-12), divide, scale, gamma, +0.0) with SiLU; FoldedPadConv2d folds the symmetric F.pad of every causal conv into the conv's own padding, verified per (dtype, shape, stride) signature because cuDNN may pick another algorithm; the fold is only attempted above 2^18 output elements, where a bit-exact first-sight match is decisive (two engines with different accumulation orders agree on all but ~1e-4 of the elements, so on a few thousand elements they can match by chance, as the H100 runner showed at a 4x4 test latent).
  2. a99052507b channels_last decode under the quality gate: the decoder flips to channels_last (parameter memory only; flipping back restores the NCHW kernels exactly), channel_rmsnorm_silu_nhwc reduces each pixel's channels in a lane group (1-32 lanes per pixel with 16-byte loads, chosen from C by the Python wrapper so the C=144 last stage stays near bandwidth), and the nearest 2x upsample re-labels the merged-batch view with canonical NHWC strides and uses the bit-exact Triton NHWC gather.
  3. 119ab3c768 Upsampler fold (quality gate): each nearest-2x + conv3x3(p1) becomes one ConvTranspose2d(k4, s2, p1) whose kernel is the fp32 sum of the taps each output phase touches (2.25x fewer MACs, no 4x intermediate). The fold helper moves out of the FLUX.2 module into vaes/conv_fold.py so both VAEs share it.
  4. 53da9a360c Conv bias fusions: aten adds a conv's bias as a separate pass over the output. Each residual block's second conv now runs without its bias and the new bit-exact bias_residual_add JIT kernel applies bias and residual in one pass with aten's per-op bf16 rounding (default on, first-sight verified; channels_last-dense or NCHW-contiguous bf16). Under the quality gate the first conv hands its bias to the NHWC norm kernel, so that pass disappears too.
  5. 8d1e569f15 Upsampler bias into the shortcut add: the shared Wan Triton kernel dup_up3d_add takes an optional per-channel bias (aten rounding), so the upsampler conv runs without its bias pass (default on, first-sight verified).
  6. 16cadcebe6 kernel README rows, fast-paths inventory entry, pre-commit formatting (a marker benchmark added here was dropped again later in the series).

Fallbacks: spatial-parallel decode, ROCm, torch.compile, unsupported layouts and any first-sight mismatch keep the original module chain.

Accuracy Tests

  • Lossless (default) path, bit-exact: the channel_rmsnorm_finish_silu section of test_norm.py (14), the bias_residual_add section of test_norm.py (25, torch.equal in both layouts), the dup_up3d_add bias case in test_layout.py, and the Qwen-Image 2.1 VAE section of test_model_fast_paths.py (decode of an optimized tiny decoder with the real latent channel count equals the original bit for bit on a 64x64 latent, where every fold site's first-sight comparison is decisive, and again on a second latent while every gate reports verified; a mismatching kernel disables its gate and the decode stays bit-identical; state_dict keys unchanged). End to end the same-seed 1024x1024 PNG keeps main's sha256 (2781b27ac4b17cb1...) in every lossless launch.
  • extra-high path: the channel_rmsnorm_silu_nhwc section of test_norm.py (within two bf16 ulps of the eager chain, >95% of elements bit-identical, all lane-group specializations, fused bias) and the extra-high case in that section (channels_last decode close to the reference, gate off restores bit-identity). End to end, the extra-high image against the lossless image (RGBA, 1024x1024, seed 42; deterministic: the same sha256 on two GPUs and seven launches):
channel PSNR (dB) global SSIM max abs diff (/255) changed pixels
R 57.75 0.99997 8 10.3%
G 57.85 0.99995 11 9.7%
B 58.90 0.99993 8 8.2%
A 73.80 0.99995 1 0.3%
all 59.35 - 11 7.1%

Speed Tests and Profiling

Hardware and workload as in the attention PR: one cc 12.0 (SM120) GPU, 73 GB, 350 W cap, torch 2.13.0+cu132, cuDNN 9.20; sglang serve --performance-mode speed --attention-backend torch_sdpa, 1024x1024, 40 steps, bf16. Decode times are the DecodingStage under SGLANG_DIFFUSION_SYNC_STAGE_PROFILING=1, mean of 3 requests after a warmup request.

VAE decode, whole series on one GPU, interleaved with main:

quality decode (ms) vs main e2e HTTP (s) output
main 186.0 - 14.010 sha256 2781b27a...
lossless (default) 159.8 -14.1% 13.798 (with the attention PR) identical to main
extra-high 100.4 -46.0% 13.743 (with the attention PR) PSNR 59.4 dB vs lossless

Per commit (single launches on a second GPU of the same type; its main decode is 184.4 ms):

after commit lossless decode (ms) extra-high decode (ms)
1 lossless fusions 163.5 -
2 channels_last + NHWC norm 163.6 126.4
3 upsampler fold - 112.7
4 conv bias fusions 160.2 101.1
5 upsampler bias into shortcut add 158.3 99.1

Smoke of this exact branch (rebased on main @ 3ed56a341b, one launch each on a second GPU of the same type, stage-profiling cohort): main decode 184.4 ms; this PR 158.0 ms lossless (PNG sha256 identical to main) and 98.8 ms extra-high (PSNR 59.35 dB vs lossless, same sha256 as on the other GPU).

Kernel level (marker.do_bench on the decoder's production shapes, median us; cuda = lossless finish kernel with aten's reduction, cuda_nhwc = quality-gated kernel):

channel RMSNorm + SiLU site eager Triton finish (main) cuda cuda_nhwc
(1, 144, 1, 1024, 1024) 5384 2432 1881 559
(1, 288, 1, 1024, 1024) 10823 4893 3811 1106
(1, 288, 1, 512, 512) 2657 1175 915 289
(1, 576, 1, 256, 256) 1249 538 421 147

Other measured pieces: the four upsampler nearest-2x + conv3x3 sites go from 9754 us to 5529 us as ConvTranspose2d; the separate conv-bias adds go from 46 launches / 10.3 ms to 9 launches / 1.2 ms under extra-high (26 launches / 4.6 ms under lossless, where the first conv's bias cannot enter the aten norm reduction); cuDNN's NCHW/NHWC transposes (119 launches, 24.7 ms) disappear under extra-high. What remains of the extra-high decode (~100 ms) is ~80 ms of cuDNN conv, which cudnn.benchmark does not improve on this GPU.

Checklist


CI States

Latest PR Test (Base): ✅ Run #38027089458
Latest PR Test (Extra): ❌ Run #38027089365
Latest PR Test (AMD ROCm 10): ❌ Run #38027089433

…m+SiLU tail and folded conv padding

Install two bit-exact fast paths on the Qwen-Image 2.1 VAE decoder:

- The channel RMSNorm keeps aten's fp32 L2 norm and runs the normalize /
  scale / gamma / SiLU tail in one CUDA launch where the decoder applies
  RMS_norm -> SiLU (residual blocks and the output head), replacing the Triton
  finish kernel and the separate SiLU pass.
- The symmetric F.pad in front of every causal conv is folded into the
  convolution's own padding; because cuDNN may choose another algorithm for
  the new descriptor, each conv compares the folded result per input shape on
  first sight and keeps the explicit pad where it differs.

Parameter names are unchanged, both paths verify themselves and fall back on
mismatch, and the spatial-parallel decoder is left alone.
… VAE

Under quality=extra-high or high the decoder switches to channels_last so the
cuDNN NHWC conv kernels stop wrapping every 3x3 conv in NCHW/NHWC transposes,
and the channel RMSNorm + SiLU runs as one CUDA kernel over the contiguous
channels of each pixel: a lane group per pixel with 16-byte loads, sized from
C by the Python wrapper so the narrow last stage (C=144 at 1024x1024) stays
near bandwidth instead of latency-bound. The kernel has its own reduction
order, so it is not bit-exact and never runs on the lossless path; it also
takes an optional per-channel conv bias, used by the bias fusion later in the
series. The nearest 2x upsample re-labels the merged-batch view with canonical
NHWC strides and uses the bit-exact Triton NHWC gather. The gate is
decode-scoped through VaeFastPathGate and flipping it back restores the NCHW
parameter layout and kernels exactly.
…2d under quality=extra-high

Each decoder upsampler runs nearest-2x + conv3x3(p1); under the quality gate it
becomes one ConvTranspose2d(k4, s2, p1) whose kernel is the fp32 sum of the
conv taps each output phase touches (2.25x fewer MACs, no 4x intermediate).
The fold helper moves out of the FLUX.2 module into conv_fold.py so both VAEs
share it. Also points the block-fusion benchmark at the decoder's production
norm shapes (decoder_base_dim 144).
…m kernel and the residual add

aten adds a conv's bias as a separate pass over the output. In each decoder
residual block the second conv now runs without its bias and a new bit-exact
JIT kernel, bias_residual_add, applies bias and residual in one pass with
aten's per-op bf16 rounding (default on, first-sight verified). Under
quality=extra-high the first conv hands its bias to the channels_last
RMSNorm+SiLU kernel, so that pass disappears as well. Also points the VAE
benchmark cases at the decoder's real per-stage shapes.
…3D shortcut add

dup_up3d_add takes an optional per-channel bias, added with aten's rounding
before the residual add, so the up block's upsampler conv can run without its
bias pass; the fused add is first-sight verified against the eager chain and
default on.
…ting

Adds a marker benchmark for the decoder's channel RMSNorm + SiLU sites on the
production shapes, the kernel README rows and the fast-paths inventory entry,
and applies pre-commit formatting to the series (no functional change).
@mickqian

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Sep 26, 2026

@mickqian mickqian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI follow-up for exact head 16cadcebe65ba42b66b92b3de38ff6bb6afaf417 (Base run 36233408214, attempt 2): the broad CPU/NVIDIA failures share a deterministic test-registration blocker, not evidence of a VAE runtime regression.

The collection error is test/registered/kernels/ops/attention/test_deep_select.py: missing if __name__ == "__main__": entry. For example: https://github.com/sgl-project/sglang/actions/runs/36233408214/job/108384018086 . I inspected all 33 failed-job logs: 29 have this exception, one is fail-fast, coverage lacks reports, and the remaining two are aggregate failures.

This unrelated file is absent from this PR's changed-file list. Main now contains the specific fix in a947b56 (#41341), adding import sys and the pytest entry point. Please merge the current target branch (main) into this branch with a normal merge commit, then validate CI on the new head. Rerunning the old tested checkout will not repair its missing entry point. No thresholds or assertions need relaxing. I have not pushed to your fork (push permission is false), rerun these jobs, or claimed runtime tests passed.

@triple-mu

Copy link
Copy Markdown
Contributor Author

Merged the current main (includes a947b56 / #41341, the test_deep_select.py entry-point fix) into this branch with a normal merge commit; new head f3c453f725. No conflicts; the VAE test set (86 tests: test_channel_rmsnorm_finish_silu.py, test_channel_rmsnorm_silu_nhwc.py, test_bias_residual_add.py, test_qwen_image21_vae_fast_paths.py, the dup_up3d_add case of test_layout.py) passes locally on the merged head. Holding the sibling attention PR (#41339) push until the author cooldown window has passed so this run is not blocked.

@triple-mu

Copy link
Copy Markdown
Contributor Author

CI follow-up for head f3c453f725 (run 36240432868): the only non-gate failure so far is base-a-test-cpu (7) -> test/registered/unit/kernels/test_kernels_namespace.py::test_operator_and_test_groups_agree (https://github.com/sgl-project/sglang/actions/runs/36240432868/job/108399888484). It asserts that python/sglang/kernels/ops/ holds no module besides __init__.py, and main @ 710a41ba57 currently has python/sglang/kernels/ops/deep_select.py at that level (added by #40556, merged today). The test fails identically on a plain checkout of main, so it is independent of this PR; once deep_select.py moves into its group (e.g. ops/attention/) the test passes again. Not touching it here to keep the PR scoped.

… VAE test

The padding fold is kept only where cuDNN's algorithm for the folded
descriptor reproduces the padded conv bit for bit; on H100 it does not and
the gate falls back as designed while the decode stays bit-identical. The
test now requires that outcome (a decision per conv plus an exact decode)
instead of a verified fold everywhere, and still requires the exact-by-
construction norm kernels to have engaged.
@triple-mu

Copy link
Copy Markdown
Contributor Author

Second non-gate failure on head f3c453f725: multimodal-gen-test-1-b200 (https://github.com/sgl-project/sglang/actions/runs/36240432868/job/108399859396) fails the E2E-latency validation for flux1_modelopt_nvfp4_t2i (1525 ms vs limit 1046 ms) and qwen_image_2512_modelopt_nvfp4_t2i (21.6 s vs 9.65 s baseline); wan22_modelopt_nvfp4_t2v and ideogram4_nvfp4_t2i in the same job pass. The job ran on b200-cirrascale4-0123 (driver 580.126.20), and multimodal_gen/test/runner/PERFORMANCE.md documents that the Cirrascale B200 runners record exactly these slower timings for these two cases (1574-2618 ms and ~17.7 s historically), with only some of them carrying runner_overrides; the others keep the Verda-pool defaults. The extra time is entirely in DenoisingStage of two DiTs this PR does not touch (decode is 30 / 41 ms, normal), so I read it as an uncalibrated runner pool rather than a regression from this branch. Only two real failures remain then: this one and the test_kernels_namespace breakage from main; the H100 unit-test failure (test_qwen_image21_vae_fast_paths: the conv padding fold declines on H100, as designed) is fixed in a commit I will push once the author cooldown allows.

Since sgl-project#41272 the Qwen-Image lossless added-QKV split applies only when
to_added_qkv is a MergedColumnParallelLinear (LoRA wrappers are called as
they are), so the plain nn.Module fake in
test_qwen_added_qkv_lossless_uses_three_reference_gemms now takes the packed
path and the test fails on main and on every PR's merge ref. The fake
subclasses MergedColumnParallelLinear and skips its __init__, which needs no
parallel state here.

(cherry picked from commit 6b44c61)
A projection that is not a MergedColumnParallelLinear (a LoRA wrapper) is
called as it is on the lossless path since sgl-project#41272; the packed fake exercises
the genuine split, the wrapped fake pins the call-through.

(cherry picked from commit 5baf93b)
@mickqian

Copy link
Copy Markdown
Collaborator

channels_last decode could be moved to quality=lossless

@triple-mu

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@triple-mu

Copy link
Copy Markdown
Contributor Author

Pushed head 47db8aee32 (run 36373246079; the gate rejected the push by two minutes of cooldown and passed on the retried gate, so the run is attempt 2):

  • d9eeeaadf7 folds the tests into the existing files: the three kernel tests are sections of test_norm.py, the decoder-level tests are a section of test_model_fast_paths.py next to the Wan / Qwen-Image / FLUX.2 VAE fast paths, and bias_residual_add_jit.py moves into ops/diffusion/norm/ beside the two VAE norm kernels instead of opening an elementwise/ group. No new test files remain in the PR; the tests themselves are unchanged from daafd5dee2 (fold floor _FOLD_MIN_OUTPUT_ELEMENTS = 2**18, lossless decode on a 64x64 latent with the real latent channel count, divergence report with per-family isolation).
  • a5441df707 merges the current main; 5b2c8d9891 + 47db8aee32 carry the test-only fix from [diffusion] Fix test_qwen_added_qkv_lossless_uses_three_reference_gemms after #41272 #41477 so the JIT kernel job gets past test_qwen_added_qkv_lossless_uses_three_reference_gemms and reaches the VAE tests. Once [diffusion] Fix test_qwen_added_qkv_lossless_uses_three_reference_gemms after #41272 #41477 lands, the merge is a no-op.

This is the first run in which the H100 job can execute the folded-conv fix, so test_model_fast_paths.py::test_qwen21_vae_lossless_decode_is_bit_identical in jit-kernel-unit-test-1-gpu-large (1) is the result to watch. Locally: 94 tests across test_norm.py, test_model_fast_paths.py and test_layout.py selections pass on the merged tree.

@triple-mu

Copy link
Copy Markdown
Contributor Author

H100 result for head 47db8aee32 (run 36373246079): jit-kernel-unit-test-1-gpu-large (0) (job 108774327635, h100-novita5-gpu-6) ran test_model_fast_paths.py to completion and all six Qwen-Image 2.1 VAE tests passed, including test_qwen21_vae_lossless_decode_is_bit_identical (bit-identical decode on the first 64x64 latent with every gate decided, then on a second latent); no fold was declined on that host at these sizes, where each first-sight comparison covers 2^18 to 2^24 output elements. The two added-QKV tests from #41477 passed there as well. jit-kernel-unit-test-1-gpu-large (1) (job 108774327623, h100-novita5-gpu-5) ran the kernel-level sections: 36 channel_rmsnorm_silu_nhwc, 24 bias_residual_add and 12 channel_rmsnorm_finish_silu cases plus their predicate tests, 95/95 files. The rest of the run is still going.

@triple-mu

Copy link
Copy Markdown
Contributor Author

Run 36373246079 status: the only non-cascade failure so far is multimodal-gen-test-2-gpu (2) (job 108774329591, h100-novita8-gpu-67), where the LTX-2 cases ltx_2_two_stage_t2v, ltx_2_3_two_stage_ti2v_2gpus and ltx_2.3_one_stage_ti2v fail the Average Denoise Step check across their retries (E2E 7302 / 6314, 11237 / 9687, 19215 / 16722 ms); fsdp-inference failed once and passed on retry, and the other eight cases of the partition passed, including qwen_image_t2i_2_gpus. The same LTX-2 cases failed the same check on this partition for #40664 (job 108754050552, h100-novita8-gpu-45, an Intel XPU PR) and on both attempts of the previous run of this PR, and LTX-2 does not use the Qwen-Image 2.1 VAE. Everything else that has finished is green, including both JIT kernel jobs with the H100 result above.

@mickqian mickqian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head CI follow-up for 47db8aee32830fe92c4d4c008055a5abfbfb7c03, Base run 36373246079 attempt 2:

The previous QKV fixture blocker is now green: test_qwen_added_qkv_lossless_uses_three_reference_gemms and the separate wrapped-linear test both executed and passed in job 108774327635. The named Qwen21 VAE lossless, mismatch-fallback and extra-high/restoration tests in test_model_fast_paths.py also executed and passed. All six JIT jobs passed; this is not a claim that the entire PR is green.

The remaining root failure is dual-H100 partition 2, job 108774329591, runner h100-novita8-gpu-67. After the initial pass and three failed-item retries, two cases remain:

Case Final actual / limit Final AV denoise / refinement / decode
ltx_2_two_stage_t2v median step 131.3178 / 130.9680 ms 5299.73 / 636.34 / 199.81 ms
ltx_2_3_two_stage_ti2v_2gpus average step 301.5049 / 300.1920 ms 9220.71 / 733.35 / 291.32 ms

The next retry was not started: 68.1 s remained versus an estimated 213.5 s required. This is not six-retry exhaustion. The initially failing FSDP and one-stage TI2V cases recovered. Nine other failed Base leaves explicitly stopped at fail-fast; wait-for-base-b and finish are aggregates. Lint, B200, the other diffusion partitions, unit, component accuracy and BCG passed.

The stage timing identifies where time was spent, but does not establish a CPU/GPU/communication cause or prove these failures unrelated. Matching H100 development capacity is currently unavailable in the free rx inventory. No blind rerun, threshold/assertion relaxation or fork push was performed.

Logs:
https://github.com/sgl-project/sglang/actions/runs/36373246079/job/108774327635
https://github.com/sgl-project/sglang/actions/runs/36373246079/job/108774329591

@triple-mu

Copy link
Copy Markdown
Contributor Author

Thanks for confirming the H100 result. The two LTX-2 cases left in partition 2 missed their limits by 0.3% and 0.4% (median step 131.32 vs 130.97 ms, average step 301.50 vs 300.19 ms) with the in-job retries cut off by the time budget rather than exhausted, so I am rerunning the failed job once; the folded-conv fix and the kernel tests do not depend on it.

@triple-mu

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@triple-mu

Copy link
Copy Markdown
Contributor Author

Attempt 3 of run 36373246079 put partition 2 on a fourth host (h100-novita8-gpu-45, job 108796996849) and the same LTX-2 cases failed their performance checks again (ltx_2.3_two_stage_t2v_2gpus and ltx_2_3_two_stage_ti2v_2gpus in all four attempts, the last one on the refinement stage at 747.1 vs 589.3 ms); the other eight cases of the partition passed, qwen_image_t2i_2_gpus included. Across the base runs created since 2026-09-27 12:00Z this partition passed 2 of its 6 completed executions, one of them on this PR's own run 36326269661 (h100-novita9-gpu-23, 14:33Z yesterday, same LTX-2 code), and failed on six different hosts for three PRs, including #40664 which changes no diffusion code. Nothing in this PR touches LTX-2, so I will stop rerunning it; how do you want to handle that partition?

…-decoder-fast-paths

# Conflicts:
#	python/sglang/kernels/ops/diffusion/__init__.py
#	python/sglang/multimodal_gen/.claude/skills/sglang-diffusion-benchmark-profile/existing-fast-paths.md
#	test/registered/kernels/ops/diffusion/test_model_fast_paths.py
@triple-mu

Copy link
Copy Markdown
Contributor Author

Pushed head d51e68ffaf: a merge of the current main, which now contains #41339 (2e7e0802f4). Three append-append conflicts were resolved by keeping both sides in order: the _SPECS entries in ops/diffusion/__init__.py (the two attention kernels from #41339, then the three VAE kernels), the sections 17 and 18 of existing-fast-paths.md, and the Qwen-Image 2.1 attention tests followed by the VAE section in test_model_fast_paths.py. The two carried #41477 commits are now identical to what main has, so the PR's own change set is back to the VAE work only. Locally on the merged tree the kernel registry imports (72 specs) and 156 selected tests across test_model_fast_paths.py, test_norm.py, test_complex_rope.py and test_layout.py pass. New run: 36432308415.

@triple-mu

Copy link
Copy Markdown
Contributor Author

Run 36432308415 (head d51e68ffaf) finished. Green: both JIT kernel jobs (H100, with the Qwen-Image 2.1 VAE tests and the merged attention tests), lint, all four single-H100 multimodal-gen partitions, and this time dual-H100 partition 2 as well (h100-novita8-gpu-67, the LTX-2 cases included). The only job that failed on its own tests is multimodal-gen-test-1-b200 (job 108961564362, b200-cirrascale4-0123): flux1_modelopt_nvfp4_t2i at 1414 to 1494 ms against an 837 ms baseline and qwen_image_2512_modelopt_nvfp4_t2i at 18.2 to 23.2 s against 9.65 s in all seven attempts, the other three cases passed. Those are the two cases and the Cirrascale runner mickqian listed for #41339, where they passed on b200-fin03-4-4567; neither pipeline runs the Qwen-Image 2.1 VAE. Because of fail-fast, dual-H100 partitions 0 and 1 (green in every earlier run of this PR) were stopped at the health check and the coverage check then reported them missing. I am rerunning the failed jobs once so those partitions run and the B200 job gets another runner draw.

@triple-mu

Copy link
Copy Markdown
Contributor Author

/rerun-failed-ci

@triple-mu

Copy link
Copy Markdown
Contributor Author

Attempt 2 of run 36432308415 (head d51e68ffaf) is finishing; here is where every diffusion job of this head stands, so you can decide without another rerun from my side:

Job Result Note
jit-kernel-unit-test-1-gpu-large (0) / (1) passed (attempt 1) H100; the six Qwen-Image 2.1 VAE tests, the three kernel sections in test_norm.py, the merged attention tests
multimodal-gen-test-1-gpu (0..3) passed (attempt 1)
multimodal-gen-test-1-b200 passed (attempt 2, b200-fin03-4-0123) attempt 1 on b200-cirrascale4-0123 failed only flux1_modelopt_nvfp4_t2i and qwen_image_2512_modelopt_nvfp4_t2i, the same two cases as on #41339
multimodal-gen-test-2-gpu (2) passed (attempt 1, h100-novita8-gpu-67) the LTX-2 partition that failed in the earlier runs
multimodal-gen-test-2-gpu (1) failed (attempt 2, h100-novita9-gpu-67) 8 of 9 cases at baseline, qwen_image21_t2i_tp2 at 2902.6 and 2912.5 vs 2914.8 ms; only ltx_2_5_diffusion_decoder_2gpus misses Average Denoise Step (E2E 10739 vs 10142 ms); attempt 1 never ran it (fail-fast after the B200 job)
multimodal-gen-test-2-gpu (0) failed (attempt 2, h100-novita2-gpu-67) 6 of 9 passed incl. qwen_image_t2i_2_gpus_extra_high; mova_360p_tp2, wan2_1_t2v_14b_2gpu, wan2_2_t2v_a14b_lora_2gpu fail Load Latency (excluding warmup) with E2E within a few percent of baseline, plus a JoyAI-Echo ... still missing required files after re-download download error; passed on this PR's previous run 36373246079
base-b-test-2-gpu-large (3) failed (attempt 2) LLM gsm8k evaluation with request errors (error_rate 1.0 / 0.51), not a diffusion job

Nothing that fails here exercises the Qwen-Image 2.1 VAE; the cases that do (qwen_image21_t2i_tp2, the extra-high 2-GPU Qwen-Image case, the JIT tests) pass on every attempt. I will leave the run as it is rather than keep rolling the runner dice; if you would like a specific job re-run before merging, tell me which one.

detain added a commit to detain/sglang that referenced this pull request Oct 8, 2026
…-project#41340)

Squash of 16 commits a99db03..47db8ae (net diff from PR base
f385390 via git apply -3). Adds fused norm+SiLU tail, folded conv
padding, bias-fused residual add, DupUp3D->ConvTranspose2d folding and
quality-gated channels_last decode for the Qwen-Image 2.1 VAE; new JIT
CUDA kernels bias_residual_add / channel_rmsnorm_finish_silu /
channel_rmsnorm_silu_nhwc (+ .cuh headers) exported from
kernels.ops.diffusion, conv_fold.py helper, qwen_image21_vae_cuda_opt.py,
flux2_vae_cuda_opt.py + wan_causal_cache_triton.py updates, cuda.py hooks.

Conflict/resolution notes:
- Skill doc path redirected .agents/skills -> .claude/skills (our tree
  predates the upstream .agents split; only directory differs).
- kernels README table: kept our conv_bias-annotated wan_rmsnorm_silu +
  KDA residual_gate_add rows; inserted theirs' three new kernel rows.

Tests: test_norm.py 254 passed; test_model_fast_paths.py+test_layout.py
181 passed / 51 skipped (JIT kernels compile on SM120).
@mickqian
mickqian merged commit 5e90312 into sgl-project:main Oct 14, 2026
138 of 161 checks passed
@triple-mu
triple-mu deleted the pr/qwen-image21-vae-decoder-fast-paths branch October 15, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion documentation Improvements or additions to documentation jit-kernel run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants