GDN prefill accuracy: bf4 a/b projection drives the 8-19% per-layer error in the G2 arm #71

Open
opened 2026-09-25 22:13:52 +02:00 by Grok · 13 comments
Owner

Root cause

QWEN36_ATTN_GDN_BF4=1 (the G2 arm, R-2026-09-25-gptq-g2) folds in_proj_a and in_proj_b into the fused [qkv|z|a|b] weight and packs the whole thing as bfloat4_b. But GPTQ only put qkv, z and out_proj on the bfp4 grid — a and b are left on the 8-bit grid, so packing them as bf4 is a plain round-to-nearest to 4 bits, with no quantisation-aware error compensation.

a and b are not ordinary activations. They are the entire input to the GDN gates:

  • g = -exp(A_log) · softplus(a + dt_bias), the per-step log-decay
  • beta = sigmoid(b), the delta-rule write strength

Measured at TP=1 on layer 6 (code.v2, 4096 rows), device output against the checkpoint's own weights:

stage error
qkv projection 0.43%
z projection 0.45%
a projection 9.7%
b projection 6.4%
conv + SiLU (fed device qkv) 0.26–0.31%
l2norm 0.38%
chunked scan (fed device q/k/v/g/beta) o 1.9%, state 2.2%
gated RMSNorm out 0.47%

device a = x @ bfp4_RTN(W_a) to 0.44%, and = x @ W_ckpt only to 9.7%, so the mechanism is confirmed, not inferred. Every other stage is under 0.5% and the scan itself is ~2%: the whole 8–19% per-layer GDN error enters at the a/b projection.

Why it hits some heads and some layers

A relative error in a becomes an error in the decay g, which is then summed over the whole prefill. For a slow-decay head (mean g ≈ −0.0004, layer 6 head 33) the cumulative log-decay error reaches 55%, and the head's recurrent state is 40% off. Fast-decay heads (mean g ≈ −0.2) integrate almost nothing and stay at 0.1%. That is why layers 1–30 are 8–19% off while layers 50–63 are ~2%, and why only about 5.5% of heads are bad: it is conditioning, not a defective kernel.

This also closes the earlier suspects: the fused chunk op's WY inverse, bf16 state, chunk size, bf16 decay parameters and bfp8 activation packing are all refuted by measurement (bench/runs/mtp-tp1-layer-ref-20260925.jsonl).

Fix

QWEN36_GDN_AB_BF8=1 (bench/mtp/overlay/.../gdn/tp.py): keep the fused bf4 weight for qkv/z, and compute a/b from a separate bfloat8_b [a|b] weight. Exact for the checkpoint's 8-bit values.

Measured at TP=1 (card 1, G2, code.v2, banner QWEN36_GDN_AB_BF8 engaged):

bf4 a/b bf8 a/b
a projection error 9.7% 0.43%
b projection error 6.4% 0.51%
beta vs fp32 3.4% 0.23%
g vs fp32 4.7% 1.38%

Cost, and it is not free: plain decode 108.0 ms/token vs a ~98–100 ms same-day baseline, so roughly +8 ms/token at TP=1 for the extra per-step matmul. The weight itself is tiny (5120×96), so this looks like an unoptimised interleaved matmul rather than a real floor — worth folding into the existing projection instead of adding an op.

Status / asks

  • Per-layer accuracy delta and the TP=2 arm: in flight.
  • KL against the FP8 teacher is not measured yet. If it improves, this is a production quality win for any bf4 arm and should ride along with the G2 deploy; the decode cost has to be weighed against it.
  • Pre-existing: this affects the already-shipped G2 arm, so it is not a blocker for the current deploy.

Records: bench/runs/mtp-tp1-layer-ref-20260925.jsonl, mtp-tp1-gdn-ab-20260925.jsonl (in progress). Tools: bench/mtp/idump_cmp.py, QWEN36_GDN_IDUMP_LAYER.

Related: #63, #69, #62 (bfp quant).

## Root cause `QWEN36_ATTN_GDN_BF4=1` (the G2 arm, `R-2026-09-25-gptq-g2`) folds `in_proj_a` and `in_proj_b` into the fused `[qkv|z|a|b]` weight and packs the whole thing as `bfloat4_b`. But **GPTQ only put `qkv`, `z` and `out_proj` on the bfp4 grid — `a` and `b` are left on the 8-bit grid**, so packing them as bf4 is a plain round-to-nearest to 4 bits, with no quantisation-aware error compensation. `a` and `b` are not ordinary activations. They are the entire input to the GDN gates: - `g = -exp(A_log) · softplus(a + dt_bias)`, the per-step log-decay - `beta = sigmoid(b)`, the delta-rule write strength Measured at TP=1 on layer 6 (code.v2, 4096 rows), device output against the checkpoint's own weights: | stage | error | |---|---| | `qkv` projection | 0.43% | | `z` projection | 0.45% | | **`a` projection** | **9.7%** | | **`b` projection** | **6.4%** | | conv + SiLU (fed device qkv) | 0.26–0.31% | | l2norm | 0.38% | | chunked scan (fed device q/k/v/g/beta) | o 1.9%, state 2.2% | | gated RMSNorm out | 0.47% | `device a = x @ bfp4_RTN(W_a)` to **0.44%**, and `= x @ W_ckpt` only to 9.7%, so the mechanism is confirmed, not inferred. Every other stage is under 0.5% and the scan itself is ~2%: **the whole 8–19% per-layer GDN error enters at the a/b projection.** ### Why it hits some heads and some layers A relative error in `a` becomes an error in the decay `g`, which is then **summed over the whole prefill**. For a slow-decay head (mean `g` ≈ −0.0004, layer 6 head 33) the cumulative log-decay error reaches 55%, and the head's recurrent state is 40% off. Fast-decay heads (mean `g` ≈ −0.2) integrate almost nothing and stay at 0.1%. That is why layers 1–30 are 8–19% off while layers 50–63 are ~2%, and why only about 5.5% of heads are bad: it is conditioning, not a defective kernel. This also closes the earlier suspects: the fused chunk op's WY inverse, bf16 state, chunk size, bf16 decay parameters and bfp8 activation packing are all refuted by measurement (`bench/runs/mtp-tp1-layer-ref-20260925.jsonl`). ## Fix `QWEN36_GDN_AB_BF8=1` (`bench/mtp/overlay/.../gdn/tp.py`): keep the fused bf4 weight for `qkv`/`z`, and compute `a`/`b` from a separate `bfloat8_b` `[a|b]` weight. Exact for the checkpoint's 8-bit values. Measured at TP=1 (card 1, G2, code.v2, banner `QWEN36_GDN_AB_BF8 engaged`): | | bf4 a/b | bf8 a/b | |---|---:|---:| | `a` projection error | 9.7% | **0.43%** | | `b` projection error | 6.4% | **0.51%** | | `beta` vs fp32 | 3.4% | **0.23%** | | `g` vs fp32 | 4.7% | **1.38%** | **Cost, and it is not free:** plain decode 108.0 ms/token vs a ~98–100 ms same-day baseline, so roughly **+8 ms/token at TP=1** for the extra per-step matmul. The weight itself is tiny (5120×96), so this looks like an unoptimised interleaved matmul rather than a real floor — worth folding into the existing projection instead of adding an op. ## Status / asks - Per-layer accuracy delta and the TP=2 arm: in flight. - **KL against the FP8 teacher is not measured yet.** If it improves, this is a production quality win for any bf4 arm and should ride along with the G2 deploy; the decode cost has to be weighed against it. - Pre-existing: this affects the already-shipped G2 arm, so it is **not a blocker** for the current deploy. Records: `bench/runs/mtp-tp1-layer-ref-20260925.jsonl`, `mtp-tp1-gdn-ab-20260925.jsonl` (in progress). Tools: `bench/mtp/idump_cmp.py`, `QWEN36_GDN_IDUMP_LAYER`. Related: #63, #69, #62 (bfp quant).
Author
Owner

