mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5414] [Engine] a long prompt stalls 60 s in "reading the prompt (batched)" - 9 times in 5,927 requests #3234
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#3234
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 @sxk5315 on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5414
Summary
On Windows with a two-GPU layer split, a long prompt sometimes stops making progress in
reading the prompt (batched)and the engine's own watchdog ends it after 60 s ("no progress for 60 s ... issue #29"). It has happened 9 times in 5,927 completed requests over 14 days of continuous use, always with 74K–118K tokens already read, and always with very little VRAM and a large part of the process paged out.Two of the nine are on 0.1.57, the rest on 0.1.54, so it is not new in either.
Environment
BUILD.json:commit 0bdcef4682c5, archs60,61,70,75,80,86,89, cuda 12.9)Engine arguments:
layer split autoputs CUDA0 then CUDA1 (K = 25 / 48 depending on the window). Startup reportsexpert cache 4329 slots, 8.26 GiB of VRAMand496 MiB of VRAM free with everything loaded(it warns that this is below its 1024 MiB line, and suggests--prefill auto:8192).The stall report (0.1.57, verbatim)
Nothing at all moves in those 60 s: the expert pool finished all 51 jobs, all 16 workers are asleep, and page faults grew by 1 in 2 s. So the host thread is parked on a wait, not computing.
Note for whoever reads this: the
verify window (last window, not the current stage)line is the previous request's window (position 131721 belongs to the 131,792-token request that completed just before). It says so itself. I first tookserved 25 / plan 25 / copies 25for the stall point — it is not, and it sent me down the--pipeline-windows/ drafter path for a day.positionnever advances across the two samples.The nine stalls
mtp draft: waiting for the GPU -1reading the prompt (batched)reading the prompt (batched)reading the prompt (batched)reading the prompt (batched)reading the prompt (batched)reading the prompt (batched)reading the prompt (batched)reading the prompt (batched)Rate: 9 / 5,927 requests = 0.15 %, or 9 / 3,706 requests with a prompt ≥ 70K tokens = 0.24 %.
Two constants across all nine:
VRAM free when this request beganis 1432–1672 MiB, i.e. just above the reserve. The engine itself calls 496 MiB free after loading a warning condition.The prompts themselves are mostly prompt-cache hits with a small tail read, which is the shape an agent turn has here:
So the common case is "reuse almost the whole prompt, read a few dozen new tokens". The
done up to tokenvalues above do not fall exactly on a reuse boundary of a completed request (only #5 is within 3 tokens of one, 86108), so I can't claim the stall is at the reuse→new-token handover; I have no token count for the stalled request itself since it never finished.Ruled out
--pipeline-windowswindow loop (generate.cpp,mtp.prefill(..., false)beside a stage-0 window). This stall's stage is named insrc/prefill/prefill.cppand that file contains nomtp.call at all (the only drafter prefill isgenerate.cpp:12423, guarded by!batched). #5149 also only addsserve_stage0_to_end()ingenerate.cppand is still open — 0.2.11 has no trace of it.Files
strata-stall-15084.dmp.gz — 274 KB, gzipped; the 0.1.57 stall #9 (73,895 of 73,902 tokens).
Two more exist from earlier stalls (
strata-stall-15264.dmp1.9 MB,strata-stall-3820.dmp423 KB); the rest are 0 bytes. Ask and I will attach those as well.What I am trying now
--pipeline-windows 2→0, to rule that flag in or out as a contributor (it is confounded: it was turned on the same day the engine went 0.1.44.1 → 0.1.52, and every stall since is on 0.1.52+). I'll report back with a day of data either way.If the intended answer is "lower
--prefillso the verify buffers don't fight the expert cache" or "this is the memory guard", tell me which knob you want measured and I'll run it — the machine is dedicated to this workload and I can hold a configuration for days.@github-actions[bot] commented on GitHub (Nov 6, 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:
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
@github-actions[bot] commented on GitHub (Nov 6, 2026):
Thanks, this follows the format now.
@undrtkr commented on GitHub (Nov 6, 2026):
@sxk5315
try --no-prefill-borrow
@sxk5315 commented on GitHub (Nov 7, 2026):
Tried it on 0.1.57, 2×V100-SXM2-16GB, IQ3_S (50 GB pack). It does remove the borrow/refill window, but prefill collapsed: a 77,396-token cold read went from 49 s (1,624 tok/s) to 503 s (154 tok/s), CUDA1 cache 3,667 → 2,812 slots. Too expensive for a 16 GB card with a 50 GB pack — the chunk shrinks and every chunk re-streams its experts. Reverted. I'll keep --pipeline-windows 0 for now and report whether the stall returns.
@udqe commented on GitHub (Nov 7, 2026):
Same bug class you were pointed away from, measured from the other side: on a fully-auto-filled 24 GB pair,
--no-prefill-borrowis not a workaround - it manufactures the #2065 paging condition this issue is about. Numbers, then the negative control.Our shape. 2x RTX 4090 (24 GB, sm_89) Windows 11, engine 0.1.57 throughout (quoted boots all
0.1.57-windows-x86_64-cuda), main engine with fixed--layer-split 22,--expert-cache auto --prefill auto(chunk 8192),--vram-reserve-mib 2048 --vram-reserve-later-mib 972 --pipeline-windows 2, two quant arms on the same box (UD-IQ4_XS-v31 and UD-Q4_K_XL). Both arms run the borrow - the boot line, IQ4 arm:Negative control first, because the denominator is comparable to yours: 9 stalls / 5,927 - we have 0 / 6,920. Three engine logs on this rig (IQ4 arm 380 requests, Q4 arm 6,508 + 32),
grep-equivalent over all of them forno progress for 60 s|stall reportandwatchdog|stopping the engine: zero occurrences in any. Long prompts run here (295K-token cold prefills at 75.5 s as the tuned benchmark), so the stage your watchdog names does get exercised. If the borrow path itself were the trigger, this box should have hit it by now.Then the offered test: one variable per boot,
--no-prefill-borrowadded, everything else identical, 24 GB cards. The plan changes at start-up in a way we did not expect:With nothing to borrow,
autostill fills the card - the cache lands at 6,440 / 6,391 slots (14.18 / 15.07 GiB) versus the borrow-enabled plan's 5,867 - and the prompt buffers have nowhere free to go.VRAM free with everything loadedreads 571 MiB (CUDA0), and two requests later the engine prints its own warning, twice:The same 324 MiB-start warning follows. So on 24 GB the flag does not "remove the borrow/refill window" cleanly - it moves the card into exactly the low-free state #2065 describes, which is the state your stall report is investigating.
The measured cost, same ladder both sides:
--no-prefill-borrowYour 16 GB collapse and ours agree in kind and roughly in magnitude: the flag trades prefill for a card that has no room left, and the slower the prompt, the longer the window where #2065 conditions exist. Where I would look next is not the borrow itself - both our arms run it continuously without a stall - but what is different before the borrow matters: your
--prefill auto:32768chunk on 16 GB cards, the mixed IQ3_S pool, and sm_70.If a 24 GB-class arm would help the bisect (borrow kept with a 32768 chunk, or borrow off with
--vram-reserve-mib 2560as the warning advises, one variable per boot), this box is set up to run either in a few minutes; the flag goes in and comes out of the config between boots.(ai-assisted; all lines quoted from this box's logs, boots timestamped in our notes; probe reverted, baseline config byte-restored)
@sxk5315 commented on GitHub (Nov 7, 2026):
Thanks — this is the strongest data point on the thread so far, and the negative control is exactly what was missing. It settles two things, I think one inference needs correcting for our box, and our logs add one line of evidence that narrows the bisect further.
What it settles
--no-prefill-borrowis not a workaround here either. We measured it on 2x V100 16 GB (engine 0.1.57, same--prefill auto:32768): a 77K cold prefill went from 49 s / 1,624 tok/s to 503 s / 154 tok/s (~10x), and we reverted it. Our boot line matches yours verbatim:the prompt path allocates its own buffers (too few cache slots to borrow)(strata-noborrow.log:58). Your 2.05x / 2.45x on 24 GB and our ~10x on 16 GB agree in kind; sm_70 / 16 GB / a 32K chunk just makes the penalty much worse. Your unchanged warm pool and needle suite also fit a prefill-path-only cost.The borrow itself is not the trigger. 0 stalls in 6,920 requests across two quant arms, including 295K cold prefills, is a solid negative control. We have nothing that contradicts it, and we have dropped the borrow from the list of suspects.
One correction: #2065 is not the state our stall happens in
The run in this issue is
strata-iq3_s-direct.json(borrow on,--ple-io direct,--vram-reserve-mib 1536,--max-context 262144). Its log contains zero occurrences ofWARNING: only N MiB of VRAM free at the start of this request. Boot lines:and the stall report itself prints
VRAM free when this request began: 1438 MiB. System RAM was ~65.9 GiB free under--ple-io direct(no 26.8 GiB PLE table pinned). So the stall occurs with both VRAM and RAM comfortably clear of the #2065 threshold. The 48#2065warnings in our olderstrata-iq3_s.logcome from earlier configs, not this run. I agree the flag pushes a 24 GB card into that state and your warning lines are a useful catch in general — but for this report it would send the bisect down the wrong path.What the stall report actually shows
The 60 s watchdog fires while nothing is busy (
strata-direct.log:100-105, 77,396-token prompt):7 tokens short of the end; every job done, every worker asleep, host idle for 223 s. That is a completion/synchronisation deadlock at the tail of a batched prefill, not slowness, paging or resource contention. Two other stalls in our logs name different stages but the same shape —
verify window: waiting for the GPU to finish the window (flags A/B/M raised) 4andmtp draft: waiting for the GPU -1— which points at a lost GPU→host completion signal rather than one stage's kernel. A 75K prompt also stalled at 75334/75339 with all 16 workers sleeping during a separate long-context run, after the conversation cache had accumulated 4.6-5.5 GB with evictions.Where your intuition is most useful:
--prefill auto:32768There is source support for why this is the first variable to test.
docs/DETAILS.md:1309-1314says the 32768 ceiling is automatic only on a single NVIDIA card of sm_80 or above, that a layer split keeps 8192, and that a RAM guard steps 32768 -> 16384 -> 8192 when RAM cannot cover the extra loan — but that--prefill N,auto:NandSTRATA_PREFILL_AUTO_MAXare never changed. Our box is sm_70, 2x16 GB in a layer split, with an explicitauto:32768: that overrides all three guards and runs a path the source designs for sm_80+ single cards.docs/DGX_SPARK_LINUX.md:43measures the automatic 8192 as only 2-6% slower on NVIDIA, so the cost of testing it is small. Mixed IQ3_S is the other difference you named; we have no A/B on that yet.On the 24 GB arm
Yes please, if you have the time — but the useful run is borrow kept with the chunk forced to 32768 (
--prefill auto:32768), since your bare--prefill autoon a layer split already resolves to 8192 and would not isolate our difference. One variable per boot, as you say. sm_89 + 24 GB may well not reproduce it; that result is useful too. I will run the complementary single-variable boot here (change onlyauto:32768->auto, repeat the 77K cold prefill) and post prefill tok/s and stall count.(ai-assisted; every quoted line is from this box's engine logs; the
docs/claims are static source reading, not measurements; the chunk A/B has not been run yet.)