[GH-ISSUE #1208] HIP layer split / gfx1030: batched prompt path produces NaN logits (output "!!!!") unless STRATA_HIP_PROMPT_F16=1 and the gfx1030 card is the first stage #498

Closed
opened 2026-11-04 01:43:31 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @cloud4t0r on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1208

Strata 0.1.40.1 (82f46a8), Fedora 44, ROCm 7.1.1 system packages (rocBLAS 7.1.1, hipBLAS 7.1.0, no hipBLASLt),
build gfx1030;gfx1201, STRATA_PREFILL_MMQ=ON. RX 6800 (gfx1030) + RX 9070 (gfx1201), Qwen3.8-Flash-Next
GSQ-RCO IQ3_S, --kv int8 --max-context 131072 --spec 4 --mtp. The same bug was seen first on a single RX 6800 with
setup's TheRock 7.10 wheels.

  • Any prompt part > 64 tokens (short_read, batched path) gives 248320/248320 non-finite logits → token 0 (!)
    repeated. ≤ 64-token parts (verify windows) are fine.
  • STRATA_DBG_NAN=1: the first non-finite MoE layer is the first layer that runs on the gfx1030 card (layer 12 in a
    [9070, 6800] split; layer 0-3 on the 6800 alone). The RX 9070 alone is fine.
  • STRATA_PREFILL_MMQ=0, STRATA_PROMPT_ATTN_OLD=1, --no-prefill-borrow, STRATA_HC_SPLIT=0,
    STRATA_DENSE_MMQ=1, STRATA_GR_UNFUSED=1: still NaN. A standalone hipblasGemmEx BF16→FP32 (OP_T/OP_N, same
    shapes, 32 MiB workspace) is correct on gfx1030 with the same rocBLAS.
  • STRATA_HIP_PROMPT_F16=1 fixes the 6800 alone, and fixes the split only when the gfx1030 card is stage 0
    (gpu [0,1]): 69 to 20183-token prompts OK, 0 FP16 overflows. With gfx1030 as stage 1, STRATA_DBG_NAN counts
    non-finite FP16 GEMM outputs from the first GEMM of the stage (hc up, N=10240 K=320). The engine also exits
    sometimes with prefill gr_silu: no kernel image is available / prefill swiglu_interleaved: no kernel image…
    in that order (cf. #690).
  • Suspects: a BF16-activation prompt kernel on gfx1030, and the per-device state of the second stage
    (set_act_f16 symbol / code object selection, #690).
Originally created by @cloud4t0r on GitHub (Oct 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1208 > Strata 0.1.40.1 (`82f46a8`), Fedora 44, ROCm 7.1.1 system packages (rocBLAS 7.1.1, hipBLAS 7.1.0, no hipBLASLt), > build `gfx1030;gfx1201`, `STRATA_PREFILL_MMQ=ON`. RX 6800 (gfx1030) + RX 9070 (gfx1201), Qwen3.8-Flash-Next > GSQ-RCO IQ3_S, `--kv int8 --max-context 131072 --spec 4 --mtp`. The same bug was seen first on a single RX 6800 with > setup's TheRock 7.10 wheels. > > - Any prompt part > 64 tokens (`short_read`, batched path) gives 248320/248320 non-finite logits → token 0 (`!`) > repeated. ≤ 64-token parts (verify windows) are fine. > - `STRATA_DBG_NAN=1`: the first non-finite MoE layer is the first layer that runs on the gfx1030 card (layer 12 in a > `[9070, 6800]` split; layer 0-3 on the 6800 alone). The RX 9070 alone is fine. > - `STRATA_PREFILL_MMQ=0`, `STRATA_PROMPT_ATTN_OLD=1`, `--no-prefill-borrow`, `STRATA_HC_SPLIT=0`, > `STRATA_DENSE_MMQ=1`, `STRATA_GR_UNFUSED=1`: still NaN. A standalone `hipblasGemmEx` BF16→FP32 (OP_T/OP_N, same > shapes, 32 MiB workspace) is correct on gfx1030 with the same rocBLAS. > - `STRATA_HIP_PROMPT_F16=1` fixes the 6800 alone, and fixes the split **only when the gfx1030 card is stage 0** > (`gpu [0,1]`): 69 to 20183-token prompts OK, 0 FP16 overflows. With gfx1030 as stage 1, `STRATA_DBG_NAN` counts > non-finite FP16 GEMM outputs from the first GEMM of the stage (hc up, N=10240 K=320). The engine also exits > sometimes with `prefill gr_silu: no kernel image is available` / `prefill swiglu_interleaved: no kernel image…` > in that order (cf. #690). > - Suspects: a BF16-activation prompt kernel on gfx1030, and the per-device state of the second stage > (`set_act_f16` symbol / code object selection, #690).
Author
Owner

@Vop3p commented on GitHub (Oct 9, 2026):

A data point from another gfx1030 box, in case it narrows this down. 2x RX 6900 XT (gfx1030), Ubuntu 26.04, ROCm 10.0.0 system packages (rocBLAS 5.6.0, no hipBLASLt for gfx1030), Strata 0.1.41 fb58e0db built for gfx1030 only with STRATA_PREFILL_MMQ=ON, the same IQ3_S model, layer split across the two cards, --kv int8 --spec 4 --mtp, and no STRATA_HIP_PROMPT_F16: six fresh prompts of 4K / 32K / 128K tokens (8,192-token batched chunks, so every one went through the batched path) all produced normal text, 0 non-finite logits, and engine.log has no NaN line. The split-stock and split-stock-kc folders in #1657 have the configs, summaries and every output text.

So the default batched MMQ path is finite on gfx1030 with ROCm 10.0. With #1103 (the ROCm 7.14 gfx103x wheels regression on an RX 6800 XT, fixed by a different ROCm) that points at the ROCm 7.1 / TheRock 7.10 side rather than at the engine, if that helps. A mixed gfx1030;gfx1201 build is something I have not tried.

Developed with an AI coding assistant; every number above was measured on 2x RX 6900 XT (gfx1030, PCIe 4.0 x8 each) / Ryzen 5 5600X, ROCm 10.0.

<!-- gh-comment-id:6074272117 --> @Vop3p commented on GitHub (Oct 9, 2026): A data point from another gfx1030 box, in case it narrows this down. 2x RX 6900 XT (gfx1030), Ubuntu 26.04, ROCm 10.0.0 system packages (rocBLAS 5.6.0, no hipBLASLt for gfx1030), Strata 0.1.41 `fb58e0db` built for gfx1030 only with `STRATA_PREFILL_MMQ=ON`, the same IQ3_S model, layer split across the two cards, `--kv int8 --spec 4 --mtp`, and **no** `STRATA_HIP_PROMPT_F16`: six fresh prompts of 4K / 32K / 128K tokens (8,192-token batched chunks, so every one went through the batched path) all produced normal text, 0 non-finite logits, and `engine.log` has no NaN line. The `split-stock` and `split-stock-kc` folders in #1657 have the configs, summaries and every output text. So the default batched MMQ path is finite on gfx1030 with ROCm 10.0. With #1103 (the ROCm 7.14 gfx103x wheels regression on an RX 6800 XT, fixed by a different ROCm) that points at the ROCm 7.1 / TheRock 7.10 side rather than at the engine, if that helps. A mixed `gfx1030;gfx1201` build is something I have not tried. Developed with an AI coding assistant; every number above was measured on 2x RX 6900 XT (gfx1030, PCIe 4.0 x8 each) / Ryzen 5 5600X, ROCm 10.0.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156033832 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Author
Owner

@cloud4t0r commented on GitHub (Nov 3, 2026):

Reproduced on 0.1.56 (Strata 0.2.10, commit 5571819a), same machine class as the report: Fedora 44, RX 9070 (gfx1201) as stage 0 + a 16 GB gfx1030 as stage 1, pack swift-iq3_s built from Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S (qwen4exp, 48 layers, 512 experts / top 10, 320M-row PLE), --kv int8 --kv-resident 32768 --spec 4 --spec-min-p 0.5 --mtp --vision --max-context 131072 --layer-split auto, HIP build.

Symptoms match exactly.

  • Every request with any token on the batched prompt path gives 248320 of 248320 logits non-finite → non-finite logits (#879) in a first decode window, whatever the prompt: --short-read 0 fails even on a 56-token prompt. The same requests are fine through the verify windows: --short-read 8192 answers a 71-token and a 1109-token prompt (1109 tokens read at 106.9 tok/s in windows).
  • STRATA_DBG_NAN=1: the non-finite values appear in the MoE of the layers of the stage on the gfx1030 (38, 43, 44, 47), on 2 tokens of 66 (GU 25600 / H 12800 / Dm 51200 / bo 5120), with types 18/20, 21/20 and 23/20.
  • Prompt length is not the boundary, the batched path is: with the default --short-read 64 a 56-token prompt (windows only) answers and a 71-token one fails.

This did not change it: STRATA_PREFILL_MMQ=0, --kv fp16, STRATA_ROUTE_TAIL_SKIP=0, STRATA_HC_Q8=0, --prompt-cache 0 --conversation-cache-mib 0, --max-context 32768 (VRAM headroom), and --gpu 0 alone. The last one is the only difference from the 0.1.40.1 report: here the RX 9070 on its own still produced the NaN, so on 0.1.56 the batched path is non-finite on gfx1201 too, not only on the gfx1030.

STRATA_HIP_PROMPT_F16=1 fixes it, with the gfx1030 as stage 1 (0.1.40.1 needed it as stage 0): 56, 71 and 1109-token prompts answered in a row, the 1109-token prompt read at 420.3 tok/s and answered at 59.9 tok/s. So the tip line the engine already prints at start ("HIP device 1 gfx1030 - tip: STRATA_HIP_PROMPT_F16=1 …") is still the workaround on 0.1.56, and it is also faster here.

Unrelated, same session, in case it helps the tracker: after a few turns the engine hit the watchdog in request: parking the previous conversation -1 (52.2 GB resident, 5.4 GB RAM available — the 46.84 GiB expert arena on a 64 GB box), the same shape as the parking stall mentioned in #4862.

<!-- gh-comment-id:6613940494 --> @cloud4t0r commented on GitHub (Nov 3, 2026): Reproduced on **0.1.56** (Strata 0.2.10, commit `5571819a`), same machine class as the report: Fedora 44, **RX 9070 (gfx1201) as stage 0 + a 16 GB gfx1030 as stage 1**, pack `swift-iq3_s` built from `Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S` (qwen4exp, 48 layers, 512 experts / top 10, 320M-row PLE), `--kv int8 --kv-resident 32768 --spec 4 --spec-min-p 0.5 --mtp --vision --max-context 131072 --layer-split auto`, HIP build. **Symptoms match exactly.** - Every request with any token on the batched prompt path gives `248320 of 248320 logits non-finite` → `non-finite logits (#879) in a first decode window`, whatever the prompt: `--short-read 0` fails even on a 56-token prompt. The same requests are fine through the verify windows: `--short-read 8192` answers a 71-token and a 1109-token prompt (1109 tokens read at 106.9 tok/s in windows). - `STRATA_DBG_NAN=1`: the non-finite values appear in the MoE of the layers of the stage on the gfx1030 (38, 43, 44, 47), on 2 tokens of 66 (`GU 25600 / H 12800 / Dm 51200 / bo 5120`), with types 18/20, 21/20 and 23/20. - Prompt length is not the boundary, the batched path is: with the default `--short-read 64` a 56-token prompt (windows only) answers and a 71-token one fails. **This did not change it:** `STRATA_PREFILL_MMQ=0`, `--kv fp16`, `STRATA_ROUTE_TAIL_SKIP=0`, `STRATA_HC_Q8=0`, `--prompt-cache 0 --conversation-cache-mib 0`, `--max-context 32768` (VRAM headroom), and `--gpu 0` alone. The last one is the only difference from the 0.1.40.1 report: here the RX 9070 **on its own** still produced the NaN, so on 0.1.56 the batched path is non-finite on gfx1201 too, not only on the gfx1030. **`STRATA_HIP_PROMPT_F16=1` fixes it**, with the gfx1030 as **stage 1** (0.1.40.1 needed it as stage 0): 56, 71 and 1109-token prompts answered in a row, the 1109-token prompt read at 420.3 tok/s and answered at 59.9 tok/s. So the tip line the engine already prints at start ("HIP device 1 gfx1030 - tip: STRATA_HIP_PROMPT_F16=1 …") is still the workaround on 0.1.56, and it is also faster here. Unrelated, same session, in case it helps the tracker: after a few turns the engine hit the watchdog in `request: parking the previous conversation -1` (52.2 GB resident, 5.4 GB RAM available — the 46.84 GiB expert arena on a 64 GB box), the same shape as the parking stall mentioned in #4862.
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
Niko1221/Strata#498
No description provided.