Skip to content

feat(h3_causal): add Hopper FP8-FP32 GEMM and fused QKV cache updates - #1657

Merged
llmc-reviewer merged 1 commit into
ModelTC:mainfrom
zhangbilang:h3-h100-fp8
Oct 29, 2026
Merged

llmc-reviewer merged 1 commit into
ModelTC:mainfrom
zhangbilang:h3-h100-fp8

Conversation

@zhangbilang

@zhangbilang zhangbilang commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added an H100 preset for real-time 768p video generation, with audio looping and sequence parallelism.
    • Added FP8 inference with FP32 accumulation for supported H100 workflows.
    • Added a fused attention-cache option for MiniMax H3 causal inference.
  • Documentation
    • Added guidance for building NVIDIA kernels for H100 and configuring FP8 with FP32 accumulation.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request adds SM90 FP8 GEMM support with FP32 accumulation, integrates the new quantization mode into MiniMax-H3, and adds an H100 realtime configuration. It also adds a fused QKV cache path that applies RoPE during rolling-cache storage and reads.

Changes: FP8 accumulation support

Layer / File(s) Summary
Architecture-specific GEMM build and operator registration
lightx2v_kernel/nvidia/CMakeLists.txt, lightx2v_kernel/nvidia/csrc/*, lightx2v_kernel/nvidia/include/lightx2v_kernel_ops.h, lightx2v_kernel/nvidia/python/lightx2v_kernel_nvidia/gemm.py, tools/profile/operator_facts.py
Makes the NVIDIA kernel architecture selectable and adds SM90 FP16- and FP32-accumulation GEMM operators, declarations, Python wrappers, and operator facts.
Accumulation-aware linear dispatch
lightx2v/common/ops/mm/*, lightx2v/models/input_encoders/hf/q_linear.py
Selects GEMM implementations by accumulation dtype and passes the selected callable through FP8 linear operations.
MiniMax-H3 integration and H100 configuration
lightx2v/models/networks/*, lightx2v/models/video_encoders/hf/minimax_h3/video_vae.py, configs/minimax_h3_causal/h100/realtime_768p_fp8_sp8.json, lightx2v_kernel/nvidia/README.md, tools/benchmarks/operator_backends.py
Accepts fp8-f32-accum in MiniMax-H3 model, checkpoint, weight, and VAE paths. Adds an H100 realtime configuration and documents the mode and operator requirements.

Fused QKV cache and RoPE

Layer / File(s) Summary
Rolling-cache mapping and fused store/read operation
lightx2v/models/networks/minimax_h3/causal/kv_cache.py
Adds shared rolling-cache position and FP32 RoPE helpers, plus a fused method that stores and reads Q, K, and V while applying RoPE.
Causal transformer inference wiring
lightx2v/models/networks/minimax_h3/infer/autoregressive/causal/transformer_infer.py
Adds configuration checks and routes Q, K, V, and separate rotary-frequency inputs through the fused cache path.

Priority: Not assessed

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Transformer as MiniMaxH3CausalTransformerInfer
  participant Cache as FP8StepRollingKVCachePool
  participant Kernel as _store_read_rope
  Transformer->>Cache: Submit Q, K, V and rotary frequencies
  Cache->>Kernel: Launch fused cache and RoPE operation
  Kernel-->>Cache: Return Q, K, V outputs
  Cache-->>Transformer: Return Q, K, V outputs
Loading

Possibly related issues

  • ModelTC/LightX2V#1445 — This pull request adds MiniMax-H3 FP8-F32 execution support and an H100 configuration that references quantized H3 checkpoints, but does not add checkpoint files.

Possibly related PRs

  • ModelTC/LightX2V#1650 — Adds the MiniMax-H3 causal FP8 rolling KV cache and fused-QKV inference path extended here with fused QKV RoPE storage and reads.
  • ModelTC/LightX2V#1656 — Adds the operator profiling framework extended here with SM90 FP8 GEMM operators and precision contracts.

Suggested reviewers: stwangyingrui, gushiqiao, llmc-reviewer

Merge Risk: Moderate · up to 8cb52

FP8 inference can fail on an unsupported kernel or in multi-rank fused-cache execution. Fix those paths and clarify the H100 launch configuration before merging.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@llmc-reviewer
llmc-reviewer merged commit d08f0c0 into ModelTC:main Oct 29, 2026
1 of 2 checks passed
@zhangbilang
zhangbilang deleted the h3-h100-fp8 branch October 29, 2026 08:28
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