nwoolmer commited on
Commit
2dd87cc
Β·
verified Β·
1 Parent(s): 78c1274

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +212 -0
README.md ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ base_model: deepgrove/maple-preview
4
+ base_model_relation: quantized
5
+ language: en
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - hipfire
9
+ - mixture-of-experts
10
+ - reasoning
11
+ - ternary
12
+ - rdna
13
+ - rocm
14
+ ---
15
+
16
+ # Maple-Preview β€” hipfire HFQ (arch 15)
17
+
18
+ A [hipfire](https://github.com/warpfront/hipfire) build of
19
+ [`deepgrove/maple-preview`](https://huggingface.co/deepgrove/maple-preview),
20
+ a 20B-A1B natively-ternary reasoning MoE, for AMD RDNA GPUs.
21
+
22
+ | | |
23
+ |---|---|
24
+ | File | `maple-preview.mq2lloydu` |
25
+ | Size | 6,499,340,288 bytes (6.05 GiB) |
26
+ | sha256 | `7fb52fe72c1a0a4455d0fe3a8109b0df66fa53782f41d8b257140d3e966645db` |
27
+ | arch_id | 15 |
28
+ | Body carrier | `MQ2G256LloydU` (qt=51), 2.250 bpw |
29
+ | lm_head | Q8 |
30
+ | Context | 131,072 |
31
+
32
+ ```bash
33
+ hipfire run maple-preview "Prove that sqrt(2) is irrational."
34
+ ```
35
+
36
+ ## The body is a packing, not a quantization
37
+
38
+ Every linear weight in Maple-Preview is already exactly `{-s, 0, +s}` with one
39
+ bf16 scale per output row. `MQ2G256LloydU` (qt=51) is an **unrotated** MQ2-Lloyd
40
+ carrier built for this: it stores those three levels exactly.
41
+
42
+ Verified end-to-end against the **original** `deepgrove/maple-preview`
43
+ safetensors β€” not against our own dequantizer, which could only confirm a shared
44
+ misunderstanding:
45
+
46
+ ```
47
+ model.layers.0.mlp.experts.0.gate_proj.weight max|err| = 0
48
+ model.layers.0.mlp.experts.0.down_proj.weight max|err| = 0
49
+ model.layers.0.self_attn.q_proj.weight max|err| = 0
50
+ model.layers.0.self_attn.o_proj.weight max|err| = 0
51
+ ```
52
+
53
+ Every bitwise difference is a signed zero (`-0.0` β†’ `+0.0`), which is
54
+ numerically irrelevant. The converter *refuses* a non-ternary row rather than
55
+ falling back to lossy quantization, so a clean convert is itself evidence the
56
+ property holds across all 18,528 ternary tensors (19,579,011,072 weights).
57
+
58
+ The accuracy this model loses relative to full precision therefore comes from
59
+ the runtime, not the weights.
60
+
61
+ ## Measured quality
62
+
63
+ Against a BF16 reference β€” `deepgrove/maple-preview` converted to a BF16 GGUF
64
+ and scored with llama.cpp on CPU β€” over 2,048 teacher-forced wikitext tokens,
65
+ identical tokens and protocol on both sides:
66
+
67
+ | KV tier | lm_head | mean KL | top-1 agreement |
68
+ |---|---|---|---|
69
+ | **bf16** (default) | **Q8** | **0.0511** | **91.9%** |
70
+ | q8 | Q8 | 0.0842 | 90.8% |
71
+
72
+ The lm_head is free: a bf16 head gives the *identical* 0.0511, so Q8 costs
73
+ nothing and decodes 23% faster.
74
+
75
+ **Interpreting 0.0511.** It is close to the floor for this model rather than a
76
+ defect. llama.cpp rounds activations to bf16 before every matmul
77
+ (`vec_dot_type = GGML_TYPE_BF16`, Ρ = 2⁻⁸), so the reference is itself
78
+ precision-limited: an F16 reference built from the same weights differs from the
79
+ BF16 reference by **mean KL 0.0357** β€” the same order as our entire divergence
80
+ from it β€” and this build sits *closer* to the more precise reference (0.0477)
81
+ than to the bf16 one (0.0511). Maple is unusually sensitive to activation
82
+ precision, plausibly because ternary weights and 256-expert top-8 routing make
83
+ expert selection easy to perturb.
84
+
85
+ At position 0, where attention has no history to read, KL is **1.2e-4**.
86
+
87
+ ## Performance and the lm_head
88
+
89
+ gfx1151 (Radeon 8060S / Strix Halo), bf16 KV, greedy, 1,500 tokens, 3 paired
90
+ interleaved repetitions. KL is against the BF16 reference on the same 2,048
91
+ tokens as above.
92
+
93
+ | lm_head | bpw | mean KL | top-1 | decode |
94
+ |---|---|---|---|---|
95
+ | **q8** (shipped in the base) | 8.5 | **0.0511** | **91.9%** | ~145 tok/s |
96
+ | q4k (overlay) | 4.5 | 0.0640 | 90.1% | ~168 tok/s |
97
+ | bf16 (overlay) | 16 | 0.0511 | 91.7% | ~118 tok/s |
98
+
99
+ Prefill is roughly 800 tok/s on short prompts.
100
+
101
+ **q8 is the default because bf16 is strictly dominated** β€” identical KL, 23%
102
+ slower. A bf16 head costs throughput and buys exactly zero accuracy.
103
+
104
+ **q4k is offered for throughput**, not recommended by default: +16% decode for
105
+ +25% mean KL and βˆ’1.8pp top-1. Note DeepGrove *do* ship a Q4_K head in their own
106
+ llama.cpp example, and that is the right call there β€” on their CPU path the same
107
+ swap buys 49% (252.7 vs 169.8 tok/s) rather than 16%, because the MoE body
108
+ dominates decode differently on a GPU. Same decision, different machine.
109
+
110
+ ## Head variants ship as overlays, not as separate models
111
+
112
+ The head is 2.7% of the file, so shipping a whole model per carrier would
113
+ duplicate the identical 6.17 GB body every time. Instead the base carries the
114
+ recommended q8 head and runs standalone, and alternative carriers are
115
+ single-tensor `.hfq` overlays that shadow `lm_head.weight` at load:
116
+
117
+ | file | size |
118
+ |---|---|
119
+ | `maple-preview.mq2lloydu` (base, q8 head) | 6.50 GB |
120
+ | `maple-head-q4k.hfq` | 188 MB |
121
+ | `maple-head-bf16.hfq` | 635 MB |
122
+
123
+ Each overlay is a normal `.hfq` carrying a single tensor at the same logical
124
+ shape as the base's head, which is what lets hipfire attach it at load time and
125
+ shadow `lm_head.weight`. They are listed in the registry entry under `heads`,
126
+ with their own sha256, and are rebuilt with:
127
+
128
+ ```bash
129
+ hipfire-quantize --format maple --input <safetensors dir> \
130
+ --output maple-head-q4k.hfq --head-quant q4k --head-only
131
+ ```
132
+
133
+ An overlay is not an approximation of a full build β€” it reproduces one exactly
134
+ (q4k overlay 0.0640 KL / 90.1% top-1; a monolithic q4k build measures the same).
135
+ Three full variants would be 19.63 GB; this is 7.30 GB, and switching heads
136
+ costs 188–635 MB rather than a 6.5 GB re-download.
137
+
138
+ ## Recommended settings
139
+
140
+ Use the **vendor's** values β€” they are not the Qwen defaults, despite the shared
141
+ tokenizer:
142
+
143
+ ```
144
+ temperature 1.0
145
+ top_p 0.95
146
+ ```
147
+
148
+ Source: DeepGrove's own llama.cpp fork,
149
+ [`github.com/deepgrove-ai/llama.cpp`](https://github.com/deepgrove-ai/llama.cpp),
150
+ which `deepgrove/maple-preview-GGUF` links to as the official setup. There is no
151
+ `generation_config.json` upstream and the model card names no sampler, so that
152
+ README is the only first-party source. `top_k` / `min_p` values circulating
153
+ elsewhere are **not** from DeepGrove.
154
+
155
+ **The chat template matters.** Maple's embedded template ends its generation
156
+ prompt with `<|im_start|>assistant\n<think>\n` β€” including the thinking prefix.
157
+ Omitting it makes the model open its own reasoning block, starting every
158
+ generation off-distribution *inside* the block where degenerate loops occur. On
159
+ a fixed prompt across 8 seeds, the loop rate went from **5/8 to 0/8** once the
160
+ prefix and temperature were corrected. hipfire applies the template from the
161
+ HFQ metadata automatically.
162
+
163
+ ## KV cache
164
+
165
+ Defaults to **bf16**, overridable with `--kv-mode q8`.
166
+
167
+ Maple is 3:1 sliding-window(512) / global-NoPE attention. Q8 KV costs 39% of the
168
+ measured divergence, and the damage is concentrated in the **tail** rather than
169
+ spread as uniform blur β€” the median position moves only 24%, but the worst goes
170
+ 10.36 β†’ 4.21 nats. Rare catastrophic positions are what derail long generations.
171
+
172
+ bf16 KV costs 1.88Γ— the KV bytes (26,112 β†’ 49,152 B/token; +2.81 GiB at 131k
173
+ context) and ~2% decode. Use `--kv-mode q8` to trade that fidelity back for
174
+ memory.
175
+
176
+ ## Limitations
177
+
178
+ These are the **model's**, not the port's β€” see the
179
+ [upstream card](https://huggingface.co/deepgrove/maple-preview):
180
+
181
+ > This preview received minimal post-training for agentic tasks and only
182
+ > small-scale general reinforcement learning.
183
+
184
+ Wikitext perplexity is high (~57 on the standard protocol) where a comparable
185
+ peer scores ~7.7. That is the model, not the packing: KL against a
186
+ full-precision reference is 0.05, and DeepGrove's own ternary GGUF scores within
187
+ 0.2% of a BF16 run of the same weights. Maple is not *uncertain* on raw prose β€”
188
+ its entropy matches its peer β€” it is confidently wrong on it, which is
189
+ consistent with a reasoning-focused preview.
190
+
191
+ **Give it room to think.** Maple spends a large share of its budget reasoning,
192
+ and a short cap truncates it mid-derivation in a way that reads like a
193
+ repetition loop but is not one. On a five-house logic puzzle, 8/8 sampled runs
194
+ hit a 12,000-token cap without converging β€” while at 40,000 tokens they
195
+ terminated cleanly with the correct answer after ~84–134 KB of reasoning. If
196
+ output looks stuck, raise `max_tokens` before suspecting the model.
197
+
198
+ Most of what otherwise looked like intrinsic looping was configuration: with
199
+ the vendor template and temperature above, the loop rate on a fixed prompt went
200
+ from 5/8 to 0/8 across 8 seeds.
201
+
202
+ ## Provenance
203
+
204
+ MIT, inherited from `deepgrove/maple-preview`. Weights are DeepGrove's,
205
+ carried into HFQ losslessly. Converted with:
206
+
207
+ ```bash
208
+ hipfire-quantize --format maple \
209
+ --input <maple-preview safetensors dir> \
210
+ --output maple-preview.mq2lloydu \
211
+ --head-quant q8
212
+ ```