[GH-ISSUE #4566] [Engine] gfx1031: batched-prefill #29 stalls; --adapt-swaps 0 avoids them #2063

Open
opened 2026-11-04 01:56:21 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @mkw432 on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4566

Problem
On gfx1031 the engine intermittently self-stops with the #29 watchdog during "reading the prompt (batched)". 7 stalls across 7 configs so far, at layers 14/19/31/35/38/44/46 and chunks 0/512/1024/3484/12613. Same command sometimes passes several runs first.

Environment

  • Strata 0.1.46.3, local HIP build (c87773ed5df25479)
  • RX 6700 XT 12 GB (gfx1031), Ryzen 5 5600X, 32 GB RAM, Linux 7.0.0-38, ROCm 7.13.0a20260515
  • Qwen3.8-Flash-Next GSQ-RCO Q2_0 native pack, 32K, int8 KV, --prefill 512, --resident-budget-gib 16, STRATA_RESIDENT_PIN=1, --spec 2 (0 is rejected for this pack)

Reproduce
Start with those args and run a two-task agent loop (m4 then m13 from a local hard set), or any growing prompt chain. Usually within ~10 min the watchdog fires at a random layer.

Expected
Requests complete.

Actual
The engine exits -6 after 60 s without progress:

strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 38 of the prompt chunk from token 1024) - stopping the engine so the server starts it again (issue #29)
strata serve: stall report (engine 0.1.46.3): ... for 77 s; 0 layers served since the last finished step
  expert pool: 18 of 18 jobs claimed, 18 done; 5 of 5 workers parked, 5 sleeping
  threads waiting on the disk (state D): 0 of 39
  memory: ... 12554 MiB RAM available
strata: released the verify window's GPU waits (#267): the GPU finished in 13617 ms

The pool is idle, no disk waits, RAM is fine (min ~10.5 GiB available, ~1.1 GiB free VRAM during runs), and there are no amdgpu/kfd/ttm messages. With STRATA_VERIFY_TRACE=1 the handshake was clean up to the last window (CPU served every doorbell) and then went silent; GPU breadcrumbs stopped at layer 48 group 0: hc-read0. After the waits are released the GPU finishes (4.3 s / 13.6 s / 0 ms). The work completes; the host just doesn't see it. Same family as #649, but in prefill rather than verify.

Configs tried

config result
stock (resident 16 GiB pinned, swaps on) stall (2 runs)
--no-prefill-borrow stall (2)
STRATA_HIP_ADAPT_KERNEL_COPY=1 (line confirmed in log) stall at layer 44 of chunk 0
STRATA_VERIFY_COHERENT=1 with swaps on stall at layer 46 of chunk 3484
--adapt-swaps 0 pass, two full validations (m4/m13/m18 × 2, m18 hidden tests green), 0 stalls
--no-prefill-borrow --adapt-swaps 0 pass, but costs ~380 cache slots

Long context
A 29K-token decode hits verify: timed out at layer 23 (the 20 s deadline). STRATA_VERIFY_COHERENT=1 fixes that: 48K and 62K prompts pass (~210 s / ~280 s prefill, 5/5 needle retrieval). It doesn't touch the prefill stall.

Untested
GFXOFF (debugfs needs root here), HSA_ENABLE_SDMA=0, STRATA_DOORBELL_STORE=1. The mmap/file-tier arm stalled once as well, so the workaround is only validated in resident mode.

Reproduction status
Reproduced locally, many runs. Full logs and STRATA_VERIFY_TRACE blocks available; happy to run an instrumented build.

Originally created by @mkw432 on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4566 **Problem** On gfx1031 the engine intermittently self-stops with the #29 watchdog during "reading the prompt (batched)". 7 stalls across 7 configs so far, at layers 14/19/31/35/38/44/46 and chunks 0/512/1024/3484/12613. Same command sometimes passes several runs first. **Environment** - Strata 0.1.46.3, local HIP build (`c87773ed5df25479`) - RX 6700 XT 12 GB (gfx1031), Ryzen 5 5600X, 32 GB RAM, Linux 7.0.0-38, ROCm 7.13.0a20260515 - Qwen3.8-Flash-Next GSQ-RCO Q2_0 native pack, 32K, int8 KV, `--prefill 512`, `--resident-budget-gib 16`, `STRATA_RESIDENT_PIN=1`, `--spec 2` (0 is rejected for this pack) **Reproduce** Start with those args and run a two-task agent loop (m4 then m13 from a local hard set), or any growing prompt chain. Usually within ~10 min the watchdog fires at a random layer. **Expected** Requests complete. **Actual** The engine exits -6 after 60 s without progress: ``` strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 38 of the prompt chunk from token 1024) - stopping the engine so the server starts it again (issue #29) strata serve: stall report (engine 0.1.46.3): ... for 77 s; 0 layers served since the last finished step expert pool: 18 of 18 jobs claimed, 18 done; 5 of 5 workers parked, 5 sleeping threads waiting on the disk (state D): 0 of 39 memory: ... 12554 MiB RAM available strata: released the verify window's GPU waits (#267): the GPU finished in 13617 ms ``` The pool is idle, no disk waits, RAM is fine (min ~10.5 GiB available, ~1.1 GiB free VRAM during runs), and there are no amdgpu/kfd/ttm messages. With `STRATA_VERIFY_TRACE=1` the handshake was clean up to the last window (CPU served every doorbell) and then went silent; GPU breadcrumbs stopped at `layer 48 group 0: hc-read0`. After the waits are released the GPU finishes (4.3 s / 13.6 s / 0 ms). The work completes; the host just doesn't see it. Same family as #649, but in prefill rather than verify. **Configs tried** | config | result | |---|---| | stock (resident 16 GiB pinned, swaps on) | stall (2 runs) | | `--no-prefill-borrow` | stall (2) | | `STRATA_HIP_ADAPT_KERNEL_COPY=1` (line confirmed in log) | stall at layer 44 of chunk 0 | | `STRATA_VERIFY_COHERENT=1` with swaps on | stall at layer 46 of chunk 3484 | | `--adapt-swaps 0` | **pass**, two full validations (m4/m13/m18 × 2, m18 hidden tests green), 0 stalls | | `--no-prefill-borrow --adapt-swaps 0` | pass, but costs ~380 cache slots | **Long context** A 29K-token decode hits `verify: timed out at layer 23` (the 20 s deadline). `STRATA_VERIFY_COHERENT=1` fixes that: 48K and 62K prompts pass (~210 s / ~280 s prefill, 5/5 needle retrieval). It doesn't touch the prefill stall. **Untested** GFXOFF (debugfs needs root here), `HSA_ENABLE_SDMA=0`, `STRATA_DOORBELL_STORE=1`. The mmap/file-tier arm stalled once as well, so the workaround is only validated in resident mode. **Reproduction status** Reproduced locally, many runs. Full logs and `STRATA_VERIFY_TRACE` blocks available; happy to run an instrumented build.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 29, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6486553132 --> @github-actions[bot] commented on GitHub (Oct 29, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 29, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6486602958 --> @github-actions[bot] commented on GitHub (Oct 29, 2026): Thanks, this follows the format now.
Author
Owner

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

Reproduction and a working mitigation on 0.1.56 (v0.2.10), same card.

Setup. RX 6700 XT 12 GB (gfx1031), Ryzen 5 5600X, 31 GiB RAM, Ubuntu, in-kernel amdgpu. Engine 0.1.56, built from source for gfx1031 (setup.py --update compiled rather than installing the rx6000 package).

Model. Qwen3.8-Flash-Next Coder IQ1_M (pack + both source shards), --prefill 512 --max-context 32768 --kv int8 --spec 2 --vram-reserve-mib 1536 --resident-budget-gib 16 --mmap-experts.

Failure. Short requests are fine (chat decode 22.4 tok/s; 4K and 16K prompts ~267 tok/s). A 700-token answer at temperature 0 stopped at ~146 generated tokens with:

Unrecoverable native verification failure: verify: timed out at layer 37;
its GPU waits were released and the GPU finished (#267)

engine exit −15; the server restarted the engine on the next request.

Mitigation. With --adapt-swaps 0 and STRATA_VERIFY_COHERENT=1 the same request completed: 343 tokens in 13.48 s (25.4 tok/s), drafts accepted 69/92, correct output. So the pair that stabilised prefill here also covers the verify-timeout variant on Coder/IQ1_M on this box.

Also measured, same box. STRATA_DENSE_MMQ=1 on the qwen35moe path (Qwen3.6-35B-A3B UD-Q4_K_XL, 24K context, --mtp 2): +14.8% at 16K prefill (606.6 → 696.2 tok/s), +0.5% at 4K (710.4 → 713.8), decode flat (41.3 tok/s), agent decode −4.7%. Outputs diverged from the non-MMQ arm on all three fixed greedy prompts, so I am leaving it off outside prompt-heavy batch work.

<!-- gh-comment-id:6617283922 --> @mkw432 commented on GitHub (Nov 3, 2026): Reproduction and a working mitigation on **0.1.56 (v0.2.10)**, same card. **Setup.** RX 6700 XT 12 GB (gfx1031), Ryzen 5 5600X, 31 GiB RAM, Ubuntu, in-kernel amdgpu. Engine 0.1.56, built from source for gfx1031 (`setup.py --update` compiled rather than installing the rx6000 package). **Model.** Qwen3.8-Flash-Next Coder IQ1_M (pack + both source shards), `--prefill 512 --max-context 32768 --kv int8 --spec 2 --vram-reserve-mib 1536 --resident-budget-gib 16 --mmap-experts`. **Failure.** Short requests are fine (chat decode 22.4 tok/s; 4K and 16K prompts ~267 tok/s). A 700-token answer at temperature 0 stopped at ~146 generated tokens with: ``` Unrecoverable native verification failure: verify: timed out at layer 37; its GPU waits were released and the GPU finished (#267) ``` engine exit −15; the server restarted the engine on the next request. **Mitigation.** With `--adapt-swaps 0` and `STRATA_VERIFY_COHERENT=1` the same request completed: 343 tokens in 13.48 s (25.4 tok/s), drafts accepted 69/92, correct output. So the pair that stabilised prefill here also covers the verify-timeout variant on Coder/IQ1_M on this box. **Also measured, same box.** `STRATA_DENSE_MMQ=1` on the qwen35moe path (Qwen3.6-35B-A3B UD-Q4_K_XL, 24K context, `--mtp 2`): +14.8% at 16K prefill (606.6 → 696.2 tok/s), +0.5% at 4K (710.4 → 713.8), decode flat (41.3 tok/s), agent decode −4.7%. Outputs diverged from the non-MMQ arm on all three fixed greedy prompts, so I am leaving it off outside prompt-heavy batch work.
Author
Owner

@shaoyanji commented on GitHub (Nov 4, 2026):

New data point for this thread, from a different gfx10 part (gfx1010, RX 5700 8 GB, local HIP build, engine 0.1.46.2, binary 2026-10-21). Full report in #5229; the part that belongs here:

It is deterministic at this prompt size, not random. Qwen3.8-Flash-Next Coder IQ1_M (58.4 GB, same pack family as your comment), plain flags (--prefill auto --max-context 32768 --kv int8 --spec 4 --mtp, default threads, no --adapt-swaps), one request at a time. Three agent-suite runs, three stall sites:

reading the prompt (batched): layer 1 of the prompt chunk from token 9076
reading the prompt (batched): layer 1 of the prompt chunk from token 9121
reading the prompt (batched): layer 1 of the prompt chunk from token 9063

Always layer 1 of the prompt chunk, always ~9k. 4,096-token prompts never stall (166.8 tok/s); turns of 609 to 9,029 tokens never stall; IQ2_XS and IQ3_XXS stall the same way at turn 0, so it is not the pack. The startup line on this box is strata serve: prompt chunk auto: 3840 tokens, a 351-slot ring — 9,076 is not a multiple of 3,840, so it is not simply the second chunk boundary.

Two questions for your mitigation: does --adapt-swaps 0 help when the stall is inside a batched prompt chunk read rather than the verify path (yours also needed STRATA_VERIFY_COHERENT=1 after a verify: timed out at layer 37)? And is this on your list for a build after 0.1.56? I am ten point releases back and will retest 0.1.56 on this card either way.

<!-- gh-comment-id:6635650840 --> @shaoyanji commented on GitHub (Nov 4, 2026): New data point for this thread, from a different gfx10 part (gfx1010, RX 5700 8 GB, local HIP build, engine **0.1.46.2**, binary 2026-10-21). Full report in #5229; the part that belongs here: **It is deterministic at this prompt size, not random.** Qwen3.8-Flash-Next Coder IQ1_M (58.4 GB, same pack family as your comment), plain flags (`--prefill auto --max-context 32768 --kv int8 --spec 4 --mtp`, default threads, no `--adapt-swaps`), one request at a time. Three agent-suite runs, three stall sites: ``` reading the prompt (batched): layer 1 of the prompt chunk from token 9076 reading the prompt (batched): layer 1 of the prompt chunk from token 9121 reading the prompt (batched): layer 1 of the prompt chunk from token 9063 ``` Always `layer 1 of the prompt chunk`, always ~9k. 4,096-token prompts never stall (166.8 tok/s); turns of 609 to 9,029 tokens never stall; IQ2_XS and IQ3_XXS stall the same way at turn 0, so it is not the pack. The startup line on this box is `strata serve: prompt chunk auto: 3840 tokens, a 351-slot ring` — 9,076 is not a multiple of 3,840, so it is not simply the second chunk boundary. Two questions for your mitigation: does `--adapt-swaps 0` help when the stall is inside a batched prompt chunk read rather than the verify path (yours also needed `STRATA_VERIFY_COHERENT=1` after a `verify: timed out at layer 37`)? And is this on your list for a build after 0.1.56? I am ten point releases back and will retest 0.1.56 on this card either way.
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#2063
No description provided.