Fixed, at no decode cost — and the a/b projection was only half of it

QWEN36_GDN_AB_BF8 alone (8-bit in_proj_a/in_proj_b) cleans the gate inputs ~20x but barely moves the per-layer error: L2 12.26% vs 12.37%, L6 18.70% vs 19.13%. Once a/b are accurate, the residual bf16 gate arithmetic dominates and the same cumulative-decay conditioning amplifies it: g was still 1.38% off fp32, from A_log/dt_bias stored bf16, a bf16 softplus and a bf16 multiply.

QWEN36_GDN_G_FP32=1 stores A_log/dt_bias as fp32, computes -exp(A_log) on the host, and runs the whole gate in fp32. It also fixes tp_common.shard_small, which cast every small tensor to bf16 on the host before upload whatever device dtype was requested — silently throwing the fp32 away.

Per-layer prefill error vs fp32 (TP=1, G2, code.v2, 4096 rows)

Arm = AB8=prefill + G_FP32=1, against the production bf4 arm.

layer bf4 (now) fixed recurrent state, bf4 → fixed
L0 0.89% 0.91% 2.0% → 3.1%
L1 4.25% 2.40% 17.2% → 5.7%
L2 12.37% 2.83% 27.4% → 2.0%
L4 8.17% 2.80% 24.1% → 5.9%
L5 11.45% 2.95% 47.8% → 2.5%
L6 19.13% 3.53% 31.4% → 8.7%

The GDN prefill error drops to the attention layers' level (2–3.5%), and the recurrent state error falls by 3–20x. Layer-6 stage errors: negA and the softplus become exact, g goes from 4.67% to 0.003% against fp32 on the device's own a, and the scan's gate-sensitivity term falls from 31.5% to 6.3%.

Cost: none at decode

QWEN36_GDN_AB_BF8=prefill keeps the extra a/b matmul out of the decode step — the error only integrates over the prefill, so decode does not need it.

arm plain TG ms/token (median, 20 prompts)
bf4 control 100.26
AB8=1 (a/b everywhere) 107.93
AB8=prefill + G_FP32=1 98.68

Cross-card (one container per card via ttx slots), so treat the combined arm as neutral, not a win. The fp32 gate weights are 48 values per layer.

What is still open

  • KL / top-1 against the FP8 teacher is not measured. This is a per-layer numerical result; it is not yet a quality result. The GPU teacher path is bench/bfpq/kl_probe.py + teacher_fp8.py from the bfp-quant branch and needs a vLLM server, and the TT teacher is not ready.
  • Not yet run at TP=2 (expected identical: the finding is not TP-dependent).
  • No new prefill number: PP tok/s and TTFT are not separated in this arms set.

For the deploy: this is pre-existing and not a blocker, but if a KL run confirms it, QWEN36_GDN_AB_BF8=prefill QWEN36_GDN_G_FP32=1 is a free accuracy win for any QWEN36_ATTN_GDN_BF4 arm and should ride along.

Branch mtp-thinkingcap @ 2cffb41. Records: bench/runs/mtp-tp1-gdn-ab-20260925.jsonl.

## Fixed, at no decode cost — and the a/b projection was only half of it `QWEN36_GDN_AB_BF8` alone (8-bit `in_proj_a`/`in_proj_b`) cleans the gate inputs ~20x but **barely moves the per-layer error**: L2 12.26% vs 12.37%, L6 18.70% vs 19.13%. Once `a`/`b` are accurate, the residual **bf16 gate arithmetic** dominates and the same cumulative-decay conditioning amplifies it: `g` was still 1.38% off fp32, from `A_log`/`dt_bias` stored bf16, a bf16 softplus and a bf16 multiply. **`QWEN36_GDN_G_FP32=1`** stores `A_log`/`dt_bias` as fp32, computes `-exp(A_log)` on the host, and runs the whole gate in fp32. It also fixes `tp_common.shard_small`, which cast every small tensor to bf16 on the host before upload whatever device dtype was requested — silently throwing the fp32 away. ### Per-layer prefill error vs fp32 (TP=1, G2, code.v2, 4096 rows) Arm = `AB8=prefill` + `G_FP32=1`, against the production bf4 arm. | layer | bf4 (now) | fixed | recurrent state, bf4 → fixed | |---|---:|---:|---| | L0 | 0.89% | 0.91% | 2.0% → 3.1% | | L1 | 4.25% | **2.40%** | 17.2% → **5.7%** | | L2 | 12.37% | **2.83%** | 27.4% → **2.0%** | | L4 | 8.17% | **2.80%** | 24.1% → **5.9%** | | L5 | 11.45% | **2.95%** | 47.8% → **2.5%** | | L6 | 19.13% | **3.53%** | 31.4% → **8.7%** | **The GDN prefill error drops to the attention layers' level (2–3.5%), and the recurrent state error falls by 3–20x.** Layer-6 stage errors: `negA` and the softplus become exact, `g` goes from 4.67% to **0.003%** against fp32 on the device's own `a`, and the scan's gate-sensitivity term falls from 31.5% to 6.3%. ### Cost: none at decode `QWEN36_GDN_AB_BF8=prefill` keeps the extra `a`/`b` matmul out of the decode step — the error only integrates over the prefill, so decode does not need it. | arm | plain TG ms/token (median, 20 prompts) | |---|---:| | bf4 control | 100.26 | | `AB8=1` (a/b everywhere) | 107.93 | | **`AB8=prefill` + `G_FP32=1`** | **98.68** | Cross-card (one container per card via ttx slots), so treat the combined arm as **neutral**, not a win. The fp32 gate weights are 48 values per layer. ### What is still open - **KL / top-1 against the FP8 teacher is not measured.** This is a per-layer numerical result; it is not yet a quality result. The GPU teacher path is `bench/bfpq/kl_probe.py` + `teacher_fp8.py` from the `bfp-quant` branch and needs a vLLM server, and the TT teacher is not ready. - Not yet run at TP=2 (expected identical: the finding is not TP-dependent). - No new prefill number: PP tok/s and TTFT are not separated in this arms set. **For the deploy:** this is pre-existing and not a blocker, but if a KL run confirms it, `QWEN36_GDN_AB_BF8=prefill QWEN36_GDN_G_FP32=1` is a free accuracy win for any `QWEN36_ATTN_GDN_BF4` arm and should ride along. Branch `mtp-thinkingcap` @ 2cffb41. Records: `bench/runs/mtp-tp1-gdn-ab-20260925.jsonl`.
Author
Owner

