Skip to content

MiniMax-H3-Image: fused blocks and tabulated AdaLN modulation (0.18.0) - #29

Merged
iamwavecut merged 1 commit into
mainfrom
feat/minimax-h3-image
Nov 10, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
feat/minimax-h3-image

Conversation

@iamwavecut

@iamwavecut iamwavecut commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Adds MiniMaxH3ImageTransformer2DModel (Diffusers pull request 15230) to the minimax_h3 fused family. The image model has the MiniMax-H3 blocks, so the fused prologues, attention and epilogues are the same.

MiniMax-H3-Image samples six fixed timesteps (and one noise level for reference images), and its per-block AdaLN projections read only the timestep embedding. minimax_h3.tabulate_modulation(model, timesteps) computes their outputs for those timesteps from the loaded weights and replaces the projections, the timestep MLP and the output-norm projection with tables: 13.0 of the 33.1 billion transformer parameters (26 GB in BF16) are not stored. add_modulation_tables builds the empty tables before a tabulated checkpoint loads, and install runs the forward with table lookups. A timestep outside the table raises ValueError.

fuse_linears no longer keeps the replaced projections alive until it returns. Before, it iterated over a list of all modules, so a text encoder could hold up to twice its packed weights on the device during fusion.

Tests: the tabulated forward matches the original forward (tiny model), the tables load into an empty skeleton, and an unknown timestep raises.

Validation on an RTX PRO 6000 Blackwell (Torch 2.12.1, CUDA 13.0) with the GPTQ W4A8 checkpoint WaveCut/MiniMax-H3-Image-OrbitQuant-W4A8: a 2048×2048 image takes 2.94 s end to end (six transformer steps 2.15 s) with a 27.3 GiB device peak, and LPIPS against the BF16 original is 0.182 over 18 prompts. With the PyTorch allocator capped at 30.5 GiB, the transformer and the text encoder now load and run resident; before the fuse_linears change the same load ran out of memory during text-encoder fusion.

Add MiniMaxH3ImageTransformer2DModel to the minimax_h3 fused family.
tabulate_modulation replaces the per-block AdaLN projections, the
timestep MLP and the output-norm projection with tables for the model's
fixed timesteps (13.0 of 33.1 billion parameters); add_modulation_tables
builds the empty tables before a tabulated checkpoint loads.

fuse_linears no longer keeps every replaced projection alive until it
returns, so a text encoder no longer holds its packed weights twice on
the device during fusion.
@iamwavecut
iamwavecut merged commit 73beb8f into main Nov 10, 2026
3 checks passed
@iamwavecut
iamwavecut deleted the feat/minimax-h3-image branch November 10, 2026 18:17
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.

1 participant