[GH-ISSUE #890] HIP: "parallel": 2 + --layer-split on 2x R9700 exits (code 1) after "captured the batch window over slots 0,1" #390

Closed
opened 2026-11-04 01:42:34 +07:00 by bsakaguchi · 7 comments
Owner

Originally created by @asaffulks on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/890

Setup

  • Strata v0.1.39 (6f32ec0) built from source, HIP backend, gfx1201, TheRock ROCm 7.10 wheels, Ubuntu 26.04, kernel 7.0
  • 2x Radeon AI PRO R9700 (32 GB), Qwen3.8-Flash-Next IQ3_S
  • layer_split "24", --trim-stage-weights --mmap-experts, MTP --spec 4 — 100% of experts resident in VRAM

What happens
With "parallel": 2, the first time two requests decode together the engine exits with code 1 and no error message. Last log line:

strata verify: captured the batch window over slots 0,1

--batch-groups 2 crashes the same way (last line captured the batch window over slots 0).

What works

  • Same box single-lane: ~1,227 tok/s prompt (29K tokens), 52-64 tok/s decode, stable.
  • "parallel": 2 on a single R9700 (no split) — fine.
  • "parallel": 2 with a layer split on 3x RTX 5070 Ti (CUDA) — fine.

So it looks specific to batch decode + layer split on HIP. Happy to run a debug build or send the full log.

Originally created by @asaffulks on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/890 **Setup** - Strata v0.1.39 (6f32ec0) built from source, HIP backend, gfx1201, TheRock ROCm 7.10 wheels, Ubuntu 26.04, kernel 7.0 - 2x Radeon AI PRO R9700 (32 GB), Qwen3.8-Flash-Next IQ3_S - `layer_split "24"`, `--trim-stage-weights --mmap-experts`, MTP `--spec 4` — 100% of experts resident in VRAM **What happens** With `"parallel": 2`, the first time two requests decode together the engine exits with code 1 and no error message. Last log line: ``` strata verify: captured the batch window over slots 0,1 ``` `--batch-groups 2` crashes the same way (last line `captured the batch window over slots 0`). **What works** - Same box single-lane: ~1,227 tok/s prompt (29K tokens), 52-64 tok/s decode, stable. - `"parallel": 2` on a single R9700 (no split) — fine. - `"parallel": 2` with a layer split on 3x RTX 5070 Ti (CUDA) — fine. So it looks specific to batch decode + layer split on HIP. Happy to run a debug build or send the full log.
Author
Owner

@cassettesgoboom commented on GitHub (Oct 6, 2026):

Potentially relevant HIP/gfx906 evidence: independent 2x MI50 validation of #845. Disabling the resident path and applying #845 both resolved our explicit layer-0 verify timeout, with p2/p4 correctness passing. Confirmation of #890 on the reporter's gfx1201 setup still requires testing there.

<!-- gh-comment-id:6007197323 --> @cassettesgoboom commented on GitHub (Oct 6, 2026): Potentially relevant HIP/gfx906 evidence: [independent 2x MI50 validation of #845](https://github.com/Niko1221/Strata/pull/845#issuecomment-6007186390). Disabling the resident path and applying #845 both resolved our explicit layer-0 verify timeout, with p2/p4 correctness passing. Confirmation of #890 on the reporter's gfx1201 setup still requires testing there.
Author
Owner

@aswin-dot-R commented on GitHub (Oct 7, 2026):

Data point: does not reproduce on v0.1.40 on a similar HIP gfx1201 layer split, including a stress run aimed at the trigger described here.

Setup

  • Strata v0.1.40 (1735d64), HIP, ROCm 7.2.0, kernel 6.17, Ubuntu
  • R9700 (32 GB, stage 0) + RX 9070 XT (16 GB, stage 1), Qwen3.8-Flash-Next IQ3_S, 262k context, int8 KV
  • layer_split "32", --trim-stage-weights, --pipeline-windows 2, --spec 4 + MTP, --batch 2 --batch-groups 2
  • Slot sessions: 4.92 GiB on CUDA0 and 1.27 GiB each on CUDA1. Expert cache 11,458 + 4,135 slots, decode hit rate ~97%.

Difference from the original report: this split is not 100% resident. A small number of experts are still read over PCIe, so the fully-resident path from the original report (and #776) is not exercised exactly.

Stress run (~50 min)

  • 20 pairs of requests started on a barrier, so both slots begin decoding at the same instant. This is the reported trigger.
  • Then 40 min of 3 concurrent clients, so requests also queue behind the 2 slots. The mix:
    • short and long essays (no thinking);
    • thinking-on arithmetic;
    • nonce-prefixed long-context recall prompts of 15k / 63k / 129k / 240k tokens, so both slots held large contexts at the same time;
    • 32 streaming requests dropped mid-answer (client disconnect).

Result

  • 227 completed requests + 32 cancels, 0 errors. The engine never exited, and no captured the batch window over slots 0,1 exit occurred.
  • No amdgpu or OOM lines in the kernel log.
  • Correctness: arithmetic 41/41, recall 20/22. The two misses are in line with what the same model gives single-slot at long context.

Throughput, versus the same config without --batch

  • One request alone: same speed (65-70 vs 66-72 tok/s wall).
  • Two at once: ~33-39 tok/s each. Total throughput is about the same as one-at-a-time, so on this split the slots buy no-queueing rather than speed.

Happy to run a specific build or flag combination if it helps tell whether 0.1.40 fixed this or whether this setup just avoids it (for example the fully-resident path).

<!-- gh-comment-id:6034815936 --> @aswin-dot-R commented on GitHub (Oct 7, 2026): Data point: **does not reproduce on v0.1.40** on a similar HIP gfx1201 layer split, including a stress run aimed at the trigger described here. **Setup** - Strata v0.1.40 (1735d64), HIP, ROCm 7.2.0, kernel 6.17, Ubuntu - R9700 (32 GB, stage 0) + RX 9070 XT (16 GB, stage 1), Qwen3.8-Flash-Next IQ3_S, 262k context, int8 KV - `layer_split "32"`, `--trim-stage-weights`, `--pipeline-windows 2`, `--spec 4` + MTP, `--batch 2 --batch-groups 2` - Slot sessions: 4.92 GiB on CUDA0 and 1.27 GiB each on CUDA1. Expert cache 11,458 + 4,135 slots, decode hit rate ~97%. **Difference from the original report:** this split is **not** 100% resident. A small number of experts are still read over PCIe, so the fully-resident path from the original report (and #776) is not exercised exactly. **Stress run (~50 min)** - 20 pairs of requests started on a barrier, so both slots begin decoding at the same instant. This is the reported trigger. - Then 40 min of 3 concurrent clients, so requests also queue behind the 2 slots. The mix: - short and long essays (no thinking); - thinking-on arithmetic; - nonce-prefixed long-context recall prompts of 15k / 63k / 129k / 240k tokens, so both slots held large contexts at the same time; - 32 streaming requests dropped mid-answer (client disconnect). **Result** - **227 completed requests + 32 cancels, 0 errors.** The engine never exited, and no `captured the batch window over slots 0,1` exit occurred. - No amdgpu or OOM lines in the kernel log. - Correctness: arithmetic 41/41, recall 20/22. The two misses are in line with what the same model gives single-slot at long context. **Throughput, versus the same config without `--batch`** - One request alone: same speed (65-70 vs 66-72 tok/s wall). - Two at once: ~33-39 tok/s each. Total throughput is about the same as one-at-a-time, so on this split the slots buy no-queueing rather than speed. Happy to run a specific build or flag combination if it helps tell whether 0.1.40 fixed this or whether this setup just avoids it (for example the fully-resident path).
Author
Owner

@asaffulks commented on GitHub (Oct 7, 2026):

Update from the original reporter, now on v0.1.40.1 (82f46a8), HIP gfx1201, 3x R9700 32 GB, Qwen3.8-Flash-Next IQ3_S, --layer-split 16,32 --trim-stage-weights --mmap-experts --pcie-frac 0, 100% experts resident ("zero-doorbell graph"), --batch-groups 1, --kv-resident 32768, MTP --spec 4. Env from our launcher: STRATA_HIP_WMMA=1 STRATA_SELECT_WMMA=1 STRATA_MTP_BATCH=0.

  • The original --parallel 2 exit no longer happens on 0.1.40.1.
  • New, reproducible on the fully-resident path: with --batch 6, two long prompts admitted together (65k + 111k tokens) hang every time (3/3): no progress for 60 s ... reading the prompt (batched): waiting for the GPU (attention, router) at layer 0 (once at layer 4, chunk from token 16384); the stall report shows 0 threads in state D, expert pool idle, GPUs ~3% busy.
  • Same build and flags with --batch 5: 3/3 pass (38/110 s, 29/86 s, 52/113 s), and two real coding agents run without a stall.

Happy to retest with STRATA_HIP_WMMA off or any build you want, since the WMMA prompt attention past 16K is listed as not validated in AMD_HIP.md.

<!-- gh-comment-id:6034898061 --> @asaffulks commented on GitHub (Oct 7, 2026): Update from the original reporter, now on v0.1.40.1 (82f46a8), HIP gfx1201, 3x R9700 32 GB, Qwen3.8-Flash-Next IQ3_S, `--layer-split 16,32 --trim-stage-weights --mmap-experts --pcie-frac 0`, 100% experts resident ("zero-doorbell graph"), `--batch-groups 1`, `--kv-resident 32768`, MTP `--spec 4`. Env from our launcher: `STRATA_HIP_WMMA=1 STRATA_SELECT_WMMA=1 STRATA_MTP_BATCH=0`. - The original `--parallel 2` exit no longer happens on 0.1.40.1. - New, reproducible on the fully-resident path: with `--batch 6`, two long prompts admitted together (65k + 111k tokens) hang every time (3/3): `no progress for 60 s ... reading the prompt (batched): waiting for the GPU (attention, router) at layer 0` (once at layer 4, chunk from token 16384); the stall report shows 0 threads in state D, expert pool idle, GPUs ~3% busy. - Same build and flags with `--batch 5`: 3/3 pass (38/110 s, 29/86 s, 52/113 s), and two real coding agents run without a stall. Happy to retest with `STRATA_HIP_WMMA` off or any build you want, since the WMMA prompt attention past 16K is listed as not validated in AMD_HIP.md.
Author
Owner

@asaffulks commented on GitHub (Oct 7, 2026):

A follow-up question on the same box (3x R9700, 32 GB RAM, v0.1.40.1, --mmap-experts, 100% experts resident, --pcie-frac 0):

The startup says "mapping the experts from the model files (about 55 GB, --mmap-experts): they are not loaded into RAM", yet once the expert caches are filled the engine process holds ~20-23 GB of host RAM as shared anonymous mappings (Shmem ~20 GB in /proc/meminfo; ~330 /dev/zero regions in smaps, flags rd wr sh ... hg, not mlocked). It grows while "filling the GPU's expert cache" and stays after load. One region is exactly the 322 MiB token-embedding "mapped host memory", so they look like hipHostMalloc/mapped allocations, but I can't find what the other ~20 GB is: the KV streaming pin is 1.03 GiB and STRATA_ARENA_PIN_GIB=1 made no difference.

On a 32 GB box that leaves ~2 GB free, so --conversation-cache parking mostly skips ("snapshot ... exceeds available budget"). What allocates that host memory on a fully resident HIP split, and is there a way to release it after the caches are filled (or not allocate it at all)? Happy to run any build or env flag.

<!-- gh-comment-id:6035407912 --> @asaffulks commented on GitHub (Oct 7, 2026): A follow-up question on the same box (3x R9700, 32 GB RAM, v0.1.40.1, `--mmap-experts`, 100% experts resident, `--pcie-frac 0`): The startup says "mapping the experts from the model files (about 55 GB, --mmap-experts): they are not loaded into RAM", yet once the expert caches are filled the engine process holds ~20-23 GB of host RAM as shared anonymous mappings (`Shmem` ~20 GB in /proc/meminfo; ~330 `/dev/zero` regions in smaps, flags `rd wr sh ... hg`, not mlocked). It grows while "filling the GPU's expert cache" and stays after load. One region is exactly the 322 MiB token-embedding "mapped host memory", so they look like hipHostMalloc/mapped allocations, but I can't find what the other ~20 GB is: the KV streaming pin is 1.03 GiB and STRATA_ARENA_PIN_GIB=1 made no difference. On a 32 GB box that leaves ~2 GB free, so `--conversation-cache` parking mostly skips ("snapshot ... exceeds available budget"). What allocates that host memory on a fully resident HIP split, and is there a way to release it after the caches are filled (or not allocate it at all)? Happy to run any build or env flag.
Author
Owner

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

This is likely fixed in 0.1.40: all-resident stages now honor the batch windows (36d28148), and 0.1.40.1 also names the ERR line of a failed batch window. Could you retest --parallel 2 with --layer-split on 0.1.40.1 and post the log if it still exits?

<!-- gh-comment-id:6037851555 --> @Niko1221 commented on GitHub (Oct 7, 2026): This is likely fixed in 0.1.40: all-resident stages now honor the batch windows (36d28148), and 0.1.40.1 also names the ERR line of a failed batch window. Could you retest --parallel 2 with --layer-split on 0.1.40.1 and post the log if it still exits?
Author
Owner

@asaffulks commented on GitHub (Oct 7, 2026):

Thanks, Niko, and thanks for the SYCL fix on #891 too. We've since moved these cards off Strata to other work, so I can't retest --parallel 2 with --layer-split on 0.1.40.1 right now. Feel free to close this. If we bring Strata back on this box, I'll retest on the current release and reopen with the full log if it still exits.

<!-- gh-comment-id:6037984338 --> @asaffulks commented on GitHub (Oct 7, 2026): Thanks, Niko, and thanks for the SYCL fix on #891 too. We've since moved these cards off Strata to other work, so I can't retest --parallel 2 with --layer-split on 0.1.40.1 right now. Feel free to close this. If we bring Strata back on this box, I'll retest on the current release and reopen with the full log if it still exits.
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:6155979135 --> @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.
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#390
No description provided.