mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[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
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#788
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.pynative pack) the engine self-stopped four times with--ple-io mmap— three times in a--mmap-expertssession, 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 directin the config restored normal service (32K needles 9/9, repeated).What those sessions logged at boot
What happened next (arena-mode session, a 32K prompt)
server.pyrestarted the engine; clients saw HTTP 503 while that happened. The stopped engine was left with a7.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:
direct measures slow here (11812 rows/s)→using --ple-io mmap insteadno progress for 60 s→ self-stop →strata-stall-3644.dmpPLE direct read probe: 42898 rows/s (fine)The three earlier stalls were in a
--mmap-expertssession (GGUF in place, noexperts.bin) whose log alsoshows the auto-switch to
--ple-io mmap: dumpsstrata-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 fourdumps 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 completesrather 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 directin the config: with--ple-iogiven explicitly the probe onlywarns (
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 ramis the other candidate; I measured it onthis 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.
@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=1brings the 0.1.42 switch back.Until then your workaround is the right one:
--ple-io directin 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 withSTRATA_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.
@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 saysdirect ... (fine), and as you asked,STRATA_PLE_AUTO_MMAP/--ple-io mmapis 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 reusedfor each one: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.
@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.