port: tt-metal GDN prep stack #58928 (merged) + #58925/#58929 on gpool (#58891) for BH=24 #207

Closed
opened 2026-10-08 21:34:14 +02:00 by tenstorrent · 4 comments
Member

Pickup (same-day from upstream watch)

Port the tt-metal GDN prep stack tip for BH=24 onto our gpool arm.

Upstream (theirs — do not bank as ours)

  • #58928 merged 2026-10-07 — GDN L loads through MATH RISC data cache; prep_item ~19.1→18.6 µs (theirs). Source: https://github.com/tenstorrent/tt-metal/pull/58928
  • Stack tip on 1× p150 (theirs): BH=24 401→368 µs (−8.2%), BH=32 550→474 (−13.7%), BH=16 ~flat (hand-off-bound). Same PR / stack narrative; treat as third-party until we measure.
  • Still open upstream (not merged as of 2026-10-08 check): #58925, #58929, on tip of #58891 (gpool / producer pool).

Ours

  • gpool port: #197 / #202 (run #7303: PP +0.76…+2.00% alone — our record).
  • Combo screen: #200 open (do not drive that card run from this issue; link only).
  • Related umbrella watch: #154 (older #58635 GDN prep mention; this issue tracks the #58928 tip specifically).

Plan

  1. Cherry #58928 LLK alone first (cheap, desk).
  2. Then #58925 / #58929 once #58891 tip is stable upstream.
  3. Test as a combo arm with gpool (+ b8k3-cph48 if joint control lands). Coordinate with #200; do not touch the concurrent joint-control A/B / #200 card run / geometry-harness grill.

Pass bar

  • Prefill 4k + 32k up
  • B4 / B8 wall down
  • No B1 regression
  • gsm8k / retrieval / equiv pass
  • must-fail fresh-ELF check

Out of scope

  • No pushes from this tracker, no code land without desk + evidence, no card boots from the watch agent.
  • Do not dual-maintain against an unstable #58891 tip.
## Pickup (same-day from upstream watch) Port the tt-metal **GDN prep** stack tip for BH=24 onto our gpool arm. ### Upstream (theirs — do not bank as ours) - **#58928 merged 2026-10-07** — GDN L loads through MATH RISC data cache; prep_item ~19.1→18.6 µs (theirs). Source: https://github.com/tenstorrent/tt-metal/pull/58928 - Stack tip on **1× p150** (theirs): BH=24 **401→368 µs (−8.2%)**, BH=32 **550→474 (−13.7%)**, BH=16 ~flat (hand-off-bound). Same PR / stack narrative; treat as third-party until we measure. - Still open upstream (not merged as of 2026-10-08 check): [#58925](https://github.com/tenstorrent/tt-metal/pull/58925), [#58929](https://github.com/tenstorrent/tt-metal/pull/58929), on tip of [#58891](https://github.com/tenstorrent/tt-metal/pull/58891) (gpool / producer pool). ### Ours - gpool port: **#197** / **#202** (run **#7303**: PP **+0.76…+2.00%** alone — our record). - Combo screen: **#200** open (do not drive that card run from this issue; link only). - Related umbrella watch: #154 (older #58635 GDN prep mention; this issue tracks the **#58928** tip specifically). ### Plan 1. Cherry **#58928 LLK alone** first (cheap, desk). 2. Then **#58925 / #58929** once **#58891** tip is stable upstream. 3. Test as a **combo arm with gpool** (+ **b8k3-cph48** if joint control lands). Coordinate with #200; do not touch the concurrent joint-control A/B / #200 card run / geometry-harness grill. ### Pass bar - Prefill **4k + 32k** up - **B4 / B8** wall down - **No B1 regression** - gsm8k / retrieval / equiv pass - must-fail **fresh-ELF** check ### Out of scope - No pushes from this tracker, no code land without desk + evidence, no card boots from the watch agent. - Do not dual-maintain against an unstable #58891 tip. ### Links - https://github.com/tenstorrent/tt-metal/pull/58928 - https://github.com/tenstorrent/tt-metal/pull/58925 - https://github.com/tenstorrent/tt-metal/pull/58929 - https://github.com/tenstorrent/tt-metal/pull/58891 - Our: #197 #202 #200 · umbrella #154
Author
Member

tt-lab sfpu.py vs SFPI on our WY SFPU solve (desk only, no card, no ttsim)

