qwen35_w8a8: qwen35_fp8.cpp built for a rotated int8 trunk

A third build of the qwen35 source, as qwen35moe_fp8 is, claiming (qwen35, w8a8_fwht128).
Behind QWEN35_W8A8: check_format's method and fmt, a probe of the first delta-net input
projection that learns the trunk is rotated int8 before the activations are declared (and refuses
one that is not, plain int8 included: the descriptor names the rotation), and the plugin
identity; the four trunk activations then carry int8 code pairs.

It declines imported checkpoints (RAD_ARCH_SERVES_IMPORTS(0)): as the family's second quantised
plugin it would make every imported Qwen3.8 release (Quark, ParoQuant, GPTQ, NVFP4) refuse, so
those stay with qwen35_fp8.

arch_test: every trunk linear an i8a8h GEMM behind its own quantiser at one and two ranks, the
refusals (no int8 trunk, a plain one, another format, no fmt), lint clean with the MTP head and
with DFlash2, and two ArchCases (pinned graphs; libref's vocabulary serves it at one rank).
shipped_plugins_test lists the new key and holds each shipped family to at most one plugin that
takes imports. ARCHITECTURES.md and GUIDE.md list the plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
eddie168168andClaude Opus 5.5 authored and StillDeadcode committed 2026-10-19 10:42:13 +02:00
1 parent 2ac0d966b3
commit 5d11c7c200
7 files changed
+298 -7

No files matched your search

+24
View File
@@ -11,6 +11,7 @@ plugin claims.
| `arch/llama_dense_fp8` | `llama` | *(empty)* | the same graph from a bf16 checkpoint, linears made block fp8 by a recipe or kept bf16. MiniCPM5-2B |
| `arch/qwen35_bf16` | `qwen35` | *(empty)* | the Qwen3.5/3.6/3.8 dense hybrid, served bf16 |
| `arch/qwen35_fp8` | `qwen35` | `fp8_e4m3` | the same, block-scaled FP8 weights and activations |
| `arch/qwen35_w8a8` | `qwen35` | `w8a8_fwht128` | `qwen35_fp8` with an int8 trunk: i8 weights with a bf16 scale per 128 of K, rotated by a 128-wide Hadamard, against int8 activations under the same rotation (`data/recipes/q38-27b-w8a8-df2.recipe`) |
| `arch/qwen35moe_fp8` | `qwen35moe` | `fp8_e4m3` | `qwen35_fp8` with the feed-forward routed |
| `arch/qwen4exp_fp8` | `qwen4exp` | *(empty)* | Qwen4-Exp (Qwen3.8-Flash-Next), a bf16 checkpoint quantised at convert |
| `arch/lfm2_bf16` | `lfm2` | *(empty)* | LiquidAI's LFM2 and LFM2-VL, bf16, one rank |
@@ -235,6 +236,29 @@ and every difference is behind `#if QWEN35_MOE` in the shared source. It is a se
unit rather than a branch on `n_expert` because the id is half the selection key, and one `.so`
cannot claim both ids.
## `qwen35_w8a8`
The dense build again, behind `#if QWEN35_W8A8`, for a container `data/recipes/q38-27b-w8a8-df2.recipe`
converts from the bf16 checkpoint: the trunk's linears (the set Qwen's FP8 release quantises) as
`i8*bf16[1x128]/fwht128`, each 128 of K rotated by the unnormalised Hadamard before rounding, served
by `gemm_nt_q` at `i8a8h`. The descriptor `w8a8_fwht128` is what the convert's `--set` keys state;
a probe of the first delta-net input projection holds the weights to it before the activations are
declared, since only an int8 trunk gives them an int8 code pair. The descriptor names the rotation, so
a plain int8 trunk is refused.
- **The 1/128 is the weight's.** `had_quant_act_i8g` rotates the activation and folds nothing, as
`had_quant_act_fp8` does; the per-row `had_*_i8` forms fold 1/sqrt(128) into the activation's
scale and against this weight give an output sqrt(128) too small.
- **The encoding is the only guard.** Rotated and plain int8 have the same bytes and extents, and
the rotated weight against the plain quantiser measures rel_l2 ~1.0 (r4d_selftest, `i8a8h_rot`),
so each dtype's layout hook takes only its own transform.
- **Each rotated linear quantises its own input** from the bf16 plane its producer writes: q, k and
v quantise one input three times, and no producer writes rotated codes yet. The MLP's gated fold
is an fp8a8 tile over E4M3 codes, so an int8 gate_up runs the pair.
- **It declines imported checkpoints** (`RAD_ARCH_SERVES_IMPORTS(0)`). An imported quantisation
goes to the family's one quantised plugin, and a second one would refuse every Quark, ParoQuant,
GPTQ or NVFP4 Qwen3.8 release; they stay with `qwen35_fp8`.
---
# `qwen4exp`: Qwen4-Exp / Qwen3.8-Flash-Next