Production port ready: branch fix/71-gdn-gate-fp32-prod

One commit on top of deploy/g2-prefix-0019, touching only patches/prod-local-metal/models/demos/blackhole/qwen36/tt/gdn/tp.py (+125 lines). Both flags default off.

QWEN36_GDN_AB_BF8=prefill   a/b from a separate bfloat8_b weight, prefill only
QWEN36_GDN_G_FP32=1         A_log/dt_bias fp32, prefill gate in fp32

Banners, for the gdnPrefillPrecision check:

QWEN36_GDN_AB_BF8 engaged: in_proj_a/b BFLOAT8_B, mode=prefill
QWEN36_GDN_G_FP32 engaged: A_log/dt_bias and the prefill g gate in FLOAT32

How each production difference was handled

hazard handling
decode feeds tw["dt_bias"] / tw["neg_exp_A"] straight into gdn_decode_conv_gates and fused_recurrent_gated_delta_rule_ttnn those stay bf16, untouched; the fp32 gate uses separate dt_bias_f32 / neg_exp_A_f32 copies. Decode cannot see fp32 by construction.
three _project_qkvzab call sites ab8 is opt-in per call; only the two prefill sites pass it, decode keeps the default False.
no tt_all_gather import, no TP=1 wrapper tt_all_gather added to the existing models.tt_transformers.tt.ccl import and used to gather the K-sharded prefill activation.
no MTP-head bf4 exemption in prod the ab8 gate keys off the same inline QWEN36_ATTN_GDN_BF4 test the file already uses.
AB_BF8=1 costs +7.7 ms/token refused at load with an explanatory error. Only prefill is implemented, matching the deploy option.
tp_common.shard_small casts to bf16 on the host whatever dtype is asked local _shard_small_f32 helper; tp_common is untouched.

One design error caught and recorded: my first version made the K-sharded prefill projection row-parallel with tt_all_reduce, to avoid adding an import. That is wrong — it gives every device all devices' a/b instead of its own [a_d|b_d] slice. The port gathers x instead.

Tested

  • bench/mtp/test_ab8_layout.py (host, real checkpoint, no device): the separate bf8 [a|b] weight hands each device exactly the columns the fused weight does, at TP=1 and TP=2. This was the silent-corruption risk. It also shows the bf16 round-trip of -exp(A_log) is 0.17% off on its own.
  • AST and call-site audit: decode gate sites and the kernel arguments are unchanged.
  • The semantics are the ones measured on mtp-thinkingcap: L2 12.37% → 2.83%, L6 19.13% → 3.53%, state L5 47.8% → 2.5%, decode neutral (98.7 vs 100.3 ms/token).

Not tested — the gate the deploy side should run

This file has not been run on the production stack. Two checks:

  1. flags off → byte-identical to the current deploy. On mtp-thinkingcap the equivalent change was 20/20 bit-identical at TP=1 and 20/20 at TP=2 against the pre-change reference, so this is expected to hold, but it is the file that ships.
  2. flags on → both banners, TG ms/token unchanged, and the new ab8.col / dt_bias.f32 / neg_exp_A.f32 cache entries build on first load.

Ping me if you would rather I run either one; I have mesh access through the ttx slots, just not the production image.

Port tooling is on mtp-thinkingcap @ 6733749 (bench/mtp/port71.py, prod-port-71.sh, test_ab8_layout.py).

## Production port ready: branch `fix/71-gdn-gate-fp32-prod` One commit on top of `deploy/g2-prefix-0019`, touching only `patches/prod-local-metal/models/demos/blackhole/qwen36/tt/gdn/tp.py` (+125 lines). Both flags default off. QWEN36_GDN_AB_BF8=prefill a/b from a separate bfloat8_b weight, prefill only QWEN36_GDN_G_FP32=1 A_log/dt_bias fp32, prefill gate in fp32 Banners, for the `gdnPrefillPrecision` check: QWEN36_GDN_AB_BF8 engaged: in_proj_a/b BFLOAT8_B, mode=prefill QWEN36_GDN_G_FP32 engaged: A_log/dt_bias and the prefill g gate in FLOAT32 ### How each production difference was handled | hazard | handling | |---|---| | decode feeds `tw["dt_bias"]` / `tw["neg_exp_A"]` straight into `gdn_decode_conv_gates` and `fused_recurrent_gated_delta_rule_ttnn` | those stay **bf16, untouched**; the fp32 gate uses **separate** `dt_bias_f32` / `neg_exp_A_f32` copies. Decode cannot see fp32 by construction. | | three `_project_qkvzab` call sites | `ab8` is **opt-in per call**; only the two prefill sites pass it, decode keeps the default `False`. | | no `tt_all_gather` import, no TP=1 wrapper | `tt_all_gather` added to the **existing** `models.tt_transformers.tt.ccl` import and used to gather the K-sharded prefill activation. | | no MTP-head bf4 exemption in prod | the ab8 gate keys off the same inline `QWEN36_ATTN_GDN_BF4` test the file already uses. | | `AB_BF8=1` costs +7.7 ms/token | **refused** at load with an explanatory error. Only `prefill` is implemented, matching the deploy option. | | `tp_common.shard_small` casts to bf16 on the host whatever dtype is asked | local `_shard_small_f32` helper; **tp_common is untouched**. | **One design error caught and recorded:** my first version made the K-sharded prefill projection row-parallel with `tt_all_reduce`, to avoid adding an import. That is wrong — it gives every device *all* devices' `a`/`b` instead of its own `[a_d|b_d]` slice. The port gathers `x` instead. ### Tested - `bench/mtp/test_ab8_layout.py` (host, real checkpoint, no device): the separate bf8 `[a|b]` weight hands each device **exactly** the columns the fused weight does, at TP=1 and TP=2. This was the silent-corruption risk. It also shows the bf16 round-trip of `-exp(A_log)` is 0.17% off on its own. - AST and call-site audit: decode gate sites and the kernel arguments are unchanged. - The semantics are the ones measured on `mtp-thinkingcap`: L2 12.37% → 2.83%, L6 19.13% → 3.53%, state L5 47.8% → 2.5%, decode neutral (98.7 vs 100.3 ms/token). ### Not tested — the gate the deploy side should run **This file has not been run on the production stack.** Two checks: 1. **flags off → byte-identical** to the current deploy. On `mtp-thinkingcap` the equivalent change was 20/20 bit-identical at TP=1 and 20/20 at TP=2 against the pre-change reference, so this is expected to hold, but it is the file that ships. 2. **flags on** → both banners, TG ms/token unchanged, and the new `ab8.col` / `dt_bias.f32` / `neg_exp_A.f32` cache entries build on first load. Ping me if you would rather I run either one; I have mesh access through the ttx slots, just not the production image. Port tooling is on `mtp-thinkingcap` @ 6733749 (`bench/mtp/port71.py`, `prod-port-71.sh`, `test_ab8_layout.py`).
Author
Owner

KL probes for the fix: tooling landed, run queued on one card

Pushed on mtp-thinkingcap (b5138d0). The two arms will be produced in kl_probe.py format on
exactly the P1 grid — same contexts.json
(/var/lib/models/bfpq/stage/contexts.json, md5 c5875443119a2fda54d2223151160696, byte-identical
to the G2 arm's own copy), same 44 (ctx, p) probes (cpp/py/prose/docs × 1024, 2048, 4096,
6144, 8192, 12288, 16384, 20480, 24576, 28672, 32000), gen 32, top-20, greedy.

  • control G2CTL: QWEN36_ATTN_GDN_BF4=1 only — today's production numerics.
  • fixed G2FIX: + QWEN36_GDN_G_FP32=1 QWEN36_GDN_AB_BF8=prefill.

Two things worth knowing about how the numbers are produced, because they affect how they should
be read:

  1. The TT plugin has no /v1/completions logprobs on this stack, so the probe comes from the
    in-process logit capture, which records logits. logitprobe.record now also stores the
    full-row logsumexp, and the rows are emitted as logit - lse. Renormalising over the kept
    top-20 instead would rescale each arm's tail mass differently and the KL would measure the
    renormalisation, not the model.
  2. The contexts are raw token ids with no BOS and no chat template, and they are fed verbatim.
    Re-templating them would mean we and the teacher scored different prompts.

The conversion asserts prompt_tokens == p, 32 generated tokens, 20 entries per step, and that the
probe's chosen ids are the tokens actually emitted — so a row that reaches the teacher is on-grid
by construction.

Card discipline: the flags are read at weight-load time, so the two arms cannot share a
process; they run as two sequential TP=1 runs on a single card, waiting on the ttx card slot and
never preempting. Both cards are currently held by deploy-pool, so the run is queued (8 h wait
budget). A 2-probe shakeout goes first so a format bug costs two prefills instead of a card window.

No new speed number from these arms, by construction: the probe's per-step full-vocab readback
sits inside the timed loop, so they are marked timings_valid=false. The fix's speed number stands
where it was measured — bf4 control 100.26 ms/token, AB8=prefill + G_FP32 98.68 ms/token
(neutral, cross-card caveat); AB8=1 everywhere is +7.7 ms/token and stays rejected.

Background, unrelated to the card: the per-layer table now runs to L25 —
g32 rd=0.0266 st=0.0719 vs bf4 rd=0.0687 st=0.2430, i.e. the state error is still ~3.4× worse
without the fix that deep into the stack.

## KL probes for the fix: tooling landed, run queued on one card Pushed on `mtp-thinkingcap` (b5138d0). The two arms will be produced in `kl_probe.py` format on **exactly** the P1 grid — same `contexts.json` (`/var/lib/models/bfpq/stage/contexts.json`, md5 `c5875443119a2fda54d2223151160696`, byte-identical to the G2 arm's own copy), same 44 `(ctx, p)` probes (`cpp`/`py`/`prose`/`docs` × 1024, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32000), gen 32, top-20, greedy. - **control** `G2CTL`: `QWEN36_ATTN_GDN_BF4=1` only — today's production numerics. - **fixed** `G2FIX`: + `QWEN36_GDN_G_FP32=1 QWEN36_GDN_AB_BF8=prefill`. Two things worth knowing about how the numbers are produced, because they affect how they should be read: 1. The TT plugin has no `/v1/completions` logprobs on this stack, so the probe comes from the in-process logit capture, which records **logits**. `logitprobe.record` now also stores the **full-row logsumexp**, and the rows are emitted as `logit - lse`. Renormalising over the kept top-20 instead would rescale each arm's tail mass differently and the KL would measure the renormalisation, not the model. 2. The contexts are raw token ids with no BOS and no chat template, and they are fed verbatim. Re-templating them would mean we and the teacher scored different prompts. The conversion asserts `prompt_tokens == p`, 32 generated tokens, 20 entries per step, and that the probe's chosen ids are the tokens actually emitted — so a row that reaches the teacher is on-grid by construction. **Card discipline:** the flags are read at weight-load time, so the two arms cannot share a process; they run as two sequential TP=1 runs on a single card, waiting on the ttx card slot and never preempting. Both cards are currently held by `deploy-pool`, so the run is queued (8 h wait budget). A 2-probe shakeout goes first so a format bug costs two prefills instead of a card window. **No new speed number from these arms, by construction:** the probe's per-step full-vocab readback sits inside the timed loop, so they are marked `timings_valid=false`. The fix's speed number stands where it was measured — bf4 control 100.26 ms/token, `AB8=prefill` + `G_FP32` 98.68 ms/token (neutral, cross-card caveat); `AB8=1` everywhere is +7.7 ms/token and stays rejected. Background, unrelated to the card: the per-layer table now runs to L25 — `g32 rd=0.0266 st=0.0719` vs `bf4 rd=0.0687 st=0.2430`, i.e. the state error is still ~3.4× worse without the fix that deep into the stack.
Author
Owner

The two production-stack checks cannot be run at TP=1 — they need a mesh window

QWEN36_TP1 does not exist anywhere on deploy/g2-prefix-0019 (git grep -l QWEN36_TP1 ba11d8db
returns nothing). The TP=1 path — the TP stack at divisor 1 — lives only on the mtp-thinkingcap
overlay. So a single-card run of vllm-tt:k2 + patches/prod-local-{metal,plugin} is not the
production stack: it would either fail to build the model, or, if I spliced in the MTP branch's
TP=1 plumbing to make it load, it would no longer prove anything about the deployed unit. Check (a)
is "byte-identical to the current deploy", and that only means something against the deploy's own
configuration.

So the two checks are queued for a mesh window, behind tt-quant and the deploy load probes. The
KL probes are unaffected — those are TP=1 screening on one card, as directed, and are already
queued on card1.

What can be settled without a device, and is: with both flags off the port is a no-op by
construction.
Every hunk in e7d1b0fc is behind a guard that is false when the flags are unset:

  • the loader's fp32 copies are inside if QWEN36_GDN_G_FP32 == "1", and ab8_col inside
    if _ab8 == "prefill" and QWEN36_ATTN_GDN_BF4 == "1";
  • self._g_fp32 / self._ab8 are read off the weights the loader actually built ("neg_exp_A_f32" in tw, "ab8_col" in tw), so the module cannot disagree with the loader about which arm it is;
  • _gate_prefill_g with _g_fp32 false returns the original expression verbatim,
    ttnn.multiply(tw["neg_exp_A"], _softplus_add(a, tw["dt_bias"]));
  • the three _project_qkvzab(..., ab8=True) call sites reach the new code only via
    if ab8 and self._ab8;
  • tt_all_gather is added to the existing models.tt_transformers.tt.ccl import and is called
    only from _project_ab8.
  • QWEN36_GDN_AB_BF8=1 raises at load with an explicit message, as the deploy side's
    gdnPrefillPrecision option expects; 0 / unset / prefill are the only accepted values.

That is an argument, not a measurement, and it does not replace the run — but it says what the run
is expected to confirm, and it is the reason I am not tempted to approximate the run on one card.

## The two production-stack checks cannot be run at TP=1 — they need a mesh window `QWEN36_TP1` does not exist anywhere on `deploy/g2-prefix-0019` (`git grep -l QWEN36_TP1 ba11d8db` returns nothing). The TP=1 path — the TP stack at divisor 1 — lives only on the `mtp-thinkingcap` overlay. So a single-card run of `vllm-tt:k2` + `patches/prod-local-{metal,plugin}` is not the production stack: it would either fail to build the model, or, if I spliced in the MTP branch's TP=1 plumbing to make it load, it would no longer prove anything about the deployed unit. Check (a) is "byte-identical to the current deploy", and that only means something against the deploy's own configuration. So the two checks are queued for a **mesh** window, behind tt-quant and the deploy load probes. The KL probes are unaffected — those are TP=1 screening on one card, as directed, and are already queued on card1. What can be settled without a device, and is: **with both flags off the port is a no-op by construction.** Every hunk in e7d1b0fc is behind a guard that is false when the flags are unset: - the loader's fp32 copies are inside `if QWEN36_GDN_G_FP32 == "1"`, and `ab8_col` inside `if _ab8 == "prefill" and QWEN36_ATTN_GDN_BF4 == "1"`; - `self._g_fp32` / `self._ab8` are read off the weights the loader actually built (`"neg_exp_A_f32" in tw`, `"ab8_col" in tw`), so the module cannot disagree with the loader about which arm it is; - `_gate_prefill_g` with `_g_fp32` false returns the original expression verbatim, `ttnn.multiply(tw["neg_exp_A"], _softplus_add(a, tw["dt_bias"]))`; - the three `_project_qkvzab(..., ab8=True)` call sites reach the new code only via `if ab8 and self._ab8`; - `tt_all_gather` is added to the existing `models.tt_transformers.tt.ccl` import and is called only from `_project_ab8`. - `QWEN36_GDN_AB_BF8=1` raises at load with an explicit message, as the deploy side's `gdnPrefillPrecision` option expects; `0` / unset / `prefill` are the only accepted values. That is an argument, not a measurement, and it does not replace the run — but it says what the run is expected to confirm, and it is the reason I am not tempted to approximate the run on one card.
Author
Owner

Full L0–L31 sweep: the fixed GDN layers land on the attention baseline

The per-layer table finished — 32 layers, both arms scored against the same fp32 host reference,
code.v2 at 4,096 rows. Record: bench/runs/mtp-tp1-gdn-layers-L0-L31-20260925.jsonl (8abfa45).
Per-layer contribution error (rel_delta) and recurrent state:

bf4 mean bf4 max fixed mean fixed max
GDN prefill (24 layers) 8.97% 19.13% (L6) 2.81% 3.53%
GDN state 22.71% 47.80% (L5) 5.25% 10.30%
attention prefill (8 layers) 2.78% 3.42% 2.81% 3.48%

Two things the five spot-checked layers could not show:

  1. The fixed GDN mean sits on the attention mean measured in the same run (2.81% vs 2.78%).
    The gate error is gone, not reduced; what is left is the arm's ordinary bf4 noise.
  2. The spread collapses with the mean (GDN max 3.53% vs 19.13%). For a long prefill that is
    the part that matters — there is no bad-layer tail left to integrate over thousands of rows.

No layer regresses. The only two that read higher in the fixed arm are attention layers, by
0.03pp (L27, L31), and the fix touches no attention weight — that is the run's own noise floor,
now measured rather than assumed.

One loose end, stated as loose: decode rows also improve, 10.27% → 3.87% mean, although AB8
is prefill-only. Most likely G_FP32 acting on the batched B×T gate path rather than AB8
leaking into the per-token step — consistent with TG staying neutral, since an AB8 matmul at
decode costs +7.7 ms/token and none was seen. A G_FP32-only arm would settle it; I have not run
one, so I am not claiming it.

Still numerics only — KL against the FP8 teacher is the quality number, and it is queued on card1
behind deploy-pool. Speeds unchanged and not re-measured here: PP 1,215 / 1,070 / ~920 tok/s at
32k / 64k / 103k; TG 98.68 ms/token for the fix vs a 100.26 ms bf4 control (neutral, cross-card).

## Full L0–L31 sweep: the fixed GDN layers land *on* the attention baseline The per-layer table finished — 32 layers, both arms scored against the same fp32 host reference, code.v2 at 4,096 rows. Record: `bench/runs/mtp-tp1-gdn-layers-L0-L31-20260925.jsonl` (`8abfa45`). Per-layer contribution error (`rel_delta`) and recurrent state: | | bf4 mean | bf4 max | fixed mean | fixed max | |---|---:|---:|---:|---:| | GDN prefill (24 layers) | 8.97% | 19.13% (L6) | **2.81%** | **3.53%** | | GDN state | 22.71% | 47.80% (L5) | **5.25%** | **10.30%** | | attention prefill (8 layers) | 2.78% | 3.42% | 2.81% | 3.48% | Two things the five spot-checked layers could not show: 1. The fixed GDN mean sits **on** the attention mean measured in the same run (2.81% vs 2.78%). The gate error is gone, not reduced; what is left is the arm's ordinary bf4 noise. 2. The **spread** collapses with the mean (GDN max 3.53% vs 19.13%). For a long prefill that is the part that matters — there is no bad-layer tail left to integrate over thousands of rows. **No layer regresses.** The only two that read higher in the fixed arm are *attention* layers, by 0.03pp (L27, L31), and the fix touches no attention weight — that is the run's own noise floor, now measured rather than assumed. **One loose end, stated as loose:** decode rows also improve, 10.27% → 3.87% mean, although `AB8` is prefill-only. Most likely `G_FP32` acting on the batched B×T gate path rather than `AB8` leaking into the per-token step — consistent with TG staying neutral, since an `AB8` matmul at decode costs +7.7 ms/token and none was seen. A `G_FP32`-only arm would settle it; I have not run one, so I am not claiming it. Still numerics only — KL against the FP8 teacher is the quality number, and it is queued on card1 behind `deploy-pool`. Speeds unchanged and not re-measured here: PP 1,215 / 1,070 / ~920 tok/s at 32k / 64k / 103k; TG 98.68 ms/token for the fix vs a 100.26 ms bf4 control (neutral, cross-card).
Author
Owner

gdn/tp.py has a new base on master (85fe82a) — rebase fix/71-gdn-gate-fp32-prod onto it before pushing further. (Posting here because I could not reach the MTP agent directly.)

Owner decision, 2026-09-25: three branches claimed patches/prod-local-metal/models/demos/blackhole/qwen36/tt/gdn/tp.py and only one file can be mounted there. #64's production-shaped file won and is now on master (PR #86, 1291 lines plus a one-line hardening). Sequencing set by the owner: #64 lands first as the base, then #71's hunks rebase onto it, then #50 re-derives. You are next; #50 is held until you are in.

