Archived
radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
This commit is contained in:
1 parent
b068190326
commit
1e968f6e1d
739 files changed
+128447
-84632
No files matched your search
@@ -1,21 +1,9 @@
|
||||
# Research note: measured quant recipes of `unsloth/Qwen3.8-Flash-Next-GGUF`
|
||||
# Research note: quant recipes of `unsloth/Qwen3.8-Flash-Next-GGUF`
|
||||
|
||||
Method: GGUF header reads only (HTTP `Range`), no weight downloads · Verified against published file sizes to 4 significant figures
|
||||
Method: GGUF header reads only (HTTP `Range`), no weight downloads; sizes verified against the
|
||||
published file sizes to 4 significant figures.
|
||||
|
||||
## TL;DR
|
||||
|
||||
- Qwen3.8 Flash Next is **176.94 B total / ~6.04 B active** parameters: 125.74 B "normal"
|
||||
weights (48 layers, 512-expert MoE, Gated DeltaNet + 12 layers of QSA sparse attention)
|
||||
plus a **51.20 B n-gram/PLE look-up table** (29 % of all params, 0 FLOPs).
|
||||
- Unsloth's quants only really compress **two things**: the routed-expert `gate`/`up`
|
||||
matrices and the n-gram table. Everything else stays at Q8_0/Q6_K/F32 in every build.
|
||||
- Consequence: **file size has a floor (~72 GB) and per-token traffic has a floor (~3.5 GB)**
|
||||
that are invisible in the quant name. Q2_K_XL → IQ1_S buys 3 % of per-token bandwidth and
|
||||
costs 0.6 bpw of expert precision — a bad trade.
|
||||
- MTP speculative decoding trades **+17 % compute for −38 % weight traffic** per token at
|
||||
batch 1, and is a net loss at ≥8 concurrent streams.
|
||||
|
||||
## Model facts (read from the GGUF KV metadata)
|
||||
## Model facts (from the GGUF KV metadata)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
@@ -28,35 +16,37 @@ Method: GGUF header reads only (HTTP `Range`), no weight downloads · Verified a
|
||||
| draft | 1 MTP layer (`blk.48`, `nextn.*`), 3.88 B params self-contained / 2.61 B shared |
|
||||
| quantisation | imatrix-driven: `quantize.imatrix.file = imatrix_unsloth.gguf`, 926 entries of 1224 tensors, 45 calibration chunks (absent only in the BF16 build) |
|
||||
|
||||
Per-token tensor census: 1224 tensors; `blk.N` names appear 48× (layers), attn_q/k/v/o and
|
||||
`indexer.*` 12× (QSA layers), `attn_qkv`/`attn_gate`/`ssm_*` 36× (DeltaNet layers),
|
||||
`ffn_gate_exps/up_exps/down_exps` 48× as `[2560, 640, 512]`-stacked 3-D tensors (838.86 M
|
||||
params each).
|
||||
176.94 B parameters in total: 125.74 B of model weights and a 51.20 B n-gram/PLE look-up table
|
||||
(29%, no FLOPs). About 6.04 B are active per token (see "Active parameters").
|
||||
|
||||
## Method — how to read a quant recipe without downloading anything
|
||||
Tensor census: 1224 tensors; `blk.N` names appear 48× (layers), attn_q/k/v/o and `indexer.*` 12×
|
||||
(QSA layers), `attn_qkv`/`attn_gate`/`ssm_*` 36× (DeltaNet layers), and
|
||||
`ffn_gate_exps/up_exps/down_exps` 48× as `[2560, 640, 512]`-stacked 3-D tensors (838.86 M params
|
||||
each).
|
||||
|
||||
`GET` the first ~1 MB of each `.gguf` with a `Range` header and parse the header:
|
||||
magic `GGUF`, version, `n_tensors` (u64), `n_kv` (u64), KV pairs, then per tensor
|
||||
`name`, `n_dims`, `dims[]`, `ggml_type` (u32), `offset` (u64). Name + dims + type *is* the
|
||||
recipe; the tensor data blobs are never touched.
|
||||
## Reading a recipe without downloading
|
||||
|
||||
Four things that bite:
|
||||
`GET` the first ~1 MB of each `.gguf` with a `Range` header and parse the header: magic `GGUF`,
|
||||
version, `n_tensors` (u64), `n_kv` (u64), the KV pairs, then per tensor `name`, `n_dims`, `dims[]`,
|
||||
`ggml_type` (u32), `offset` (u64). Name, dims and type are the recipe; the tensor data is never
|
||||
read.
|
||||
|
||||
1. **Split repos.** In a `gguf-split` "magic" layout the **first shard has
|
||||
`n_tensors = 0`** and carries only metadata (≈ 11 MB, mostly tokenizer arrays); every
|
||||
*data* shard repeats 3 KV pairs plus the tensor-info table for the tensors it holds. So
|
||||
tensor info must be merged from shards 2…N, and KV (`general.file_type`,
|
||||
`quantize.imatrix.*`) read from shard 1. A scanner that only reads shard 1 reports zero
|
||||
tensors.
|
||||
2. **Don't guess the type enum.** Use the real `GGMLQuantizationType` values (F32 0, F16 1,
|
||||
Q4_0 2, Q8_0 8, Q2_K 10, Q4_K 12, Q5_K 13, Q6_K 14, IQ2_XXS 16, IQ3_XXS 18, IQ1_S 19,
|
||||
IQ4_NL 20, IQ3_S 21, IQ2_S 22, IQ4_XS 23, IQ1_M 29, BF16 30) and
|
||||
`GGML_QUANT_SIZES` for block sizes. A wrong enum silently mislabels the whole table.
|
||||
3. **Validate.** Compute `Σ ⌈n/block⌉ · type_size` over all tensors and compare with the
|
||||
published shard sizes. Agreement to 4 significant figures across all 11 builds
|
||||
(e.g. 354.02 GB computed vs 354.03 GB published) is what makes the dtype IDs trustworthy.
|
||||
4. Parse with an offset pointer into the buffer, not `buf = buf[n:]` per field — that is
|
||||
quadratic on an 11 MB header and looks exactly like a network hang.
|
||||
Pitfalls:
|
||||
|
||||
1. **Split repos.** In a `gguf-split` layout the **first shard has `n_tensors = 0`** and carries
|
||||
only metadata (≈ 11 MB, mostly tokenizer arrays); every data shard repeats 3 KV pairs plus the
|
||||
tensor-info table for its own tensors. Merge tensor info from shards 2…N, and read KV
|
||||
(`general.file_type`, `quantize.imatrix.*`) from shard 1. A scanner that reads only shard 1
|
||||
reports zero tensors.
|
||||
2. **Use the real type enum.** `GGMLQuantizationType` values: F32 0, F16 1, Q4_0 2, Q8_0 8, Q2_K 10,
|
||||
Q4_K 12, Q5_K 13, Q6_K 14, IQ2_XXS 16, IQ3_XXS 18, IQ1_S 19, IQ4_NL 20, IQ3_S 21, IQ2_S 22,
|
||||
IQ4_XS 23, IQ1_M 29, BF16 30; block sizes from `GGML_QUANT_SIZES`. A wrong enum silently
|
||||
mislabels the whole table.
|
||||
3. **Validate.** Compute `Σ ⌈n/block⌉ · type_size` over all tensors and compare with the published
|
||||
shard sizes. Agreement to 4 significant figures across all 11 builds (e.g. 354.02 GB computed vs
|
||||
354.03 GB published) confirms the type IDs.
|
||||
4. Parse with an offset into the buffer, not `buf = buf[n:]` per field, which is quadratic on an
|
||||
11 MB header and looks like a network hang.
|
||||
|
||||
## File sizes
|
||||
|
||||
@@ -74,9 +64,9 @@ Four things that bite:
|
||||
| UD-IQ1_M | 176.94 B | 74.54 GB | 3.37 |
|
||||
| UD-IQ1_S | 176.94 B | 72.55 GB | 3.28 |
|
||||
|
||||
`L2`/`L46-47` below = layers given one notch more precision (dynamic "UD/XL" selection).
|
||||
## Recipe matrix
|
||||
|
||||
## The recipe matrix
|
||||
`L2`/`L46-47` = layers given one notch more precision (the dynamic "UD/XL" selection).
|
||||
|
||||
| weight group (count, params) | BF16 | Q8_0 | Q6_K_XL | Q5_K_XL | Q4_K_XL | Q3_K_XL | IQ4_XS | Q2_K_XL | IQ3_XXS | IQ1_M | IQ1_S |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
@@ -104,15 +94,14 @@ Four things that bite:
|
||||
the other 24. IQ1_S: IQ2_XXS at L1-2, 4, 14, 16, 25, 30, 32, 37, 39, 42, 45-47 (14 tensors),
|
||||
IQ1_S on the other 34.
|
||||
|
||||
Type bpw for reference: Q4_K 4.50, Q5_K 5.50, Q5_1 6.00, Q6_K 6.56, Q8_0 8.50, IQ1_S 1.56,
|
||||
IQ1_M 1.75, IQ2_XXS 2.06, IQ2_XS 2.31, IQ2_S 2.56, IQ3_XXS 3.06, IQ3_S 3.44, IQ4_NL 4.50,
|
||||
IQ4_XS 4.25.
|
||||
Type bpw: Q4_K 4.50, Q5_K 5.50, Q5_1 6.00, Q6_K 6.56, Q8_0 8.50, IQ1_S 1.56, IQ1_M 1.75,
|
||||
IQ2_XXS 2.06, IQ2_XS 2.31, IQ2_S 2.56, IQ3_XXS 3.06, IQ3_S 3.44, IQ4_NL 4.50, IQ4_XS 4.25.
|
||||
|
||||
MTP drafts are separate recipes: `mtp-*Q8_0` is Q8_0 throughout (indexer BF16, norms F32);
|
||||
MTP drafts have their own recipes: `mtp-*Q8_0` is Q8_0 throughout (indexer BF16, norms F32);
|
||||
`mtp-*Q4_K_M` is stock llama.cpp Q4_K_M (Q4_K base, `output`/`attn_v`/`ffn_down*`/`hc_ffn_down`
|
||||
upcast to Q6_K/Q8_0, and the `[320, 10240]` up-projections fall to **Q5_0** because 320 is not
|
||||
a multiple of the 256-element K-quant block). `mmproj-*` is a 0.449 B `clip` vision tower,
|
||||
BF16 or F16 only, with biases/pos-embed in F32.
|
||||
upcast to Q6_K/Q8_0, and the `[320, 10240]` up-projections fall to **Q5_0** because 320 is not a
|
||||
multiple of the 256-element K-quant block). `mmproj-*` is a 0.449 B `clip` vision tower, BF16 or
|
||||
F16 only, with biases and position embeddings in F32.
|
||||
|
||||
## Where the bytes go
|
||||
|
||||
@@ -124,11 +113,11 @@ BF16 or F16 only, with biases/pos-embed in F32.
|
||||
| everything else (5 B, 2 %) | 8.96 / 4.1 | 9.04 / 4.2 | 9.04 / 4.2 | 6.92 / 3.2 | 6.91 / 3.2 |
|
||||
| share of file that is n-gram + expert down | 51 % | 54 % | 57 % | 65 % | 71 % |
|
||||
|
||||
## Sizes with the n-gram table removed
|
||||
## Sizes without the n-gram table
|
||||
|
||||
`per_layer_token_embd.weight` is a single 160 × 320 001 536 tensor — 51.20 B params, i.e. 41 %
|
||||
as many params as the rest of the model combined. It takes only three settings across the whole
|
||||
repo: BF16 (102.4 GB), Q8_0 (54.4 GB) and IQ4_NL (28.8 GB).
|
||||
`per_layer_token_embd.weight` is a single 160 × 320 001 536 tensor: 51.20 B params, 41 % as many
|
||||
as the rest of the model combined. It takes only three settings across the repository: BF16
|
||||
(102.4 GB), Q8_0 (54.4 GB) and IQ4_NL (28.8 GB).
|
||||
|
||||
| build | file | n-gram table | rest of model | rest bpw (÷ 125.74 B) | n-gram share |
|
||||
|---|---|---|---|---|---|
|
||||
@@ -144,13 +133,12 @@ repo: BF16 (102.4 GB), Q8_0 (54.4 GB) and IQ4_NL (28.8 GB).
|
||||
| UD-IQ1_M | 74.53 | 28.80 | **45.73 GB** | 2.91 | 38.6 % |
|
||||
| UD-IQ1_S | 72.54 | 28.80 | **43.74 GB** | 2.78 | 39.7 % |
|
||||
|
||||
Strip the table and the ladder is a genuine 2.8-8.5 bpw spread instead of the flat 3.3-8.5 the
|
||||
file sizes suggest.
|
||||
Without the table the builds span 2.8-8.5 bpw, not the 3.3-8.5 the file sizes suggest.
|
||||
|
||||
## Active parameters
|
||||
|
||||
Per forward, counting only tensors actually touched (routed experts at 10/512, embedding and
|
||||
n-gram tables as look-ups):
|
||||
Per forward, counting only tensors touched (routed experts at 10/512, embedding and n-gram tables
|
||||
as look-ups):
|
||||
|
||||
| component | active/token | in file | fraction used |
|
||||
|---|---|---|---|
|
||||
@@ -167,14 +155,14 @@ n-gram tables as look-ups):
|
||||
| token embedding | ≈ 0 (1 row) | 0.64 B | 2e-4 % |
|
||||
| **total** | **6.671 B** incl. lm_head / **6.036 B** excl. | 176.94 B | **3.77 %** |
|
||||
|
||||
6.036 B reproduces Qwen's advertised "6B activated"; 125.74 B reproduces "125B". Two thirds of
|
||||
the active mass is dense (DeltaNet + gated residual + attention), not expert — so this behaves
|
||||
like a bandwidth-bound 6 B dense model wearing a 177 B memory footprint, not like a normal MoE.
|
||||
6.036 B matches Qwen's advertised "6B activated" and 125.74 B its "125B". Two thirds of the active
|
||||
parameters are dense (DeltaNet, gated residual, attention), not experts, so per-token cost is that
|
||||
of a bandwidth-bound 6 B dense model with a 177 B memory footprint.
|
||||
|
||||
Per draft step, the MTP head adds 139.7 M of real work (`attn` 49.8 M, 10 experts 49.2 M,
|
||||
`eh_proj` 13.1 M, gated residual 13.1 M, `hc_head` 6.6 M, shared expert 4.9 M, router/indexer
|
||||
3.3 M) plus the 636 M output projection → **0.776 B active and 0.83 GB read per draft token**,
|
||||
of which 82 % is the output projection.
|
||||
Per draft step the MTP head adds 139.7 M of compute (`attn` 49.8 M, 10 experts 49.2 M, `eh_proj`
|
||||
13.1 M, gated residual 13.1 M, `hc_head` 6.6 M, shared expert 4.9 M, router/indexer 3.3 M) plus the
|
||||
636 M output projection: **0.776 B active and 0.83 GB read per draft token**, 82 % of it the output
|
||||
projection.
|
||||
|
||||
| | active params | weight bytes read (Q4_K_XL) |
|
||||
|---|---|---|
|
||||
@@ -186,8 +174,8 @@ of which 82 % is the output projection.
|
||||
## Weight traffic per token (batch 1)
|
||||
|
||||
`step(P) = experts_touched(P) + dense + lm_head`, with `experts_touched(P) = 512·(1 − (1 −
|
||||
10/512)^P)` (P=1 → 10.0, P=2 → 19.8, P=3 → 29.4 experts per layer). MTP row uses
|
||||
`shared-Q8_0` draft, llama.cpp's `--spec-draft-n-max 2`, mean accepted length 2.76.
|
||||
10/512)^P)` (P=1 → 10.0, P=2 → 19.8, P=3 → 29.4 experts per layer). The MTP columns use the
|
||||
`shared-Q8_0` draft, llama.cpp's `--spec-draft-n-max 2`, and mean accepted length 2.76.
|
||||
|
||||
| build | no MTP | MTP cycle | MTP per token | traffic ratio | measured speedup |
|
||||
|---|---|---|---|---|---|
|
||||
@@ -205,53 +193,51 @@ of which 82 % is the output projection.
|
||||
|
||||
## Analysis
|
||||
|
||||
1. **Quantisation here is applied to the expert FFNs and the n-gram table; nothing else
|
||||
matters.** The other 3.6 B params sit at 7-32 bpw in every build and cost 3-4 GB total.
|
||||
2. **`down_proj` is protected, `gate`/`up` is the sacrifice.** Down never drops below 4.5 bpw
|
||||
and is still full Q8_0 at Q6_K_XL/Q5_K_XL; at IQ1_S the down tables cost *more* bytes
|
||||
(22.6 GB) than the gate+up tables (17.2 GB). Sensible — down-projection error is applied
|
||||
after the nonlinearity and summed across the 10 active experts.
|
||||
3. **Router is never quantised** (F32 everywhere), nor is the QSA indexer (BF16 everywhere,
|
||||
20 M params). Both are small and both fail catastrophically when wrong.
|
||||
4. **Layer 2 is special in every build** (one notch up, plus attention/shared-expert upcasts
|
||||
at the aggressive levels) — it is adjacent to layer 1, where the n-gram/PLE signal is
|
||||
injected. Layers 2, 4, 30, 46, 47 form an identical "important down-expert" set across
|
||||
Q4_K_XL, Q3_K_XL and IQ4_XS, so the ranking comes from the calibration run, not from a
|
||||
per-target heuristic.
|
||||
5. **The names understate size at the bottom.** UD-Q3_K_XL (90.0 GB) is *smaller* than
|
||||
UD-IQ4_XS (93.7 GB), and UD-Q2_K_XL (78.9 GB) smaller than UD-IQ3_XXS (82.0 GB). Each pair
|
||||
is one tier offered with two codebooks; the IQ variant buys accuracy with size
|
||||
(IQ3_S 3.44 vs IQ3_XXS 3.06, IQ2_S 2.56 vs IQ2_XS 2.31 bpw).
|
||||
6. **The n-gram table is the real constraint.** 51.2 B params at a 4.5 bpw floor = 28.8 GB that
|
||||
never shrinks, 71 % of the IQ1_S file when combined with the down tables. Nothing in this
|
||||
repo goes under ~72 GB. It is a pure random look-up (≈ 1.4 KB/token, 2 560 values), so it is
|
||||
a VRAM cost, not a bandwidth cost — the one component that is genuinely free to park in CPU
|
||||
RAM or on disk.
|
||||
7. **MTP is a bandwidth-only trade.** +17 % compute (7.81 vs 6.67 B active params per token)
|
||||
for −38 % weight traffic. Its hidden cost is that a 3-position verify pass touches ~29 of
|
||||
512 experts per layer instead of 10, so MTP stops paying the moment concurrency saturates
|
||||
the experts: unsloth measures Q4_K_XL at 83 → 139 tok/s with 1 user but 216 → 192 tok/s
|
||||
*worse* with 8 users.
|
||||
8. **Value points.** Q4_K_XL (5.03 bpw, 111 GB) is the best engineering point. Below it,
|
||||
each step buys surprisingly little traffic: Q2_K_XL → IQ1_S is 3 % of per-token bandwidth
|
||||
for 0.6 bpw of expert precision, and IQ1_S additionally under-delivers in practice (1.34×
|
||||
vs 1.74× modelled) because 1.5 bpw IQ1_S is dequant-bound. Take IQ1_M over IQ1_S if 74.5 GB
|
||||
fits — 2 GB more for +0.2 bpw. For MTP, use a `shared-*` draft: identical runtime cost,
|
||||
~1.3 GB less resident weight, and the draft's output projection is then read at the *main*
|
||||
model's precision.
|
||||
1. **Only the expert FFNs and the n-gram table are compressed hard.** Everything else stays at
|
||||
Q4_K or better, mostly Q8_0/Q6_K/F32: the other 3.6 B params sit at 7-32 bpw and cost 3-4 GB in
|
||||
every build, a floor on both file size and per-token traffic that the quant name does not show.
|
||||
2. **`down_proj` is protected, `gate`/`up` gives way.** Down never drops below 4.5 bpw and stays
|
||||
Q8_0 at Q6_K_XL/Q5_K_XL; at IQ1_S the down tables cost more bytes (22.6 GB) than gate+up
|
||||
(17.2 GB). Down-projection error is applied after the nonlinearity and summed across the 10
|
||||
active experts.
|
||||
3. **The router is never quantised** (F32 everywhere), nor is the QSA indexer (BF16 everywhere,
|
||||
20 M params). Both are small and both fail badly when wrong.
|
||||
4. **Layer 2 is upgraded in every build** (one notch up, plus attention/shared-expert upcasts at the
|
||||
aggressive levels); it is adjacent to layer 1, where the n-gram/PLE signal is injected. Layers 2,
|
||||
4, 30, 46, 47 form the same "important down-expert" set across Q4_K_XL, Q3_K_XL and IQ4_XS, so
|
||||
the ranking comes from the calibration run, not a per-target heuristic.
|
||||
5. **Names understate size at the bottom.** UD-Q3_K_XL (90.0 GB) is smaller than UD-IQ4_XS
|
||||
(93.7 GB), and UD-Q2_K_XL (78.9 GB) smaller than UD-IQ3_XXS (82.0 GB). Each pair is one tier with
|
||||
two codebooks; the IQ variant buys accuracy with size (IQ3_S 3.44 vs IQ3_XXS 3.06, IQ2_S 2.56 vs
|
||||
IQ2_XS 2.31 bpw).
|
||||
6. **The n-gram table is the binding constraint on size.** 51.2 B params at a 4.5 bpw floor is
|
||||
28.8 GB in every build below Q5_K_XL, 71 % of the IQ1_S file together with the down tables;
|
||||
nothing in the repository is under ~72 GB. It is a random look-up (≈ 1.4 KB per token,
|
||||
2 560 values), so it costs memory, not bandwidth, and is the one component that can live in CPU
|
||||
RAM or on disk at no speed cost.
|
||||
7. **MTP trades compute for bandwidth.** +17 % compute (7.81 vs 6.67 B active params per token) for
|
||||
−38 % weight traffic at batch 1. A 3-position verify pass touches ~29 of 512 experts per layer
|
||||
instead of 10, so MTP stops paying once concurrency saturates the experts: unsloth measures
|
||||
Q4_K_XL at 83 → 139 tok/s with 1 user but 216 → 192 tok/s with 8.
|
||||
8. **Value points.** Q4_K_XL (5.03 bpw, 111 GB) is the best balance. Below it each step saves little
|
||||
traffic: Q2_K_XL → IQ1_S saves 3 % of per-token bandwidth for 0.6 bpw of expert precision, and
|
||||
IQ1_S also under-delivers in practice (1.34× vs 1.74× modelled) because 1.5 bpw IQ1_S is
|
||||
dequant-bound. Prefer IQ1_M over IQ1_S if 74.5 GB fits (2 GB more for +0.2 bpw). For MTP, use a
|
||||
`shared-*` draft: the same runtime cost, ~1.3 GB less resident weight, and the draft's output
|
||||
projection read at the main model's precision.
|
||||
|
||||
## What the imatrix says
|
||||
## The imatrix
|
||||
|
||||
`imatrix_unsloth.gguf` (580 MB, in the repo as `imatrix_unsloth.gguf_file`) is llama.cpp's GGUF
|
||||
imatrix: per weight, `in_sum2` (the sum of the input's squares, per input channel) and `counts`
|
||||
`imatrix_unsloth.gguf` (580 MB, in the repository as `imatrix_unsloth.gguf_file`) is llama.cpp's
|
||||
GGUF imatrix: per weight, `in_sum2` (the sum of the input's squares, per input channel) and `counts`
|
||||
(tokens seen). 45 chunks of 18 432 tokens = **829 440 tokens** from one file,
|
||||
`unsloth_calibration_Qwen3.8-Flash-Next.txt`. The routed experts are recorded **per expert**
|
||||
(`in_sum2` is `[K, 512]`, `counts` `[512]`); `ffn_gate_exps` and `ffn_up_exps` are byte-identical,
|
||||
being the same input. There is nothing for `blk.48`, `output`, `token_embd` or the n-gram table.
|
||||
having the same input. There is nothing for `blk.48`, `output`, `token_embd` or the n-gram table.
|
||||
|
||||
**The Q8_0 down layers are the layers that host a super expert.** One expert in each of a few
|
||||
layers carries a large share of the layer's `down` input energy from a sliver of its tokens, all
|
||||
of it in one or two channels -- up to 208 000x that expert's median channel:
|
||||
**The Q8_0 down layers are the layers that host a super expert.** One expert in each of a few layers
|
||||
carries a large share of the layer's `down` input energy from a sliver of its tokens, all of it in
|
||||
one or two channels, up to 208 000x that expert's median channel:
|
||||
|
||||
| layer | expert | share of the layer's down-input energy | share of its routing |
|
||||
|---|---|---|---|
|
||||
@@ -261,40 +247,38 @@ of it in one or two channels -- up to 208 000x that expert's median channel:
|
||||
| 46 | 290 | 6.9 % | 0.84 % |
|
||||
| 30 | 169 | 3.9 % | 0.12 % |
|
||||
|
||||
Those are exactly the five layers given Q8_0 down. The next layers by energy share (28, 37, 26:
|
||||
~4 %) are heavily *routed* experts, energy share equal to routing share, and are not protected. A
|
||||
super expert is **not harder to quantise relative to its own output** -- scored against its own
|
||||
imatrix profile, int4 g128 costs it the same ~12 % relative output error as an ordinary expert and
|
||||
E4M3 the same 2.6 % -- its output is simply that much larger, so the same relative error is a large
|
||||
absolute one. A GGUF type is per tensor and a tensor is all 512 experts of a layer, so protecting
|
||||
one expert costs the whole layer's `down`.
|
||||
These are the five layers given Q8_0 down. The next layers by energy share (28, 37, 26: ~4 %) are
|
||||
heavily routed experts whose energy share equals their routing share, and are not protected. A
|
||||
super expert is not harder to quantise relative to its own output: against its own imatrix
|
||||
profile, int4 g128 costs it the same ~12 % relative output error as an ordinary expert and E4M3 the
|
||||
same 2.6 %. Its output is larger, so the same relative error is a large absolute one. A GGUF type is
|
||||
per tensor and a tensor holds all 512 experts of a layer, so protecting one expert costs the whole
|
||||
layer's `down`.
|
||||
|
||||
**A pooled down profile describes no expert.** A typical expert's own `down` input profile has a
|
||||
median cosine of 0.15-0.87 with the layer's pooled one (0.15 at layer 4, 0.20 at 47: the pool *is*
|
||||
the super expert there); `gate_up` 0.91-0.98. `down`'s input channels are each expert's own
|
||||
median cosine of 0.15-0.87 with the layer's pooled one (0.15 at layer 4, 0.20 at 47, where the pool
|
||||
is the super expert); `gate_up` 0.91-0.98. `down`'s input channels are each expert's own
|
||||
intermediate units, so channel `i` of one expert has nothing to do with channel `i` of another.
|
||||
|
||||
**Against radiance's 10M-token Grams** (recorded from the bf16 model over ten million tokens of its
|
||||
calibration corpus, pooled per layer; [MOE-W4.md](MOE-W4.md), "Calibration"): the `gate_up`
|
||||
diagonals agree at every layer (cosine 0.98-0.99, the same top channels at the same shares), and so
|
||||
do the `down` spikes at layers 46 and 47 (channels 218 and 635). At layers 2, 4, 9, 14, 16, 25, 30
|
||||
and 32 the spike channels sit at a flat channel's share in radiance's Grams -- the super experts
|
||||
there never fired on its corpus. Open: either the imatrix harness (raw 18K-token chunks, each from
|
||||
**Compared with radiance's 10M-token Grams** (recorded from the bf16 model over ten million tokens
|
||||
of its calibration corpus, pooled per layer; [MOE-W4.md](MOE-W4.md), "Calibration"): the `gate_up`
|
||||
diagonals agree at every layer (cosine 0.98-0.99, the same top channels at the same shares), as do
|
||||
the `down` spikes at layers 46 and 47 (channels 218 and 635). At layers 2, 4, 9, 14, 16, 25, 30 and
|
||||
32 the spike channels sit at a flat channel's share in radiance's Grams: those super experts never
|
||||
fired on its corpus. Open question: either the imatrix harness (raw 18K-token chunks, each from
|
||||
position 0, special tokens as plain text) triggers what chat-templated traffic does not, or the two
|
||||
implementations compute those experts differently.
|
||||
|
||||
**The expert stack repeats every 16 layers in the middle of the model.** Per-expert routing counts
|
||||
correlate 0.76-0.93 between layer L and L+16 for L in 8..23, and ~0 between neighbours; the same
|
||||
(expert, channel) spikes at 9/25 (e368 c191), 14/30 (e169 c72) and 16/32 (e391 c139).
|
||||
(expert, channel) spikes appear at 9/25 (e368 c191), 14/30 (e169 c72) and 16/32 (e391 c139).
|
||||
|
||||
## Caveats
|
||||
|
||||
- These are the recipes of the shipped files as published when read (2026-09-30); later uploads
|
||||
to the repository may differ. They say nothing about the *quality* of each level, which needs a
|
||||
downstream eval.
|
||||
- Percentages inside a cell are byte shares of that tensor group.
|
||||
- These are the recipes of the files as published on 2026-09-30; later uploads may differ. They say
|
||||
nothing about the quality of each level, which needs a downstream evaluation.
|
||||
- Traffic numbers assume batch 1 and independent routing across positions; real expert usage is
|
||||
skewed, so distinct-expert counts (and hence MTP cost) are slightly over-estimated.
|
||||
- Mean accepted length 2.76 and 66 % acceptance are from a single unsloth log line
|
||||
(`shared-Q8_0` draft + `Q4_K_XL`, 4× A100, 8 K input, llama.cpp's `--spec-draft-n-max 2`),
|
||||
applied to every build here.
|
||||
skewed, so distinct-expert counts (and hence MTP cost) are slightly overestimated.
|
||||
- Mean accepted length 2.76 and 66 % acceptance come from a single unsloth log line (`shared-Q8_0`
|
||||
draft + `Q4_K_XL`, 4× A100, 8K input, llama.cpp's `--spec-draft-n-max 2`) and are applied to
|
||||
every build here.
|
||||
Reference in new issue
Block a user