danielhanchen commited on
Commit
f5d548a
·
verified ·
1 Parent(s): f43f737

Document the Ref2VA pre-quantized denoisers

Browse files
Files changed (1) hide show
  1. README.md +58 -12
README.md CHANGED
@@ -25,10 +25,11 @@ Pre-quantized PyTorch checkpoints of
25
  [MiniMaxAI/MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3), for diffusers plus torchao.
26
 
27
  MiniMax H3 is an omni-modal generative system that produces video with native stereo audio, up to
28
- 15 seconds at 24 FPS with 32 kHz stereo audio. The files here quantize the `fl2va_pruned` H3-Base
29
- first-and-last-frame variant, which takes zero, one or two input images plus text. Both schemes
30
- quantize the same 200 main-block matmuls, 95.8% of the parameters, and leave every 1-D gain, every
31
- bias and the whole modulation path bit-identical.
 
32
 
33
  ## Examples
34
 
@@ -61,24 +62,69 @@ FP8
61
 
62
  ## Files
63
 
 
 
 
 
 
 
 
64
  | File | Size |
65
  |---|---|
66
  | `MiniMax-H3-INT8.pt` | 18.86 GiB |
 
67
  | `MiniMax-H3-FP8.pt` | 18.87 GiB |
68
 
69
- **Both checkpoints live here, INT8 included.** The two are the same repo on purpose: they are one
70
- artifact built two ways, and a loader picks between them by filename. Against the 40.23 GB bf16
71
- pruned source either one takes the checkpoint to 20.25 GB and the end-to-end render peak from
72
- 57.11 GB to 36.97 GB. Prefer INT8 with `torch.compile` and FP8 without it.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  Both are torchao pre-quantized transformer state dicts, per-output-channel absmax scales, INT8
75
  symmetric and FP8 e4m3. The skeleton is built on `meta` and the quantized subclass tensors are
76
  assigned rather than copied, so dense bf16 never touches the GPU. Each file carries
77
- `base_model_id = MiniMaxAI/MiniMax-H3` and
78
- `base_checkpoint = Comfy-Org/MiniMax-H3/diffusion_models/minimax_h3_fl2va_pruned_bf16.safetensors`
79
- in its metadata, which the loader checks before accepting it.
 
80
 
81
- The source is `minimax_h3_fl2va_pruned_bf16.safetensors` from
82
  [Comfy-Org/MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3), which already has the
83
  modulation pruned to `[96768, 8]` per block plus a shared `adaln_t_table [1025, 8]`. Note that
84
  stable-diffusion.cpp cannot load these, it has no int8 linear path that reads external per-channel
 
25
  [MiniMaxAI/MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3), for diffusers plus torchao.
26
 
27
  MiniMax H3 is an omni-modal generative system that produces video with native stereo audio, up to
28
+ 15 seconds at 24 FPS with 32 kHz stereo audio. The files here quantize the `fl2va_pruned`
29
+ H3-Base first-and-last-frame variant, which takes zero, one or two input images plus text, and the
30
+ `ref2va_pruned` omni-reference variant, which takes a prompt plus up to twelve image, video and
31
+ audio references. Both schemes quantize the same 200 main-block matmuls, 95.8% of the parameters,
32
+ and leave every 1-D gain, every bias and the whole modulation path bit-identical.
33
 
34
  ## Examples
35
 
 
62
 
63
  ## Files
64
 
65
+ H3 ships two denoiser partitions and a load opens exactly one. `transformer/` serves the keyframe
66
+ workflow `fl2va`, which also covers text-only generation; `transformer_ref/` serves the
67
+ omni-reference workflow `ref2va`. They are separate weights, so each partition has its own
68
+ checkpoints here and the two sets are not interchangeable.
69
+
70
+ Keyframe and text-only (`fl2va`, from `transformer/`):
71
+
72
  | File | Size |
73
  |---|---|
74
  | `MiniMax-H3-INT8.pt` | 18.86 GiB |
