[TRTLLM-13767][feat] integrate FP4 Conv3d into parallel Wan VAE - #17262
Draft
taianz-nv wants to merge 4 commits into
Draft
[TRTLLM-13767][feat] integrate FP4 Conv3d into parallel Wan VAE#17262taianz-nv wants to merge 4 commits into
taianz-nv wants to merge 4 commits into
Conversation
Signed-off-by: Taian Zhang <taianz@nvidia.com>
Signed-off-by: Taian Zhang <taianz@nvidia.com>
Signed-off-by: Taian Zhang <taianz@nvidia.com>
taianz-nv
force-pushed
the
user/taianz/TRTLLM-13767-fp4-parallel-wan-vae
branch
from
August 5, 2026 02:40
8b7be32 to
d3d7d12
Compare
This was referenced Aug 7, 2026
Signed-off-by: Taian Zhang <taianz@nvidia.com>
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.
Summary
Integrate the Blackwell NVFP4 Conv3d kernel into the native Wan VAE and make it compose with the existing parallel VAE wrapper.
beta != 0, allowing overlap with A/B/SFB traffic while leaving non-residual launch geometry unchanged.\n- Use the 256x256, 2CTA, 2x1-cluster tactic selected for parallel Wan shapes.No public VisualGen API or per-fusion environment variables are introduced.
Checkpoint selection and quantization behavior
The native loader selects this path when
vae/config.jsoncontains:{"quantization_config": {"quant_algo": "NVFP4"}}The checkpoint already contains packed FP4 weights and ModelOpt weight scales. TensorRT-LLM dequantizes those weights into the native state dict during loading, then prequantizes eligible 3x3x3 Conv3d weights once into the layout consumed by the integrated kernel.
input_scaleselects calibrated static activation quantization and enables the fused input-preparation path.input_scale, the operator falls back to rank-local dynamic activation quantization using the current sharded activation amax.The FastWan production-best measurements use checkpoint-calibrated static activation scales. When a ModelOpt checkpoint omits
input_scalefor some quantized convolutions, only those convolutions use the dynamic fallback. Dynamic activation quantization remains slower because it recomputes amax and cannot use the same fused static input preparation.Related PRs
This diff intentionally does not duplicate the implementations from #17001 or #17003. The performance tables below show the validated selected stack and therefore include the applicable precision-independent optimizations; they are project-level results, not an isolated attribution of every millisecond to this PR.
Performance
FastWan 2.2 TI2V 5B
NSC B200, 121 frames at 704x1280, three DMD steps. VAE-only endpoints pool 16 critical-rank samples from two independent runs; end-to-end values are medians of three measured generations after one warmup.
Wan2.2 TI2V 5B cross-check
NSC B200, 81 frames at 704x1280. End-to-end uses ten denoise steps, guidance 5, sequence length 512, and seed 1234.
The Wan2.2 checkpoint contains 48 quantized 3x3x3 convolutions: 28 use calibrated static input scales and 20 use the dynamic activation fallback. All 48 execute the FP4 kernel.
The denoiser is unchanged, so VAE-only gains are intentionally diluted in end-to-end latency.
Accuracy
FastWan end-to-end comparisons use Diffusers BF16 at the same GPU count as reference:
The four-GPU static-FP4 shard-seam error ratio is 1.159 versus 1.207 for native BF16, so the parallel FP4 path shows no quantization-specific seam amplification. On the Wan2.2 ten-step workload, four-GPU FP4 best measures LPIPS 0.013590 versus native BF16 best and 0.013604 versus Diffusers BF16 across all 81 encoded frames.
Full interactive reports:
Validation
dynamic-kernel-generator!20906commita28df6ded13) was revalidated on exact PR sources: NSC job 1637299 passed both focused fused bias+residual/product-path tests; direct ABBA job 1637290 passed all reference checks; full-VAE ABBA job 1637284 measured 1103.017 -> 1095.787 ms on 1 GPU and an effectively neutral 371.379 -> 371.987 ms on 4 GPUs.\n- FastWan 1/4/8-GPU VAE-only, matched end-to-end, videos, and 1/4-GPU LPIPS validation completed on NSC B200.Draft follow-ups