ZixiQi commited on
Commit
e6b2bbf
·
verified ·
1 Parent(s): 1cc6023

Simplify model card

Browse files
Files changed (1) hide show
  1. README.md +2 -63
README.md CHANGED
@@ -9,71 +9,10 @@ tags:
9
  - draft-model
10
  - gqa
11
  - vllm
12
- - torchspec
13
- - minimax
14
  - nvfp4
15
  - quantized
16
  ---
17
 
18
- # MiniMax-M3-EAGLE3-GQA-NVFP4 (W4A4)
19
 
20
- **NVFP4 W4A4** quantization of [`Inferact/MiniMax-M3-EAGLE3-GQA`](https://huggingface.co/Inferact/MiniMax-M3-EAGLE3-GQA)
21
- the 1-layer **grouped-query-attention (GQA)** EAGLE3 speculative-decoding draft for
22
- [`MiniMaxAI/MiniMax-M3`](https://huggingface.co/MiniMaxAI/MiniMax-M3), served with
23
- **[vLLM](https://github.com/vllm-project/vllm)** and trained with **[TorchSpec](https://github.com/lightseekorg/TorchSpec)**.
24
-
25
- Only the draft's **MLP** (`layers.0.mlp.{gate,up,down}_proj`, `intermediate_size=18432`) is quantized —
26
- **both weights and activations to FP4** (NVFP4, group size 16). Everything else (`embed_tokens`,
27
- `lm_head`, `fc`, `self_attn`, all norms) stays bf16. Produced with NVIDIA TensorRT Model Optimizer
28
- (`quant_method: modelopt`, `quant_algo: NVFP4`); W4A4 engages the Blackwell FP4 tensor cores.
29
-
30
- The base draft is a 1-layer dense Llama (`LlamaForCausalLMEagle3`) on MiniMax-M3's `hidden_size=6144` /
31
- `vocab_size=200064`; at serve time it shares the target's embedding and LM head (EAGLE3). See the
32
- [base model card](https://huggingface.co/Inferact/MiniMax-M3-EAGLE3-GQA) for training data and bf16
33
- acceptance numbers, and `config.json` here for the full architecture.
34
-
35
- ## Why MLP-only
36
-
37
- Profiling the draft's decode path shows the MLP is the bulk of the draft's *compressible* compute; the
38
- `lm_head` (full 200k vocab) and `self_attn` are the larger remaining bf16 ops. Quantizing the MLP
39
- weights+activations to FP4 cuts its weight bandwidth ~4× and runs the GEMM on the FP4 tensor cores, while
40
- keeping the output-distribution-sensitive `lm_head`/`fc`/attention in bf16 to preserve acceptance.
41
-
42
- ## Calibration
43
-
44
- The activation `input_scale` for each MLP linear was calibrated by capturing `max|input|` on the **bf16**
45
- draft while serving MiniMax-M3 (TP4 + EP, `num_speculative_tokens=3`, `--enforce-eager`) over a short
46
- MT-Bench drive, aggregated by max across TP ranks. Calibration used the `MiniMaxAI/MiniMax-M3-MXFP8`
47
- target (its hidden states are representative for capturing MLP-input amax). NVFP4 sets
48
- `input_scale = amax / (fp4_max·fp8_e4m3_max) = amax / 2688`.
49
-
50
- | MLP input | amax | input_scale |
51
- |---|---|---|
52
- | gate/up (post-attention-norm output) | 40.75 | 0.01515997 |
53
- | down (SiLU(gate)·up) | 119.50 | 0.04445685 |
54
-
55
- ## Serving (vLLM)
56
-
57
- ```bash
58
- vllm serve MiniMaxAI/MiniMax-M3 \
59
- --speculative-config '{"method":"eagle3","model":"Inferact/MiniMax-M3-EAGLE3-GQA-NVFP4","num_speculative_tokens":3}'
60
- ```
61
-
62
- > Serving a **quantized** EAGLE3 draft requires a vLLM whose eagle3 first layer constructs its `qkv_proj`
63
- > under the real `self_attn.qkv_proj` module path, so the quant config's exclude-matching keeps the (bf16)
64
- > attention out of quantization. Otherwise the excluded attention is wrongly quantized and the 2×hidden
65
- > fused-QKV weight fails to load.
66
-
67
- ## Files
68
-
69
- | File | Notes |
70
- |---|---|
71
- | `model.safetensors` | FP4-packed MLP (`weight` U8, `weight_scale` F8_E4M3 per-16-group, `weight_scale_2` F32, `input_scale` F32); bf16 elsewhere |
72
- | `config.json` | Original EAGLE3 config + `quantization_config` (`quant_algo: NVFP4`, group 16) |
73
- | `hf_quant_config.json` | ModelOpt quant metadata; `exclude_modules: [embed_tokens, fc, self_attn, lm_head]` |
74
-
75
- ## Status
76
-
77
- Acceptance-rate and decode-latency evaluation vs the bf16 draft is **pending**. Prior W4A4 MLP
78
- quantization of sibling MiniMax-M3 EAGLE3 GQA drafts was quality-neutral (acceptance / accuracy within
79
- run-to-run noise), so no quality regression is expected.
 
9
  - draft-model
10
  - gqa
11
  - vllm
 
 
12
  - nvfp4
13
  - quantized
14
  ---
15
 
16
+ # MiniMax-M3-EAGLE3-GQA-NVFP4
17
 
18
+ W4A4 NVFP4 MLP-quantized version of [`Inferact/MiniMax-M3-EAGLE3-GQA`](https://huggingface.co/Inferact/MiniMax-M3-EAGLE3-GQA).