Skip to content

[TRTLLM-13767][perf] autotune NVFP4 Conv3d launch tactics - #17576

Closed
taianz-nv wants to merge 9 commits into
NVIDIA:mainfrom
taianz-nv:dev-taianz-fp4-conv-autotuner
Closed

taianz-nv wants to merge 9 commits into
NVIDIA:mainfrom
taianz-nv:dev-taianz-fp4-conv-autotuner

Conversation

@taianz-nv

@taianz-nv taianz-nv commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add runtime tactic autotuning for the Blackwell NVFP4 Conv3d path used by the native Wan VAE.

  • Profile a bounded CuTeDSL shmoo across 1CTA and 2CTA launch configurations.
  • Tune each exact runtime Conv3d problem shape independently.
  • Precompile every candidate before measurement so JIT time is excluded.
  • Encode the complete ordered tactic definitions in persistent cache keys.
  • Bypass generic autotuner bookkeeping after selection without bypassing tuning, capture/replay, cache reload, or distributed post-tune merge.
  • Preserve the provider-recommended 256x256/2CTA/2x1 product fallback when tuning is unavailable.
  • Quarantine candidates that fail compilation or launch for the same kernel signature.

Stacked dependency

This is a stacked Draft PR based on #17262, which introduces the FP4 Wan VAE and its CuTeDSL Conv3d integration. The autotuner changes are:

47b3526cce [TRTLLM-13767][fix] harden NVFP4 Conv3d autotuning
c851245671 [TRTLLM-13767][perf] autotune NVFP4 Conv3d launch tactics

Until #17262 merges, GitHub's main-based diff also contains its prerequisite FP4 VAE changes. After #17262 merges, this PR will be rebased onto main.

Candidate space

Family M tile N tiles CTA / CGA
Small-tile candidates 128 64, 128, 192, 256 1CTA, 1x1
Provider-recommended 2CTA family 256 64, 128, 192, 256 2CTA, 2x1

The existing fixed 256x256/2CTA/2x1 configuration is both a candidate and the eager product fallback. The earlier acceptance experiment temporarily used 128x128/1CTA/1x1 as a deliberately non-optimal baseline to demonstrate real discovery; that slow fallback is not shipped.

Performance

NSC B200, four-GPU Wan2.2 VAE decode, latent [1,48,21,44,80], output 704x1280x81, selected FP4 stack with temporal chunk size 3. Fixed/tuned/tuned/fixed ABBA ordering; two warmups and eight measured samples per process. Reported fixed and tuned values pool 16 samples each.

Path VAE-only pooled median
Experimental 128x128 acceptance baseline 412.619 ms
Existing fixed 256x256 tactic 367.729 ms
Autotuned tactics 367.171 ms

Autotuning recovered the experimental baseline's 11.0% deficit and was 0.558 ms / 0.15% faster than the fixed tactic. The two tuned process medians were 367.333/366.974 ms versus fixed 367.573/367.729 ms. Selected 2CTA N tiles span 64/128/192/256, confirming per-shape profiling rather than restoration of one hard-coded configuration.

Validation

  • Changed-file pre-commit suite passed at final HEAD (47b3526cce).
  • NSC B200 job 1685070: 11 targeted autotuner/FP4 Conv tests passed in 18.94 seconds.
    • fixed product fallback and malformed tactic handling;
    • persistent key changes automatically with the tactic definitions;
    • compilation and launch failure isolation across runner instances;
    • fast-cache invalidation during tuning/capture and after profiling-cache mutation;
    • real AutoTuner.capture() / replay state and distributed post-merge generation;
    • every launch-valid FP4 tactic compared with an independent BF16 Conv3d reference;
    • static activation quantization with bias + residual epilogue compared with BF16.
  • NSC B200 job 1685106: production warmup path loaded the real FP4 Wan VAE (48 FP4 convs), populated 18 problem-shape cache entries, and a fresh Python process reloaded all 18 with zero profiling. Both processes completed real decode and post-cache-selection inference successfully.
  • NSC B200 job 1685233: single-node four-GPU production-path validation passed end to end.
    • Real BasePipeline.warmup(), VisualGenMapping, and ParallelVAEFactory exercised distributed post_tune_merge_dist without hangs.
    • Populate profiled 18 FP4 Conv problem signatures on every rank; all four ranks converged on the same merged tactics for all 18 common signatures.
    • A fresh four-rank Python process loaded the persistent cache with zero profiling on every rank, then completed post-load decode with identical selections.
  • NSC job 1670437: four-GPU fixed/experimental-fallback/tuned ABBA completed successfully.
  • Two Opus 5 review rounds plus a final diff review completed; the final review reported no merge blockers.

Follow-up before ready

@taianz-nv

Copy link
Copy Markdown
Collaborator Author

The autotuner implementation, hardening, tactic-space documentation, and NSC validation have been folded into #17262 at head 364a021534. Closing this stacked Draft PR so the FP4 VAE and its runtime tactic selection are reviewed as one complete feature. The fixed provider tactic remains the eager fallback.

@taianz-nv taianz-nv closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant