mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #997] 0.1.39: engine exits (code 1) with "parallel": 4 on UD-IQ4_XS, RTX 3090 24 GB, three concurrent 8K prompts (reproducible; IQ3_S unaffected) #439
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#439
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 @cardosofelipe on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/997
Summary: with
"parallel": 4, UD-IQ4_XS on a 24 GB RTX 3090 exits with code 1 (no error line) when three 8K-token prompts are read concurrently. Reproduced 2/2, at the same point both times. IQ3_S with the identical test and"parallel": 4never failed (2 × 21/21 requests).Environment
6f32ec07), Linux build (Fedora 44, kernel 6.19.10), CUDA 13.3, driver 595.80--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.70 --mtp <rt> --max-context 32768 --kv int8 --resident-budget-gib 55 --pcie-frac 0.20(the second run; the first used defaults--spec-min-p 0.5, no--pcie-frac, same result),"parallel": 4--batch: 4 slot sessions on CUDA0 (0.56 GiB each); 15.89 GiB free, then360 MiB of VRAM free with everything loadedReproduction
OpenAI streaming chat completions, unique ~8,150-token prompts,
max_tokens512, reasoning on. Concurrency ladder 1 → 2 → 3, three waves per level:slot 1 takes 8151 tokens,slot 2 takes 8152 tokens, prompt reads at ~1,860–1,885 tok/s). Each had generated 2–4 tokens when the engine exited.Log at failure
All three in-flight requests failed (
done: 1/2/4 tokens in 23 s (error, cancel=False)). The engine log has no traceback, CUDA error or out-of-memory message.Possibly related: #511 / #535 (stalls with very little free VRAM). Here 360 MiB was free after loading. I haven't tried a larger
--vram-reserve-mibyet; that would be my next test if useful.Happy to provide full engine/server logs or run a debug build.
@ischencheng commented on GitHub (Oct 5, 2026):
About the missing error line: a failed batch window prints its reason only as an
ERRline on the engine's stdout, and with all three requests decoding in slots nobody reads it, so the server falls back to the laststrataline in the log. #998 makes the server window show thatERRline. It only touches serve/server.py, so you can try it without rebuilding the engine; the line should say which step of the window failed.@Jackwwg83 commented on GitHub (Oct 6, 2026):
We hit what looks like the same failure on a 48 GB card, and the hidden error line was visible in our server log. It is
verify: batch instantiate: out of memory.Setup
6f32ec0), Linux, RTX PRO 5000 Blackwell 48 GB (PCIe 5.0 x16), Threadripper PRO 9955WX."parallel": 8,--max-context 131072 --kv-resident 32768 --conversation-cache-mib 8192 --conversation-cache-slots 16 --pool-workers 5,--expert-cache auto, a custom expert profile.--batch 8: the slot sessions take 5.82 GiB,expert cache 18124 slots, 34.37 GiB, then379 MiB of VRAM free with everything loaded. The engine captured the 1- to 6-token windows at startup.What happens
When 7 or 8 slots decode together, the server prints:
Every request in the batch fails, and the engine restarts.
We reproduced it three ways (streaming chat completions):
Workaround that worked:
--vram-reserve-mib 1700(1 GB more than the default 700). After that, no batch-window failure came back: 1K, 32K and 120K prompts with 8 and 10 requests at once, and the 10-user replay. A few 120K requests got HTTP 400 because our client made them longer than the context; that is a separate thing.So the automatic expert cache seems to leave too little VRAM for the batch-window graphs that are first needed at runtime (7-8 rows here, maybe fewer rows with the larger UD-IQ4_XS buffers in this issue). Two possible fixes: reserve room for a
--batch-row window when sizing the cache, or capture every window size up to--batchat startup.@ischencheng commented on GitHub (Oct 6, 2026):
@Jackwwg83 thanks, that ERR line was the key. Each set of slots that decodes together keeps its own graph pair (20-30 MiB each on an L40S), so with 8 slots the cache's last few hundred MiB run out. #1185 frees the least recently used ones when an instantiate hits OOM; on an L40S with ~440 MiB free it went from 8 engine restarts in 7 minutes to none.
@Jackwwg83 commented on GitHub (Oct 7, 2026):
Root cause, as far as we can tell, and a fix.
Every slot layout of a batch window (which slots are in it, how many rows) captures its own CUDA graph pair (
exec_bm_/commit_bm_in src/core/verify.cpp). The pairs are never freed:set_batch_graph_limit(64)is set only with--batch-mtp("0.1.39 keeps all"). As users start and end, new layouts keep coming (8 slots: up to 255), each pair holds VRAM, and the nextcudaGraphInstantiatefails:verify: batch instantiate: out of memory, and the engine exits.Measured on an RTX PRO 5000 48 GB (PCIe 5.0), IQ3_S,
"parallel": 8,--vram-reserve-mib 1700, a 10-minute replay of a multi-user agent workload:--vram-reserve-mibonly delays it.With 4 slots there are only 15 layouts, which is why it is rare; on a card with little VRAM left after the expert cache (like the 24 GB card in this issue) it is enough.
Our fix (verify.cpp, verify.hpp, generate.cpp):
--batch-mtplimit, for every run.STRATA_BATCH_GRAPHSoverrides it (0: no limit).cudaErrorMemoryAllocation, the least recently used half of the pairs is freed (never the layout being captured;cs_is synchronized first) and the instantiation is tried again.With the fix, the same replays at 5, 8, 10, 12 and 15 users ran 10 minutes each with 0 engine stops. With no limit (
STRATA_BATCH_GRAPHS=0), 8 users for 5 minutes: the fallback freed graphs 2 times and the engine went on.The patch (against our 0.1.40-based tree; the hunks touch only the batch graph cache)
@Niko1221 commented on GitHub (Oct 7, 2026):
A window graph that finds no VRAM now frees the graphs of the least recently used batch slot layouts and tries again, instead of exiting (PR #1185 by ischencheng, in 0.1.40.2 with authorship kept); the start prints how many were freed. An exit with code 1 also names its reason since 0.1.40.1 (#998). Please retest parallel 4 to 8 on your L40S and the smaller card. If it still runs out, try a bigger --vram-reserve-mib and send the log.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.