[GH-ISSUE #1984] --ple-io mmap picked automatically at boot can wedge the engine: "no progress for 60 s" at the prompt's first chunk (self-stop + restart) #788

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

Originally created by @jy02375437-max on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1984

Summary. On this box (Windows 11 26200, single RTX 4090 D 48 GB, Ryzen AI Max+ 395, 127.1 GiB RAM, engine 0.1.43 release build, IQ3_XXS GSQ-RCO with a tools/iq_pack.py native pack) the engine self-stopped four times with --ple-io mmap — three times in a --mmap-experts session, once in a plain arena session — all in sessions whose boot had auto-selected --ple-io mmap. The stall stage is the first prompt chunk (layer 1 of the prompt chunk from token 0) and the counters show zero progress, not slow I/O. Pinning --ple-io direct in the config restored normal service (32K needles 9/9, repeated).

What those sessions logged at boot

strata generate: --ple-io direct measures slow here (11812 rows/s, about 48 MB/s of random 4 KiB reads):
                 using --ple-io mmap instead (the OS file cache holds the pages; --ple-io direct forces the
                 old mode, --ple-io ram keeps the table in RAM)

What happened next (arena-mode session, a 32K prompt)

strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 1 of the prompt
chunk from token 0) - stopping the engine so the server starts it again (issue #29)
strata serve: stall report (engine 0.1.43): stage "reading the prompt (batched): layer 1 of the prompt
chunk from token 0" for 60 s; 0 layers served since the last finished step
  expert pool: epoch 0, batch epoch 0: 0 of 0 jobs claimed, 0 done; 15 of 15 workers parked, 15 sleeping
  expert pool threads: w0..w14=sleeping; host idle for 90366 ms
  verify window: 0 tokens at position 0, host at layer step 1; the GPU rang 0; flags: served 0, plan (A) 0, copies (B) 0
  memory: 7964 MiB resident, 96196 MiB committed, 63482 MiB RAM available; 3184370 page faults so far
  wrote the thread stacks to ...\strata-stall-3644.dmp (attach it to the issue)
strata: released the verify window's GPU waits (#267): the GPU finished in 0 ms

server.py restarted the engine; clients saw HTTP 503 while that happened. The stopped engine was left with a
7.1 GB working set against 96 GB committed (its pages had been paged out / compressed).

The A/B — same config file, same machine, same hour; only the boot probe's verdict differs:

session boot line the same 32K prompt
02:20:21 direct measures slow here (11812 rows/s) → using --ple-io mmap instead no progress for 60 s → self-stop → strata-stall-3644.dmp
02:23:34 (auto-restart) PLE direct read probe: 42898 rows/s (fine) 32K needle 3x3 = 9/9, reads 10.9 s / 14.8 s (repeated)

The three earlier stalls were in a --mmap-experts session (GGUF in place, no experts.bin) whose log also
shows the auto-switch to --ple-io mmap: dumps strata-stall-43064.dmp (01:48), strata-stall-38852.dmp
(01:52), strata-stall-21644.dmp (01:57) — same stage, same "0 layers served" pattern. I can attach all four
dumps if useful; I held them back because thread stacks may contain memory contents.

Context that may matter. The probe's verdict varies with the state of the OS file cache. Before these
sessions the machine had done a lot of I/O (a 47 GB pack build, full-file sha256 passes, an 81 GB download, and
mapped-mode runs that read ~104 GB through the file tier), so "direct measures slow" may well have been true at
that moment — but the fallback then appears to stall rather than merely be slow. The stall counters
(0 of 0 jobs claimed, all workers sleeping, host idle 90 s, GPU rang 0) look like a read that never completes
rather than I/O that is slow. It may be the same family as #1910 (a report about 0.1.42 mmap'ing the PLE shard
and re-reading it).

Workaround I now use. Pin --ple-io direct in the config: with --ple-io given explicitly the probe only
warns (generate.cpp:3180) and the engine stays on the unbuffered direct reads with the bounded row cache.
Since then: 32K needles 9/9 repeatedly, no stalls. (--ple-io ram is the other candidate; I measured it on
this box — +0.1% at 117K prompt tokens — so I kept direct.)