75
+ | `MiniMax-H3-INT8-ConvRot.pt` | 18.86 GiB |
76
  | `MiniMax-H3-FP8.pt` | 18.87 GiB |
77
 
78
+ Omni-reference (`ref2va`, from `transformer_ref/`):
79
+
80
+ | File | Size |
81
+ |---|---|
82
+ | `MiniMax-H3-Ref2VA-INT8-ConvRot.pt` | 18.86 GiB |
83
+ | `MiniMax-H3-Ref2VA-FP8.pt` | 18.87 GiB |
84
+
85
+ **Every checkpoint lives here, INT8 included.** One repo on purpose: these are one artifact built
86
+ a few ways, and a loader picks between them by filename. Against the 40.23 GB bf16 pruned source
87
+ any of them takes the checkpoint to 20.25 GB and the end-to-end render peak from 57.11 GB to
88
+ 36.97 GB. Prefer INT8 with `torch.compile` and FP8 without it.
89
+
90
+ Pick the pair that matches the workflow you are running. The two partitions have the same class,
91
+ the same config and the same 635-key state dict, so a keyframe checkpoint seeded into the
92
+ reference workflow loads cleanly, passes every metadata check and generates from the wrong
93
+ weights rather than failing. The `Ref2VA` in the filename is the only thing that distinguishes
94
+ them.
95
+
96
+ The `-ConvRot` INT8 files store their weights in a Hadamard-rotated basis and need a loader that
97
+ rotates the activations to match; they carry a format tag that makes an older loader refuse them
98
+ rather than read them as plain INT8. Where both an INT8 and an INT8-ConvRot file exist, the
99
+ ConvRot one is the newer build.
100
+
101
+ ### Reference (Ref2VA) build recipe
102
+
103
+ Identical to the keyframe rungs apart from the source file: 313 Linears quantized, 55 skipped, the
104
+ `adaLN` modulation path left at full precision, and on the INT8 arm a ConvRot Hadamard rotation at
105
+ group size 256 over all 313. The source is
106
+ `minimax_h3_ref2va_pruned_bf16.safetensors` from
107
+ [Comfy-Org/MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3), which is the reference
108
+ partition with the same curve-form modulation pruning as the keyframe one, and both files record
109
+ it in `metadata.base_checkpoint`.
110
+
111
+ Verified before publishing: each file loads through the pre-quantized path against the
112
+ `transformer_ref` config with no missing or unexpected keys, and renders a 640x384, 124-frame
113
+ reference clip. Measured against the reference-partition bfloat16 denoiser at the same prompt,
114
+ seed and shape (20 steps, two prompts, one image reference), the same composition comes back with
115
+ fine detail redistributed: SSIM 0.92 and 0.82 for INT8 and 0.88 and 0.78 for FP8, against a
116
+ determinism ceiling of 1.00 for the bfloat16 arm rendered twice. Those numbers are a divergence
117
+ measure, not a quality score.
118
 
119
  Both are torchao pre-quantized transformer state dicts, per-output-channel absmax scales, INT8
120
  symmetric and FP8 e4m3. The skeleton is built on `meta` and the quantized subclass tensors are
121
  assigned rather than copied, so dense bf16 never touches the GPU. Each file carries
122
+ `base_model_id = MiniMaxAI/MiniMax-H3` and a `base_checkpoint` naming the exact source it was cut
123
+ from (`.../minimax_h3_fl2va_pruned_bf16.safetensors` or
124
+ `.../minimax_h3_ref2va_pruned_bf16.safetensors`) in its metadata, which the loader checks before
125
+ accepting it.
126
 
127
+ The keyframe source is `minimax_h3_fl2va_pruned_bf16.safetensors` from
128
  [Comfy-Org/MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3), which already has the
129
  modulation pruned to `[96768, 8]` per block plus a shared `adaln_t_table [1025, 8]`. Note that
130
  stable-diffusion.cpp cannot load these, it has no int8 linear path that reads external per-channel