mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[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
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#786
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 @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):--vision--vision,--vram-reserve-mib 450The 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
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.
ships.
--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(+--visionin the vision runs). 3,585 cache slotswithout vision, 2,934 with it.
(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):
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
serve/server.py(the same 15,866tokens 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.@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 mmapmode 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 mmapby 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=1restores the 0.1.42 behaviour). Until then, pin--ple-io directin the engine arguments (or--ple-io ramif 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.
@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:
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.PLE direct read probe: 35,000-69,000 rows/s (fine).0.1.43.1 with
--ple-io mmapforced. 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.--ple-io mmap--ple-io mmapWith 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.
@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.
@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 mmapexplicitly 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 16384for 61 s, 0 layers served. Thread stacks written tostrata-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/184750508b5dbabf523683ca34d57d24What 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 underramwould mean the 0.1.43.1 mmap fix does not cover this path on this machine.