Skip to content

perf(minimax-h3): add conservative DiT velocity reuse - #38

Closed
L17807593 wants to merge 4 commits into
Tele-AI:mainfrom
L17807593:perf/minimax-h3-conservative-cache
Closed

perf(minimax-h3): add conservative DiT velocity reuse#38
L17807593 wants to merge 4 commits into
Tele-AI:mainfrom
L17807593:perf/minimax-h3-conservative-cache

Conversation

@L17807593

@L17807593 L17807593 commented Aug 25, 2026

Copy link
Copy Markdown

This PR contains the Conservative DiT velocity cache, disabled by default, and depends on the lossless optimizations in PR #37.

Please review and merge #37 first. Once #37 is merged, this PR will contain only the Conservative optimization relative to main.

TeleFuser MiniMax-H3: Conservative DiT Velocity Cache

1. Summary

This implementation adds a Conservative DiT velocity cache on top of the five lossless optimizations from PR #37. The cache is disabled by default. Under a four-GPU setup with five prompt/seed pairs, the final results are:

Configuration Avg. wall time Speedup vs. baseline Avg. denoise time DiT calls Cache hits
Baseline 78.546 s 0.000% 75.737 s 49 0
Five lossless optimizations 75.766 s 3.539% 72.934 s 49 0
Conservative only 55.450 s 29.404% 52.612 s 34 15
All optimizations 53.380 s 32.040% 50.601 s 34 15

2. Lossless optimizations from PR #37

PR #37 provides the following five lossless optimizations:

  • Overlap Ulysses communication with FlashAttention 4.
  • Fuse Q/K RMSNorm, RoPE, and Ulysses packing.
  • Add fixed-valid and valid-only attention modes.
  • Fuse valid-only gather with zero-tail merge.
  • Fuse RMSNorm with indexed AdaLN modulation.

These changes are described and validated in detail in PR #37.

3. Conservative DiT velocity cache

Added MiniMaxH3DiTCacheConfig:

mode="off"
start_ratio=0.2
end_ratio=0.8
refresh_interval=2
max_consecutive_reuse=1
threshold=None

conservative is accepted as an alias for velocity. In the default validation schedule, caching is active only between 20% and 80% of the denoising process. A DiT refresh is forced every other step, and at most one consecutive step reuses the previous video/audio velocity.

When the cache is hit, the previous DiT-predicted video and audio velocities are reused and the current DiT invocation is skipped.

4. Per-case performance

Case Baseline (s) Lossless (s) Conservative only (s) All optimizations (s)
P0/S0 78.426 75.745 55.347 53.503
P0/S42 78.420 75.893 55.618 53.334
P0/S1234 78.801 75.740 55.423 53.413
P1/S0 78.612 75.706 55.400 53.366
P1/S42 78.473 75.745 55.463 53.284

5. Quality verification

All quality comparisons use the baseline generated with the same prompt and seed, comparing the final video and audio MP4 outputs.

Configuration Exact MP4 SHA match Video PSNR Video SSIM Audio cosine Audio SNR Audio RMSE
Five lossless optimizations 5/5 inf 1.000000 1.000000 inf 0
Conservative only 0/5 35.860 dB 0.964553 0.988936 18.811 dB 0.015783
All optimizations 0/5 35.860 dB 0.964553 0.988936 18.811 dB 0.015783

Additional hash checks:

  • baseline == lossless: 5/5.
  • lossy_only == all: 5/5.

The lossless optimizations are bit-exact with the baseline at the final video and audio file level. The Conservative cache changes the denoising trajectory and final outputs, so it is a lossy optimization. The average PSNR, SSIM, and audio metrics show that the quality difference is limited under the tested settings.

@L17807593
L17807593 force-pushed the perf/minimax-h3-conservative-cache branch from f898472 to 4622b9d Compare August 26, 2026 05:04
@lzx1413

lzx1413 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

MiniMax h3已经支持了AdaTaylorCache的feature cache策略,应该包括了这种特殊情况

@L17807593 L17807593 closed this Aug 27, 2026
@L17807593

Copy link
Copy Markdown
Author

感觉优化方向很类似但实现上没有完全包含,PR #38 中的 Conservative cache 位于 denoising loop 层,使用上一次 DiT 预测的完整 velocity 来跳过当前 DiT 调用;AdaTaylorCache 是在 block/feature 层进行缓存和近似。

@lzx1413

lzx1413 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

@L17807593 AdaTaylorCache也是用来跳步加速的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants