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
No Branch/Tag specified
master
claude/public-release-v8
claude/pi-lora-device
claude/pi-lora-epyc-check
claude/pi-lora-plumbing
perf/export-cap-12288
claude/pd-kv-admission
claude/ship-cdr8g
claude/ship-col3-cdr8g
codex/public-release
codex/pp10k
codex/mando-kernels
opus/router-delta-margin
opus/rtx-b8-32k
claude/router-ttdown-fastpath
claude/license-apache2
codex/mtp-w1
docs/longctx-pp
codex/k8b4-speed
codex/kvarn2-study
codex/sglang-port-study
codex/inc393-offload-assert
codex/x16-bench
codex/mtp-cpu
codex/mtp-accept-train
opus/rtx-gpu0diag-rec
opus/rtx-sample-sparse
opus/rtx-prof32k-rec
opus/rtx-prof32k
opus/rtx-b8-prof
codex/k8b4-concurrent
opus/rtx-decode-lane
opus/rtx-w4a8-park
opus/rtx-ar-q8
codex/modelopt-scan
opus/pd-master-consolidation
codex/pd-recipe
opus/rtx-k8b4-connector
opus/pd-branch-archive
codex/pd-docs-fix
codex/pd-prod-snapshot
opus/rtx-kv4
opus/pd-connector-lows
history/hermes-review-uplift
eval-sglang-torchtpu
pp32k-w3c-upstream
pp32k-prefill
upstream-scan-20261109
plugin-283-slot-keep
docs/history-pd-delta
opus/pd-delta-export
opus/pd-stack-to-master
pp32k-ethdisp
opus/pd-router-template
docs/pd-path-breakdown
skill/pd-enterprise-bench
opus/pd-arena-freelist
opus/pd-adaptive
opus/rtx-decode-night
opus/rtx-dynk-fix
opus/rtx-night-ar
opus/rtx-night-attn
opus/pd-export-followup
opus/rtx-night-topk
docs/history
opus/pd-export-arm-master
opus/cmb-crash
opus/pd-draft-tune
opus/tt-interleave
opus/pd-adaptive-v2
opus/rtx-embed-host
opus/pd-adaptive-sim
opus/pd-adaptive-router
opus/pd-cutover
opus/pd-hyperqwen
opus/pd-reprefill
opus/pd
public/arm-flatten
public/upstream-inventory
opus/pd-handoff-opt
opus/lsa-eval
fix/tt-serving-hold-guard
opus/pd-sim-levers
opus/mtp-host-row-isolate
opus/mando2222-cp7
opus/upstream-scan-1104
opus/host-sample-why
opus/cold-prefix-s10
opus/cold-prefix-s10-pack
opus/pd-r3
scout/upstream-20261103
opus/rtx-drafter
opus/b8d-measure
docs/status-refresh-20261102
opus/b8d-verify-attn-splitkv
opus/b8d-sparse-verify-sampling
opus/b8d-ar-asym-x8
opus/b8d-draft-head-quant
opus/b8d-prob-draft-topk
opus/b8d-marlin-m32-mma
opus/rtx-opt
opus/traffic-bench
opus/pd-r2
opus/pd-e2e
opus/pd-export
opus/pd-router
opus/pd-connector
opus/pd-rtx-serve
opus/gdn-id-pool
opus/kv-1m
opus/prefix-rounds
opus/prod-spec-image-id
opus/blend-publish
opus/cold-pp
opus/dashboard-bench
opus/pd-rtx
opus/night-window
opus/prod-edge
opus/probe-hugepages
opus/so-vsplit
opus/fused-decode
opus/fused-decode-vsplit
opus/bfp-autoround
opus/blend-b09d16
opus/blend-gptq-table
opus/kv-host-tier
opus/serve-arm
opus/ttx-ab-suite-refuse
opus/kv-host-tier-history
opus/bfp-quant-docs
opus/s12-prefix
opus/kv-host-tier-staging
opus/cfx-llm0
opus/s12-sdlofi
opus/optrace-addon
opus/tmc-premise
opus/s12-budget
ship/s12
opus/s11-next
ship/s11
opus/verify-rest-2
docs/s10-greedy
docs/optrace-fcb-pf32
opus/pf32
ship/s10
opus/verify-rest
opus/dcx
x280-foundation
docs/crashcourse
opus/sdpa32k
docs/stale-fix
opus/dcx-hcap
x280-program-doc
ship/s9
opus/draftcut
ship/s7-pp3
docs/port-skills
opus/ssparity
probe/drafter-t1
opus/verify64
fix/gate-boot-identity
plan/tg100
ship/s7
screen/batch4
sim/fabric-link-counters
opus/s7cand
opus/rs-bank-ship
readme/s6-ss-numbers
free/t-ethtxq
opus/specsample-s6
opus/dualtrace
sim/kernel-overlay-fix
opus/fusedsampler
opus/rs-bank
opus/devaccept
anatomy/rs-line
fix/abpad-cache-key
free/k-swiglu
opus/sscost
free/k-gdnpre
free/u-matmul
launch/opus-specsample
free/u-ccl
free/c-audit
free/s-cost
free/u-models
free/c-sparse
serve/sampling-defaults
free/w-rsnorm
free/f-tail
ship/s6
launch/s-sample4
free/k-glue
bench/acc-curve
opus/top2-branch
screen/acc-levers3
screen/ss-capture
free/s-rowfall
free/a-oracle2
free/d-top2
free/c-sparse-rev
free/s-penalty
opus/specsample
rv4/m-specsample3
free/m-specsample3
free/s-sample4
review/t-proxy2
free/t-proxy2
free/t-served
free/l-kvbytes
free/m-specsample2
free/t-ops
free/l-verifykv
free/m-specsample
free/a-kdyn
fix/pphost-probe-mml
free/w-swiglu4
free/s-prefix4
free/m-creative
free/w-b8dec
free/w-gdnscan
free/t-proxy
free/b-bucket
free/m-multidraft
free/a-tree
free/s-sample3
free/w-swiglu3
docs/goal-recommended-sampling
free/f-sdpa2
ship/cap
b-bucket-tools
review/b-bucket
free/s-prefix3
free/d-gdn
free/s-prefix2
free/s-sample2
free/p-host
free/d-enq
feat/s-prefix-agentic
ship/s5
free/s-specsample
free/a-sink
free/a-accctx2
screen/acc-levers2
free/f-swiglu
bench/agentic-s4
free/f-draft
screen/acc-levers
free/f-qkvz
free/f-dmlp
free/a-window
free/f-gdnprep
free/f-glue
free/a-oracle
free/a-survey
screen/a-accctx
free/a-accctx
free/f-sdpa
docs/utilization
pp/rsfold
pp/idle
tooling/stream-accept
ship/gum2-s4
pp/agmm-t9
pp/gdn-s3cmb
pp/agmm-fwo
ship/s4
pp/agmm
pp/s3prof
ship/rs4
ship-s3-narrow
tools/jit-check-kernel
pp/gdn-combo
ship/s3
pp/glue3
pp/gdn-scan
free/w2eff
pp/gdn
free/agmm2
free/dsdpa
pp/glue2
pp/glue
ttx-claim-unique
pp/warm
pp/gdn-sdpa
free/vrows
pp/host2
pp/host
ar-prefix-hit-log
feat/card-queue-service
dev/prefetch-reopen
k-sweep-s
lookup-swap-k3
docs/s2-ledger-9309
ci-slot-reclaim
ship-s2-narrow
research/verify-rows-gt32
handoff/claude-20261017
dev/ship-stack-2
lc0-agent-corpus-stats
ci/card-gate-armsel
dev/draft-path
dev/bkda-fix
dev/codex-kernels
dev/decode-next
ship-s-narrow
dev/prefill-hostgap
dev/ship-stack
dev/agmm-eff
dev/so-chain
ar-bf8-out8
lever-studies-20261013
ar-bf8-serve
control-dfr
grill/metal-60316-gdn-prefill-waves
grill/metal-60840-vllm-spec-serve
ship-dfr
screen-201-joint
dspark-serve
land-195-drisc-0042
agmm-swiglu-pack
worktree-agent-aceb187bf909a2834
decode-mr-span-direct
gdn-so-fuse-serve
probe-59622-onecard
ship-e-gpgob
gates-e-gpgob
ci-fingerprint
ttx-heal-within-run
levers-nogo-closeout-20261009
tooling-picker-armderive
tg-toks
agent-harness
ci-fp-base
lc0-bench-token-ids
confirm-cpbaol-gpool
screen-hec-joint
control-joint-b8k3c48
grill/metal-58817-llk-8bit-stream
grill/metal-59507-dram-bank-grid
grill/metal-59622-dram-read-split
grill/metal-59695-sdpa-gqa-flags
grill/metal-59957-spec-batch
grill/metal-59965-gdn-scan-fp32
lookup-swap-k3-base
combo-mx-screen
joint-w2t-b8k3c48
muse-mtp-chunked
muse-decode-profile
muse-harness3
muse-state-bfp8
muse-state-bfp8-study
muse-commit-defer
fix/picker-accept-defining
records-197-close
lever/prefill-unlocks-u2-u3-u6-u7
verify-depth-gt4
lever/u2-norm2d-v2
gdn-producer-pool
prefill-kernel-8k
cpb-lmhead-screen
reeval-decode-gdn-attn-mtp
drisc-prefetch-prio
fp8-fidelity-deepdive
reeval/prefill-20261006
drisc-prefetch-pf13
lever-reeval-decode-weights
odo-on-dx
decode-bundle
kx-compute-fuse
gdn-verify-fused
conv-fold
kx-compute-splitread
drisc-prefetch-lever
kx-matmul
kx-matmul-outdirect
drisc-prefetch
decode-research
ci-tg-toks
kv-update-fold
sdpa-dec-lift
baseline/retarget-cph32
lever/agmm-grid9-cph32
lever/attnqkv-11x6-bf4
lever/sdpa-dec-cph-dualnoc
lever/gdn-scan-mcast
lever/gdn-fused-maxbh
lever/sdpa-dec-kchunk-dualnoc
lever/lmlofi-loo
lever/kda2-loo
lever/kda2-lmlofi-loo
lever/agmm-grid9-chunk2304
ci-serve-fix
ci-sweep-faster
ci/agmm-2x2
ci-token-prefix
ci-pr-driven
gdn-prefill-lift
gateup-on-gdc-cpk
resident-epoch-fix
kv-devinit
serving-throughput
gdn-fused-decode
spec-cycle
opmark-c177
resident-host
boot-speed
gateup-mr
prefill-prof
ship-c175-gdc-cpk
lottolabs-repro
lotto-forensics
decode-mr
mtp-c157
dram-attach
upstream-154
mtp-csplit
queue-guard
mtp-so1-cplit
dram-persist
serve-b16
incr-gcroots
resident-dv
mtp-draft-vocab
mtp-so-t0
arm-switch
queue-stepid-fix
p1-levers
tracy-image
op-datasheets
upstream-watch
op-anatomy
skill-prefill-bringup
ttx-gates-correctness
skill-bh-arch
ttx-ops-tools
mtp-gdn-state-traffic
mtp-device-accept
mtp-conv-multi
gdn-vsplit
cm-g9
agmm-grid
verify-ablate
mtp-warm
prefill-cloud
mtp-stack
gdn-multitoken
dspark-device
mtp-async
mtpb-dn
mtp-state-slot
k8v4-mtp
sdpa-spec-fold
pfprof
fabric-ring
ttx-merged
ttx-gates
kv-k8v4-dn
ttx-safety
mmrs-probe
agmm-silu
prefetch-dn
tailtrace-dn
normbf8
prefill-agmm-abso
worktree-agent-a5e29df1933a6076c
sdpa-dec-v-noc0
worktree-agent-aff7f4014dd906d8b
worktree-agent-a015e99a3392d569c
c105-smallops
agmm-in0-lowp
prefill-combo
worktree-agent-a4c964697339cbea0
tp1-prod-port
resident-rearm
decode-sa1
ttx-gc-sudo
prefill-rs-cfg
wb-gaps
prefill-bundle-h
mtp-batch-fix
ttx-fast-fail
host-leak-investigation
kernel-workbench
ttx-quickwins
kernel-workbench-research
decode-split-probe
mtp-batch
sdpa-mcast-q128
decode-mr-lmhead
prefill-kernels
dram-sharded-mr
decode-levers-2
qb2-scout
decode-levers
prefill-deepdive
prefill-devsplit
sim/prevalidate
port/issue-50-bucket-trace
research/lowlevel-levers
integrate-all
perf-loop-c1
g2-arms-registry
ttx-slot-stale-reclaim
bfp4-overlay
deploy/g2-prefix-0019
mtp-thinkingcap
agy/issue-39
agy/issue-36
kv-k8v4
agy/issue-51
agy/issue-64
fix-dead-assumptions
decode-campaign-53-55
fix/71-gdn-gate-fp32-prod
thinkingcap-baseline
tt-quant
bfp-quant
ttx
agy/issue-49
agy/issue-47
dspark-thinkingcap
repo-skills
harness-overhaul
agy/issue-50
agy/issue-45
agy/issue-38
agy/issue-23
dspark-acceptance-rate
thatch/lane2-serve-gotchas
agent/claude-auth/goal-4-nvfp4-single-card
agent/claude-auth/ttsim-scout
archive/vscode-toolkit-flake
archive/tt-tooling-scout
archive/tt-model-publish
archive/thatch/lane1-fir-drift
archive/serving-throughput
archive/serving-cleared-arm
archive/prefill-optimization-notes
archive/mtp-scout
archive/mtp-dflash2-ttsim
archive/harvest-whitehole-notes
archive/fix-serving-paths
archive/fix-readiness-race
archive/fix-probe-sigpipe
archive/fix-probe-card-sabotage
archive/fix-inspect-empty-stdout
archive/fix-http-code-format
archive/docs/agents-md-retire-claude-md
archive/autoresearch/dspark-drafter-sep07
archive/agent/fable/warm-tensor-cache
archive/agent/fable/external-repo-runbook
archive/agent/fable/cxx-fork-build
archive/agent/claude-auth/two-card-external-report
archive/agent/claude-auth/silicon-validation-findings
archive/agent/claude-auth/prod-27b-serving
archive/agent/claude-auth/ornith-moe
archive/agent/claude-auth/on-box-iteration
archive/agent/claude-auth/mesh-ready
archive/agent/claude-auth/inventory-pre-reboot
archive/agent/claude-auth/goal-vllm-serving
archive/agent/claude-auth/goal-2-3
archive/agent/claude-auth/first-bringup
Labels
Clear labels
cards:go
Force a card run on this PR (consumed by CI; re-add to force again)
hermes-approved
Approved by Hermes (bot). Not a human approval.
human-approved
Approved by @donach for T2-path changes. Required by .forgejo/workflows/ci.yml approve_gate.
human-approved
Approved by the human reviewer — merge gate
iter
0
X280 program stage
iter
1
X280 program stage
iter
2
X280 program stage
iter
3
X280 program stage
prio:high
Still a large B=4/B=8 wall or tokens/cycle lever
prio:low
Parked, already lost, or bookkeeping
prio:med
Real but smaller, or needs a gate
priority/high
Owner-flagged; queue agent picks these first
state
blocked
X280 program workflow state
state
doing
X280 program workflow state
state
done
X280 program workflow state
state
review
X280 program workflow state
state
todo
X280 program workflow state
x280
SiFive X280 (L2CPU) on-card control plane
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause
QWEN36_ATTN_GDN_BF4=1(the G2 arm,R-2026-09-25-gptq-g2) foldsin_proj_aandin_proj_binto the fused[qkv|z|a|b]weight and packs the whole thing asbfloat4_b. But GPTQ only putqkv,zandout_projon the bfp4 grid —aandbare 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.aandbare not ordinary activations. They are the entire input to the GDN gates:g = -exp(A_log) · softplus(a + dt_bias), the per-step log-decaybeta = sigmoid(b), the delta-rule write strengthMeasured at TP=1 on layer 6 (code.v2, 4096 rows), device output against the checkpoint's own weights:
qkvprojectionzprojectionaprojectionbprojectiondevice a = x @ bfp4_RTN(W_a)to 0.44%, and= x @ W_ckptonly 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
abecomes an error in the decayg, which is then summed over the whole prefill. For a slow-decay head (meang≈ −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 (meang≈ −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 forqkv/z, and computea/bfrom a separatebfloat8_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):aprojection errorbprojection errorbetavs fp32gvs fp32Cost, 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
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).
Fixed, at no decode cost — and the a/b projection was only half of it
QWEN36_GDN_AB_BF8alone (8-bitin_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%. Oncea/bare accurate, the residual bf16 gate arithmetic dominates and the same cumulative-decay conditioning amplifies it:gwas still 1.38% off fp32, fromA_log/dt_biasstored bf16, a bf16 softplus and a bf16 multiply.QWEN36_GDN_G_FP32=1storesA_log/dt_biasas fp32, computes-exp(A_log)on the host, and runs the whole gate in fp32. It also fixestp_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.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:
negAand the softplus become exact,ggoes from 4.67% to 0.003% against fp32 on the device's owna, and the scan's gate-sensitivity term falls from 31.5% to 6.3%.Cost: none at decode
QWEN36_GDN_AB_BF8=prefillkeeps the extraa/bmatmul out of the decode step — the error only integrates over the prefill, so decode does not need it.AB8=1(a/b everywhere)AB8=prefill+G_FP32=1Cross-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
bench/bfpq/kl_probe.py+teacher_fp8.pyfrom thebfp-quantbranch and needs a vLLM server, and the TT teacher is not ready.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=1is a free accuracy win for anyQWEN36_ATTN_GDN_BF4arm and should ride along.Branch
mtp-thinkingcap@2cffb41. Records:bench/runs/mtp-tp1-gdn-ab-20260925.jsonl.Production port ready: branch
fix/71-gdn-gate-fp32-prodOne commit on top of
deploy/g2-prefix-0019, touching onlypatches/prod-local-metal/models/demos/blackhole/qwen36/tt/gdn/tp.py(+125 lines). Both flags default off.Banners, for the
gdnPrefillPrecisioncheck:How each production difference was handled
tw["dt_bias"]/tw["neg_exp_A"]straight intogdn_decode_conv_gatesandfused_recurrent_gated_delta_rule_ttnndt_bias_f32/neg_exp_A_f32copies. Decode cannot see fp32 by construction._project_qkvzabcall sitesab8is opt-in per call; only the two prefill sites pass it, decode keeps the defaultFalse.tt_all_gatherimport, no TP=1 wrappertt_all_gatheradded to the existingmodels.tt_transformers.tt.cclimport and used to gather the K-sharded prefill activation.QWEN36_ATTN_GDN_BF4test the file already uses.AB_BF8=1costs +7.7 ms/tokenprefillis implemented, matching the deploy option.tp_common.shard_smallcasts to bf16 on the host whatever dtype is asked_shard_small_f32helper; 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/binstead of its own[a_d|b_d]slice. The port gathersxinstead.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.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:
mtp-thinkingcapthe 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.ab8.col/dt_bias.f32/neg_exp_A.f32cache 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).KL probes for the fix: tooling landed, run queued on one card
Pushed on
mtp-thinkingcap(b5138d0). The two arms will be produced inkl_probe.pyformat onexactly the P1 grid — same
contexts.json(
/var/lib/models/bfpq/stage/contexts.json, md5c5875443119a2fda54d2223151160696, byte-identicalto 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.
G2CTL:QWEN36_ATTN_GDN_BF4=1only — today's production numerics.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:
/v1/completionslogprobs on this stack, so the probe comes from thein-process logit capture, which records logits.
logitprobe.recordnow also stores thefull-row logsumexp, and the rows are emitted as
logit - lse. Renormalising over the kepttop-20 instead would rescale each arm's tail mass differently and the KL would measure the
renormalisation, not the model.
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 theprobe'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 waitbudget). 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 standswhere it was measured — bf4 control 100.26 ms/token,
AB8=prefill+G_FP3298.68 ms/token(neutral, cross-card caveat);
AB8=1everywhere 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.0719vsbf4 rd=0.0687 st=0.2430, i.e. the state error is still ~3.4× worsewithout the fix that deep into the stack.
The two production-stack checks cannot be run at TP=1 — they need a mesh window
QWEN36_TP1does not exist anywhere ondeploy/g2-prefix-0019(git grep -l QWEN36_TP1 ba11d8dbreturns nothing). The TP=1 path — the TP stack at divisor 1 — lives only on the
mtp-thinkingcapoverlay. So a single-card run of
vllm-tt:k2+patches/prod-local-{metal,plugin}is not theproduction 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
e7d1b0fcis behind a guard that is false when the flags are unset:if QWEN36_GDN_G_FP32 == "1", andab8_colinsideif _ab8 == "prefill" and QWEN36_ATTN_GDN_BF4 == "1";self._g_fp32/self._ab8are 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_gwith_g_fp32false returns the original expression verbatim,ttnn.multiply(tw["neg_exp_A"], _softplus_add(a, tw["dt_bias"]));_project_qkvzab(..., ab8=True)call sites reach the new code only viaif ab8 and self._ab8;tt_all_gatheris added to the existingmodels.tt_transformers.tt.cclimport and is calledonly from
_project_ab8.QWEN36_GDN_AB_BF8=1raises at load with an explicit message, as the deploy side'sgdnPrefillPrecisionoption expects;0/ unset /prefillare 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.
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:Two things the five spot-checked layers could not show:
The gate error is gone, not reduced; what is left is the arm's ordinary bf4 noise.
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
AB8is prefill-only. Most likely
G_FP32acting on the batched B×T gate path rather thanAB8leaking into the per-token step — consistent with TG staying neutral, since an
AB8matmul atdecode costs +7.7 ms/token and none was seen. A
G_FP32-only arm would settle it; I have not runone, 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 at32k / 64k / 103k; TG 98.68 ms/token for the fix vs a 100.26 ms bf4 control (neutral, cross-card).
gdn/tp.py has a new base on master (
85fe82a) — rebasefix/71-gdn-gate-fp32-prodonto 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.pyand 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:
QWEN_GDN_CONV_GATES,QWEN_GDN_FUSED_INPLACEandQWEN_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.QWEN36_GDN_OUTPROJ_COLPAR(default OFF, upstream PR #57377): anout_colparweight inload_gdn_weights_tp,_is_gdn_outproj_colpar_enabled(), aself._out_colpar_prefillbranch in the prefill out-proj, and an optionaldtype=parameter on_silu_mul.gdn/tp.pyas an eighth production source.bench/arms/prod.tomlderives its overlay from thepatches/prod-local-metaltree, sotools/ttx/tests/test_prod_matches_nix.pykeeps 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_FP32andQWEN36_GDN_AB_BF8should apply cleanly, and both being default-off is right.One thing to check: your copy also carries the
QWEN36_ATTN_GDN_BF4hook, which the new base does not. That hook belongs to the bfp-quant lineage, and the bfpq arms mount their ownbench/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-baselineanddecode-campaign-53-55have all landed, so mergeorigin/masterin first. Your branch was cut fromdeploy/g2-prefix-0019, which predates PR #68 — after merging, verifydocs/is still 11 files and thatQWEN36_PREFILLED_SLOTS_FIXis still present inqwen36_vllm.py. Two branches today would have silently reverted patch 0019 exactly that way.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-20present, 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:
logit - lsechoice was not pedantry. Renormalising over the kept 20 wouldhave 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.
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-rowlseeither way, so the tail mass isrecoverable as
1 - sum(exp(kept)).Timing so far, for planning: 54.7 s for
cpp@1024and 14.7 s forpy@2048(the first carrieswarm-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.Control arm done and teacher-ready; the truncation caveat is bigger than the smoke suggested
G2CTLfinished rc 0 in 20m48s (02:40:55 → 03:01:43Z) and converts cleanly with the fullgrid check on — no
--allow-partial: 44 probes, 1,408 positions, 4 contexts × 11 depthsexactly as
contexts.jsonlists them, chosen == argmax at every one of the 1,408 positions.Rows at
/var/lib/models/mtp-tp1/kl-tp1-20260925/probes-G2CTL.jsonl.G2FIXtook the card at03:01:44Z.
Over the whole grid the kept top-20 mass is worse than the 2-probe sample showed:
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-rowlse, sothe missing tail is already quantified as
1 - sum(exp(kept))per position and can be reportedalongside whichever KL we use.
STOP on the KL handoff: the fixed arm's decode was corrupt. Bug found and fixed; prefill result stands.
Both arms completed (
G2FIXrc 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:
1857 -0.047,1698 -4.547,523 -4.922, …1857 -0.048,1698 -4.673,523 -4.923, …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 is3.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"]andtw["neg_exp_A"]with fp32in 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 readfp32 bits as bf16 and returned nonsense instead of raising.
patches/prod-local-metalwas never affected. The production port kept separate*_f32copies 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 thesafe path, and
_g_fp32read off the weights the loader built rather than the env.What this withdraws (
029fbf9): the 98.68 ms/token TG reading and the "decode rowsimprove 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=1costing +7.7 ms/token stands (that arm never setG_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
G2FIXneeds re-running — ~22 min on one card, whenever card time is cheap. I am not taking acard for it now; the perf loop and the deploy ladder are ahead of it. Say when.
QWEN36_GDN_OUTPROJ_COLPAR) #97c21 (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): 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.
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.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.