Question. Is the mmap PLE path expected to be stall-safe on NTFS? Happy to rerun with STRATA_* tracing,
to keep a session in the bad state for you to inspect, or to send the four dumps.

Originally created by @jy02375437-max on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1984 **Summary.** On this box (Windows 11 26200, single RTX 4090 D 48 GB, Ryzen AI Max+ 395, 127.1 GiB RAM, engine 0.1.43 release build, IQ3_XXS GSQ-RCO with a `tools/iq_pack.py` native pack) the engine self-stopped four times with `--ple-io mmap` — three times in a `--mmap-experts` session, once in a plain arena session — all in sessions whose boot had auto-selected `--ple-io mmap`. The stall stage is the first prompt chunk (`layer 1 of the prompt chunk from token 0`) and the counters show *zero* progress, not slow I/O. Pinning `--ple-io direct` in the config restored normal service (32K needles 9/9, repeated). **What those sessions logged at boot** ``` strata generate: --ple-io direct measures slow here (11812 rows/s, about 48 MB/s of random 4 KiB reads): using --ple-io mmap instead (the OS file cache holds the pages; --ple-io direct forces the old mode, --ple-io ram keeps the table in RAM) ``` **What happened next (arena-mode session, a 32K prompt)** ``` strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 1 of the prompt chunk from token 0) - stopping the engine so the server starts it again (issue #29) strata serve: stall report (engine 0.1.43): stage "reading the prompt (batched): layer 1 of the prompt chunk from token 0" for 60 s; 0 layers served since the last finished step expert pool: epoch 0, batch epoch 0: 0 of 0 jobs claimed, 0 done; 15 of 15 workers parked, 15 sleeping expert pool threads: w0..w14=sleeping; host idle for 90366 ms verify window: 0 tokens at position 0, host at layer step 1; the GPU rang 0; flags: served 0, plan (A) 0, copies (B) 0 memory: 7964 MiB resident, 96196 MiB committed, 63482 MiB RAM available; 3184370 page faults so far wrote the thread stacks to ...\strata-stall-3644.dmp (attach it to the issue) strata: released the verify window's GPU waits (#267): the GPU finished in 0 ms ``` `server.py` restarted the engine; clients saw HTTP 503 while that happened. The stopped engine was left with a 7.1 GB working set against 96 GB committed (its pages had been paged out / compressed). **The A/B** — same config file, same machine, same hour; only the boot probe's verdict differs: | session | boot line | the same 32K prompt | | --- | --- | --- | | 02:20:21 | `direct measures slow here (11812 rows/s)` → **`using --ple-io mmap instead`** | `no progress for 60 s` → self-stop → `strata-stall-3644.dmp` | | 02:23:34 (auto-restart) | `PLE direct read probe: 42898 rows/s (fine)` | 32K needle 3x3 = 9/9, reads 10.9 s / 14.8 s (repeated) | The three earlier stalls were in a `--mmap-experts` session (GGUF in place, no `experts.bin`) whose log also shows the auto-switch to `--ple-io mmap`: dumps `strata-stall-43064.dmp` (01:48), `strata-stall-38852.dmp` (01:52), `strata-stall-21644.dmp` (01:57) — same stage, same "0 layers served" pattern. I can attach all four dumps if useful; I held them back because thread stacks may contain memory contents. **Context that may matter.** The probe's verdict varies with the state of the OS file cache. Before these sessions the machine had done a lot of I/O (a 47 GB pack build, full-file sha256 passes, an 81 GB download, and mapped-mode runs that read ~104 GB through the file tier), so "direct measures slow" may well have been true at that moment — but the fallback then appears to *stall* rather than merely be slow. The stall counters (`0 of 0 jobs claimed`, all workers sleeping, host idle 90 s, GPU rang 0) look like a read that never completes rather than I/O that is slow. It may be the same family as #1910 (a report about 0.1.42 mmap'ing the PLE shard and re-reading it). **Workaround I now use.** Pin `--ple-io direct` in the config: with `--ple-io` given explicitly the probe only warns (`generate.cpp:3180`) and the engine stays on the unbuffered direct reads with the bounded row cache. Since then: 32K needles 9/9 repeatedly, no stalls. (`--ple-io ram` is the other candidate; I measured it on this box — +0.1% at 117K prompt tokens — so I kept `direct`.) **Question.** Is the mmap PLE path expected to be stall-safe on NTFS? Happy to rerun with `STRATA_*` tracing, to keep a session in the bad state for you to inspect, or to send the four dumps.
Author
Owner

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

