Repository navigation
docs: a Zyphra family page — sizes, quantization picks, and the stale-quantizer trap (Refs #1036) - #1345
docs: a Zyphra family page — sizes, quantization picks, and the stale-quantizer trap (Refs #1036)#1345bong-water-water-bong wants to merge 1 commit into
Conversation
…-quantizer trap (Refs #1036) The three Zyphra architectures had no page of their own, and the two changes that made a Zamba2 GGUF the size of its checkpoint (engine #1036: the shared block stored once per block, and the per-layer MLP adapter stored as a low-rank pair instead of baked into a full FFN matrix) are invisible from any single model file. docs/zyphra-models.md records: - the sizes, measured: 7B 16,875,503,904 -> 14,722,123,360 B (-2.005 GiB, 771 -> 786 tensors) and 2.7B 6,009,822,848 -> 5,328,903,360 B (-0.63 GiB, 520 -> 531), plus the fact that both forms load from one binary (an older GGUF keeps the merged path, so nothing published before the change stops working); - why the forms are not bit-identical (KLD 0.000067 at 2.7B, 0.000095 at 7B — f32-merged-at-conversion vs pair-at-run-time) and therefore why a quantized arm has to be re-measured rather than inherited; - the picks under the family bar (mean KLD <= 0.03 AND same-top-1 >= 95 %), including the decision this page exists to record: **Zamba2-7B-Instruct moves from Q5_K_M to Q6_K** (5829 MiB, 0.010430, 96.593 %), with Q5_K_M kept visible as the smaller file that no longer clears the bar (4938 MiB, 0.019383, 94.792 % - the adapter form moves this model's top-1 down 0.52 points against 0.025 of headroom, while the 2.7B moved up); - the trap: a llama-quantize older than the F16 default quantizes the rank-128 adapter pair, and because the block formats need input_size >= 256 while the float path only needs % 4, that puts the pair's B matmul on the CPU for every hybrid layer - 9 of 3051 nodes and pp512 463.66 vs 589.47 tok/s, with no error to say so. The explicit flag is `--tensor-type ffn_gate_up_adapter=f16` (+31.8 MiB); - the layout asserts worth making before trusting a PPL (ffn_up x2, rank key = 128, 9+9 / 13+13 adapters), and the current HRX placement caveat for `-ngl 99` (engine #1316, base-level, affects both forms). docs/models.md gains a pointer so the page is reachable from the models index. Refs #1036
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 677af4e21db9726d7665b9c376cc332fc8740d28. Docs only, and every figure I could hold it to checks out.
- Sizes: 16,875,503,904 → 14,722,123,360 B = −2.0055 GiB (7B), and 6,009,822,848 → 5,328,903,360 B = −0.6342 GiB (2.7B). On disk,
~/models/zyphra-orig/ref/Zamba2-2.7B-instruct-bf16.ggufis exactly 6,009,822,848 B andZamba2-7B-Instruct-bf16-adapter.ggufexactly 14,722,123,360 B, so two of the four numbers are files, not transcriptions. - The picks match the record they cite:
models/zyphra-orig/quant/PUBLISH-READY.md:45has Q6_K, 5829 MiB, KLD 0.010430, top-1 96.593 %, and:47hasQ5_K_Mwithdrawn at 4938 MiB, 0.019383, 94.792 %, "misses top-1 by 0.21 points" (95 − 94.792 = 0.208 ✔). The decision not to restate it inside another lane's working doc is right. - The stale-quantizer cost: pp512 463.66 / 589.47 = 0.787, i.e. the "silent 21 %" ✔.
--tensor-type ffn_gate_up_adapter=f16as the remedy follows from the block formats'input_size ≥ 256versus the rank-128 pair. - Every relative link in
docs/zyphra-models.mdresolves. Thedocs/models.mdpointer is one paragraph.copyright.py --checkrc 0. Refs #1036on a closed issue, with nothing re-opened, is the right form.
Note: the #1316 caveat (tok-embd GET_ROWS off HRX at -ngl 99) is accurate for main today. Engine #1344 shows that's by design (LLAMA_INPUT_LAYER_ON_DEV), so when #1344 lands with its rebased pin, this line can say "by design, opt-in to move it" rather than reading as a defect.
Adds
docs/zyphra-models.md— the Zyphra family (Zamba2, Zamba v1, BlackMamba) — and a pointer to it fromdocs/models.md. Refs #1036(closed, so nothing is being re-opened by this).
It exists because two changes made a Zamba2 GGUF the size of its checkpoint, and neither is visible from a single model file: the shared
transformer block is stored once per shared block and aliased per layer (#203), and each layer's rank-128 MLP adapter is stored as a
low-rank pair and applied in the graph as
base + B*(A*x)instead of being baked into a full FFN matrix (#218). What the page records:5,328,903,360 B (−0.63 GiB), 520 → 531. Both forms load from one binary, so a GGUF written before the change keeps working.
why a quantized arm must be re-measured, not inherited — which is exactly what forced the pick decision below.
Zamba2-7B-Instruct moves Q5_K_M → Q6_K (5829 MiB, KLD 0.010430, top-1 96.593 %), with Q5_K_M kept visible as the smaller file
that no longer clears the bar (4938 MiB, 0.019383, 94.792 %, −0.21 points). The reason is stated: the adapter form moved this
model's top-1 down 0.52 points against 0.025 of headroom, while it moved the 2.7B's up 0.05 — the same change, opposite reaction. The
32-chunk rows are marked, because those were decided on the longer run.
llama-quantizeolder than the F16 default quantizes therank-128 pair, and since the block formats need
input_size ≥ 256while the float path only needs% 4, the pair'sBmatmul leavesHRX on every hybrid layer — 9 of 3051 nodes, pp512 463.66 vs 589.47 tok/s, no error. The flag is
--tensor-type ffn_gate_up_adapter=f16(+31.8 MiB).ffn_up×2,zamba2.ffn_gate_up_adapter_rank = 128, 9+9 / 13+13 adapters), andthe current
-ngl 99placement caveat (engine hrx: token-embedding GET_ROWS leaves the device at -ngl 99 after the host-pointer weight import (#226/#228), 1 node + 1 split per graph #1316: the tok-embdGET_ROWSis off HRX at the current base, base-level, both forms).On the two items this was asked to cover
config/recipes.json(llama-server settings permodel/route, no Zamba2 entry),
models/pins.json(pins published repos' files; no Zamba2-7B/2.7B entry), andregistry/{architectures,census,check_models.tsv,checked,significant,support_pins}.json, and grepped the tree forpick/sweet_spot/default_quant/recommended— nothing names a per-model quantization. The pick has only ever lived inPUBLISH-READY.md, whichalready carries the decision (
Zamba2-7B-Instruct | Q6_K | sweet spot + smallest usable | 5829 MiB | 0.010430 | 96.593 %with~~Q5_K_M~~ withdrawn … 94.792 %), so I did not edit another lane's working doc to restate it. This page is where the engine nowrecords it, which is the piece that was missing.
docs/model-families/does not exist in the engine (docs/is flat), so the page isdocs/zyphra-models.mdtomatch the repo, linked from
docs/models.md. The archived1bit-MONSTERmonorepo was not touched.tools/copyright.py --check→ clean (exit 0). Docs-only; no code, no pin, no behaviour.