upstream BH kernels: metal #57395 SDPA / #58922–23 DRAM cores_per_bank / #58635 GDN prep / #57445 SFPU WY #154

Closed
opened 2026-10-02 20:32:07 +02:00 by tenstorrent · 9 comments
Member

Grill\n- Call: WATCH\n- Hypothesis: The upstream Blackhole kernel changes may improve portability to 2×p150a Qwen3.8, but each needs local validation rather than a blind lift.\n- Depends: #90; target 2×p150a Qwen3.8 environment.\n- Measure first: compatibility and focused perf/correctness checks for metal #57395 SDPA, #58922–23 DRAM cores_per_bank, #58635 GDN prep, and #57445 SFPU WY.\n- Out of scope: wholesale upstream sync or unvalidated cherry-picks.\n- Refs: #90, metal #57395, #58922–23, #58635, #57445.

## Grill\n- **Call:** WATCH\n- **Hypothesis:** The upstream Blackhole kernel changes may improve portability to 2×p150a Qwen3.8, but each needs local validation rather than a blind lift.\n- **Depends:** #90; target 2×p150a Qwen3.8 environment.\n- **Measure first:** compatibility and focused perf/correctness checks for metal #57395 SDPA, #58922–23 DRAM `cores_per_bank`, #58635 GDN prep, and #57445 SFPU WY.\n- **Out of scope:** wholesale upstream sync or unvalidated cherry-picks.\n- **Refs:** #90, metal #57395, #58922–23, #58635, #57445.
Owner

Desk audit, no speed numbers yet. Record: bench/runs/upstream-154-audit-20261002T213420Z.jsonl. Upstream gains below are upstream's own figures [third-party].

  • #57395 (SDPA): skip.
    • Its K/V chains only run for non-chunked SDPA, and we serve chunked SDPA.
    • The last-cores remainder assumes the full grid; we run 96 of 110 cores.
    • The decode hunk only applies to MLA.
    • V on the second NoC is already our 0033.
  • #58922 + #58923's rule: lifted as patch 0040, flag QWEN36_DECODE_MR_CPB=auto, branch upstream-154.
    • ttsim correctness passes on all 6 MR roles. Flag off is bitwise identical, and the must-fail is refused.
    • Hardware gates are queued as block c164-upstream of card queue c160:
      1. A 1-card screen. It ends the block unless the new path is ≥5% faster than MR on w13 and w2.
      2. Then a C A C A served A/B.
    • Upstream's −39% is measured against the single reader, not against our MR.
  • #58635 (GDN prep): needs an upstream merge. It is built on upstream's newer GDN prep code, which we don't carry, and its gain is below our served noise. The follow-up is a prep-resync lever.
  • #57445: our patch 0038.
    • The c160 kernel gate passed, and the workbench prefill ladder shows −1.6…−2.9% prefill wall from 2k to 32k.
    • Next: rebased onto the best arm, then the served equiv, A/B, GSM8K and retrieval checks (being prepared as c165).
    • After that, the #58891 producer pool.
Desk audit, no speed numbers yet. Record: `bench/runs/upstream-154-audit-20261002T213420Z.jsonl`. Upstream gains below are upstream's own figures [third-party]. - **#57395 (SDPA): skip.** - Its K/V chains only run for non-chunked SDPA, and we serve chunked SDPA. - The last-cores remainder assumes the full grid; we run 96 of 110 cores. - The decode hunk only applies to MLA. - V on the second NoC is already our 0033. - **#58922 + #58923's rule: lifted** as patch 0040, flag `QWEN36_DECODE_MR_CPB=auto`, branch `upstream-154`. - ttsim correctness passes on all 6 MR roles. Flag off is bitwise identical, and the must-fail is refused. - Hardware gates are queued as block c164-upstream of card queue c160: 1. A 1-card screen. It ends the block unless the new path is ≥5% faster than MR on w13 and w2. 2. Then a C A C A served A/B. - Upstream's −39% is measured against the single reader, not against our MR. - **#58635 (GDN prep): needs an upstream merge.** It is built on upstream's newer GDN prep code, which we don't carry, and its gain is below our served noise. The follow-up is a prep-resync lever. - **#57445: our patch 0038.** - The c160 kernel gate passed, and the workbench prefill ladder shows −1.6…−2.9% prefill wall from 2k to 32k. - Next: rebased onto the best arm, then the served equiv, A/B, GSM8K and retrieval checks (being prepared as c165). - After that, the #58891 producer pool.
Owner

0040 one-card screen: screen_pass=false, so the served steps were skipped as designed.

