[Feature]: VisualGen MiniMax-H3: support AdaLN-pruned checkpoints (multimodalart/MiniMax-H3-Pruned)
The feature, motivation and pitch
Please add support for the community AdaLN-pruned MiniMax-H3 checkpoint (multimodalart/MiniMax-H3-Pruned) in the VisualGen MiniMax-H3 pipeline.
Motivation. The pruned transformer is 40 GiB instead of 66 GiB (39% fewer parameters), and the text encoder is truncated from 66.7 to 52.5 GB. In diffusers this makes MiniMax-H3 fit one 80 GB H100 (see below), which the stock checkpoint cannot do in VisualGen today (weights alone are about 104 GiB with an FP8 transformer, and there is no CPU offload for H3; see #13893).
Current behavior (1.3.0rc29, 1x H200). VisualGen(model=<dir>) detects the MiniMax-H3 pipeline and reads the weights, then MiniMaxH3Transformer.load_weights fails:
ValueError: MiniMax-H3 checkpoint is missing 55 required tensors:
time_embedder.linear_1.weight, time_embedder.linear_1.bias,
time_embedder.linear_2.weight, time_embedder.linear_2.bias,
transformer_blocks.0.adaln_proj.linear.bias, ...
tensorrt_llm/_torch/visual_gen/models/minimax_h3/transformer_minimax_h3.py:859
Why. The pruned checkpoint stores AdaLN differently:
| Stock | Pruned | |
|---|---|---|
| Time embedding | time_embedder.linear_1/2 (MLP) |
time_embedder.table (precomputed, 1025 entries) |
adaln_proj.linear.weight |
(96768, 2688) | (96768, 8) |
adaln_proj bias |
adaln_proj.linear.bias |
adaln_proj.folded_bias |
| Extra tensors | none | adaln_basis [8, 2688], adaln_mean [2688] (in transformer/adaln_affine.safetensors) |
| Transformer config | stock | custom class MiniMaxH3PrunedTransformer3DModel (auto_map), adaln_rank: 8, num_layers: 50 |
The reference implementation is modeling_minimax_h3_pruned.py in the pruned repo. Expanding the weights back to the stock shapes would make the loader pass but restores the 66 GiB transformer, so it does not help. The useful change is a rank-8 AdaLN and time-table path in the transformer.
Reproduction.
- Build a model directory with the stock
vae,scheduler,audio_scheduler,audio_vae,tokenizer,processorandmodular_model_index.jsonfromMiniMaxAI/MiniMax-H3, and thetransformer/andtext_encoder/frommultimodalart/MiniMax-H3-Pruned. - Run
VisualGen(model=<dir>, args=VisualGenArgs.from_yaml("cfg.yaml"))withquant_config: {quant_algo: FP8, dynamic: true},attention_config: {backend: FA4}, resolution 480x832, 124 frames.
Measured with the pruned weights in diffusers (modular pipeline, 832x480, 124 frames, 28 steps, seed 42, 8 prompts, 1x H200):
- Cost: 9.5 GPU-s per video-s vs 20.9 for the stock checkpoint, both with CPU offload (2.2x). This is not a comparison with TensorRT-LLM.
- Quality vs stock: VBench composite +0.003 (95% paired-bootstrap interval -0.000 to +0.006); LPIPS 0.146, similar to the 0.149 between two stock runs on different engines. Only 8 prompts and one seed.
- Memory on an emulated 80 GB H100 (driver-reported free memory capped; real H100 not tested): peak 52.6 GiB at 960x544 and 53.4 GiB at 1344x768 with automatic CPU offload. The stock checkpoint peaks at 76.8 GiB there.
Alternatives
- CPU offload in VisualGen (#13893): would also help H100 fit, but costs latency; pruning shrinks the weights themselves.
- Quantized pruned variants (SDNQ, GGUF, NVFP4 builds exist on Hugging Face) use formats VisualGen does not load.
- Converter to the stock layout: loads, but gives back the full transformer size.
Additional context
- Related: #13893 (offloading for visual_gen) and the open PR #19772 (fuses MiniMax-H3 AdaLN RMSNorm with per-token modulation), which touches the same AdaLN code a pruned path would change.
- Open question: does the truncated 51-layer text encoder load in VisualGen? The failure occurs before that point.
- The FastH3 4-step adapter also expects the original AdaLN width, so we have not tested pruned + distilled in any engine.
- Environment: TensorRT-LLM 1.3.0rc29 (NGC image), 1x H200, includes the MiniMax-H3 support from #18733.
Trimmed log (TensorRT-LLM 1.3.0rc29, 1x H200)
[TensorRT-LLM] TensorRT LLM version: 1.3.0rc29
Loading transformer: 100%|██████████| 15/15
Loading MiniMax-H3 weights: ...
Traceback (most recent call last):
File ".../tensorrt_llm/_torch/visual_gen/executor.py", line 820, in run_diffusion_worker
executor = DiffusionExecutor(
File ".../tensorrt_llm/_torch/visual_gen/executor.py", line 486, in __init__
self._load_pipeline()
File ".../tensorrt_llm/_torch/visual_gen/executor.py", line 521, in _load_pipeline
self.pipeline = loader.load(
File ".../tensorrt_llm/_torch/visual_gen/pipeline_loader.py", line 305, in load
pipeline.load_weights(weights)
File ".../tensorrt_llm/_torch/visual_gen/models/minimax_h3/pipeline_minimax_h3.py", line 237, in load_weights
self.transformer.load_weights(transformer_weights)
File ".../tensorrt_llm/_torch/visual_gen/models/minimax_h3/transformer_minimax_h3.py", line 859, in load_weights
raise ValueError(
ValueError: MiniMax-H3 checkpoint is missing 55 required tensors: time_embedder.linear_1.weight, time_embedder.linear_1.bias, time_embedder.linear_2.weight, time_embedder.linear_2.bias, transformer_blocks.0.adaln_proj.linear.bias, transformer_blocks.1.adaln_proj.linear.bias, transformer_blocks.2.adaln_proj.linear.bias, transformer_blocks.3.adaln_proj.linear.bias ...
[TRT-LLM] [E] [_torch] DiffusionClient: local worker processes exited: exitcode=1
Tensor names: pruned checkpoint vs stock (transformer, from the safetensors index files)
Pruned (multimodalart/MiniMax-H3-Pruned, 637 tensors in the index), outside the blocks:
adaln_basis [8, 2688] (in adaln_affine.safetensors)
adaln_mean [2688] (in adaln_affine.safetensors)
audio_proj_in.{weight,bias}, audio_proj_out.{weight,bias}
context_embedder.{weight,bias}
norm_out.{folded_bias,linear.weight,norm.weight}
proj_in.{weight,bias}, proj_out.{weight,bias}
time_embedder.table
token_refiner.final_norm.weight
Pruned, transformer_blocks.0.* (AdaLN-related entries first):
adaln_proj.folded_bias
adaln_proj.linear.weight [96768, 8]
attn.{norm_k,norm_q}.weight, attn.to_{k,q,v}.weight, attn.to_out.0.weight
ff.net.0.proj.weight, ff.net.2.weight
norm1.weight, norm2.weight
Stock (MiniMaxAI/MiniMax-H3), the entries that differ:
time_embedder.linear_1.{weight,bias}
time_embedder.linear_2.{weight,bias}
transformer_blocks.0.adaln_proj.linear.{weight,bias} weight: [96768, 2688]
I'd like to help with a bounded first slice of #19865: BF16 compatibility for the pruned timestep/AdaLN path, initially targeting T2VA with the composed local model directory described in the issue. Would that be useful before FP8 and additional workflow coverage?
I compared current main (448321fb) with the reference at HF revision 1a0ef5e. A correct port needs more than weight-key remapping:
- Interpolate the FP32 coordinate table from raw timesteps; bypass the stock timestep projection/MLP and avoid a second SiLU.
- Load the table and folded biases explicitly as buffers, preserving FP32 bias addition for both block modulation and
norm_out. The current loader traverses parameters, so those buffers need deliberate handling. - Preserve the modulation-table interface from merged #19772 for the fused AdaLN path, with GPU parity still to be checked.
I ran seven small CPU reference-check groups covering interpolation, dtype/layout, folded-bias arithmetic, output normalization, the synthetic affine-fold identity and metadata. These inspect the reference; no TensorRT-LLM implementation, real checkpoint weights, model inference or quality/memory result has been validated. The truncated encoder's 51-layer config satisfies the current layer-count guard, but its actual outputs remain untested.
Two scope questions before implementation: is the local composed-directory target acceptable, or should direct mixed-source HF model-ID loading be included from the start? Is anyone already implementing this variant? I would keep quantized combinations, offload, LoRA conversion and distillation outside the first slice. Checkpoint registration, a CI example and E2E reference-quality coverage would still be needed for a model-enabling PR under the VisualGen engineering criteria.
Would the reporter or maintainers be able to provide supported large-GPU validation and a pinned pruned-reference recipe/output with an agreed quality threshold? My available T4 cannot validate this full checkpoint, so I do not want to promise a review-ready implementation without that path.
Thanks for picking this up. Yes, a BF16-first slice is useful, with FP8 as a follow-up.
- Composed local directory is fine. It's what we tested (stock VAE/scheduler/tokenizer/processor + pruned
transformer/andtext_encoder/). HF mixed-source loading isn't needed in the first slice. - We aren't implementing this ourselves, and I'm not aware of anyone else doing so. Maintainers may know better.
- Validation: once there's a branch, we can run it on a single H200 and report back the results. We'll compare against the pruned model in diffusers, measuring LPIPS, VBench, peak memory and time. For context, pruned vs stock in diffusers gives VBench composite +0.003 (95% interval -0.000 to +0.006) and LPIPS 0.146, about the level of LPIPS between two stock runs on different engines (0.149). A proposed bar for the port is LPIPS at or below that noise level, but maintainers should set the threshold. We've only checked video output, not audio.
- Scope: agreed to keep quantization, offload, LoRA and distillation out of the first slice. The 4-step FastH3 adapter doesn't merge with the pruned AdaLN, so that case needs a separate answer.
Maintainers: does this scope match what you'd accept?
Thanks @atokayev, the BF16/local-directory scope and H200 validation offer are helpful.
I have prepared a local prototype for the Diffusers pruned representation: metadata-driven rank-width projections, raw-timestep table interpolation, and explicit FP32 folded-bias/buffer loading. There are 37 passing isolated CPU checks, but these bypass native package initialization and use CPU substitutes for native Linear/RMSNorm in the arithmetic checks. Native constructor/loader tests, GPU kernels and full generation remain unvalidated; I have not pushed the prototype or opened a PR.
The overlap check found #20926, which already adds H3 pruned-curve support for Comfy NVFP4. The Diffusers checkpoint here has different metadata and keys (adaln_rank, time_table_size, time_embedder.table, and folded_bias), but both implementations touch the same transformer methods.
@karljang, would you prefer this BF16 Diffusers loader support to be handled alongside #20926, or as a follow-up reusing its shared curve path? I'd like to coordinate before opening a separate PR.
For the eventual H200 comparison, could you share the pinned Diffusers recipe/component revisions, @atokayev, and whether audio comparison can be included? The proposed T2VA scope needs audio coverage as well as video, with the acceptance thresholds still for maintainers to agree.
Thanks, coordinating with #20926 makes sense. @karljang, we'd be glad to validate either route.
Pinned reference: pruned repo multimodalart/MiniMax-H3-Pruned @ 1a0ef5e65b639e84af81d883817968532180e9c7; diffusers 0.40.0 modular pipeline (workflow="t2va", trust_remote_code=True), BF16, torch 2.14.0a0, Python 3.12.3; 832x480, 124 frames, 28 steps, seed 42. I'll confirm the stock MiniMaxAI/MiniMax-H3 revision and the transformers version when I rebuild the environment.
Audio: our existing diffusers runs produced video comparisons only; the audio output was not saved or scored. We can rerun the reference with audio saved, but we'd need agreement on an audio metric first. Maintainers, any preference?
Validation is on H200 once a branch exists.