Body: _triangle_solve_tile_<Float32, L_NEGATED=true> from 0038/0041 (byte-identical in both), the QWEN36_GDN_WY_SFPU prep instantiation. It is the only GDN overlay with SFPU code of our own. ROW0 inv_rms/expc and conv_gates call the stock LLK rsqrt/exp/silu, which need SFPSHFT, a vector-vector SFPIADD, and SFPEXEXP. The DSL has none of these (a sfpshft probe gives "unsupported SFPU instruction").
Toolchain: SFPI 7.73.0 (sha256 matches tt_metal/sfpi-version @ dhavli/tt-metal 3b31bad; same as v0.79.0-dev20260903), tt-metal compute flags -mcpu=tt-bh-tensix -O3 …. Counts come from objdump plus a small RV32 emulator that replays each issued Tensix word (inline .ttinsn + __instrn_buffer stores). Sanity check: 496 MAD = 32·31/2, 496 L1 reads.

per 32×32 tile SFPI (ours, stock) tt-lab sfpu.py (e6baf56), same driver, SFPI-compiled ours + .insn pack
column update (hot inner loop) 13 SFPU (1 LOAD + 8 LOADI + 4 MAD) 13 (same) 13
SFPU total 1752 (992 LOADI / 496 MAD / 176 LOAD / 64 STORE / 24 TRANSP) 1744 (−8 TRANSP) 1752 (word-identical)
SFPNOP / REPLAY / LOADMACRO 0 / 0 / 0 0 / 0 / 0 0 / 0 / 0
math-RISC instrs executed 4754 4308 (−9.4%) 4259
inner loop (4 cols): RISC / SFPU 139 / 52 122 / 52 123 / 52
  • Delta: the SFPU stream is not meaningfully shorter (−8 of 1752, −0.46%). The 8 are the leading SFPTRANSP per row group. It only preserves LREG5/6, so the DSL can't express it. The LOADI immediates, LOADI modes and DEST addresses are identical in sequence. The RISC saving comes from pack for the low-half LOADI word. SFPI 7.73 -mcpu=tt-bh-tensix doesn't define __riscv_zbkb, so our #if never takes the pack path. Applied to our header via .insn r 0x33,4,0x04, it gives 4259 RISC instructions and the same 1752 Tensix words.
  • Encoding: tt-lab src/ckernel_ops.h = pinned tt_llk_blackhole/common/inc/ckernel_ops.h apart from the copyright line (43/43 SFP*/REPLAY/SETRWC macros identical). No SFPLOADMACRO on either side. Semantic diffs in the emitted words: LOAD/STORE mod0=3 (FP32) vs our 0 (SRCB), and addrmod=0 vs our ADDR_MOD_7. The DSL only accepts 0..3, and A2D copy_tile programs ADDR_MOD_0/2, so to integrate we'd have to patch sfpu.py. Splat in LREG5 vs LREG7.
  • Effort to adopt as overlay: patch sfpu.py (addrmod 7, mod0 0), add a codegen step and a C++ driver, then a ttsim bitwise gate, all for −8 SFPU instrs.
  • Recommendation: drop tt-lab as a codegen path for #207. It isn't a ttsim-bitwise candidate. Separately, we could take the .insn pack line straight into 0038/0041 (RISC-only, Tensix stream word-identical). It still needs the usual ttsim/warmup gate; silicon pack support is tt-lab's claim, not verified here. No timing claims.
**tt-lab `sfpu.py` vs SFPI on our WY SFPU solve (desk only, no card, no ttsim)** Body: `_triangle_solve_tile_<Float32, L_NEGATED=true>` from 0038/0041 (byte-identical in both), the `QWEN36_GDN_WY_SFPU` prep instantiation. It is the only GDN overlay with SFPU code of our own. ROW0 inv_rms/expc and conv_gates call the stock LLK rsqrt/exp/silu, which need `SFPSHFT`, a vector-vector `SFPIADD`, and `SFPEXEXP`. The DSL has none of these (a `sfpshft` probe gives "unsupported SFPU instruction"). Toolchain: SFPI 7.73.0 (sha256 matches `tt_metal/sfpi-version` @ dhavli/tt-metal 3b31bad; same as v0.79.0-dev20260903), tt-metal compute flags `-mcpu=tt-bh-tensix -O3 …`. Counts come from objdump plus a small RV32 emulator that replays each issued Tensix word (inline `.ttinsn` + `__instrn_buffer` stores). Sanity check: 496 MAD = 32·31/2, 496 L1 reads. | per 32×32 tile | SFPI (ours, stock) | tt-lab sfpu.py (e6baf56), same driver, SFPI-compiled | ours + `.insn` pack | |---|---|---|---| | column update (hot inner loop) | 13 SFPU (1 LOAD + 8 LOADI + 4 MAD) | 13 (same) | 13 | | SFPU total | 1752 (992 LOADI / 496 MAD / 176 LOAD / 64 STORE / 24 TRANSP) | 1744 (−8 TRANSP) | 1752 (word-identical) | | SFPNOP / REPLAY / LOADMACRO | 0 / 0 / 0 | 0 / 0 / 0 | 0 / 0 / 0 | | math-RISC instrs executed | 4754 | 4308 (−9.4%) | 4259 | | inner loop (4 cols): RISC / SFPU | 139 / 52 | 122 / 52 | 123 / 52 | - **Delta:** the SFPU stream is not meaningfully shorter (−8 of 1752, −0.46%). The 8 are the leading `SFPTRANSP` per row group. It only preserves LREG5/6, so the DSL can't express it. The LOADI immediates, LOADI modes and DEST addresses are identical in sequence. The RISC saving comes from `pack` for the low-half LOADI word. SFPI 7.73 `-mcpu=tt-bh-tensix` doesn't define `__riscv_zbkb`, so our `#if` never takes the pack path. Applied to our header via `.insn r 0x33,4,0x04`, it gives 4259 RISC instructions and the same 1752 Tensix words. - **Encoding:** tt-lab `src/ckernel_ops.h` = pinned `tt_llk_blackhole/common/inc/ckernel_ops.h` apart from the copyright line (43/43 SFP*/REPLAY/SETRWC macros identical). No SFPLOADMACRO on either side. Semantic diffs in the emitted words: LOAD/STORE `mod0=3` (FP32) vs our `0` (SRCB), and `addrmod=0` vs our `ADDR_MOD_7`. The DSL only accepts 0..3, and A2D `copy_tile` programs ADDR_MOD_0/2, so to integrate we'd have to patch sfpu.py. Splat in LREG5 vs LREG7. - **Effort to adopt as overlay:** patch sfpu.py (addrmod 7, mod0 0), add a codegen step and a C++ driver, then a ttsim bitwise gate, all for −8 SFPU instrs. - **Recommendation: drop tt-lab** as a codegen path for #207. It isn't a ttsim-bitwise candidate. Separately, we could take the `.insn` pack line straight into 0038/0041 (RISC-only, Tensix stream word-identical). It still needs the usual ttsim/warmup gate; silicon `pack` support is tt-lab's claim, not verified here. No timing claims.
Author
Member

PP tracking check, 2026-10-09: #58891 / #58925–27 / #58929 numbers and one correction

Upstream state on 2026-10-09:

  • #58891: open draft (updated 2026-10-08 17:47 UTC).
  • #58925 and #58929: open drafts.
  • #58928: merged 2026-10-07 20:22 UTC.

Upstream numbers at our geometry (theirs; one p150, 11×10, Tracy device time per 2048-token chunk):

  • #58891 at BH=24 "27B TP-2": NV=1 NP=3 on 96 cores, 454.5 µs → pool NV=1 P=86 on 110 cores, 371.7 µs.
  • #58929 whole-stack table at BH=24, from #58891's tip:
    • tip 401.1 µs;
    • after #58925–#58927: 370.9 µs;
    • full stack incl. #58928 + #58929: 368.4 µs (−8.2%).
    • The BH=24 gain is in the producer item (19.09 → 16.16 µs MATH).
  • Note: the two "before" figures (454.5 vs 401.1) are different baselines inside the same series.