role MR µs cpb µs Δ
out 213.1 97.2 −54%
attn_qkv 275.5 136.1 −51%
lm_head 439.1 400.0 −9%
qkvzab 296.4 287.3 −3%
w13 280.9 274.3 −2%
w2 173.6 282.3 +63% (slower)
  • Why it failed: the kill rule looked only at w13 and w2. The new path's error was ≤ MR's everywhere.
  • Next: a per-role served A/B with cpb on out, attn_qkv and lm_head only, MR elsewhere, plus a must-fail, equiv, and GSM8K/retrieval if it wins.
  • Record: bench/runs/upstream-154-dsmc-hw1card-20261002T221004Z.jsonl (branch upstream-154).
**0040 one-card screen:** `screen_pass=false`, so the served steps were skipped as designed. | role | MR µs | cpb µs | Δ | |---|---|---|---| | out | 213.1 | 97.2 | **−54%** | | attn_qkv | 275.5 | 136.1 | **−51%** | | lm_head | 439.1 | 400.0 | −9% | | qkvzab | 296.4 | 287.3 | −3% | | w13 | 280.9 | 274.3 | −2% | | w2 | 173.6 | 282.3 | **+63%** (slower) | - **Why it failed:** the kill rule looked only at w13 and w2. The new path's error was ≤ MR's everywhere. - **Next:** a per-role served A/B with cpb on out, attn_qkv and lm_head only, MR elsewhere, plus a must-fail, equiv, and GSM8K/retrieval if it wins. - **Record:** `bench/runs/upstream-154-dsmc-hw1card-20261002T221004Z.jsonl` (branch upstream-154).
Owner

Served A/B on the C-split best, cpbsel (QWEN36_DECODE_MR_CPB=qkvzab=4,attn_qkv=4,out=3,lm_head=4) vs ov40: TG −0.7…−5.5% at B4/B8 (B4/4k wall −4.8%), but B1/32k wall +2.0% / TG +2.6% and B4/32k wall +2.6%. A split result, so ab-won declined and GSM8K/retrieval were skipped. The must-fail was refused by its self-test as designed. Not shipped; next is a per-role subset that avoids the B1 regression. Record: bench/runs/perf-loop-c166-cpbsel-verdict-20261003T000855Z.jsonl.

Served A/B on the C-split best, cpbsel (QWEN36_DECODE_MR_CPB=qkvzab=4,attn_qkv=4,out=3,lm_head=4) vs ov40: TG −0.7…−5.5% at B4/B8 (B4/4k wall −4.8%), but B1/32k wall +2.0% / TG +2.6% and B4/32k wall +2.6%. A split result, so ab-won declined and GSM8K/retrieval were skipped. The must-fail was refused by its self-test as designed. Not shipped; next is a per-role subset that avoids the B1 regression. Record: bench/runs/perf-loop-c166-cpbsel-verdict-20261003T000855Z.jsonl.
Author
Member

Do not ship cpbsel, and do not rerun QWEN36_DECODE_MR_CPB=qkvzab=4,attn_qkv=4,out=3,lm_head=4. That A/B on the old C-split arm cut TG at B4/B8 but raised B1/32k wall and TG, so it was not shipped (c166). Next card, on current BEST and not on C-split: one served A/B of a narrower per-role subset chosen from the one-card screen winners (out, attn_qkv, lm_head; w2 stays off), plus the existing must-fail. Pass: B=4 and B=8 wall or TG down outside the rep band, and B1/32k not worse. Fail: any B=1 regression, then no-ship and skip GSM8K. One-card microseconds are not a served number. No kernel.

Do not ship cpbsel, and do not rerun QWEN36_DECODE_MR_CPB=qkvzab=4,attn_qkv=4,out=3,lm_head=4. That A/B on the old C-split arm cut TG at B4/B8 but raised B1/32k wall and TG, so it was not shipped (c166). Next card, on current BEST and not on C-split: one served A/B of a narrower per-role subset chosen from the one-card screen winners (out, attn_qkv, lm_head; w2 stays off), plus the existing must-fail. Pass: B=4 and B=8 wall or TG down outside the rep band, and B1/32k not worse. Fail: any B=1 regression, then no-ship and skip GSM8K. One-card microseconds are not a served number. No kernel.
Author
Member

Delta 2026-10-07 — CPB / upstream #58922 (theirs)

From sjettTT on https://github.com/tenstorrent/tt-metal/pull/58922 (still open upstream as of 2026-10-08 check):

  • BH p150 at M=32 vs best of 1–3 readers (theirs): 1.10–1.28× bfp8, 1.10–1.47× bfp4.
  • 14336×4096 bfp8 ~96–99% of DRAM ceiling (theirs).
  • Spec verify needs 2–8 row tiles (TT_FATAL today) — blocks our MTP verify until fixed.
  • Author folding into num_workers_per_dram_bank.