Thank you, this is a very clear report and the A/B (same config, only the boot probe's verdict differs) pointed straight at it.

What we found in the code: the stall is in the mapped (--ple-io mmap) path, not in the direct one. When a prompt chunk starts, the n-gram table rows for the whole chunk are gathered on a helper thread, and the first chunk only has layer 0 to hide that behind. In mmap mode the gather read the rows one at a time, 16 random 4 KiB page faults per token, with no read-ahead, and no progress mark is set while it runs. With the 27 GB table not in the file cache (you had just done a 47 GB pack build, sha256 passes and an 81 GB download, which is also why the probe measured 'slow' at that moment), a 32K chunk is hundreds of thousands of serial cold faults. That looks exactly like your counters: all workers parked, host idle, 'layer 1 of the prompt chunk from token 0', 0 layers served. It is slowness that the watchdog cannot tell from a hang, not a lost read. On a Linux box with a cold table the same mode finishes (about 12% slower than direct at 32K, same answers), so the mode itself is not broken. We cannot check Windows page-fault timings here, so we are not claiming the Windows number.

What changed in 0.1.43.1 (out now): (1) the mapped gather now asks the OS for the rows a window ahead (PrefetchVirtualMemory on Windows, MADV_WILLNEED on Linux) instead of faulting them one by one; answers are unchanged. (2) On Windows the start-up probe no longer switches to mmap by itself: when direct measures slow it prints a warning and keeps direct. STRATA_PLE_AUTO_MMAP=1 brings the 0.1.42 switch back.

Until then your workaround is the right one: --ple-io direct in the config (or --ple-io ram, which you measured at +0.1%). Keep the four dumps for now; if you can still reproduce on the next build with STRATA_PLE_AUTO_MMAP=1, one dump would tell us which line of the gather the main thread sits in, and we would ask for it then. Thanks for the offer.

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:6129309968 --> @Niko1221 commented on GitHub (Oct 12, 2026): Thank you, this is a very clear report and the A/B (same config, only the boot probe's verdict differs) pointed straight at it. What we found in the code: the stall is in the mapped (`--ple-io mmap`) path, not in the direct one. When a prompt chunk starts, the n-gram table rows for the whole chunk are gathered on a helper thread, and the first chunk only has layer 0 to hide that behind. In mmap mode the gather read the rows one at a time, 16 random 4 KiB page faults per token, with no read-ahead, and no progress mark is set while it runs. With the 27 GB table not in the file cache (you had just done a 47 GB pack build, sha256 passes and an 81 GB download, which is also why the probe measured 'slow' at that moment), a 32K chunk is hundreds of thousands of serial cold faults. That looks exactly like your counters: all workers parked, host idle, 'layer 1 of the prompt chunk from token 0', 0 layers served. It is slowness that the watchdog cannot tell from a hang, not a lost read. On a Linux box with a cold table the same mode finishes (about 12% slower than direct at 32K, same answers), so the mode itself is not broken. We cannot check Windows page-fault timings here, so we are not claiming the Windows number. What changed in 0.1.43.1 (out now): (1) the mapped gather now asks the OS for the rows a window ahead (PrefetchVirtualMemory on Windows, MADV_WILLNEED on Linux) instead of faulting them one by one; answers are unchanged. (2) On Windows the start-up probe no longer switches to mmap by itself: when direct measures slow it prints a warning and keeps direct. `STRATA_PLE_AUTO_MMAP=1` brings the 0.1.42 switch back. Until then your workaround is the right one: `--ple-io direct` in the config (or `--ple-io ram`, which you measured at +0.1%). Keep the four dumps for now; if you can still reproduce on the next build with `STRATA_PLE_AUTO_MMAP=1`, one dump would tell us which line of the gather the main thread sits in, and we would ask for it then. Thanks for the offer. 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

@jy02375437-max commented on GitHub (Oct 13, 2026):

Upgraded to 0.1.43.1 (release strata-windows-x64.zip) and tested the mapped path on the same box as the original report (RTX 4090D 48 GB, 128 GB RAM, Gen4 x4, IQ3_XXS native pack, Windows). The boot probe still says direct ... (fine), and as you asked, STRATA_PLE_AUTO_MMAP / --ple-io mmap is what I forced to test the path that wedged before.

To get close to the original conditions (cold 27 GB table), I first read ~30 GB of unrelated files to evict the n-gram table from the file cache, then sent prompts with a unique salt so the engine logged 0 reused for each one:

prompt read (mapped, 0.1.43.1) tokens time rate
random 32K #1 33,420 11,429 ms 2,924 tok/s
random 32K #2 32,404 9,199 ms 3,522 tok/s
random 32K #3 33,372 11,337 ms 2,944 tok/s
random 70K 70,053 18,926 ms 3,702 tok/s

All four completed with the correct answers. Zero no progress / stall-report lines, no self-stop, no dump. For reference, direct on the same box: 31,456 tokens in 10,107 ms = 3,112 tok/s (32K) and 4,352 tok/s at 117K — so mapped is now within the same band as direct here, where before it was a 60 s watchdog stop at "layer 1 of the prompt chunk".

The four dumps from 0.1.42/0.1.43 are still kept in case you want them. Our config keeps --ple-io direct (it was the workaround; no need to change it now that the default keeps direct anyway). Quality is unchanged on our side: 32K needle 9/9, 120K needle 6/6, and our six greedy answers are byte-identical to 0.1.43.

Thanks for the root-cause writeup — the Windows half of it checks out.

<!-- gh-comment-id:6135439589 --> @jy02375437-max commented on GitHub (Oct 13, 2026): Upgraded to 0.1.43.1 (release `strata-windows-x64.zip`) and tested the mapped path on the same box as the original report (RTX 4090D 48 GB, 128 GB RAM, Gen4 x4, IQ3_XXS native pack, Windows). The boot probe still says `direct ... (fine)`, and as you asked, `STRATA_PLE_AUTO_MMAP` / `--ple-io mmap` is what I forced to test the path that wedged before. To get close to the original conditions (cold 27 GB table), I first read ~30 GB of unrelated files to evict the n-gram table from the file cache, then sent prompts with a unique salt so the engine logged `0 reused` for each one: | prompt read (mapped, 0.1.43.1) | tokens | time | rate | |---|---:|---:|---:| | random 32K #1 | 33,420 | 11,429 ms | 2,924 tok/s | | random 32K #2 | 32,404 | 9,199 ms | 3,522 tok/s | | random 32K #3 | 33,372 | 11,337 ms | 2,944 tok/s | | random 70K | 70,053 | 18,926 ms | 3,702 tok/s | All four completed with the correct answers. Zero `no progress` / stall-report lines, no self-stop, no dump. For reference, direct on the same box: 31,456 tokens in 10,107 ms = 3,112 tok/s (32K) and 4,352 tok/s at 117K — so mapped is now within the same band as direct here, where before it was a 60 s watchdog stop at "layer 1 of the prompt chunk". The four dumps from 0.1.42/0.1.43 are still kept in case you want them. Our config keeps `--ple-io direct` (it was the workaround; no need to change it now that the default keeps direct anyway). Quality is unchanged on our side: 32K needle 9/9, 120K needle 6/6, and our six greedy answers are byte-identical to 0.1.43. Thanks for the root-cause writeup — the Windows half of it checks out.
Author
Owner

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

Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta.

If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment /reopen. A check runs and reopens it.

<!-- gh-comment-id:6270744756 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta. If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment `/reopen`. A check runs and reopens it.
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#788
No description provided.