pp-glue3: GDN prefill qkv slice + untilize fused (qrm), tier-1 PP +0.5–2.5% 6/6 over the glue stack #271

Closed
Grok wants to merge 5 commits from pp/glue3 into pp/glue2
Owner

Stacked on #269 (pp/glue2).

  • qrm (QWEN36_PREFILL_GDN_QKV_RM): the full-chunk kda conv reads only a row-major copy of qkv, so one generic_op reads qkv's columns straight out of qkvzab, untilizes them and writes the row-major DRAM copy. That replaces the qkv slice and the 4.9 ms/chunk to_layout.
    • Default off and bitwise, with an in-boot self-test on both chips plus a wrong-input branch.
    • ttsim: 1 chip PASS, 1x2 ALL_OK, MUSTFAIL refused. JIT-check 5/5.
    • Card (n=2, tier 1) vs …-gtl-xa: PP +0.5…+2.5% in 6/6 cells, TG/user flat, B1/32k −4.4 ms/chunk.
  • dm (QWEN36_PREFILL_GDN_TAIL_DM): gtl data-movement tuning. Inert on the card (−0.7…+0.8%, mixed sign) and stays off.
  • Records the runtime-arg check: device inter-program gaps are ~0.12 µs/program, so they don't explain the wall-vs-device gap.
  • The nix unit mounts the new files; test_prod_matches_nix passes 8/8.

LEDGER R-2026-10-20-glue3; record bench/runs/prefill-glue3-card-verdict-20261019.jsonl.

🤖 Generated with Claude Code

Stacked on #269 (pp/glue2). - **qrm** (`QWEN36_PREFILL_GDN_QKV_RM`): the full-chunk kda conv reads only a row-major copy of qkv, so one generic_op reads qkv's columns straight out of qkvzab, untilizes them and writes the row-major DRAM copy. That replaces the qkv slice and the 4.9 ms/chunk to_layout. - Default off and bitwise, with an in-boot self-test on both chips plus a wrong-input branch. - ttsim: 1 chip PASS, 1x2 ALL_OK, MUSTFAIL refused. JIT-check 5/5. - Card (n=2, tier 1) vs `…-gtl-xa`: PP +0.5…+2.5% in 6/6 cells, TG/user flat, B1/32k −4.4 ms/chunk. - **dm** (`QWEN36_PREFILL_GDN_TAIL_DM`): gtl data-movement tuning. Inert on the card (−0.7…+0.8%, mixed sign) and stays off. - Records the runtime-arg check: device inter-program gaps are ~0.12 µs/program, so they don't explain the wall-vs-device gap. - The nix unit mounts the new files; test_prod_matches_nix passes 8/8. LEDGER `R-2026-10-20-glue3`; record `bench/runs/prefill-glue3-card-verdict-20261019.jsonl`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
pp-glue3: QWEN36_PREFILL_GDN_QKV_RM (qrm) — GDN prefill qkv slice + to_layout(ROW_MAJOR) in one program
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Has been cancelled
tt-stack-ci / Report upstream drift (pull_request) Has been cancelled
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Has been cancelled
tt-stack-ci / Serialized card gate (pull_request) Has been cancelled
01e30fd546
The glue2 32k opmark has every GDN layer slicing qkv [T, 5120] out of qkvzab [T, 8248] (L1 TILE) and the kda conv
then untilizing it to a DRAM row-major copy (to_layout, 101 us/call, 4.9 ms/chunk); the kda conv reads only that
copy, so the TILE qkv is a pure intermediate. qrm writes the row-major copy straight from qkvzab: the image's untilize
helper over 8-tile blocks, each row stored at its token row. bf16 in and out, a data move: bitwise.
Expected: -4.9 ms to_layout and -~2 ms of the 4.3 ms slice, plus the new program's cost (unknown until the card).

