decode: fused kernels GDN norm+gate and q/k-norm+partial RoPE #107

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

Desk research 2026-09-27 (no hardware, no new speed number). Notes: docs/notes/decode-sharded-activations-2026-09-27.md §7, docs/notes/sram-model-split-2026-09-27.md (branch serving-throughput). Follow-up to the decode layout clean-up issue.

Idea

New fused decode kernels that remove conversions no config change can:

  1. GDN norm + gate ("milestone 3" in 0012-packed-decode-wrapper.py): ~0.7–1.0 ms.
  2. q/k-norm + partial RoPE for the 16 attention layers: ~0.8–1.0 ms. Upstream also reshards around q/k-norm (tt_transformers attention.py:297-305, llama3_70b_galaxy llama_attention.py:390-473), so a fused kernel is the only route.

Estimate −1.5…−2 ms/step total (estimate). Bit-exact only if designed to keep the reduction order.

Plan

After the layout clean-up (SA1/SA2) lands: kernel via the workbench (ttx wb), ttsim bitwise vs the unfused chain, then one-card op timing, then arm with <FLAG> engaged banners and the equiv gate.

Desk research 2026-09-27 (no hardware, no new speed number). Notes: `docs/notes/decode-sharded-activations-2026-09-27.md` §7, `docs/notes/sram-model-split-2026-09-27.md` (branch `serving-throughput`). Follow-up to the decode layout clean-up issue. ## Idea New fused decode kernels that remove conversions no config change can: 1. **GDN norm + gate** ("milestone 3" in `0012-packed-decode-wrapper.py`): ~0.7–1.0 ms. 2. **q/k-norm + partial RoPE** for the 16 attention layers: ~0.8–1.0 ms. Upstream also reshards around q/k-norm (tt_transformers `attention.py:297-305`, llama3_70b_galaxy `llama_attention.py:390-473`), so a fused kernel is the only route. Estimate −1.5…−2 ms/step total (estimate). Bit-exact only if designed to keep the reduction order. ## Plan After the layout clean-up (SA1/SA2) lands: kernel via the workbench (`ttx wb`), ttsim bitwise vs the unfused chain, then one-card op timing, then arm with `<FLAG> engaged` banners and the equiv gate.
Author
Owner

Runbook: https://git.bitp.cz/donach/tt-stack/src/branch/serving-throughput/docs/runbooks/107-fused-norm-kernels.md. Parked behind #104 SA1/SA2 (those prove whether removing layout programs moves the step). GDN norm+gate is best as an epilogue of the recurrence kernel (NV=1), which conflicts with the #105 V-split only at B=1.

Runbook: https://git.bitp.cz/donach/tt-stack/src/branch/serving-throughput/docs/runbooks/107-fused-norm-kernels.md. Parked behind #104 SA1/SA2 (those prove whether removing layout programs moves the step). GDN norm+gate is best as an epilogue of the recurrence kernel (NV=1), which conflicts with the #105 V-split only at B=1.
Member

Shipped: exactly the two fused kernels asked here are live prod banners — QWEN36_GDN_NORM_GATE and QWEN36_ATTN_PREP in bench/arms/ship-cdr8g.toml, landed as K3/K5 in LEDGER R-2026-09-28-c86. Verified 2026-11-18.

Shipped: exactly the two fused kernels asked here are live prod banners — QWEN36_GDN_NORM_GATE and QWEN36_ATTN_PREP in bench/arms/ship-cdr8g.toml, landed as K3/K5 in LEDGER R-2026-09-28-c86. 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#107
No description provided.