[GH-ISSUE #1971] 0.1.42: the engine stops in "reading the prompt (batched)" right after the conversation cache's reused prefix (about one run in two, --vram-reserve-mib 1000, RTX 4070 SUPER 12 GB) #786

Closed
opened 2026-11-04 01:45:50 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @LeGeRyChEeSe on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1971

Summary

On 0.1.42 the hang guard (#29) stops the engine during a prompt read: "no progress for 60 s during a request (reading
the prompt (batched): layer 1 of the prompt chunk from token N)". The engine then exits with 3221226505 (0xC0000409),
as in #1865. N is always the end of the previous turn's context, i.e. the first chunk read after the conversation
cache's reused prefix. The turn before the stall already reads its prompt about twice as slowly as in a run that does
not stall (837 tok/s against 1,820). It happens with and without --vision, and with and without the route tail skip.
It never happened on 0.1.41.

How often (a replay of coding-agent turns, one engine process per run, --vram-reserve-mib 1000):

engine runs stalled
0.1.42, --vision 7 4
0.1.42, no vision 4 2
0.1.41, no vision 2 0
0.1.42, --vision, --vram-reserve-mib 450 2 0

The stall is always at the same place for a given corpus: turn 3 at token 15866 (turn 2 ended at 15871), or turn 4 at
token 43718 (turn 3 ended at 43723).

Setup

  • RTX 4070 SUPER 12 GB (PCIe 4.0 x16, driver 617.14, CUDA 13.1), Ryzen 5 5600X, 64 GB DDR4-3600, Windows 11 Pro build
    26300, 30 GB page file. "Windows commit: 24.3 GiB left of a 93.9 GiB limit" at start; about 7 GB of RAM available at
    the stall.
  • Engine 0.1.42 built from the tag (CUDA archs 86;89). Flash-Next IQ2_XS (GSQ-RCO), the expert profile the repository
    ships.
  • Args: --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.7 --mtp <rt> --max-context 131072 --kv int8 --kv-resident 32768 --pcie-frac 0.55 --vram-reserve-mib 1000 (+ --vision in the vision runs). 3,585 cache slots
    without vision, 2,934 with it.
  • Load: 23 coding-agent turns (2.5K-103K tokens) from 5 simulated agent sessions on this repository at a fixed commit
    (the tool results are the repository's real files), replayed in order, so a turn shares its session's prefix with the
    one before and the conversation cache reuses it; 256 tokens at T = 1, one request at a time.

Stall report (no vision run):

strata serve: prompt 15871 tokens = 5062 reused + 10809 read in 12909 ms (837.3 tok/s), 52 generated in 586 ms (88.8 tok/s), drafts accepted 35 of 42, 2 checkpoints
strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 1 of the prompt chunk from token 15866) - stopping the engine so the server starts it again (issue #29)
strata serve: stall report (engine 0.1.42): stage "reading the prompt (batched): layer 1 of the prompt chunk from token 15866" for 61 s; 0 layers served since the last finished step (0 = stopped, more = slow)
  expert pool: epoch 5204, batch epoch 5204: 18 of 18 jobs claimed, 18 done; 5 of 5 workers parked, 5 sleeping; mode 0
  expert pool threads: w0=sleeping w1=sleeping w2=sleeping w3=sleeping w4=sleeping; host idle for 61931 ms
  verify window (last window, not the current stage): 4 tokens at position 15920, host at layer step 48; the GPU rang 48; flags: served 48, plan (A) 48, copies (B) 48
  memory: 36205 MiB resident, 49383 MiB committed, 7092 MiB RAM available; 19156906 page faults so far

In runs that do not stall, the same turn 2 reads its 10,809 tokens in 5.9 s (1,820 tok/s).

Not checked

  • Linux; another card; another quant.
  • Whether 450 is truly free of it, or only rarer (0 of 2 runs).
  • Odd detail, maybe chance: the same 0.1.42 engine driven by the 0.1.39 serve/server.py (the same 15,866
    tokens reused at turn 3) did not stall in 4 runs at 1000.

The thread-stack dumps (strata-stall-*.dmp, 6 of them) and the full engine logs are available: tell me which ones help.

Originally created by @LeGeRyChEeSe on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1971 **Summary** On 0.1.42 the hang guard (#29) stops the engine during a prompt read: "no progress for 60 s during a request (reading the prompt (batched): layer 1 of the prompt chunk from token N)". The engine then exits with 3221226505 (0xC0000409), as in #1865. N is always the end of the previous turn's context, i.e. the first chunk read after the conversation cache's reused prefix. The turn before the stall already reads its prompt about twice as slowly as in a run that does not stall (837 tok/s against 1,820). It happens with and without `--vision`, and with and without the route tail skip. It never happened on 0.1.41. **How often** (a replay of coding-agent turns, one engine process per run, `--vram-reserve-mib 1000`): | engine | runs | stalled | |---|---|---| | 0.1.42, `--vision` | 7 | 4 | | 0.1.42, no vision | 4 | 2 | | 0.1.41, no vision | 2 | 0 | | 0.1.42, `--vision`, `--vram-reserve-mib 450` | 2 | 0 | The stall is always at the same place for a given corpus: turn 3 at token 15866 (turn 2 ended at 15871), or turn 4 at token 43718 (turn 3 ended at 43723). **Setup** - RTX 4070 SUPER 12 GB (PCIe 4.0 x16, driver 617.14, CUDA 13.1), Ryzen 5 5600X, 64 GB DDR4-3600, Windows 11 Pro build 26300, 30 GB page file. "Windows commit: 24.3 GiB left of a 93.9 GiB limit" at start; about 7 GB of RAM available at the stall. - Engine 0.1.42 built from the tag (CUDA archs 86;89). Flash-Next IQ2_XS (GSQ-RCO), the expert profile the repository ships. - Args: `--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.7 --mtp <rt> --max-context 131072 --kv int8 --kv-resident 32768 --pcie-frac 0.55 --vram-reserve-mib 1000` (+ `--vision` in the vision runs). 3,585 cache slots without vision, 2,934 with it. - Load: 23 coding-agent turns (2.5K-103K tokens) from 5 simulated agent sessions on this repository at a fixed commit (the tool results are the repository's real files), replayed in order, so a turn shares its session's prefix with the one before and the conversation cache reuses it; 256 tokens at T = 1, one request at a time. **Stall report** (no vision run): ``` strata serve: prompt 15871 tokens = 5062 reused + 10809 read in 12909 ms (837.3 tok/s), 52 generated in 586 ms (88.8 tok/s), drafts accepted 35 of 42, 2 checkpoints strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 1 of the prompt chunk from token 15866) - stopping the engine so the server starts it again (issue #29) strata serve: stall report (engine 0.1.42): stage "reading the prompt (batched): layer 1 of the prompt chunk from token 15866" for 61 s; 0 layers served since the last finished step (0 = stopped, more = slow) expert pool: epoch 5204, batch epoch 5204: 18 of 18 jobs claimed, 18 done; 5 of 5 workers parked, 5 sleeping; mode 0 expert pool threads: w0=sleeping w1=sleeping w2=sleeping w3=sleeping w4=sleeping; host idle for 61931 ms verify window (last window, not the current stage): 4 tokens at position 15920, host at layer step 48; the GPU rang 48; flags: served 48, plan (A) 48, copies (B) 48 memory: 36205 MiB resident, 49383 MiB committed, 7092 MiB RAM available; 19156906 page faults so far ``` In runs that do not stall, the same turn 2 reads its 10,809 tokens in 5.9 s (1,820 tok/s). **Not checked** - Linux; another card; another quant. - Whether 450 is truly free of it, or only rarer (0 of 2 runs). - Odd detail, maybe chance: the same 0.1.42 engine driven by the 0.1.39 `serve/server.py` (the same 15,866 tokens reused at turn 3) did not stall in 4 runs at 1000. The thread-stack dumps (`strata-stall-*.dmp`, 6 of them) and the full engine logs are available: tell me which ones help.
Author
Owner

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

Thank you for the table and the stall reports. They helped a lot.

One thing we found that fits your pattern: the stage 'layer 1 of the prompt chunk from token N' is where the engine waits for the n-gram table (PLE) rows of the chunk. For the first chunk after a reused prefix (token 15866, 43718) that read only has layer 0 to hide behind, while later chunks have it read ahead during the previous chunk. In --ple-io mmap mode those rows were gathered one page fault at a time with no read-ahead and no progress mark, so a cold or evicted table (you had about 7 GB of RAM available, a 36 GB working set and 19 million page faults at the stall) is slow enough for the 60 s watchdog to stop the engine. That also fits the turn before reading at 837 tok/s instead of 1,820.

What we do not know: whether your 0.1.42 sessions actually used mmap. On 0.1.42 the engine switches to --ple-io mmap by itself when the start-up probe finds direct slow (cold file cache, busy drive), and it never did so on 0.1.41, which would also explain why 0.1.41 and the run that does not stall look different. Could you check the boot log of a stalled run for the line 'PLE direct read probe: N rows/s (fine)' or '--ple-io direct measures slow here ... using --ple-io mmap instead'? If it shows the mmap switch, this is the same thing as #1984. If it shows 'fine', then it is something else and the dump from a stalled run (the main thread's stack) would be the next thing to look at; we would then tell you which one to attach.

In 0.1.43.1 (out now) the mapped gather reads ahead a window at a time, and on Windows the probe no longer switches to mmap by itself (it warns and keeps direct; STRATA_PLE_AUTO_MMAP=1 restores the 0.1.42 behaviour). Until then, pin --ple-io direct in the engine arguments (or --ple-io ram if you can spare the RAM for the 27 GB table).

Also in 0.1.43.1: the stall watchdog's allowance for slow disk reads now works on Windows too and holds while the disk was busy in the last 10 seconds, and the start-up check no longer switches to mmap by itself on any platform.

<!-- gh-comment-id:6129304708 --> @Niko1221 commented on GitHub (Oct 12, 2026): Thank you for the table and the stall reports. They helped a lot. One thing we found that fits your pattern: the stage 'layer 1 of the prompt chunk from token N' is where the engine waits for the n-gram table (PLE) rows of the chunk. For the first chunk after a reused prefix (token 15866, 43718) that read only has layer 0 to hide behind, while later chunks have it read ahead during the previous chunk. In `--ple-io mmap` mode those rows were gathered one page fault at a time with no read-ahead and no progress mark, so a cold or evicted table (you had about 7 GB of RAM available, a 36 GB working set and 19 million page faults at the stall) is slow enough for the 60 s watchdog to stop the engine. That also fits the turn before reading at 837 tok/s instead of 1,820. What we do not know: whether your 0.1.42 sessions actually used mmap. On 0.1.42 the engine switches to `--ple-io mmap` by itself when the start-up probe finds direct slow (cold file cache, busy drive), and it never did so on 0.1.41, which would also explain why 0.1.41 and the run that does not stall look different. Could you check the boot log of a stalled run for the line 'PLE direct read probe: N rows/s (fine)' or '--ple-io direct measures slow here ... using --ple-io mmap instead'? If it shows the mmap switch, this is the same thing as #1984. If it shows 'fine', then it is something else and the dump from a stalled run (the main thread's stack) would be the next thing to look at; we would then tell you which one to attach. In 0.1.43.1 (out now) the mapped gather reads ahead a window at a time, and on Windows the probe no longer switches to mmap by itself (it warns and keeps direct; `STRATA_PLE_AUTO_MMAP=1` restores the 0.1.42 behaviour). Until then, pin `--ple-io direct` in the engine arguments (or `--ple-io ram` if you can spare the RAM for the 27 GB table). Also in 0.1.43.1: the stall watchdog's allowance for slow disk reads now works on Windows too and holds while the disk was busy in the last 10 seconds, and the start-up check no longer switches to mmap by itself on any platform.
Author
Owner

@LeGeRyChEeSe commented on GitHub (Oct 12, 2026):

You were right: it is the mmap switch.

Boot logs. I checked the boot logs of 43 runs on 0.1.41, 0.1.42 and 0.1.43:

  • All 8 runs that stalled had logged ple-io direct measures slow here (7,329-12,453 rows/s ...): using --ple-io mmap instead. That includes one stall on 0.1.43.
  • None of the 35 runs that did not stall had: they all show PLE direct read probe: 35,000-69,000 rows/s (fine).
  • 0.1.41 logs no probe at all.

0.1.43.1 with --ple-io mmap forced. Same replay as above (first 4 turns, no vision, --vram-reserve-mib 1000). The Windows standby list was purged before each run, so the 27 GB table starts cold.

engine runs stalled prompt read, turns 1-4
0.1.42, --ple-io mmap 4 3 (all at token 15866) 30 s, 12 s, then the stall; the run that did not stall: 30 / 58 / 163 / 101 s
0.1.43.1, --ple-io mmap 4 0 3.5-8 / 5.9-7.0 / 14-23 / 8-13 s

With a warm file cache, forced mmap on 0.1.42 stalled only once, on the first run of the evening (at token 0). With 0.1.43.1's defaults, the probe reported "fine" and the engine kept direct.

So, for this setup, 0.1.43.1 fixes it. I'm fine with closing this as a duplicate of #1984.

<!-- gh-comment-id:6133123051 --> @LeGeRyChEeSe commented on GitHub (Oct 12, 2026): You were right: it is the mmap switch. **Boot logs.** I checked the boot logs of 43 runs on 0.1.41, 0.1.42 and 0.1.43: - All 8 runs that stalled had logged `ple-io direct measures slow here (7,329-12,453 rows/s ...): using --ple-io mmap instead`. That includes one stall on 0.1.43. - None of the 35 runs that did not stall had: they all show `PLE direct read probe: 35,000-69,000 rows/s (fine)`. - 0.1.41 logs no probe at all. **0.1.43.1 with `--ple-io mmap` forced.** Same replay as above (first 4 turns, no vision, `--vram-reserve-mib 1000`). The Windows standby list was purged before each run, so the 27 GB table starts cold. | engine | runs | stalled | prompt read, turns 1-4 | |---|---|---|---| | 0.1.42, `--ple-io mmap` | 4 | 3 (all at token 15866) | 30 s, 12 s, then the stall; the run that did not stall: 30 / 58 / 163 / 101 s | | 0.1.43.1, `--ple-io mmap` | 4 | 0 | 3.5-8 / 5.9-7.0 / 14-23 / 8-13 s | With a warm file cache, forced mmap on 0.1.42 stalled only once, on the first run of the evening (at token 0). With 0.1.43.1's defaults, the probe reported "fine" and the engine kept direct. So, for this setup, 0.1.43.1 fixes it. I'm fine with closing this as a duplicate of #1984.
Author
Owner

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

Thank you for the careful logs: 43 boot logs plus the forced-mmap replays tied the stall to the automatic mmap switch exactly. 0.1.43.1 no longer makes that switch, and your 0 of 4 stalls confirms the fix on your setup, so I'm closing this as a duplicate of #1984. If it ever stalls again on 0.1.43.1 or later, please reopen with the boot log.

<!-- gh-comment-id:6133614101 --> @Niko1221 commented on GitHub (Oct 12, 2026): Thank you for the careful logs: 43 boot logs plus the forced-mmap replays tied the stall to the automatic mmap switch exactly. 0.1.43.1 no longer makes that switch, and your 0 of 4 stalls confirms the fix on your setup, so I'm closing this as a duplicate of #1984. If it ever stalls again on 0.1.43.1 or later, please reopen with the boot log.
Author
Owner

@rainmakerhuang-rgb commented on GitHub (Oct 24, 2026):

Reopening report per your request ("If it ever stalls again on 0.1.43.1 or later, please reopen with the boot log") — we hit the identical signature twice today on 0.1.43.1 with --ple-io mmap explicitly pinned in the config args (no auto-switch involved).

Setup: Windows 11, RTX 5000 Ada Generation Laptop GPU 16 GB, i9-13900HX, 128 GB RAM, Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S. Engine args: --expert-cache auto --prefill auto --spec 4 --mtp rt --max-context 262144 --kv int8 --kv-resident 32768 --vision --vram-reserve-mib 700 --conversation-cache-mib 16384 --conversation-cache-slots 4 --pcie-frac 0.00 --prompt-cache-tail --ple-io mmap. Boot probe logged: --ple-io direct measures slow here (13486 rows/s, about 55 MB/s of random 4 KiB reads) → kept direct per the 0.1.43.1 policy, config pins mmap.

Episode 1 (20:45–20:53): 103,874-token prompt, 0 reused, read at 174.5 tok/s (normal here is 1,900–2,050 tok/s), client cancelled at 427 s. Stall report: reading the prompt (batched): waiting for the GPU (attention, router) at layer 1 of the prompt chunk from token 16384 for 61 s, 0 layers served. Thread stacks written to strata-stall-4348.dmp (attached).

Episode 2 (21:43–22:0x): 44,840-token prompt, same stage string (layer 1 of the prompt chunk from token 16384), 67 s, 0 layers served → watchdog self-stop, exit code 3221226505 (0xC0000409).

Context: both episodes happened while a standalone stress replay (10 rounds growing to 238,873 tokens, --vram-reserve-mib 700) ran concurrently with an agent chat on the same engine. The stress run alone never stalls (three runs today, 61–84 s/round, clean). During the concurrent phase the engine's own warnings fired: 148/182/226 MiB of VRAM free with everything loaded - LOW: requests may stall. Episode 2's prompt was only 44,840 tokens, so this is not a huge-context case.

Evidence excerpt (both episodes, boot probe, VRAM warnings, stress table) and the 20:53 stall dmp (base64, decode with base64 -d): https://gist.github.com/rainmakerhuang-rgb/184750508b5dbabf523683ca34d57d24

What we are doing: switched to --ple-io ram (boot log: PLE table locked in RAM (--ple-io ram) in 20.5 s, table 320,001,536 rows). We are running the same chat+stress concurrency pattern for one week and will report back here with the result — stalls under ram would mean the 0.1.43.1 mmap fix does not cover this path on this machine.

<!-- gh-comment-id:6385456270 --> @rainmakerhuang-rgb commented on GitHub (Oct 24, 2026): Reopening report per your request ("If it ever stalls again on 0.1.43.1 or later, please reopen with the boot log") — we hit the identical signature twice today on 0.1.43.1 with `--ple-io mmap` explicitly pinned in the config args (no auto-switch involved). **Setup**: Windows 11, RTX 5000 Ada Generation Laptop GPU 16 GB, i9-13900HX, 128 GB RAM, Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S. Engine args: `--expert-cache auto --prefill auto --spec 4 --mtp rt --max-context 262144 --kv int8 --kv-resident 32768 --vision --vram-reserve-mib 700 --conversation-cache-mib 16384 --conversation-cache-slots 4 --pcie-frac 0.00 --prompt-cache-tail --ple-io mmap`. Boot probe logged: `--ple-io direct measures slow here (13486 rows/s, about 55 MB/s of random 4 KiB reads)` → kept direct per the 0.1.43.1 policy, config pins mmap. **Episode 1** (20:45–20:53): 103,874-token prompt, 0 reused, read at 174.5 tok/s (normal here is 1,900–2,050 tok/s), client cancelled at 427 s. Stall report: `reading the prompt (batched): waiting for the GPU (attention, router) at layer 1 of the prompt chunk from token 16384` for 61 s, 0 layers served. Thread stacks written to `strata-stall-4348.dmp` (attached). **Episode 2** (21:43–22:0x): 44,840-token prompt, same stage string (`layer 1 of the prompt chunk from token 16384`), 67 s, 0 layers served → watchdog self-stop, exit code 3221226505 (0xC0000409). **Context**: both episodes happened while a standalone stress replay (10 rounds growing to 238,873 tokens, `--vram-reserve-mib 700`) ran **concurrently** with an agent chat on the same engine. The stress run alone never stalls (three runs today, 61–84 s/round, clean). During the concurrent phase the engine's own warnings fired: `148/182/226 MiB of VRAM free with everything loaded - LOW: requests may stall`. Episode 2's prompt was only 44,840 tokens, so this is not a huge-context case. Evidence excerpt (both episodes, boot probe, VRAM warnings, stress table) and the 20:53 stall dmp (base64, decode with `base64 -d`): https://gist.github.com/rainmakerhuang-rgb/184750508b5dbabf523683ca34d57d24 **What we are doing**: switched to `--ple-io ram` (boot log: `PLE table locked in RAM (--ple-io ram) in 20.5 s`, table 320,001,536 rows). We are running the same chat+stress concurrency pattern for one week and will report back here with the result — stalls under `ram` would mean the 0.1.43.1 mmap fix does not cover this path on this machine.
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#786
No description provided.