Pair as correctness prerequisite

Interaction

  • Same w2/out DRAM reads as #161 Dual-NoC — note when sequencing; do not drive #161 from here.

Action

  • Port after single-knob merge of #58922; do not dual-maintain the old multi-reader path.
  • Prior local CPB screens on this issue (0040 / cpbsel) stay historical; next port tracks the upstream single-knob shape, not a re-run of the declined cpbsel arm.
## Delta 2026-10-07 — CPB / upstream #58922 (theirs) From **sjettTT** on https://github.com/tenstorrent/tt-metal/pull/58922 (still open upstream as of 2026-10-08 check): - BH p150 at **M=32** vs best of 1–3 readers (theirs): **1.10–1.28×** bfp8, **1.10–1.47×** bfp4. - **14336×4096** bfp8 ~**96–99%** of DRAM ceiling (theirs). - Spec verify needs **2–8 row tiles** (`TT_FATAL` today) — **blocks our MTP verify until fixed**. - Author folding into `num_workers_per_dram_bank`. ### Pair as correctness prerequisite - https://github.com/tenstorrent/tt-metal/pull/59834 — fp32 partials reload in DRAM-sharded/reuse factories; p150a-validated; rel err **2.4e-2 → 8e-5** (theirs). Treat as **correctness prerequisite if CPB uses fp32 Dest**. ### Interaction - Same w2/out DRAM reads as **#161 Dual-NoC** — note when sequencing; do not drive #161 from here. ### Action - **Port after single-knob merge** of #58922; **do not dual-maintain** the old multi-reader path. - Prior local CPB screens on this issue (0040 / cpbsel) stay historical; next port tracks the upstream single-knob shape, not a re-run of the declined cpbsel arm.
Author
Member

Pickup reframe — SDPA BH roofline #57395 (prefill-only)

Upstream https://github.com/tenstorrent/tt-metal/pull/57395 still open (not merged, 2026-10-08 check). Prior desk audit on this issue said skip (chunked SDPA / grid / MLA decode hunk). Re-open as a prefill-only desk port for our 16 attn layers, not a decode lever.

Upstream numbers (theirs)

  • p100a causal prefill −19…−41%
  • Llama attn prefill −25…−37%
  • non-MLA decode ~flat (±0.3%)

Source: https://github.com/tenstorrent/tt-metal/pull/57395

Ours

  • Link prefill work: #151
  • Not a decode lever; do not queue decode A/B from this.
  • No dedicated new issue opened — this umbrella already tracks #57395; comment is the same-day pickup note.

Plan

  • Prefill-only desk port when/if tip is absorbable; measure on our chunked path before any card.
## Pickup reframe — SDPA BH roofline #57395 (prefill-only) Upstream https://github.com/tenstorrent/tt-metal/pull/57395 still **open** (not merged, 2026-10-08 check). Prior desk audit on this issue said **skip** (chunked SDPA / grid / MLA decode hunk). Re-open as a **prefill-only desk port** for our **16 attn layers**, not a decode lever. ### Upstream numbers (theirs) - p100a causal prefill **−19…−41%** - Llama attn prefill **−25…−37%** - non-MLA decode ~flat (**±0.3%**) Source: https://github.com/tenstorrent/tt-metal/pull/57395 ### Ours - Link prefill work: **#151** - Not a decode lever; do not queue decode A/B from this. - No dedicated new issue opened — this umbrella already tracks #57395; comment is the same-day pickup note. ### Plan - Prefill-only desk port when/if tip is absorbable; measure on our chunked path before any card.
Author
Member

PP pickup check, 2026-10-09: #57395 (SDPA BH roofline)

Re-read the upstream head on 2026-10-09. The PR was last updated 2026-10-08 22:08 UTC (2026-10-09 00:08 Prague) and is still open, not merged. It is 32 files, sitting on main 8bdf164e6e5 as 12 commits. This updates the 10-08 reframe (issuecomment-13262).

What still holds from the 10-02 audit (issuecomment-11040):

  • The K/V forwarding chains are still gated off for chunked prefill.
    • sdpa_program_factory.cpp kv_chain_mode_for(…, !is_chunked && !has_sliding_window && !is_windowed, …).
    • We serve chunked causal prefill over paged KV, so the chains (the bulk of their −19…−41% p100a causal prefill figure, theirs) do not engage on our path.
  • The decode hunk is MLA-only. V-on-second-NoC is already our 0033.

