mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5104] [Engine] Single-GPU layer-major prefill aborts on a 3.4K-token prompt: "could not copy experts 260.. of layer 24" (RTX 2070 8 GB, Coder IQ1_M) #2385
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#2385
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 @ballpin13 on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5104
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Terminal (the
stratacommand)What happened
On a single 8 GB card, Coder IQ1_M aborts while reading a prompt of about 3,400 tokens. Short prompts work. The "small expert cache" rule turns on the layer-major walk for prompts of two chunks or more, and the crash follows that path.
The stager asks for an expert id above the model's range. The pack has
n_expert 256, so valid ids are 0-255:The server then reports:
Exit code -6 fits the
std::abort()after that line insrc/prefill/prefill.cpp, so the "running out of RAM" hint looks misleading here.dmesgshows no OOM kill, and about 23 GiB of RAM was available.Expected: the prompt is read, slowly if it has to be.
Results
STRATA_ROUTE_PRIOR=1.5,STRATA_ROUTE_TAIL_SKIP=0STRATA_SSD_GBPS=2.5STRATA_PREFILL_LAYER_MAJOR=0,STRATA_SSD_GBPS=2.5STRATA_PREFILL_LAYER_MAJOR=0,STRATA_SSD_GBPS=2.5, 8K contextWorkaround:
--set STRATA_PREFILL_LAYER_MAJOR=0. The prompts then finish, at 4.8-11.2 tok/s. I did not run 8K with layer-major on, orSTRATA_PF_SMALL=0.Smallest steps or command that reproduce it
Then send this prompt to
/v1/chat/completionswithmax_tokens30,seed42 andenable_thinkingfalse. It is synthetic and comes to 3,393 tokens:In the last run the request got HTTP 503 after 19 s, and the log had the abort line.
I have since removed this model from the PC, so I can't easily run more tests on it.
Reproduction status
Reproduced locally
Strata version
strata 0.2.10 (build 0.1.56), engine
0.1.56-linux-x86_64-cuda-cuda13Graphics card, memory and system
RTX 2070 8 GB (driver 621.01), i9-9900K (AVX2), 32 GB DDR4 (WSL limit 28 GB), Windows 11 build 26200, WSL 2.6.1, kernel 6.6.87.2, ext4 VHDX on NVMe
Model, size and settings
Qwen3.8-Flash-Next Coder IQ1_M, 32K context, pictures off,
--parallel 1Logs
Engine arguments, with the data folder shortened:
Startup lines that seem relevant:
Unconfirmed static analysis (not an observed failure)
I read the source at
ffa80d7, which may not match the 0.1.56 engine exactly, and did not find the cause.FileExpertSource::copy_blobsandcopy_blobreturn false whene >= n_expert_, which fits the ids above.lm_prefetchonly builds jobs withefrom 0 toNE - 1, so an id of 256 or more should not come from there ifNEis 256. I did not confirm the value ofNEat runtime, or whether the stager read a stale or overwritten job.Prepared with an AI assistant (Claude Code). The runs and log lines are real.
@acmebiella-spec commented on GitHub (Nov 4, 2026):
The same abort on a second machine (native Linux, not WSL), and the
STRATA_PREFILL_LAYER_MAJOR=0workaround confirmed there.Environment: strata 0.2.10 (build 0.1.56), engine
0.1.56-linux-x86_64-cuda-cuda13, installed with the Terminal. Ubuntu 26.04.1, kernel 7.0.0-42, NVIDIA driver 595.91 (server, open). RTX 4060 8 GB on PCIe 3.0 x8, 2x Xeon E5-2620 v3 (AVX2, two NUMA nodes), 39 GiB RAM, NVMe SSD. Coder IQ1_M, 128K context, pictures on (CPU reader).What happened: prompts of 53 to 95 tokens are answered. Every prompt of 3,349 tokens or more aborts the engine (exit code -6), the request gets HTTP 503, and the server starts the engine again.
dmesgshows no OOM kill. Here the id is always256.. of layer 0(12 lines in 3 launches), where your log has layers 24 and 25:STRATA_PREFILL_CPU_SHARE=0STRATA_PREFILL_CPU_SHARE=auto,--adapt-decay 0.9STRATA_PREFILL_LAYER_MAJOR=0With
STRATA_PREFILL_LAYER_MAJOR=0the start line drops the layer-major part ("so prompts read with the unfused experts (chunk 768 tokens)"), and the prompts are read: 3,349 tokens in 14.0 s (239.5 and 239.6 tok/s, two runs), 6,500 tokens in 26.3 s (246.8 tok/s). Decode after them was 23.8 to 25.7 tok/s.On the same machine the 512-expert packs read the same prompts with the layer-major walk on and never aborted: IQ3_S (512-token chunks, many runs) and Q2_0 (3,072-token chunks, 2 and 3 chunks). Only the 256-expert Coder pack aborts here.
Reproduce (my steps):
Then one request to
/v1/chat/completionswithtemperature0 andmax_tokens192. The message is the first 15,000 characters of the GPL-3 text (/usr/share/common-licenses/GPL-3on Ubuntu) followed by "Riassumi in italiano, in 5 punti, il testo qui sopra." It comes to 3,349 prompt tokens.Not tested:
STRATA_PF_SMALL=0; prompts between 768 and 3,349 tokens, so I can't say whether two chunks are enough to trigger it.Reproduction status: reproduced locally.
Prepared with an AI assistant (Claude Code). The runs and log lines are real.
@Norhiro commented on GitHub (Nov 4, 2026):
A data point for the "only the 256-expert pack" question: a 512-expert pack on one 12 GB card took the small-card walk without an abort.
expert cache 884 slots, 2.57 GiB of VRAM, thensmall expert cache: the default prompt path would read in chunks of 4096 tokens (under 8192), so prompts read with the unfused experts and, from two chunks, the layer-major walk (chunk 4096 tokens).STRATA_PREFILL_LAYER_MAJOR=0.could not copy expertsline, no abort.So, like the IQ3_S and Q2_0 runs above, the 512-expert path works here. I have no Coder pack, so I could not try the 256-expert case.
@Bingkool commented on GitHub (Nov 5, 2026):
Root cause confirmed: the layer-major path uses a compile-time
NE = 512as the model's expert count, notg.n_expert.I hit the same abort on Windows with the Coder IQ1_M pack (48 layers,
n_expert 256) and traced it in the 0.2.10 source tree (the installed 0.2.11 app ships engine 0.1.57; its log behavior is identical). Line numbers below are from 0.2.10.Where it happens
src/prefill/prefill.cpp:207The layer-major path uses
NEas the model's expert count:prefill.cpp:6753—std::vector<int> pf_job((size_t) NE, -1);prefill.cpp:6762-6763—for (int32_t e = 0; e < NE; ++e) { ... m.host_res[(size_t) l * NE + e] ... }— it builds prefetch jobs for experts 256..511 even when the pack has 256.prefill.cpp:6805-6821—cnt,off,uniq,job_ofand the resident test all useNE.generate.cpp:9068allocateshost_resasg.n_layers * g.n_expert(48 x 256 = 12,288), but the layer-major path indexes it withl * NE + e: withNE = 512this reads the wrong layer's slots forl >= 1, and past the end forl >= 24.The stager then rejects the phantom job:
src/core/expert_source.cpp:3419—copy_blobsreturns false whene >= n_expert_prefill.cpp:757-759— printsprefill: the expert source could not copy experts %d.. of layer %dand callsstd::abort()It is a race:
prefill.cpp:6822-6823marks prefetched-but-unrouted jobs withskip(), but a stager thread may claim one and copy it before the skip lands. That explains the intermittency: the same pack read a 6,911-token prompt successfully once, while repeated sessions abort.A 512-expert pack is unaffected because every job has
e < NE == n_expert, socopy_blobsaccepts it. This matches the IQ3_S / Q2_0 data points already in this issue.My data point
Windows 11 build 26300, RTX 3080 Ti 12 GB (driver 621.14), Strata app 0.2.11, engine
0.1.57-windows-x86_64-cuda-cuda13, control 0.1.57 (c3b3f50).n_expert 256, profile 12,288 pairs (48 x 256)expert cache 887 slots,prompt chunk auto: 2048 tokens, small-cache rule on, layer-major walk3221226505=0xC0000409(STATUS_STACK_BUFFER_OVERRUN, the MSVC fail-fast fromabort()); the app reports "the engine stopped unexpectedly (exit code 3221226505)" and unloads the modelbase_failed/NO_TOKENS/ "engine stopped unexpectedly (exit code 3221226505)"STRATA_PREFILL_LAYER_MAJOR=0in the model's engine environment, a 4,199-token prompt completes (1,133 tok/s prefill, 1 token generated, exit 0) and no abortn_expert 512) on the same PC: layer-major on, a 6,910-token prompt read at 411.2 tok/s, no abortSuggested fix
Use
g.n_expertin the layer-major path instead ofNE:pf_jobsize and the prefetch loop boundhost_resstride (l * g.n_expert + e) and everyl * NE + einlm_expertscnt/off/uniq/job_ofsizes and loopsOr, as a smaller immediate change, gate the layer-major walk on
n_expert == NEand say why in the log until the path is generalized. (OtherNE-sized per-expert buffers in the layer-split path may be worth auditing too.)Workaround confirmed here as well:
STRATA_PREFILL_LAYER_MAJOR=0.@GruenSein commented on GitHub (Nov 5, 2026):
Can confirm the same issue on RTX 2000 Ada mobile with 8GB
@satwareAG-ironMike commented on GitHub (Nov 7, 2026):
Second machine, same abort - RTX 3060 12 GB (sm_86), engine 0.1.56 (serve layer v0.2.12), ISTA-DASLab Qwen3.8-Flash-Next-GSQ-RCO-Coder IQ1_M (sha256-verified shards, pack built with tools/iq_pack.py):
prefill: the expert source could not copy experts 259.. of layer 0.STRATA_KVA=0,STRATA_ROUTE_PRIOR=0,--expert-cache 900(1172 slots / 2.23 GiB),--max-context 131072,--spec 4 --mtp mtp/rt --kv k8v4, 1694 MiB VRAM free at boot - nothing RAM/VRAM related (58 GiB host available).--expert-cache 1200+ 196K envelope OOMs the prompt path (50 MiB free; the budget bytes follow the 2.66 MB largest blob), andverifyrefuses to start without--expert-profile(the IQ3 profile is grid-rejected48x512 vs 48x256; a neutralmake_profile.py --no-base --n-expert 256file boots it clean).Context: this is the Coder-117B arm of our Qwen optimization milestone (own tracker: faster_llama #74). Until this is fixed, Coder IQ1_M on any single <=12 GB card cannot pass a first long prompt, so coding-quality evaluation is unreachable.