ttsim: 1 chip PASS (T=128/256/2048 bitwise vs slice + to_layout, sane vs torch, must-fail differs, env guards),
1x2 mesh ALL_OK (in-boot ensure_selftest exact, MUSTFAIL REFUSED). jit-check 5/5 vs vllm-tt:k2-mr-pk3r (the
served image has no get_tile_size in the dataflow API: tile size is a constant). Flag off: byte-identical.
Arm <glue stack>-qrm, ab queue chained behind free-agmm2. nix unit mounts the new files (test_mounts passes).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The gtl programs read and ack-wait per 2 tiles (gate) or per row (norm). That is one DRAM round trip per tiny
block, and both programs together cost 85 us/call (8.2 ms/chunk). Under the flag the gate reader takes 4 tiles per
barrier with 8-deep CBs, the norm reader takes 2 rows per barrier, and both writers flush per block with one ack
barrier at the end. Compute is unchanged, so the outputs are bitwise the same. Flag off: no define and today's CB
sizes (the kernels' flag-off path is restructured but equivalent: ttsim dm0 ALL_OK).
Expected about 1-2 ms/chunk (coordinator's estimate); below one tier-1 cell's noise alone, so it rides the qrm
screen as a second arm.

ttsim: 1 chip ALL_OK with DM=1 and DM=0, 1x2 mesh in-boot self-test exact with DM=1. jit-check 8/8 (both dm kernels,
both RISCs, with and without the define) vs vllm-tt:k2-mr-pk3r.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The first qrm screen (ab 20261019T222248Z) REFUSED both arms at the identity check, as designed:
- With qrm the kda carry is built in the qrm branch, with the same ops as QWEN36_GDN_CONV_STATE_RM, so that flag's
  banner never fired. The qrm branch now logs it when the flag is on.
- gdn/tp.py calls gdn_tail.log_engaged + norm_concat, not run(), so the DM banner placed in run() never fired. It
  now logs from log_engaged too.
No speed number from that screen; only the control reps were measured.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Expected qrm -2.5..-4 ms/chunk (estimate); measured -4.4 at B1/32k and -1.6 at B8/32k. TG/user flat.
The DM tuning over qrm resolves nothing (mixed sign within noise), so it stays off.
Also records the runtime-arg check: device inter-program gaps are ~0.12 us/program, so they don't explain the
wall-vs-device gap.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner

verdict: approve
tier: T1

rationale: Clean perf-arm PR. qrm replaces the L1 qkv slice + 4.9 ms/chunk to_layout with one bitwise generic_op (default off, in-boot self-test on both chips with wrong-input MUSTFAIL, ttsim 1-chip + 1x2 PASS, JIT 5/5), and the card A/B shows PP +0.5…+2.5% 6/6 over the glue stack — the numbers in LEDGER R-2026-10-20-glue3 match the imported verdict record (qrm pp_delta 0.54…2.48, TG −0.6…+1.8%, B1/32k −4.4 ms/chunk). dm is measured inert (mixed sign within rep noise) and stays off. No secrets, no red flags.

concerns:

  • [warn] CI card gate on the head did not fire — run 9555 (pp/glue3 head) is cancelled with no conclusion, so the device proof is the manual n=2 card run (ab20261019T225329Z), not a head CI run. The CI card gate must re-fire and reproduce a winner before this ships; that is why I am not applying human-approved — approve only, comment-only.
  • [warn] tools/ttx/clients/wb_knobs.py:46 — the new QWEN36_PREFILL_GDN_QKV_RM_WB_BYPASS entry becomes a standing part of the shared knob registry when this merges. It is env-gated with default "0" (no behavior change when unset), so it is safe, but confirm it is deliberately promoted rather than left as a screen artifact.
  • [warn] PR body claims test_prod_matches_nix passes 8/8, but no such record is in the diff (the queue logs here are the A/B screen, not the nix mount check) — the new ro mounts in modules/tenstorrent-serving.nix are verified against the boot logs instead (qrm self-test exact 12 cells + engaged banner in both arm boots).
  • [nit] The x_rm is not qkv guard in _conv_kda_prefill depends on the caller freeing qkv; a comment says as much, but a follow-up caller that stops freeing would leak the row-major tensor silently.
**verdict:** approve **tier:** T1 **rationale:** Clean perf-arm PR. qrm replaces the L1 qkv slice + 4.9 ms/chunk to_layout with one bitwise generic_op (default off, in-boot self-test on both chips with wrong-input MUSTFAIL, ttsim 1-chip + 1x2 PASS, JIT 5/5), and the card A/B shows PP +0.5…+2.5% 6/6 over the glue stack — the numbers in LEDGER R-2026-10-20-glue3 match the imported verdict record (qrm pp_delta 0.54…2.48, TG −0.6…+1.8%, B1/32k −4.4 ms/chunk). dm is measured inert (mixed sign within rep noise) and stays off. No secrets, no red flags. **concerns:** - [warn] CI card gate on the head did not fire — run 9555 (pp/glue3 head) is cancelled with no conclusion, so the device proof is the manual n=2 card run (ab20261019T225329Z), not a head CI run. The CI card gate must re-fire and reproduce a winner before this ships; that is why I am not applying `human-approved` — approve only, comment-only. - [warn] `tools/ttx/clients/wb_knobs.py:46` — the new `QWEN36_PREFILL_GDN_QKV_RM_WB_BYPASS` entry becomes a standing part of the shared knob registry when this merges. It is env-gated with default "0" (no behavior change when unset), so it is safe, but confirm it is deliberately promoted rather than left as a screen artifact. - [warn] PR body claims `test_prod_matches_nix` passes 8/8, but no such record is in the diff (the queue logs here are the A/B screen, not the nix mount check) — the new ro mounts in `modules/tenstorrent-serving.nix` are verified against the boot logs instead (qrm self-test exact 12 cells + engaged banner in both arm boots). - [nit] The `x_rm is not qkv` guard in `_conv_kda_prefill` depends on the caller freeing qkv; a comment says as much, but a follow-up caller that stops freeing would leak the row-major tensor silently.
Author
Owner

Superseded by #272 (S3 shipped to master, CONTROL = …-gpgob-dfr-s3, R-2026-10-20-s3). Closing unmerged.

Superseded by #272 (S3 shipped to master, CONTROL = …-gpgob-dfr-s3, R-2026-10-20-s3). Closing unmerged.
Grok closed this pull request 2026-10-20 05:58:31 +02:00
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.

Pull request closed

Sign in to join this conversation.
No reviewers
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!271
No description provided.