schuttdev commited on
Commit
e365e95
·
verified ·
1 Parent(s): c5d3461

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +33 -32
README.md CHANGED
@@ -20,55 +20,56 @@ experts, **no shared expert**. 62 layers, hidden 3072, vocab 200064.
20
  These `.mq*` files run with the hipfire inference engine (HIP/ROCm-direct, no
21
  Python in the hot path). They are **not** GGUF/safetensors and won't load in
22
  llama.cpp / transformers. Attention, router, embedding, and lm_head are kept at
23
- **Q8** throughout; only the routed-expert precision varies below.
 
24
 
25
  ## Files
26
 
27
- | File | Routed experts (gate/up · down) | Size | Target |
28
- |------|----------------------------------|------|--------|
29
- | `MiniMax-M2.7.mq4` | MQ4 · MQ4 | 123.6 GB | best quality |
30
- | `MiniMax-M2.7.mq3-lloyd` | MQ3-Lloyd · MQ3-Lloyd | 102.6 GB | high quality |
31
- | `MiniMax-M2.7.mq2-lloyd` | MQ2-Lloyd+AWQ · **MQ4** | 86.2 GB | **smallest coherent — fits 128 GB unified (Strix Halo / gfx1151)** |
32
 
33
- (More tiers may be added as the precision sweep completes.)
 
 
 
 
 
 
34
 
35
- ## The down-projection is the precision-critical component
36
 
37
  MiniMax-M2 has **no shared expert**, so routed-expert quantization error has no
38
- high-precision path to hide behind. Pushing experts to a uniform 2-bit makes the
39
- model collapse into repetition loops on instruction prompts. The cause is
40
- specific and measurable: the **down projection's** input (the SwiGLU
41
- intermediate) carries **~588× the activation energy** of the gate/up input, so a
42
- 2-bit error in `w2` is amplified ~24× more at the block output than the same
43
- error in `w1/w3`. It behaves like the precision-critical conv1d in other
44
- architectures it doesn't degrade gracefully, it derails generation.
45
-
46
- The fix in `mq2-lloyd` here: keep gate/up at 2-bit (MQ2-Lloyd + gate/up AWQ) but
47
- promote **only the down projection to MQ4**. That restores coherence (correct
48
- factual answers, working code, no loops) at 86 GB smaller than the uniform
49
- 3-bit build. Per-expert promotion does **not** work: MiniMax's router is
50
- load-balanced (no dominant experts to anchor), so the lever is the projection,
51
- not the expert.
52
 
53
  ## Validation
54
 
55
  Forward pass validated against a PyTorch (`transformers` `MiniMaxM2`) reference
56
- on a dimension-faithful tiny random-weight oracle (per-layer hidden-state cosine):
57
- mq4 **0.9996**, mq3-lloyd **0.9994**; attention isolated **0.99990**; routing
58
- (sigmoid + bias top-8) exact. Real 229B generation is coherent on all three files
59
- (greedy): *"why is the sky blue"* → correct Rayleigh-scattering answer;
60
- *"factorial of n"* → correct Python. (Greedy decode can show mild repetition on
61
- open-ended prompts; use light sampling + a repeat penalty + the chat template for
62
- production.)
63
 
64
  ## Quantization
65
 
66
  Source: the official FP8 (E4M3 + F32 block-[128,128] `weight_scale_inv`)
67
  checkpoint, dequantized to F32 then re-quantized. gate/up AWQ uses a shared
68
  per-layer activation scale from an unsloth imatrix (math `W·s @ x/s = W·x` is
69
- exact; redistributes quant difficulty to the salient input channels). The
70
- MQ3-Lloyd indexed-decode MoE GEMV kernel and the per-projection mixed-dtype
71
- dispatch were added to hipfire for this model.
 
72
 
73
  ## Usage (hipfire)
74
 
 
20
  These `.mq*` files run with the hipfire inference engine (HIP/ROCm-direct, no
21
  Python in the hot path). They are **not** GGUF/safetensors and won't load in
22
  llama.cpp / transformers. Attention, router, embedding, and lm_head are kept at
23
+ **Q8** throughout; only the routed-expert precision varies below, and gate/up
24
+ AWQ is baked in on every quantized tier.
25
 
26
  ## Files
27
 
28
+ A 5-tier quality/size spectrum. Each routed expert is `gate/up · down`; the
29
+ **down projection is promoted independently** (see below).
 
 
 
30
 
31
+ | File | gate/up · down | Size | Notes |
32
+ |------|----------------|------|-------|
33
+ | `MiniMax-M2.7.mq4` | MQ4 · MQ4 | 123.6 GB | best quality |
34
+ | `MiniMax-M2.7.mq3-lloyd` | MQ3-Lloyd+AWQ · **MQ4** | 109.6 GB | high quality |
35
+ | `MiniMax-M2.7.mq3` | MQ3-Lloyd uniform | 102.6 GB | balanced 3-bit |
36
+ | `MiniMax-M2.7.mq2-lloyd` | MQ2-Lloyd+AWQ · **MQ4** | 86.2 GB | **fits 128 GB unified (Strix Halo / gfx1151)** |
37
+ | `MiniMax-M2.7.mq2` | MQ2-Lloyd+AWQ · **MQ3-Lloyd** | 79.2 GB | smallest coherent |
38
 
39
+ ## Why the down projection is promoted
40
 
41
  MiniMax-M2 has **no shared expert**, so routed-expert quantization error has no
42
+ high-precision path to hide behind, and uniform 2-bit experts collapse into
43
+ repetition loops. The cause is specific: the **down projection's** input (the
44
+ SwiGLU intermediate) carries **~588× the activation energy** of the gate/up
45
+ input, so a low-bit error in `w2` is amplified ~24× more at the block output. It
46
+ behaves like a precision-critical conv1d it doesn't degrade gracefully.
47
+
48
+ The fix (in every sub-mq4 tier here): keep gate/up cheap (2- or 3-bit + AWQ) but
49
+ **promote only the down projection**. Promoting down to as little as 3-bit
50
+ restores coherence; 4-bit and 6-bit progressively add richness. Per-expert
51
+ promotion does **not** help MiniMax's router is load-balanced (no dominant
52
+ experts to anchor), so the lever is the *projection*, not the expert.
 
 
 
53
 
54
  ## Validation
55
 
56
  Forward pass validated against a PyTorch (`transformers` `MiniMaxM2`) reference
57
+ on a dimension-faithful tiny random-weight oracle (per-layer hidden-state cosine
58
+ **0.9996** mq4 / **0.9994** mq3-lloyd; attention isolated **0.99990**; routing
59
+ exact). Real 229B generation is coherent on all five tiers (greedy): *"why is the
60
+ sky blue"* → correct Rayleigh-scattering answer; *"factorial of n"* → correct
61
+ Python. Greedy decode can show mild repetition on open-ended prompts — use light
62
+ sampling + a repeat penalty + the chat template for production.
 
63
 
64
  ## Quantization
65
 
66
  Source: the official FP8 (E4M3 + F32 block-[128,128] `weight_scale_inv`)
67
  checkpoint, dequantized to F32 then re-quantized. gate/up AWQ uses a shared
68
  per-layer activation scale from an unsloth imatrix (math `W·s @ x/s = W·x` is
69
+ exact). Weights are stored at the listed bit-width and **dequantized to f32 on
70
+ the fly inside the GEMV kernels** the math is f32; the bit-width is a
71
+ storage/bandwidth dial. The MQ3-Lloyd indexed-decode MoE GEMV kernel and the
72
+ per-projection mixed-dtype dispatch were added to hipfire for this model.
73
 
74
  ## Usage (hipfire)
75