grill: tt-metal #59622 BH large-DRAM-read hang workaround (2 KiB read split) vs our 16 KiB burst readers (MR/CPB/AGMM/GDN) #218

Open
opened 2026-10-09 08:55:59 +02:00 by tenstorrent · 1 comment
Member

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

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

Upstream: https://github.com/tenstorrent/tt-metal/pull/59622, [Bug fix] Large DRAM reads can hang a Blackhole chip: workaround (split into 2 KiB reads) and reproducer, by dddrrreee.

  • State: open. Filed 2026-10-07 08:49 UTC (10:49 Prague).
  • Size: 4 files, +268/−0.
  • Relates to #52270.

Their findings and change (theirs)

  • The hang: on Blackhole, large DRAM reads in flight while other cores' non-posted DRAM writes are in flight on the same NoC can hang the chip.
    • Read responses stop partway and the chip needs a reset.
    • Reproducer: 110 cores, 16 KiB reads + 1088 B writes, all on NoC 1. It hung in 9/9 recorded runs after 35–526 program runs.
    • Their 4-chip serving workload stalled in 3/3 runs (9–88 min) without the PR, and in 0 of 5.75 h with it.
    • Tested on P300 only; P150 not tested.
    • Controls that did not hang: reads without writes; reads on NoC 0 with writes on NoC 1; 8 KiB reads; 2 KiB reads.
  • The workaround (device-side only, Blackhole only):
    • dataflow_api.h noc_async_read splits any read from a DRAM bank larger than 2 KiB into ≤2 KiB noc_async_read_one_packet reads.
    • cq_prefetch.cpp sends >2 KiB DRAM pages through that path.
    • Not split: noc_async_read_one_packet*, *_with_state*, the prefetcher's linear relays and trace page reads.
  • Cost: unmeasured upstream ("read-bandwidth and serving-throughput cost are unmeasured on this upstream port").

Where it hits us (code read)

