decode: re-split GDN recurrence across cores (Dv split, fold conv+gates) — B=1 wins, bit-exact #105

Closed
opened 2026-09-27 16:55:45 +02:00 by Grok · 4 comments
Owner

Desk research 2026-09-27 (no hardware, no new speed number). Note: docs/notes/sram-model-split-2026-09-27.md §GDN (branch serving-throughput).

Problem

GDN decode recurrence is bound by serial per-core work, not DRAM: production bf16 state moves 604 MB/step at ~152 GB/s (c67's 768 MB assumed fp32). B=1: 24 heads, one per core, 46.3 µs/layer; B=8: 192 head-instances as 2 per core on 96 cores, 82.8 µs/layer (≈36.5 µs per head-instance) (ttx-wb-…130708Z, patches/upstream/A-op-53587-fused-decode.diff:783-787). At B=1 ~86 of 110 cores idle during the recurrence.

Levers (estimate)

  1. Split each head's value columns (Dv) across up to 4 cores: B=1 −0.8…−1.3 ms, B=2 −0.5, B≥4 ≈0. Bit-exact by construction (per-column recurrence independent). Upstream precedent: prefill scan chunk_gdn_phased_program_factory.cpp:123-160.
  2. Fold conv+gates into the recurrence cores; at B=8 compute q/k norm once per key head instead of 3×: −0.3…−0.6 ms, up to −0.8 ms more at B=8. Likely bit-exact.

Also check

Patch 0029 LEAN path only engages with fp32 io → on the bf16 production arm it should log lean=0 (code-read, unverified on card).

First probe

ttsim bitwise check, then one-card op timing at 24/48/96/192 head-instances with the Dv split; confirm the 0029 banner.

Desk research 2026-09-27 (no hardware, no new speed number). Note: `docs/notes/sram-model-split-2026-09-27.md` §GDN (branch `serving-throughput`). ## Problem GDN decode recurrence is bound by serial per-core work, not DRAM: production bf16 state moves 604 MB/step at ~152 GB/s (c67's 768 MB assumed fp32). B=1: 24 heads, one per core, 46.3 µs/layer; B=8: 192 head-instances as 2 per core on 96 cores, 82.8 µs/layer (≈36.5 µs per head-instance) (`ttx-wb-…130708Z`, `patches/upstream/A-op-53587-fused-decode.diff:783-787`). At B=1 ~86 of 110 cores idle during the recurrence. ## Levers (estimate) 1. Split each head's value columns (Dv) across up to 4 cores: B=1 −0.8…−1.3 ms, B=2 −0.5, B≥4 ≈0. Bit-exact by construction (per-column recurrence independent). Upstream precedent: prefill scan `chunk_gdn_phased_program_factory.cpp:123-160`. 2. Fold conv+gates into the recurrence cores; at B=8 compute q/k norm once per key head instead of 3×: −0.3…−0.6 ms, up to −0.8 ms more at B=8. Likely bit-exact. ## Also check Patch 0029 LEAN path only engages with fp32 io → on the bf16 production arm it should log `lean=0` (code-read, unverified on card). ## First probe ttsim bitwise check, then one-card op timing at 24/48/96/192 head-instances with the Dv split; confirm the 0029 banner.
Author
Owner

Runbook: https://git.bitp.cz/donach/tt-stack/src/branch/serving-throughput/docs/runbooks/105-gdn-decode-resplit.md. Confirmed the note's warning: prod arms run QWEN35_GDN__BF16=1, so 0029 LEAN prints lean=0 (null arm). A bf16 LEAN is NOT bit-exact either: the kernel's mirrors exist because mixed bf16 x fp32 srcA/srcB pairs lose the fp32 side, and Sexp(g), qinv_rms, v-v_read, deltabeta are all mixed. Lever 2 rejected at B=8: q/k-norm hoist cannot give every core a shared norm (2 inst/core, rf=3; makespan set by the slowest core), and folding conv+gates puts ~48 FIR tile ops per instance on the critical path. What remains is the V-split at B<=2 (rank-3 metric).

Runbook: https://git.bitp.cz/donach/tt-stack/src/branch/serving-throughput/docs/runbooks/105-gdn-decode-resplit.md. Confirmed the note's warning: prod arms run QWEN35_GDN_*_BF16=1, so 0029 LEAN prints lean=0 (null arm). A bf16 LEAN is NOT bit-exact either: the kernel's mirrors exist because mixed bf16 x fp32 srcA/srcB pairs lose the fp32 side, and S*exp(g), q*inv_rms, v-v_read, delta*beta are all mixed. Lever 2 rejected at B=8: q/k-norm hoist cannot give every core a shared norm (2 inst/core, rf=3; makespan set by the slowest core), and folding conv+gates puts ~48 FIR tile ops per instance on the critical path. What remains is the V-split at B<=2 (rank-3 metric).
Author
Owner

New GDN-decode lever from c69b/c69c. It is not a kernel change.

  • In-model (bench/runs/ttx-wb-wb-prod-g2-bitexact-20260927T154934Z.jsonl): every GDN layer loses a fixed ~24 µs before gdn_conv_gates, plus ~27.6 µs before decode_gated_delta_rule at B=8. That is 2.48 ms/step at B=8 and 1.26 ms at B=1.
  • Cause (1-card probe, bench/runs/dispatch-gap-20260927T160058Z.jsonl): the descriptor factories pass one CoreRange per core. The pre-program gap scales with ranges × CBs: 37–40 µs at 96 cores × 30 CBs, against 1.6–4.7 µs with the same cores merged. Runtime args are only 2–3 µs of it.
  • Fix: patches/tt-metal/0030 passes CoreRangeSet{…}.merge_ranges() in the seven GDN/attn factories. Same cores, kernels and args, so it should be bit-exact by construction. Image vllm-tt:k2-mr-pk3m, arm prod-g2-EFS-pk3m.
  • Next: c70 is queued (wb gap check, equiv, served A/B ctl/cand ×2). Gain up to −2.5 ms/step at B=8 is an estimate until measured.
New GDN-decode lever from c69b/c69c. It is not a kernel change. - **In-model** (`bench/runs/ttx-wb-wb-prod-g2-bitexact-20260927T154934Z.jsonl`): every GDN layer loses a fixed ~24 µs before `gdn_conv_gates`, plus ~27.6 µs before `decode_gated_delta_rule` at B=8. That is 2.48 ms/step at B=8 and 1.26 ms at B=1. - **Cause** (1-card probe, `bench/runs/dispatch-gap-20260927T160058Z.jsonl`): the descriptor factories pass one CoreRange per core. The pre-program gap scales with ranges × CBs: 37–40 µs at 96 cores × 30 CBs, against 1.6–4.7 µs with the same cores merged. Runtime args are only 2–3 µs of it. - **Fix**: `patches/tt-metal/0030` passes `CoreRangeSet{…}.merge_ranges()` in the seven GDN/attn factories. Same cores, kernels and args, so it should be bit-exact by construction. Image `vllm-tt:k2-mr-pk3m`, arm `prod-g2-EFS-pk3m`. - **Next**: c70 is queued (wb gap check, equiv, served A/B ctl/cand ×2). Gain up to −2.5 ms/step at B=8 is an **estimate** until measured.
Member

Measured dead at every served B: QWEN36_GDN_VSPLIT +2.1% wall B8/32k, +6.9% B8/4k, dead at B=1 too (c146b TG +2.0%); the surviving fragments (0030 merged core ranges, −2.3…−4.4% makespan) shipped in c70 (R-2026-09-27-c70-merged-ranges). LEVERS row verified 2026-11-18.

Measured dead at every served B: QWEN36_GDN_VSPLIT +2.1% wall B8/32k, +6.9% B8/4k, dead at B=1 too (c146b TG +2.0%); the surviving fragments (0030 merged core ranges, −2.3…−4.4% makespan) shipped in c70 (R-2026-09-27-c70-merged-ranges). LEVERS row verified 2026-11-18.
Author
Owner

agent-gateway closeout (closed): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (closed): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
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#105
No description provided.