What you are rebasing onto:

  • The base reads QWEN_GDN_CONV_GATES, QWEN_GDN_FUSED_INPLACE and QWEN_GDN_PACKED_QKV. That is why it won — agy/issue-50's 1936-line copy reads none of the three and would have silently dropped the fused-GDN path that every number we hold was measured with.
  • It adds QWEN36_GDN_OUTPROJ_COLPAR (default OFF, upstream PR #57377): an out_colpar weight in load_gdn_weights_tp, _is_gdn_outproj_colpar_enabled(), a self._out_colpar_prefill branch in the prefill out-proj, and an optional dtype= parameter on _silu_mul.
  • The unit now mounts gdn/tp.py as an eighth production source. bench/arms/prod.toml derives its overlay from the patches/prod-local-metal tree, so tools/ttx/tests/test_prod_matches_nix.py keeps arm and unit in lockstep — run it after the rebase; it will catch a drift.

Your delta is tractable: 1359 lines, 208 changed against the new base. QWEN36_GDN_G_FP32 and QWEN36_GDN_AB_BF8 should apply cleanly, and both being default-off is right.

One thing to check: your copy also carries the QWEN36_ATTN_GDN_BF4 hook, which the new base does not. That hook belongs to the bfp-quant lineage, and the bfpq arms mount their own bench/bfpq/sources/gdn-tp.py, so don't carry it into the production file unless you genuinely need it there — and if you do, say why in the commit.

Two more things before you push. Master moved a lot today: ttx, bfp-quant, tt-quant, mtp-thinkingcap, thinkingcap-baseline and decode-campaign-53-55 have all landed, so merge origin/master in first. Your branch was cut from deploy/g2-prefix-0019, which predates PR #68 — after merging, verify docs/ is still 11 files and that QWEN36_PREFILLED_SLOTS_FIX is still present in qwen36_vllm.py. Two branches today would have silently reverted patch 0019 exactly that way.

**gdn/tp.py has a new base on master (85fe82a) — rebase `fix/71-gdn-gate-fp32-prod` onto it before pushing further.** (Posting here because I could not reach the MTP agent directly.) Owner decision, 2026-09-25: three branches claimed `patches/prod-local-metal/models/demos/blackhole/qwen36/tt/gdn/tp.py` and only one file can be mounted there. #64's production-shaped file won and is now on master (PR #86, 1291 lines plus a one-line hardening). Sequencing set by the owner: **#64 lands first as the base, then #71's hunks rebase onto it, then #50 re-derives.** You are next; #50 is held until you are in. What you are rebasing onto: - The base reads `QWEN_GDN_CONV_GATES`, `QWEN_GDN_FUSED_INPLACE` and `QWEN_GDN_PACKED_QKV`. That is why it won — `agy/issue-50`'s 1936-line copy reads **none** of the three and would have silently dropped the fused-GDN path that every number we hold was measured with. - It adds `QWEN36_GDN_OUTPROJ_COLPAR` (default OFF, upstream PR #57377): an `out_colpar` weight in `load_gdn_weights_tp`, `_is_gdn_outproj_colpar_enabled()`, a `self._out_colpar_prefill` branch in the prefill out-proj, and an optional `dtype=` parameter on `_silu_mul`. - The unit now mounts `gdn/tp.py` as an **eighth** production source. `bench/arms/prod.toml` derives its overlay from the `patches/prod-local-metal` tree, so `tools/ttx/tests/test_prod_matches_nix.py` keeps arm and unit in lockstep — run it after the rebase; it will catch a drift. Your delta is tractable: 1359 lines, 208 changed against the new base. `QWEN36_GDN_G_FP32` and `QWEN36_GDN_AB_BF8` should apply cleanly, and both being default-off is right. **One thing to check:** your copy also carries the `QWEN36_ATTN_GDN_BF4` hook, which the new base does not. That hook belongs to the bfp-quant lineage, and the bfpq arms mount their own `bench/bfpq/sources/gdn-tp.py`, so don't carry it into the production file unless you genuinely need it there — and if you do, say why in the commit. **Two more things before you push.** Master moved a lot today: `ttx`, `bfp-quant`, `tt-quant`, `mtp-thinkingcap`, `thinkingcap-baseline` and `decode-campaign-53-55` have all landed, so merge `origin/master` in first. Your branch was cut from `deploy/g2-prefix-0019`, which **predates PR #68** — after merging, verify `docs/` is still 11 files and that `QWEN36_PREFILLED_SLOTS_FIX` is still present in `qwen36_vllm.py`. Two branches today would have silently reverted patch 0019 exactly that way.
Author
Owner

Shakeout passed; full 44-probe grid is running. One number the teacher side needs.

The 2-probe smoke run took card1 at 02:20:38Z and finished rc 0 in 4m20s. Conversion is green:
2 probes, 64 positions, every assertion passing — prompt_tokens == p, 32 generated, top-20
present, and the probe's chosen ids equal to the tokens actually emitted. Chosen is argmax at all
64 positions, as greedy decoding requires. The full chain (44 probes × 2 arms, sequential, one
card, slot-waiting) launched straight after.

The thing worth flagging before the teacher scores anything: on these rows the kept top-20
holds between 0.662 and 1.000 of the probability mass. A third of the mass sits outside the
top-20 on the worst row.

Two consequences:

  1. It confirms the logit - lse choice was not pedantry. Renormalising over the kept 20 would
    have rescaled a 0.662-mass row by 1.51x and a 1.000-mass row by 1.00x — different per row and
    per arm, so the KL would have partly measured the renormalisation. As emitted, every logprob is
    ≤ 0 (max -1.9e-5); under top-20 renormalisation a peaked row's max would read exactly 0.0,
    which is a quick way to check the rows arrived un-mangled.
  2. A KL truncated at top-20 is a lower bound on these rows, and the truncation has to be
    identical for both arms
    — same 20 ids, chosen by the teacher, for control and fixed alike. If
    each arm's own top-20 is used, the two sums run over different supports and the difference is
    not a KL. If the teacher wants the untruncated number, say so and I will re-run with a larger
    QWEN36_LOGIT_PROBE_TOPN; the probe stores the full-row lse either way, so the tail mass is
    recoverable as 1 - sum(exp(kept)).

Timing so far, for planning: 54.7 s for cpp@1024 and 14.7 s for py@2048 (the first carries
warm-up). The deep probes will dominate, so I expect a couple of hours for both arms.

Unchanged and not re-measured: PP 1,215 / 1,070 / ~920 tok/s at 32k / 64k / 103k; TG 98.68
ms/token for the fix vs a 100.26 ms bf4 control. These probed arms cannot contribute a speed
number — timings_valid=false, the full-vocab readback is inside the timed loop.

## Shakeout passed; full 44-probe grid is running. One number the teacher side needs. The 2-probe smoke run took card1 at 02:20:38Z and finished rc 0 in 4m20s. Conversion is green: 2 probes, 64 positions, every assertion passing — `prompt_tokens == p`, 32 generated, top-20 present, and the probe's chosen ids equal to the tokens actually emitted. Chosen is argmax at all 64 positions, as greedy decoding requires. The full chain (44 probes × 2 arms, sequential, one card, slot-waiting) launched straight after. **The thing worth flagging before the teacher scores anything:** on these rows the kept top-20 holds between **0.662 and 1.000** of the probability mass. A third of the mass sits outside the top-20 on the worst row. Two consequences: 1. It confirms the `logit - lse` choice was not pedantry. Renormalising over the kept 20 would have rescaled a 0.662-mass row by 1.51x and a 1.000-mass row by 1.00x — different per row and per arm, so the KL would have partly measured the renormalisation. As emitted, every logprob is ≤ 0 (max `-1.9e-5`); under top-20 renormalisation a peaked row's max would read exactly 0.0, which is a quick way to check the rows arrived un-mangled. 2. **A KL truncated at top-20 is a lower bound on these rows, and the truncation has to be identical for both arms** — same 20 ids, chosen by the teacher, for control and fixed alike. If each arm's own top-20 is used, the two sums run over different supports and the difference is not a KL. If the teacher wants the untruncated number, say so and I will re-run with a larger `QWEN36_LOGIT_PROBE_TOPN`; the probe stores the full-row `lse` either way, so the tail mass is recoverable as `1 - sum(exp(kept))`. Timing so far, for planning: 54.7 s for `cpp@1024` and 14.7 s for `py@2048` (the first carries warm-up). The deep probes will dominate, so I expect a couple of hours for both arms. Unchanged and not re-measured: PP 1,215 / 1,070 / ~920 tok/s at 32k / 64k / 103k; TG 98.68 ms/token for the fix vs a 100.26 ms bf4 control. These probed arms cannot contribute a speed number — `timings_valid=false`, the full-vocab readback is inside the timed loop.
Author
Owner

Control arm done and teacher-ready; the truncation caveat is bigger than the smoke suggested

G2CTL finished rc 0 in 20m48s (02:40:55 → 03:01:43Z) and converts cleanly with the full
grid check on — no --allow-partial: 44 probes, 1,408 positions, 4 contexts × 11 depths
exactly as contexts.json lists them, chosen == argmax at every one of the 1,408 positions.
Rows at /var/lib/models/mtp-tp1/kl-tp1-20260925/probes-G2CTL.jsonl. G2FIX took the card at
03:01:44Z.

Over the whole grid the kept top-20 mass is worse than the 2-probe sample showed:

min p1 p10 median
0.351 0.571 0.903 1.000

14.4% of positions have under 0.95 of their mass inside the top-20, and the worst position
keeps only 35%. So the earlier point is not a corner case: a top-20 KL here is a lower bound on
roughly one position in seven, and the 20 ids must be chosen once by the teacher and applied to
both arms — per-arm top-20s would sum over different supports and the difference would not be a
KL.

Top-20 is what the teacher scored P on, so I am keeping it for comparability and not changing the
running arm. But if a tight number is wanted rather than a comparable one, say so and I will
re-run both arms at a larger QWEN36_LOGIT_PROBE_TOPN — the rows carry the full-row lse, so
the missing tail is already quantified as 1 - sum(exp(kept)) per position and can be reported
alongside whichever KL we use.

## Control arm done and teacher-ready; the truncation caveat is bigger than the smoke suggested `G2CTL` finished rc 0 in 20m48s (02:40:55 → 03:01:43Z) and converts cleanly with the **full** grid check on — no `--allow-partial`: **44 probes, 1,408 positions**, 4 contexts × 11 depths exactly as `contexts.json` lists them, chosen == argmax at every one of the 1,408 positions. Rows at `/var/lib/models/mtp-tp1/kl-tp1-20260925/probes-G2CTL.jsonl`. `G2FIX` took the card at 03:01:44Z. Over the whole grid the kept top-20 mass is worse than the 2-probe sample showed: | min | p1 | p10 | median | |---:|---:|---:|---:| | 0.351 | 0.571 | 0.903 | 1.000 | **14.4% of positions have under 0.95 of their mass inside the top-20**, and the worst position keeps only 35%. So the earlier point is not a corner case: a top-20 KL here is a lower bound on roughly one position in seven, and the 20 ids must be chosen once by the teacher and applied to both arms — per-arm top-20s would sum over different supports and the difference would not be a KL. Top-20 is what the teacher scored P on, so I am keeping it for comparability and not changing the running arm. But if a tight number is wanted rather than a comparable one, say so and I will re-run both arms at a larger `QWEN36_LOGIT_PROBE_TOPN` — the rows carry the full-row `lse`, so the missing tail is already quantified as `1 - sum(exp(kept))` per position and can be reported alongside whichever KL we use.
Author
Owner

STOP on the KL handoff: the fixed arm's decode was corrupt. Bug found and fixed; prefill result stands.

Both arms completed (G2FIX rc 0 at 03:23:11Z, 44 probes, 1,408 positions, full grid check on)
and card1 is released. I did not hand the files to the teacher, because the fixed arm is not
scorable.

What the probe showed. Step 0 of the two arms is the same model to three decimals:

CTL FIX
step 0 top-5 1857 -0.047, 1698 -4.547, 523 -4.922, … 1857 -0.048, 1698 -4.673, 523 -4.923, …
step 1 top-5 680 -0.510, 369 -1.885, 1220 -2.385, … 1504 0.000, 250 -2.5e19, 149771 -4.4e19, …

From step 1 on, the fixed arm's raw logits are ~2.8e20. Token agreement across the grid is
3.2%, and the two arms' top-20 sets fail to intersect at a single decode position in all 44
probes. That last number is what made it obvious this was not numerics: real numerical drift
produces near-ties with heavily overlapping top-20s, not disjoint ones everywhere.

Cause. The research overlay's loader replaced tw["dt_bias"] and tw["neg_exp_A"] with fp32
in place. Those two tensors go straight to the decode kernels (gdn_decode_conv_gates,
fused_recurrent_gated_delta_rule_ttnn), which require bf16 and do not check — so decode read
fp32 bits as bf16 and returned nonsense instead of raising.

patches/prod-local-metal was never affected. The production port kept separate *_f32
copies and left the bf16 tensors for decode from the start; the overlay is now fixed the same way
(13d7025), with _gate_g(prefill=True) opt-in per call site so a new call site defaults to the
safe path, and _g_fp32 read off the weights the loader built rather than the env.

What this withdraws (029fbf9): the 98.68 ms/token TG reading and the "decode rows
improve 10.27% → 3.87%" line — that anomaly, which I flagged as unexplained yesterday, was this
bug. Withdrawn, not corrected: there is no decode measurement to replace them with until a re-run.
AB8=1 costing +7.7 ms/token stands (that arm never set G_FP32).

What survives, unchanged. Everything prefill. The prefill gate always read the fp32 values it
was meant to, so the full L0–L31 sweep's prefill columns stand: GDN contribution error 8.97% →
2.81% mean, 19.13% → 3.53% max, state 22.71% → 5.25%, landing on the attention layers' 2.78%.
PP 1,215 / 1,070 / ~920 tok/s at 32k / 64k / 103k is unaffected.

Cost to redo: the control arm is still valid (its decode never touched fp32 tensors), so only
G2FIX needs re-running — ~22 min on one card, whenever card time is cheap. I am not taking a
card for it now; the perf loop and the deploy ladder are ahead of it. Say when.

## STOP on the KL handoff: the fixed arm's decode was corrupt. Bug found and fixed; prefill result stands. Both arms completed (`G2FIX` rc 0 at 03:23:11Z, 44 probes, 1,408 positions, full grid check on) and card1 is released. **I did not hand the files to the teacher**, because the fixed arm is not scorable. **What the probe showed.** Step 0 of the two arms is the same model to three decimals: | | CTL | FIX | |---|---|---| | step 0 top-5 | `1857 -0.047`, `1698 -4.547`, `523 -4.922`, … | `1857 -0.048`, `1698 -4.673`, `523 -4.923`, … | | step 1 top-5 | `680 -0.510`, `369 -1.885`, `1220 -2.385`, … | `1504 0.000`, `250 -2.5e19`, `149771 -4.4e19`, … | From step 1 on, the fixed arm's raw logits are ~`2.8e20`. Token agreement across the grid is 3.2%, and the two arms' top-20 sets fail to intersect at a **single** decode position in all 44 probes. That last number is what made it obvious this was not numerics: real numerical drift produces near-ties with heavily overlapping top-20s, not disjoint ones everywhere. **Cause.** The research overlay's loader replaced `tw["dt_bias"]` and `tw["neg_exp_A"]` with fp32 **in place**. Those two tensors go straight to the decode kernels (`gdn_decode_conv_gates`, `fused_recurrent_gated_delta_rule_ttnn`), which require bf16 and do not check — so decode read fp32 bits as bf16 and returned nonsense instead of raising. **`patches/prod-local-metal` was never affected.** The production port kept separate `*_f32` copies and left the bf16 tensors for decode from the start; the overlay is now fixed the same way (`13d7025`), with `_gate_g(prefill=True)` opt-in per call site so a new call site defaults to the safe path, and `_g_fp32` read off the weights the loader built rather than the env. **What this withdraws** (`029fbf9`): the **98.68 ms/token TG** reading and the "decode rows improve 10.27% → 3.87%" line — that anomaly, which I flagged as unexplained yesterday, *was* this bug. Withdrawn, not corrected: there is no decode measurement to replace them with until a re-run. `AB8=1` costing +7.7 ms/token stands (that arm never set `G_FP32`). **What survives, unchanged.** Everything prefill. The prefill gate always read the fp32 values it was meant to, so the full L0–L31 sweep's prefill columns stand: GDN contribution error 8.97% → 2.81% mean, 19.13% → 3.53% max, state 22.71% → 5.25%, landing on the attention layers' 2.78%. PP 1,215 / 1,070 / ~920 tok/s at 32k / 64k / 103k is unaffected. **Cost to redo:** the control arm is still valid (its decode never touched fp32 tensors), so only `G2FIX` needs re-running — ~22 min on one card, whenever card time is cheap. I am not taking a card for it now; the perf loop and the deploy ladder are ahead of it. Say when.
Author
Owner

c21 (master bb8c574): prod-g2-pfnum (G_FP32=1 + AB_BF8=prefill) passes identity (48/48/64 banners) and is speed-neutral at 4k/B=8: wall 67.556 s inside the 67.53–67.57 s control band, TG 50.83 ms/token (control 50.75), TTFT p50 6.57 s (control 6.33, 1 obs). Record: bench/runs/perf-loop-c21-pfnum-20260926T1447Z.jsonl. As a precision lever it still needs GSM8K + retrieval + near-tie greedy before shipping.

c21 (master bb8c574): prod-g2-pfnum (G_FP32=1 + AB_BF8=prefill) passes identity (48/48/64 banners) and is **speed-neutral** at 4k/B=8: wall 67.556 s inside the 67.53–67.57 s control band, TG 50.83 ms/token (control 50.75), TTFT p50 6.57 s (control 6.33, 1 obs). Record: bench/runs/perf-loop-c21-pfnum-20260926T1447Z.jsonl. As a precision lever it still needs GSM8K + retrieval + near-tie greedy before shipping.
Author
Owner

c21 (master): prod-g2-pfnum (G_FP32=1 + AB_BF8=prefill) passes identity (48/48/64 banners) and is speed-neutral at 4k/B=8: wall 67.556 s, inside the 67.53-67.57 s control band; TG 50.83 ms/token (control 50.75); TTFT p50 6.57 s (control 6.33, 1 obs). Record: bench/runs/perf-loop-c21-pfnum-20260926T1447Z.jsonl. As a precision lever it still needs GSM8K + retrieval + near-tie greedy before shipping.

c21 (master): prod-g2-pfnum (G_FP32=1 + AB_BF8=prefill) passes identity (48/48/64 banners) and is **speed-neutral** at 4k/B=8: wall 67.556 s, inside the 67.53-67.57 s control band; TG 50.83 ms/token (control 50.75); TTFT p50 6.57 s (control 6.33, 1 obs). Record: bench/runs/perf-loop-c21-pfnum-20260926T1447Z.jsonl. As a precision lever it still needs GSM8K + retrieval + near-tie greedy before shipping.
Author
Owner

ttsim pre-validation (correctness only, merged to master): default GDN path bit-identical after the #71 port; G_FP32 gate error 0.36%->0.11%; AB_BF8 on a bf4-grid-snapped emulation takes a-proj error 11.5%->0.44% (layer out 5.40%->5.28%). Two bugs found and fixed in e7adf12: (1) forward_prefill_batched -- the path vLLM serving runs -- never passed ab8=True, so c21's HW run had AB_BF8 inert (c21 = G_FP32 only); (2) tt_all_gather freed the caller's x in _project_ab8 (now gathers a clone). Records: bench/runs/sim-verdicts-20260926T163335Z.jsonl, sim-gdn71-*.jsonl.

ttsim pre-validation (correctness only, merged to master): default GDN path bit-identical after the #71 port; G_FP32 gate error 0.36%->0.11%; AB_BF8 on a bf4-grid-snapped emulation takes a-proj error 11.5%->0.44% (layer out 5.40%->5.28%). Two bugs found and fixed in e7adf12: (1) forward_prefill_batched -- the path vLLM serving runs -- never passed ab8=True, so c21's HW run had AB_BF8 inert (c21 = G_FP32 only); (2) tt_all_gather freed the caller's x in _project_ab8 (now gathers a clone). Records: bench/runs/sim-verdicts-20260926T163335Z.jsonl, sim-gdn71-*.jsonl.
Member

Do not quote c21 as AB_BF8. That boot was G_FP32 only; the prefill path never passed ab8=True (fixed later in ttsim, correctness only). Next card: one served quality gate of QWEN36_GDN_G_FP32=1 and QWEN36_GDN_AB_BF8=prefill on current BEST. Pass: paired GSM8K McNemar and retrieval 1.0 early and late, and B=4 and B=8 wall not worse. Fail: a quality drop or a wall regression. This is not a speed claim. No kernel.

Do not quote c21 as AB_BF8. That boot was G_FP32 only; the prefill path never passed ab8=True (fixed later in ttsim, correctness only). Next card: one served quality gate of QWEN36_GDN_G_FP32=1 and QWEN36_GDN_AB_BF8=prefill on current BEST. Pass: paired GSM8K McNemar and retrieval 1.0 early and late, and B=4 and B=8 wall not worse. Fail: a quality drop or a wall regression. This is not a speed claim. No kernel.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack#71
No description provided.