Ours (measured): gpool (0048, #197) gave PP +0.76…+2.00% in all 6 cells, mean TG +0.35% (run #7303, #202). It is WIN-alone, screened in combo #200, and not shipped.

Derived ceiling for the rest of the stack on our tree (estimate):

  • P2 GDN fused scan is 9.5% of the eager 30k chunk (OP-DATASHEETS, c127).
  • If our op moved by their −8.2%, the prefill chunk would move by about 9.5% × 8.2% ≈ 0.8%. That is an upper-bound estimate, not a measurement.

Correction to the plan above:

  • Step 1 here says "cherry #58928 LLK alone first". But #197's description says #58928 is already in 0041 (served WY SFPU overlay). Confirm on desk before spending effort.
  • #197 also says #58925 and #58927 edit upstream's newer C3/C5 fused math, which our tree does not have.
    • So the remaining items are not cherry-picks onto 0025/0041/0048. They need either a prep resync or the #208 bump.
  • #58929 is an LLK-global change: the fp32-accurate exp_tile becomes a replay body. It hits every fp32-accurate exp user: GDN pp_decay / pp_lmask, and exp with fp32_dest_acc_en.
    • It is device-side (JIT), so it could ride a ttnn-incr overlay.
    • Its bit-exactness gtest (65,536 inputs) is theirs. We would need our own must-fail.

Tracking verdict: the numbers are now recorded here, with the dependency on #208 for #58925/#58927. No new issue. #214 (tt-metal #59965 fp32 scan state) touches the same receivers and shares L1 with gpool. Sequence them together.

## PP tracking check, 2026-10-09: #58891 / #58925–27 / #58929 numbers and one correction Upstream state on 2026-10-09: - #58891: **open draft** (updated 2026-10-08 17:47 UTC). - #58925 and #58929: **open drafts**. - #58928: **merged** 2026-10-07 20:22 UTC. **Upstream numbers at our geometry (theirs; one p150, 11×10, Tracy device time per 2048-token chunk):** - #58891 at **BH=24 "27B TP-2"**: NV=1 NP=3 on 96 cores, 454.5 µs → pool NV=1 P=86 on 110 cores, **371.7 µs**. - #58929 whole-stack table at BH=24, from #58891's tip: - tip 401.1 µs; - after #58925–#58927: 370.9 µs; - full stack incl. #58928 + #58929: **368.4 µs (−8.2%)**. - The BH=24 gain is in the producer item (19.09 → 16.16 µs MATH). - Note: the two "before" figures (454.5 vs 401.1) are different baselines inside the same series. **Ours (measured):** gpool (0048, #197) gave PP **+0.76…+2.00%** in all 6 cells, mean TG +0.35% (run #7303, #202). It is WIN-alone, screened in combo #200, and not shipped. **Derived ceiling for the rest of the stack on our tree (estimate):** - P2 GDN fused scan is 9.5% of the eager 30k chunk (OP-DATASHEETS, c127). - If our op moved by their −8.2%, the prefill chunk would move by about **9.5% × 8.2% ≈ 0.8%**. That is an upper-bound estimate, not a measurement. **Correction to the plan above:** - Step 1 here says "cherry #58928 LLK alone first". But **#197's description says #58928 is already in 0041** (served WY SFPU overlay). Confirm on desk before spending effort. - #197 also says **#58925 and #58927 edit upstream's newer C3/C5 fused math, which our tree does not have**. - So the remaining items are not cherry-picks onto 0025/0041/0048. They need either a prep resync or the #208 bump. - **#58929** is an LLK-global change: the fp32-accurate `exp_tile` becomes a replay body. It hits every fp32-accurate exp user: GDN `pp_decay` / `pp_lmask`, and `exp` with `fp32_dest_acc_en`. - It is device-side (JIT), so it could ride a ttnn-incr overlay. - Its bit-exactness gtest (65,536 inputs) is theirs. We would need our own must-fail. **Tracking verdict:** the numbers are now recorded here, with the dependency on #208 for #58925/#58927. No new issue. #214 (tt-metal #59965 fp32 scan state) touches the same receivers and shares L1 with gpool. Sequence them together.
Member

Shipped: the whole GDN prep stack was ported and shipped — gpool (patch 0048), gpo (R-2026-10-16-gpo), gum2 (R-2026-10-20-s3gum2 tier-2 SHIP; QWEN36_GDN_FUSED_POOL + UPMATH=prep3 banners live in ship-cdr8g.toml). Verified 2026-11-18.

Shipped: the whole GDN prep stack was ported and shipped — gpool (patch 0048), gpo (R-2026-10-16-gpo), gum2 (R-2026-10-20-s3gum2 tier-2 SHIP; QWEN36_GDN_FUSED_POOL + UPMATH=prep3 banners live in ship-cdr8g.toml). Verified 2026-11-18.
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
3 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#207
No description provided.