Our bandwidth levers are built on multi-tile bursts up to the 16 KiB NoC packet (docs/BLACKHOLE-PERF.md §6: "a burst up to the 16384-byte cap is the transfer the machine is built for"; one NoC plateaus at 243–347 GB/s, c81).

  • Decode MR k-row bursts:
    • 0024 and 0032 use noc.async_read<NocOptions::TXN_ID, NOC_MAX_BURST_SIZE>, one k-row per read.
    • 0032's dual-NoC path uses async_read_with_state<CUSTOM_VC, NOC_MAX_BURST_SIZE>, which is not split.
    • Whether the Device-2.0 noc.async_read lowers to noc_async_read (and so gets split) is to verify on desk.
    • D1 MR matmuls are the DRAM-bound decode class: MLP 33%, qkvzab 8%, out 3.4% of the B8/4k verify, plus lm_head 4.2% (OP-DATASHEETS).
  • CPB 0040: weights streamed on both DM RISCs. Check which read API it uses.
  • Prefill:
    • AGMM in1 weight reads (P1 37.2%), w2 (P5a 8.1%);
    • GDN prep one-read-flight (gpool 0048, #58626 flight). fp32 tiles are 4 KiB, so every multi-tile read is >2 KiB;
    • SDPA K/V chunk reads (P4).
    • Any of these that issue >2 KiB DRAM reads through noc_async_read get split.
  • Hang relevance to us: we serve TP=2 with fabric CCL and heavy concurrent DRAM writes (KV update fold, GDN state commits) during reads. #153 records a mesh hang at c99 on the MR dual-NoC weight stream (one-card gate only since). Whether that is this bug class is unknown. It is a hypothesis to check against their reproducer, not a conclusion.

Estimate

  • PP / TG: ≤ 0. It is a workaround, not a speed-up.
  • If it lands upstream and we take it via #208, every >2 KiB DRAM noc_async_read in our MR/AGMM/GDN readers becomes 8× more read requests per 16 KiB, each with its own header flit and request overhead.
  • The size of that cost on our DRAM-bound decode is unmeasured. It must be measured before a bump carries it.
  • Upside: if the c99 / serving stalls are this bug, it unblocks the parked MR dual-NoC lever (#153, #161), which was gated on a hang.

Grill questions

  1. Run their reproducer (test_dram_read_write_mix.py, 11×10 grid, 20 s) on one p150a as a hang-class probe? It needs tt-smi -r if it hangs, so it needs the owner's OK and a free card slot.
  2. Desk: list every reader in our served overlay that issues a >2 KiB DRAM noc_async_read (MR 0024/0032, CPB 0040, AGMM, GDN 0048, SDPA 0027). Mark which use with_state / one_packet (unaffected).
  3. If we bump (#208) to a main that carries this: keep the split (safe) and re-measure MR/CPB? Or carry a local opt-out for proven-safe read-only phases? An opt-out reopens the hang risk.
  4. Does it change the #161 Dual-NoC desk verdict? NoC 0 reads with NoC 1 writes were one of their non-hanging controls.

Out of scope

  • No code, no card boots. Upstream numbers are theirs.
## Pickup (same day from the upstream watch, 2026-10-09; PP + TG risk) Grill first: desk only, no card runs, no code. Tree read: master `f30ab09` (CONTROL `…-dx-w2t-b8k3-cph48`). Branch `grill/metal-59622-dram-read-split` is cut from master, with no commits. Upstream: https://github.com/tenstorrent/tt-metal/pull/59622, **[Bug fix] Large DRAM reads can hang a Blackhole chip: workaround (split into 2 KiB reads) and reproducer**, by dddrrreee. - State: open. Filed 2026-10-07 08:49 UTC (10:49 Prague). - Size: 4 files, +268/−0. - Relates to #52270. ### Their findings and change (theirs) - **The hang:** on Blackhole, large DRAM reads in flight while other cores' non-posted DRAM writes are in flight on the **same NoC** can hang the chip. - Read responses stop partway and the chip needs a reset. - Reproducer: 110 cores, 16 KiB reads + 1088 B writes, all on NoC 1. It hung in 9/9 recorded runs after 35–526 program runs. - Their 4-chip serving workload stalled in 3/3 runs (9–88 min) without the PR, and in 0 of 5.75 h with it. - **Tested on P300 only; P150 not tested.** - Controls that did not hang: reads without writes; reads on NoC 0 with writes on NoC 1; 8 KiB reads; 2 KiB reads. - **The workaround (device-side only, Blackhole only):** - `dataflow_api.h` `noc_async_read` splits any read **from a DRAM bank larger than 2 KiB** into ≤2 KiB `noc_async_read_one_packet` reads. - `cq_prefetch.cpp` sends >2 KiB DRAM pages through that path. - **Not split:** `noc_async_read_one_packet*`, `*_with_state*`, the prefetcher's linear relays and trace page reads. - **Cost: unmeasured upstream** ("read-bandwidth and serving-throughput cost are unmeasured on this upstream port"). ### Where it hits us (code read) Our bandwidth levers are built on **multi-tile bursts up to the 16 KiB NoC packet** (`docs/BLACKHOLE-PERF.md` §6: "a burst up to the 16384-byte cap is the transfer the machine is built for"; one NoC plateaus at 243–347 GB/s, c81). - **Decode MR k-row bursts:** - 0024 and 0032 use `noc.async_read<NocOptions::TXN_ID, NOC_MAX_BURST_SIZE>`, one k-row per read. - 0032's dual-NoC path uses `async_read_with_state<CUSTOM_VC, NOC_MAX_BURST_SIZE>`, which is not split. - Whether the Device-2.0 `noc.async_read` lowers to `noc_async_read` (and so gets split) is **to verify on desk**. - D1 MR matmuls are the DRAM-bound decode class: MLP 33%, qkvzab 8%, out 3.4% of the B8/4k verify, plus lm_head 4.2% (OP-DATASHEETS). - **CPB 0040:** weights streamed on both DM RISCs. Check which read API it uses. - **Prefill:** - AGMM in1 weight reads (P1 37.2%), w2 (P5a 8.1%); - GDN prep one-read-flight (gpool 0048, #58626 flight). fp32 tiles are 4 KiB, so every multi-tile read is >2 KiB; - SDPA K/V chunk reads (P4). - Any of these that issue >2 KiB DRAM reads through `noc_async_read` get split. - **Hang relevance to us:** we serve TP=2 with fabric CCL and heavy concurrent DRAM writes (KV update fold, GDN state commits) during reads. #153 records a **mesh hang at c99** on the MR dual-NoC weight stream (one-card gate only since). Whether that is this bug class is **unknown**. It is a hypothesis to check against their reproducer, not a conclusion. ### Estimate - **PP / TG: ≤ 0.** It is a workaround, not a speed-up. - If it lands upstream and we take it via #208, every >2 KiB DRAM `noc_async_read` in our MR/AGMM/GDN readers becomes 8× more read requests per 16 KiB, each with its own header flit and request overhead. - The size of that cost on our DRAM-bound decode is unmeasured. It must be measured before a bump carries it. - **Upside:** if the c99 / serving stalls are this bug, it unblocks the parked MR dual-NoC lever (#153, #161), which was gated on a hang. ### Grill questions 1. Run their reproducer (`test_dram_read_write_mix.py`, 11×10 grid, 20 s) on **one p150a** as a hang-class probe? It needs `tt-smi -r` if it hangs, so it needs the owner's OK and a free card slot. 2. Desk: list every reader in our served overlay that issues a >2 KiB DRAM `noc_async_read` (MR 0024/0032, CPB 0040, AGMM, GDN 0048, SDPA 0027). Mark which use `with_state` / `one_packet` (unaffected). 3. If we bump (#208) to a main that carries this: keep the split (safe) and re-measure MR/CPB? Or carry a local opt-out for proven-safe read-only phases? An opt-out reopens the hang risk. 4. Does it change the #161 Dual-NoC desk verdict? NoC 0 reads with NoC 1 writes were one of their non-hanging controls. ### Out of scope - No code, no card boots. Upstream numbers are **theirs**. ### Links - Upstream: https://github.com/tenstorrent/tt-metal/pull/59622, https://github.com/tenstorrent/tt-metal/issues/52270 - Ours: #153 (MR dual-NoC, mesh hung c99), #161 (Dual-NoC desk verdict), #154 (CPB 0040), #197 / #202 (gpool 0048 read flight), #201 (U7 NoC MID skip), #208 (metal bump), #205 (dead-driver reaping)
Author
Member

#59622 result (run 541, API 7641, job 43482, artifact 675): STALL_REPRODUCED on one p150a. The cards are healthy after one reset.

case traffic exit outcome
ctl2k 2 KiB reads, 20 s 0 PASS, 21.4 s wall
r16k-1 16 KiB reads, 60 s planned 1 STALL after 47 program runs, about 14 s in

Is the stall genuine? Yes.

  • The record log is new for this run (metal59622-onecard-20261009T135130Z.log, truncated on start). It contains a single STALL: line, printed inside r16k-1's own process by the upstream watchdog: STALL: no program run finished for 10 s after 47 runs. The NoC is hung; reset the chip (tt-smi -r) before using it again. The watchdog then calls os._exit(1), which is the exit 1 we saw.
  • r16k-1 started on freshly healed cards: the stale marker from run 540 was healed at 15:48:47–15:51:30, and the 2 KiB control then passed on the same card.
  • So the result does not come from run 540's state or from a grep of an older log. The probe stops at the first stall by design, so r16k-2 and r16k-3 did not run.

Reset and health: tt-smi -r 0 1 ran through the ttxlib mesh heal at 15:52:10 and settled 120 s. Then:

  • dev:0 {"ok": true}
  • dev:1 {"ok": true}
  • mesh {"devices": 2, "ok": true}

The slot was released clean.

Earlier attempts on this PR (none touched card traffic, apart from run 540 opening card0):

  • 538 and 539: hung on ssh stdin before any device access. Cancelled. Fixed in 44435d1 with ssh -n.
  • 540: harness error. rsync --delete removed out/, so drive.py died before any traffic. Health showed a false FAIL because the parser read UMD's destructor log line as the result. It reset twice and left the mesh-dirty marker. Fixed in 3233a03.

Scope: this is upstream reproducer traffic (110 cores, NoC 1, 16 KiB reads plus 1088 B writes) on a P150a, not our served kernels. It shows the #59622 hang class reproduces on our Blackhole p150a hardware and image vllm-tt:k2, which upstream had only shown on P300.

**#59622 result (run 541, API 7641, job 43482, artifact 675): STALL_REPRODUCED on one p150a. The cards are healthy after one reset.** | case | traffic | exit | outcome | |---|---|---|---| | ctl2k | 2 KiB reads, 20 s | 0 | PASS, 21.4 s wall | | r16k-1 | 16 KiB reads, 60 s planned | 1 | **STALL** after 47 program runs, about 14 s in | **Is the stall genuine? Yes.** - The record log is new for this run (`metal59622-onecard-20261009T135130Z.log`, truncated on start). It contains a single `STALL:` line, printed inside r16k-1's own process by the upstream watchdog: `STALL: no program run finished for 10 s after 47 runs. The NoC is hung; reset the chip (tt-smi -r) before using it again.` The watchdog then calls `os._exit(1)`, which is the exit 1 we saw. - r16k-1 started on freshly healed cards: the stale marker from run 540 was healed at 15:48:47–15:51:30, and the 2 KiB control then passed on the same card. - So the result does not come from run 540's state or from a grep of an older log. The probe stops at the first stall by design, so r16k-2 and r16k-3 did not run. **Reset and health:** `tt-smi -r 0 1` ran through the ttxlib mesh heal at 15:52:10 and settled 120 s. Then: - dev:0 `{"ok": true}` - dev:1 `{"ok": true}` - mesh `{"devices": 2, "ok": true}` The slot was released clean. **Earlier attempts on this PR** (none touched card traffic, apart from run 540 opening card0): - 538 and 539: hung on ssh stdin before any device access. Cancelled. Fixed in 44435d1 with `ssh -n`. - 540: harness error. `rsync --delete` removed `out/`, so drive.py died before any traffic. Health showed a false FAIL because the parser read UMD's destructor log line as the result. It reset twice and left the mesh-dirty marker. Fixed in 3233a03. **Scope:** this is upstream reproducer traffic (110 cores, NoC 1, 16 KiB reads plus 1088 B writes) on a P150a, not our served kernels. It shows the #59622 hang class reproduces on our Blackhole p150a hardware and image `vllm-tt:k2`, which upstream had only shown on P300.
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#218
No description provided.