Repository navigation
[Diffusion] MiniMax-H3 fuse the video VAE decoder's RMSNorm and QK RoPE - #41906
Merged
Merged
Conversation
Fuse the FP32 residual add with the following RMSNorm, and fuse affine-free Q/K RMSNorm with partial NeoX RoPE, so the decoder can drop the extra eager launches.
Check FP32 RMSNorm, the rounded scale-add residual, and partial NeoX Q/K RoPE so the fused launches stay aligned with the unfused decoder.
Stacked tiles share coordinates, so replay a single rotary cache per tile and keep the single-sequence NeoX kernel on the batched path.
Run the head-64 norm and the first 48 rotary channels in one kernel when the stacked tiles share one rotary table.
Keep the FP32 residual in registers for the following norm, and check the fused decoder still matches the eager forward.
niehen6174
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
kevin-mii,
mickqian,
ping1jing2,
yichiche and
yingluosanqian
as code owners
September 30, 2026 15:04
Collaborator
|
/tag-and-rerun-ci |
Collaborator
Author
|
/rerun-failed-ci |
2 of 5 tasks
This was referenced Oct 7, 2026
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Each block of the H3 video VAE decoder runs eager RMSNorm, a scaled residual add, and per-head Q/K RMSNorm plus partial NeoX RoPE. The decoder is a 36-block ViT and runs on every H3 request. Decode is still one tile per call.
Modifications
h3_vae_rmsnorm,h3_vae_scale_add_rmsnorm,h3_vae_qk_rmsnorm_rope(kernels/ops/diffusion/norm/h3_vae_fused_norm.py): FP32 RMSNorm, the scaled residual add fused into the next RMSNorm, and affine-free Q/K RMSNorm plus partial NeoX RoPE (head 64 / rotary 48). A contract mismatch stays on the eager path.MINIMAX_H3_VAE_DECODER_FUSED_NORM=1by default.B > 1.Accuracy
Fused matches eager to a max absolute error of about 5e-5 on a 28-tile output.
test_h3_vae_fused_norm.pychecks each kernel.test_fused_decoder_matches_unfused_forwardchecks the decoder and that the fused kernels actually ran.Speed
One H200, fp16 autocast, released decoder shape, one tile per call. A 1344×768, 10 s, 24 fps clip is 14 temporal units, 28 tiles each. The unit row is measured. The 10 s row is that unit times 14: same decoder, no extra run.
4×H200, FastH3 4-step, ulysses 4, VSA sparsity 0.9. One request is 1344×768, 10.125 s, 24 fps, 5 sampling steps, seed 1001. Each number is the mean of 8 requests after one warmup. The decoding stage includes the audio VAE.
Checklist
test_h3_vae_fused_norm.py,test_fused_decoder_matches_unfused_forward,test_batched_neox_rope_matches_per_tile_rows.kernels/ops/diffusion/__init__.py. The README selection matrix is not updated yet.CI States
Latest PR Test (Base): 🚫 Run #37256954420
Latest PR Test (Extra): ❌ Run #37256954215
Latest PR Test (AMD ROCm 10): ❌ Run #37256954368