Diffusers
Safetensors
MiniMax H3
video-generation
reference-to-video
text-to-audio-video
fastvideo
fasth3-omni
fp8
Instructions to use FastVideo/FastH3-Omni-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use FastVideo/FastH3-Omni-FP8 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("FastVideo/FastH3-Omni-FP8", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
[docs]: production-ready FP8 model card
Browse files
README.md
CHANGED
|
@@ -1,95 +1,66 @@
|
|
| 1 |
---
|
| 2 |
license: other
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
# FastH3
|
| 7 |
|
| 8 |
-
FastH3 OmniRef
|
| 9 |
-
RTX 4090 / L40S / RTX 6000 Ada (sm_89), H100 / H200 (sm_90), and any Blackwell part when you prefer FP8.
|
| 10 |
-
It is the original distilled OmniRef student (step 3500) quantized to FP8; nothing is retrained.
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
-
and scored against the bf16 OmniRef teacher with the QAD harness metric: teacher-forced x0 relative L2 per forward on the
|
| 16 |
-
15 held-out OmniRef rows (480p and 768p), averaged over the 8 forwards; `score` is the mean of the video and audio
|
| 17 |
-
columns. Lower is better.
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
| (b) NVFP4 QAD v2 masters, unquantized bf16 (drift from the teacher) | 0.119 | 0.249 | 0.184 |
|
| 25 |
-
| (a) FP8 weights only, bf16 activations | 0.084 | 0.136 | 0.110 |
|
| 26 |
-
| (c) (a) with static per-tensor activation scales, 1000-row max calibration | 0.098 | 0.171 | 0.134 |
|
| 27 |
-
| (c) (a) with static scales, MSE-clipped on 24 rows | 0.096 | 0.172 | 0.134 |
|
| 28 |
-
| for context: NVFP4 initialization (step 0 of the QAD runs) | 0.225 | 0.499 | 0.362 |
|
| 29 |
-
| for context: NVFP4 QAD v2, step 120 | 0.198 | 0.409 | 0.303 |
|
| 30 |
-
|
| 31 |
-
Findings:
|
| 32 |
-
|
| 33 |
-
- **The original student quantizes better to FP8 than the QAD v2 masters.** QAD moved the weights 0.18 away from the
|
| 34 |
-
teacher in bf16 (it tuned them to absorb 4-bit rounding and FP4 attention); FP8's much finer rounding gets nothing back
|
| 35 |
-
from that, so (b) stays 0.18 off the teacher before any FP8 rounding. (a) is used.
|
| 36 |
-
- FP8 error is mostly in the weights (0.110 of the 0.131); activation rounding adds the rest.
|
| 37 |
-
- **Static activation scales do not buy accuracy and FastVideo's FP8 loader does not support them.** With e4m3 the
|
| 38 |
-
rounding error is relative, so the per-tensor scale hardly matters unless values overflow or underflow: MSE clipping chose
|
| 39 |
-
the full calibrated amax for almost every layer, and static scales score 0.134 against 0.131 for dynamic per-token. They
|
| 40 |
-
are not exported. Using them would need a small kernel and loader change (a stored per-layer activation scale, and a
|
| 41 |
-
quantize step that takes it instead of reducing each row), which would also drop the per-token amax pass.
|
| 42 |
-
- The NVFP4 rows use FP4 sparse attention; every FP8 row uses bf16 attention, as the FP8 profile does. Scores are
|
| 43 |
-
therefore not an isolated linear-layer comparison, but they are what each stack delivers.
|
| 44 |
|
| 45 |
## Contents
|
| 46 |
|
| 47 |
| Component | Format |
|
| 48 |
|---|---|
|
| 49 |
-
| `transformer`
|
| 50 |
-
| `text_encoder` | NVFP4 Qwen3-VL text encoder
|
| 51 |
-
| `vae` | Dense light VAE
|
| 52 |
-
| `audio_vae`, `scheduler`, `audio_scheduler`, `processor`, `tokenizer`
|
| 53 |
-
| `
|
| 54 |
-
|
| 55 |
-
Size: DiT 47.4 GiB (24.2 GiB of it is the AdaLN projections the table replaces, 18.0 GiB FP8 linears, 5.2 GiB other),
|
| 56 |
-
encoder 16 GiB, VAE 4 GiB, audio VAE 0.6 GiB, table 0.5 GiB: about 68 GiB on disk with the duplicate `transformer`
|
| 57 |
-
stored once.
|
| 58 |
|
| 59 |
## Running with FastVideo
|
| 60 |
|
| 61 |
-
|
| 62 |
-
and the light VAE come from it rather than from base MiniMax-H3.
|
| 63 |
|
| 64 |
```bash
|
| 65 |
python examples/inference/basic/basic_fasth3_omniref_pdd.py \
|
| 66 |
-
--model-path ./FastH3-
|
| 67 |
-
--
|
| 68 |
-
--
|
| 69 |
-
--
|
|
|
|
|
|
|
| 70 |
--profile rtx-4090
|
| 71 |
```
|
| 72 |
|
| 73 |
-
|
| 74 |
-
bf16 VSA attention on the contract's 128-token tiles (`FASTVIDEO_H3_VSA_FINE_ATTENTION=emulator-bf16`), the dense VAE
|
| 75 |
-
decoder, and a non-resident encoder. On Hopper or Blackwell data-center GPUs the same command works with the `rtx-4090`
|
| 76 |
-
profile, or without a profile and with `FASTVIDEO_H3_VSA_FP4=0`.
|
| 77 |
|
| 78 |
-
|
| 79 |
-
image. A layout whose row timesteps differ raises "No precomputed AdaLN modulation"; drop `--adaln-table` then (the
|
| 80 |
-
projection weights are in the DiT).
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
-
one with a reference audio) are clean: no ghosting, tile seams, flicker or audio dropouts, with the same composition
|
| 86 |
-
as the bf16 student at the same seed.
|
| 87 |
-
- The export loads through the existing pre-quantized FP8 loader ("Loaded 300 pre-quantized FP8 linears").
|
| 88 |
-
- The scoring harness rounds weights and activations with the same math as the export and the deployed kernels, in a
|
| 89 |
-
bf16 GEMM on dequantized operands; the real `_scaled_mm` path was not scored separately.
|
| 90 |
-
- Not tested on a 4090. Peak GPU memory allocated on the GB200 at 480p with the AdaLN table was 37.9 GiB (one image),
|
| 91 |
-
38.3 GiB (image plus audio), 48.6 GiB (video plus image reference). The DiT weights alone are about 23 GiB without the
|
| 92 |
-
AdaLN projections, so a 24 GB card will probably need layerwise block streaming (`offload.dit_layerwise: true` in a YAML
|
| 93 |
-
recipe; the example script does not expose it).
|
| 94 |
|
| 95 |
-
|
|
|
|
| 1 |
---
|
| 2 |
license: other
|
| 3 |
+
license_name: minimax-h3-community-license-agreement
|
| 4 |
+
license_link: https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/LICENSE
|
| 5 |
+
base_model: FastVideo/FastVideo-FastH3-Omni-8-Step-V1
|
| 6 |
+
tags:
|
| 7 |
+
- video-generation
|
| 8 |
+
- text-to-audio-video
|
| 9 |
+
- reference-to-video
|
| 10 |
+
- minimax-h3
|
| 11 |
+
- fastvideo
|
| 12 |
+
- fp8
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# FastH3 OmniRef FP8
|
| 16 |
|
| 17 |
+
FastH3 OmniRef generates a video with synchronized audio from a prompt and ordered image, video, and audio references. It runs as an eight-forward PDD student.
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
This repository contains an **FP8 W8A8 quantization of the BF16 OmniRef model** [`FastVideo/FastVideo-FastH3-Omni-8-Step-V1`](https://huggingface.co/FastVideo/FastVideo-FastH3-Omni-8-Step-V1). It is intended for GPUs without FP4 tensor cores: RTX 4090 / L40S / RTX 6000 Ada (sm_89), H100 / H200 (sm_90), and Blackwell GPUs when an FP8 deployment is preferred.
|
| 20 |
|
| 21 |
+
## Quantization
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
- The attention and MLP projections in all 50 transformer blocks are stored as E4M3 FP8 with per-output-channel weight scales.
|
| 24 |
+
- Activations are quantized dynamically per token at runtime.
|
| 25 |
+
- The remaining transformer tensors stay in BF16: AdaLN and timestep projections, embeddings, norms, VSA compression gates, and the token refiner.
|
| 26 |
+
- The text encoder, video VAE, audio VAE, schedulers, tokenizer, and processor are unchanged from the BF16 release.
|
| 27 |
+
- This is a post-training quantization export. No retraining is applied.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## Contents
|
| 30 |
|
| 31 |
| Component | Format |
|
| 32 |
|---|---|
|
| 33 |
+
| `transformer/`, `transformer_ref/` | Identical FP8 linears (q, k, v, out, fc_in, fc_out of all 50 blocks) plus BF16 norms, embeddings, gates, AdaLN, and token refiner |
|
| 34 |
+
| `text_encoder/` | NVFP4 Qwen3-VL text encoder |
|
| 35 |
+
| `vae/` | Dense light video VAE for reference encoding and decoding |
|
| 36 |
+
| `audio_vae/`, `scheduler/`, `audio_scheduler/`, `processor/`, `tokenizer/` | Unchanged from the BF16 release |
|
| 37 |
+
| `fastvideo_inference.json` | Eight-forward PDD contract, video/audio shifts 12/3, VSA 0.9 with 128-token tiles |
|
| 38 |
+
| `adaln_table.pt` | Precomputed AdaLN outputs for the fixed timestep ladder; skips loading the large AdaLN projections |
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
## Running with FastVideo
|
| 41 |
|
| 42 |
+
Use the OmniRef consumer profile with an FP8 model path. On a 24 GB card, enable layerwise DiT offloading.
|
|
|
|
| 43 |
|
| 44 |
```bash
|
| 45 |
python examples/inference/basic/basic_fasth3_omniref_pdd.py \
|
| 46 |
+
--model-path ./FastH3-OmniRef-FP8 \
|
| 47 |
+
--base-model-path ./FastH3-OmniRef-FP8 \
|
| 48 |
+
--composed-dir ./FastH3-OmniRef-FP8-composed \
|
| 49 |
+
--adaln-table ./FastH3-OmniRef-FP8/adaln_table.pt \
|
| 50 |
+
--image reference.png \
|
| 51 |
+
--prompt "a person on a sofa, lit by a warm lamp, speaking to camera" \
|
| 52 |
--profile rtx-4090
|
| 53 |
```
|
| 54 |
|
| 55 |
+
The `rtx-4090` profile selects FP8 linears, BF16 VSA attention on the 128-token contract, the dense video VAE, and a non-resident encoder. On Hopper or Blackwell data-center GPUs, the same profile applies; alternatively use no profile and disable FP4 attention.
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
## Validation and limits
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
- The export loads through the FastVideo FP8 loader and reproduces the BF16 model's reference conditioning and eight-forward schedule.
|
| 60 |
+
- FP8 changes the numerical output relative to BF16, as expected for W8A8 execution.
|
| 61 |
+
- On a 24 GB card, the DiT does not fit without layerwise streaming. The example profile enables the validated offload path.
|
| 62 |
+
- The AdaLN table covers the shipped schedule and the reference layouts in the model card. Unsupported layouts fall back to the dense AdaLN projections when the table is not passed.
|
| 63 |
|
| 64 |
+
## License
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
MiniMax-H3 and this derivative are governed by the MiniMax-H3 Community License Agreement. See the linked license for terms.
|