What might apply on our path (estimates, not measured):

  1. Full-grid prefill SDPA. Their tt_transformers config change puts prefill SDPA on the full BH grid. Our P4 runs 96/110 cores.
    • Upper bound if P4 scaled with cores: 10.7% (HiFi2 share of the 30k chunk, OP-DATASHEETS P4) × (1 − 96/110) ≈ 1.4% of a prefill chunk. This is derived, and an upper bound.
    • Our 96 comes from the GQA multicast geometry (0025/0026, q128: 12 heads × q chunks), so it is a placement question in our code, not this PR.
  2. fp32-DEST streaming kernel. Not our config: we run streaming at fp32_dest_acc_en=False / LoFi (QWEN36_SDPA_STREAMING, QWEN36_SDPA_PREFILL_LOFI). Not a PP lever for us.
  3. Causal remainder on the last cores. Only "for block float Q or reader forwarded chains on the full grid". Our Q is bf16 and we have no chains, so it does not engage.

Tracking verdict: adequately tracked here as a prefill-only desk item. No new issue. The PP upside on our chunked path is ≤ ~1.4% of a chunk (derived upper bound, from SDPA core count only).

Same-day related pickups:

  • #215: tt-metal #59695, the SDPA GQA opt-in flags. Not applicable to causal chunked prefill.
  • #216: tt-metal #58817, BH LLK 8-bit streaming. It engages on our 16-bit-DEST prefill SDPA only.

Links: #201 (U6 SDPA k_chunk), #151, #39, #208.

## PP pickup check, 2026-10-09: #57395 (SDPA BH roofline) Re-read the upstream head on 2026-10-09. The PR was last updated 2026-10-08 22:08 UTC (2026-10-09 00:08 Prague) and is still **open, not merged**. It is 32 files, sitting on main `8bdf164e6e5` as 12 commits. This updates the 10-08 reframe (issuecomment-13262). **What still holds from the 10-02 audit (issuecomment-11040):** - The K/V forwarding chains are still gated off for chunked prefill. - `sdpa_program_factory.cpp` `kv_chain_mode_for(…, !is_chunked && !has_sliding_window && !is_windowed, …)`. - We serve **chunked** causal prefill over paged KV, so the chains (the bulk of their −19…−41% p100a causal prefill figure, theirs) do not engage on our path. - The decode hunk is MLA-only. V-on-second-NoC is already our 0033. **What might apply on our path (estimates, not measured):** 1. **Full-grid prefill SDPA.** Their tt_transformers config change puts prefill SDPA on the full BH grid. Our P4 runs 96/110 cores. - Upper bound if P4 scaled with cores: 10.7% (HiFi2 share of the 30k chunk, OP-DATASHEETS P4) × (1 − 96/110) ≈ **1.4% of a prefill chunk**. This is derived, and an upper bound. - Our 96 comes from the GQA multicast geometry (0025/0026, q128: 12 heads × q chunks), so it is a placement question in our code, not this PR. 2. **fp32-DEST streaming kernel.** Not our config: we run streaming at `fp32_dest_acc_en=False` / LoFi (`QWEN36_SDPA_STREAMING`, `QWEN36_SDPA_PREFILL_LOFI`). Not a PP lever for us. 3. **Causal remainder on the last cores.** Only "for block float Q or reader forwarded chains on the full grid". Our Q is bf16 and we have no chains, so it does not engage. **Tracking verdict:** adequately tracked here as a prefill-only desk item. No new issue. The PP upside on our chunked path is ≤ ~1.4% of a chunk (derived upper bound, from SDPA core count only). Same-day related pickups: - #215: tt-metal #59695, the SDPA GQA opt-in flags. Not applicable to causal chunked prefill. - #216: tt-metal #58817, BH LLK 8-bit streaming. It engages on our 16-bit-DEST prefill SDPA only. Links: #201 (U6 SDPA k_chunk), #151, #39, #208.
Member

Closed as fully dispositioned (records in this issue): #57395 skipped — we serve chunked SDPA and run 96 of 110 cores; #58922 lifted as patch 0040 (served split at c166, per-role residue in #103/#161); #58635 overtaken by the shipped prep stack (0041/0048/0058, R-2026-10-20-s3gum2); #57445 shipped as our patch. Verified 2026-11-18.

Closed as fully dispositioned (records in this issue): #57395 skipped — we serve chunked SDPA and run 96 of 110 cores; #58922 lifted as patch 0040 (served split at c166, per-role residue in #103/#161); #58635 overtaken by the shipped prep stack (0041/0048/0058, R-2026-10-20-s3gum2); #57445 shipped as our patch. 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.

Reference
bitpartner/tt-stack#154
No description provided.