grill: tt-metal #58817 BH LLK 8-bit streamed tiles (16-bit DEST) + row MOP — which of our prefill/decode matmuls engage #216

Open
opened 2026-10-09 08:55:58 +02:00 by tenstorrent · 0 comments
Member

Pickup (same day from the upstream watch, 2026-10-09; PP + TG scope)

Grill first: desk only, no card runs, no code. Tree read: master f30ab09 (CONTROL …-dx-w2t-b8k3-cph48). Branch grill/metal-58817-llk-8bit-stream is cut from master, with no commits.

Upstream: https://github.com/tenstorrent/tt-metal/pull/58817, blackhole llk matmul: stream 8-bit tiles at their data rate, one math MOP per row as an opt-in, assert the reuse direction of each call, by mvlahovicTT.

Previously screened only in a PR comment: #192 (issuecomment-12699), "expected gain ~0 at our fp32-dest 1x4 subblocks; not built". This is the first tracking issue. That screen was against an earlier PR head.

Their claims (theirs)

  • stream_narrow (#58712): with a 16-bit DEST, a streamed operand of ≤8 bits per datum (bfp8/bfp4/fp8/int8) unpacks in 11.4 instead of 15.4 cycles/tile (UNPACK_ISOLATE microbenchmark).
    • It is decided in the LLK API init from the operand formats and DST_ACCUM_MODE, so every matmul_block_init caller gets it.
    • 32-bit DEST keeps main's body and rate.
  • row_mop (#58714): one math MOP per reuse row.
    • Opt-in in the bmm kernel above LoFi; at LoFi only for subblocks ≥6 tiles, or 8-tile subblocks with in0_block_w > 1.
    • Their figures: auto-config prefills 0.9–3.9%; bfp8 prefills 0.3–0.5%; Llama 3.1 8B QB2 prefill gate_up 3.9%.
  • #58716: callers that set dst_full_sync_en with blocks that fit half DEST run half sync. Their figure: Llama 70B Galaxy FF1/FF3 bf4 +11.6…12.5%.
  • #58713 TTSync: for subblocks ≤2x2.
  • #59769: a correctness fix for full-sync rows of 9–16 streamed tiles (context-1 zmask).

Where it touches our cards (code read, not measured)

site DEST streamed operand engages? share (ours)
P1 AGMM prefill (5 roles), w2, projections (tp_common.py COMPUTE_PROJ / prefill configs) fp32 bf4 weights (in1, SrcA) stream_narrow no (fp32 DEST). row_mop no at our 1x4 LoFi subblocks (#192 screen) AGMM 37.2%, w2 8.1% of prefill chunk (OP-DATASHEETS)
P4 prefill SDPA streaming LoFi (attention/tp.py, QWEN36_SDPA_STREAMING) 16-bit K bf8 / V bf4 paged KV stream_narrow likely yes (QK streams K, PV streams V; direction to verify) 10.7% at HiFi2, served LoFi ~−30%
D4 decode SDPA + spec fold (tp_common.py SDPA decode cfg, fp32_dest_acc_en=False) 16-bit K bf8 / V bf4 likely yes attention class 15% at 4k, 27% at 32k of verify
D1′ decode lm_head MR (QWEN36_LMHEAD_FID, LoFi under lmlofi, fp32_dest_acc_en=False) 16-bit bf4 weights yes 4.2% (DRAM-bound, 0.79 ms floor)
D1 decode MR matmuls / CPB (0040: "whole K in fp32 Dest") fp32 bf4 no —
GDN prep/scan/conv fp32 fp32 no —

Estimate

  • PP: only P4 SDPA prefill engages, and only if it is unpack-bound. Its floor is unresolved: FPU 24 ms vs SFPU exp ~45 ms (est) vs 38.5 ms measured. So the bound is a fraction of P4's ~7.5% served share, and likely small.
  • No number without a 1-card op probe.
  • The big PP site (AGMM, fp32 DEST) does not engage.
  • The tempting combo: AGMM at 16-bit DEST (QWEN36_AGMM_SUBBLOCK=2x4 dest16, LEVERS row 73: flat at 1,153.4 vs 1,154.8 ms stock) plus stream_narrow. It would then stream the bf4 weights at the 8-bit rate.
    • But #193 puts AGMM's gap at data movement (344 vs 394–409 TF/chip ceiling). bf16 accumulation over K=5120 is also a tier-2 numerics move.
    • This is a grill question, not an estimate.
  • TG: decode SDPA and lm_head are DRAM/KV-bound per OP-DATASHEETS (D4: KV bytes; D1′: DRAM 0.79 ms), so a faster unpack is unlikely to bind. Expected ~0. Unmeasured.
  • Carry cost: LLK + bmm/SDPA kernel source are device-side JIT. It could ride a ttnn-incr overlay like U7/0047 (#201, device code, JIT at device open). The ttnn host hunks (llk_api signature defaults) need checking against fork 3b31bad. Otherwise it waits for #208.
  • Correctness value: #59769 (full-sync rows of 9–16 tiles) and #58717 (reuse-direction hang) are latent-bug fixes. Audit whether any of our kernels hit them: our dst_full_sync users (FS8, dead per LEVERS row 106, and GDN configs) and 0040 CPB matmul_block narrowing.

Grill questions

  1. Run a 1-card op probe of P4 prefill SDPA (LoFi streaming, K bf8/V bf4, 32k prefix) with and without the LLK overlay, before any arm?
  2. Revisit AGMM dest16 only if (1) shows the unpacker binding? Or close that combo now on #193's data-movement verdict?
  3. Audit #59769/#58717 exposure in our tree (full-sync rows >8 tiles; mismatched init/execute reuse direction in 0040's narrowing) as a correctness item regardless of speed?
  4. Graft as a JIT overlay now, or only through #208?

Out of scope

  • No code, no card boots. Upstream numbers are theirs.
## Pickup (same day from the upstream watch, 2026-10-09; PP + TG scope) Grill first: desk only, no card runs, no code. Tree read: master `f30ab09` (CONTROL `…-dx-w2t-b8k3-cph48`). Branch `grill/metal-58817-llk-8bit-stream` is cut from master, with no commits. Upstream: https://github.com/tenstorrent/tt-metal/pull/58817, **blackhole llk matmul: stream 8-bit tiles at their data rate, one math MOP per row as an opt-in, assert the reuse direction of each call**, by mvlahovicTT. - State: open. Filed 2026-10-01 12:52 UTC (14:52 Prague). - Size: 27 files, +1541/−210. - Fixes #58712, #58713, #58714, #58716, #58717 and #59769. Previously screened only in a PR comment: #192 (issuecomment-12699), "expected gain ~0 at our fp32-dest 1x4 subblocks; not built". This is the first tracking issue. That screen was against an earlier PR head. ### Their claims (theirs) - **`stream_narrow` (#58712):** with a **16-bit DEST**, a streamed operand of ≤8 bits per datum (bfp8/bfp4/fp8/int8) unpacks in **11.4 instead of 15.4 cycles/tile** (UNPACK_ISOLATE microbenchmark). - It is decided in the LLK API init from the operand formats and `DST_ACCUM_MODE`, so every `matmul_block_init` caller gets it. - **32-bit DEST keeps main's body and rate.** - **`row_mop` (#58714):** one math MOP per reuse row. - Opt-in in the bmm kernel above LoFi; at LoFi only for subblocks ≥6 tiles, or 8-tile subblocks with in0_block_w > 1. - Their figures: auto-config prefills 0.9–3.9%; bfp8 prefills 0.3–0.5%; Llama 3.1 8B QB2 prefill gate_up 3.9%. - **#58716:** callers that set `dst_full_sync_en` with blocks that fit half DEST run half sync. Their figure: Llama 70B Galaxy FF1/FF3 bf4 +11.6…12.5%. - **#58713 TTSync:** for subblocks ≤2x2. - **#59769:** a correctness fix for full-sync rows of 9–16 streamed tiles (context-1 zmask). ### Where it touches our cards (code read, not measured) | site | DEST | streamed operand | engages? | share (ours) | |---|---|---|---|---| | P1 AGMM prefill (5 roles), w2, projections (`tp_common.py` `COMPUTE_PROJ` / prefill configs) | **fp32** | bf4 weights (in1, SrcA) | `stream_narrow` **no** (fp32 DEST). `row_mop` no at our 1x4 LoFi subblocks (#192 screen) | AGMM 37.2%, w2 8.1% of prefill chunk (OP-DATASHEETS) | | P4 prefill SDPA streaming LoFi (`attention/tp.py`, `QWEN36_SDPA_STREAMING`) | **16-bit** | K bf8 / V bf4 paged KV | `stream_narrow` **likely yes** (QK streams K, PV streams V; direction to verify) | 10.7% at HiFi2, served LoFi ~−30% | | D4 decode SDPA + spec fold (`tp_common.py` SDPA decode cfg, `fp32_dest_acc_en=False`) | 16-bit | K bf8 / V bf4 | likely yes | attention class 15% at 4k, 27% at 32k of verify | | D1′ decode lm_head MR (`QWEN36_LMHEAD_FID`, LoFi under `lmlofi`, `fp32_dest_acc_en=False`) | 16-bit | bf4 weights | yes | 4.2% (DRAM-bound, 0.79 ms floor) | | D1 decode MR matmuls / CPB (0040: "whole K in fp32 Dest") | fp32 | bf4 | no | — | | GDN prep/scan/conv | fp32 | fp32 | no | — | ### Estimate - **PP:** only P4 SDPA prefill engages, and only if it is unpack-bound. Its floor is unresolved: FPU 24 ms vs SFPU exp ~45 ms (est) vs 38.5 ms measured. So the bound is a fraction of P4's ~7.5% served share, and likely small. - No number without a 1-card op probe. - The big PP site (AGMM, fp32 DEST) does **not** engage. - **The tempting combo:** AGMM at 16-bit DEST (`QWEN36_AGMM_SUBBLOCK=2x4` dest16, LEVERS row 73: flat at 1,153.4 vs 1,154.8 ms stock) **plus** `stream_narrow`. It would then stream the bf4 weights at the 8-bit rate. - But #193 puts AGMM's gap at data movement (344 vs 394–409 TF/chip ceiling). bf16 accumulation over K=5120 is also a tier-2 numerics move. - This is a grill question, not an estimate. - **TG:** decode SDPA and lm_head are DRAM/KV-bound per OP-DATASHEETS (D4: KV bytes; D1′: DRAM 0.79 ms), so a faster unpack is unlikely to bind. Expected ~0. Unmeasured. - **Carry cost:** LLK + bmm/SDPA kernel source are **device-side JIT**. It could ride a ttnn-incr overlay like U7/0047 (#201, device code, JIT at device open). The ttnn host hunks (`llk_api` signature defaults) need checking against fork `3b31bad`. Otherwise it waits for #208. - **Correctness value:** #59769 (full-sync rows of 9–16 tiles) and #58717 (reuse-direction hang) are latent-bug fixes. Audit whether any of our kernels hit them: our dst_full_sync users (FS8, dead per LEVERS row 106, and GDN configs) and 0040 CPB `matmul_block` narrowing. ### Grill questions 1. Run a **1-card op probe** of P4 prefill SDPA (LoFi streaming, K bf8/V bf4, 32k prefix) with and without the LLK overlay, before any arm? 2. Revisit **AGMM dest16** only if (1) shows the unpacker binding? Or close that combo now on #193's data-movement verdict? 3. Audit #59769/#58717 exposure in our tree (full-sync rows >8 tiles; mismatched init/execute reuse direction in 0040's narrowing) as a correctness item regardless of speed? 4. Graft as a JIT overlay now, or only through #208? ### Out of scope - No code, no card boots. Upstream numbers are **theirs**. ### Links - Upstream: https://github.com/tenstorrent/tt-metal/pull/58817 - Ours: #192 (prior screen comment), #193 (FLOP ceiling), #201 (U7 JIT overlay precedent), #154 (CPB 0040), #151 (AGMM), #208 (metal bump), #90
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#216
No description provided.