[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

Open
opened 2026-11-04 01:58:52 +07:00 by bsakaguchi · 5 comments
Owner

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 strata command)

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:

prefill: the expert source could not copy experts 260.. of layer 24
prefill: the expert source could not copy experts 364.. of layer 24
prefill: the expert source could not copy experts 256.. of layer 25
prefill: the expert source could not copy experts 268.. of layer 24
prefill: the expert source could not copy experts 260.. of layer 24

The server then reports:

[strata] the engine stopped unexpectedly (exit code -6). The usual cause is running out of RAM: ...
[strata] the engine had stopped (exit code -6); starting it again (a minute or two) ...

Exit code -6 fits the std::abort() after that line in src/prefill/prefill.cpp, so the "running out of RAM" hint looks misleading here. dmesg shows no OOM kill, and about 23 GiB of RAM was available.

Expected: the prompt is read, slowly if it has to be.

Results

Settings (all 32K unless noted) Long prompts Crashes
Defaults 2 2
STRATA_ROUTE_PRIOR=1.5, STRATA_ROUTE_TAIL_SKIP=0 2 2
STRATA_SSD_GBPS=2.5 1 1
STRATA_PREFILL_LAYER_MAJOR=0, STRATA_SSD_GBPS=2.5 2 0
STRATA_PREFILL_LAYER_MAJOR=0, STRATA_SSD_GBPS=2.5, 8K context 2 0

Workaround: --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, or STRATA_PF_SMALL=0.

Smallest steps or command that reproduce it

strata launch --family coder --model IQ1_M --parallel 1 --vision off --tune skip \
  --access local --port 8080 --yes --no-tui --restart --context 32k

Then send this prompt to /v1/chat/completions with max_tokens 30, seed 42 and enable_thinking false. It is synthetic and comes to 3,393 tokens:

ctx = "\n".join(f"Rad {i}: Lagret i Borås tog emot {i*7%113} pallar och skickade {i*11%97} pallar." for i in range(1, 121))
prompt = ctx + "\n\nVilken rad har flest mottagna pallar? Svara kort på svenska."

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-cuda13

Graphics 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 1

Logs

Engine arguments, with the data folder shortened:

strata --serve --pack <data>/packs/coder-iq1_m --native <data>/models/coder-IQ1_M/Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00001-of-00002.gguf --ple-gguf <data>/models/coder-IQ1_M/Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00002-of-00002.gguf --expert-profile <terminal>/data/expert-profile-coder.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <data>/mtp/rt --max-context 32768 --kv int8 --mmap-experts --kv-resident 20480

Startup lines that seem relevant:

strata generate: experts via mmap (--mmap-experts; the A/B arm of R2.1)
strata generate: expert cache auto: 1.34 GiB free, 700 MiB reserved (+220 MiB for the draft head) -> 177 slots
strata generate: short of GPU memory: the cache (177 slots) is too small to lend the prompt path 256-token buffers and keep 278 more: the loan keeps 16, prompts are read in smaller chunks, expect them to be slower
strata generate: expert cache 226 slots, 0.44 GiB of VRAM
strata serve: small expert cache: the default prompt path would read in chunks of 256 tokens (under 8192), so prompts read with the unfused experts and, from two chunks, the layer-major walk (chunk 256 tokens)
strata: prefill plan: chunk 256, ring 8 kept: file set 23.7 GiB does not fit the page cache 22.9 GiB
strata serve: prompt chunk auto: 256 tokens, a 8-slot ring

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_blobs and copy_blob return false when e >= n_expert_, which fits the ids above.
  • lm_prefetch only builds jobs with e from 0 to NE - 1, so an id of 256 or more should not come from there if NE is 256. I did not confirm the value of NE at runtime, or whether the stager read a stale or overwritten job.
  • #4695 added the job form that hands the copy to the source. It may be related, but that report has a different error on Windows with a layer split.

Prepared with an AI assistant (Claude Code). The runs and log lines are real.

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 `strata` command) ### 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: ```text prefill: the expert source could not copy experts 260.. of layer 24 prefill: the expert source could not copy experts 364.. of layer 24 prefill: the expert source could not copy experts 256.. of layer 25 prefill: the expert source could not copy experts 268.. of layer 24 prefill: the expert source could not copy experts 260.. of layer 24 ``` The server then reports: ```text [strata] the engine stopped unexpectedly (exit code -6). The usual cause is running out of RAM: ... [strata] the engine had stopped (exit code -6); starting it again (a minute or two) ... ``` Exit code -6 fits the `std::abort()` after that line in `src/prefill/prefill.cpp`, so the "running out of RAM" hint looks misleading here. `dmesg` shows no OOM kill, and about 23 GiB of RAM was available. Expected: the prompt is read, slowly if it has to be. ### Results | Settings (all 32K unless noted) | Long prompts | Crashes | | --- | --- | --- | | Defaults | 2 | 2 | | `STRATA_ROUTE_PRIOR=1.5`, `STRATA_ROUTE_TAIL_SKIP=0` | 2 | 2 | | `STRATA_SSD_GBPS=2.5` | 1 | 1 | | `STRATA_PREFILL_LAYER_MAJOR=0`, `STRATA_SSD_GBPS=2.5` | 2 | 0 | | `STRATA_PREFILL_LAYER_MAJOR=0`, `STRATA_SSD_GBPS=2.5`, 8K context | 2 | 0 | **Workaround:** `--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, or `STRATA_PF_SMALL=0`. ### Smallest steps or command that reproduce it ```bash strata launch --family coder --model IQ1_M --parallel 1 --vision off --tune skip \ --access local --port 8080 --yes --no-tui --restart --context 32k ``` Then send this prompt to `/v1/chat/completions` with `max_tokens` 30, `seed` 42 and `enable_thinking` false. It is synthetic and comes to 3,393 tokens: ```python ctx = "\n".join(f"Rad {i}: Lagret i Borås tog emot {i*7%113} pallar och skickade {i*11%97} pallar." for i in range(1, 121)) prompt = ctx + "\n\nVilken rad har flest mottagna pallar? Svara kort på svenska." ``` 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-cuda13` ### Graphics 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 1` ### Logs Engine arguments, with the data folder shortened: ```text strata --serve --pack <data>/packs/coder-iq1_m --native <data>/models/coder-IQ1_M/Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00001-of-00002.gguf --ple-gguf <data>/models/coder-IQ1_M/Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00002-of-00002.gguf --expert-profile <terminal>/data/expert-profile-coder.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <data>/mtp/rt --max-context 32768 --kv int8 --mmap-experts --kv-resident 20480 ``` Startup lines that seem relevant: ```text strata generate: experts via mmap (--mmap-experts; the A/B arm of R2.1) strata generate: expert cache auto: 1.34 GiB free, 700 MiB reserved (+220 MiB for the draft head) -> 177 slots strata generate: short of GPU memory: the cache (177 slots) is too small to lend the prompt path 256-token buffers and keep 278 more: the loan keeps 16, prompts are read in smaller chunks, expect them to be slower strata generate: expert cache 226 slots, 0.44 GiB of VRAM strata serve: small expert cache: the default prompt path would read in chunks of 256 tokens (under 8192), so prompts read with the unfused experts and, from two chunks, the layer-major walk (chunk 256 tokens) strata: prefill plan: chunk 256, ring 8 kept: file set 23.7 GiB does not fit the page cache 22.9 GiB strata serve: prompt chunk auto: 256 tokens, a 8-slot ring ``` ### 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_blobs` and `copy_blob` return false when `e >= n_expert_`, which fits the ids above. - `lm_prefetch` only builds jobs with `e` from 0 to `NE - 1`, so an id of 256 or more should not come from there if `NE` is 256. I did not confirm the value of `NE` at runtime, or whether the stager read a stale or overwritten job. - #4695 added the job form that hands the copy to the source. It may be related, but that report has a different error on Windows with a layer split. Prepared with an AI assistant (Claude Code). The runs and log lines are real.
Author
Owner

@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=0 workaround 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. dmesg shows no OOM kill. Here the id is always 256.. of layer 0 (12 lines in 3 launches), where your log has layers 24 and 25:

strata generate: expert cache 465 slots, 0.90 GiB of VRAM; policy is
strata serve: small expert cache: the default prompt path would read in chunks of 768 tokens (under 8192), so prompts read with the unfused experts and, from two chunks, the layer-major walk (chunk 768 tokens); STRATA_PF_SMALL=0 keeps the default path, STRATA_PF_FUSED / STRATA_PREFILL_LAYER_MAJOR set by hand win
strata serve: prompt chunk auto: 768 tokens, a 8-slot ring
prefill: the expert source could not copy experts 256.. of layer 0
[strata] the engine stopped unexpectedly (exit code -6). The usual cause is running out of RAM: ...
[strata] the engine had stopped (exit code -6); starting it again (a minute or two) ...
Settings (one launch each) Long prompts sent (3,349 and 6,500 tokens) Read Aborts
Defaults 4 0 4
STRATA_PREFILL_CPU_SHARE=0 4 0 4
STRATA_PREFILL_CPU_SHARE=auto, --adapt-decay 0.9 4 0 4
STRATA_PREFILL_LAYER_MAJOR=0 4 4 0

With STRATA_PREFILL_LAYER_MAJOR=0 the 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):

strata launch --family coder --model iq1_m --access local --port 8080 --yes --no-tui

Then one request to /v1/chat/completions with temperature 0 and max_tokens 192. The message is the first 15,000 characters of the GPL-3 text (/usr/share/common-licenses/GPL-3 on 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.

<!-- gh-comment-id:6624815333 --> @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=0` workaround 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. `dmesg` shows no OOM kill. Here the id is always `256.. of layer 0` (12 lines in 3 launches), where your log has layers 24 and 25: ```text strata generate: expert cache 465 slots, 0.90 GiB of VRAM; policy is strata serve: small expert cache: the default prompt path would read in chunks of 768 tokens (under 8192), so prompts read with the unfused experts and, from two chunks, the layer-major walk (chunk 768 tokens); STRATA_PF_SMALL=0 keeps the default path, STRATA_PF_FUSED / STRATA_PREFILL_LAYER_MAJOR set by hand win strata serve: prompt chunk auto: 768 tokens, a 8-slot ring prefill: the expert source could not copy experts 256.. of layer 0 [strata] the engine stopped unexpectedly (exit code -6). The usual cause is running out of RAM: ... [strata] the engine had stopped (exit code -6); starting it again (a minute or two) ... ``` | Settings (one launch each) | Long prompts sent (3,349 and 6,500 tokens) | Read | Aborts | | --- | ---: | ---: | --- | | Defaults | 4 | 0 | 4 | | `STRATA_PREFILL_CPU_SHARE=0` | 4 | 0 | 4 | | `STRATA_PREFILL_CPU_SHARE=auto`, `--adapt-decay 0.9` | 4 | 0 | 4 | | `STRATA_PREFILL_LAYER_MAJOR=0` | 4 | 4 | 0 | With `STRATA_PREFILL_LAYER_MAJOR=0` the 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):** ```bash strata launch --family coder --model iq1_m --access local --port 8080 --yes --no-tui ``` Then one request to `/v1/chat/completions` with `temperature` 0 and `max_tokens` 192. The message is the first 15,000 characters of the GPL-3 text (`/usr/share/common-licenses/GPL-3` on 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.
Author
Owner

@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.

  • Setup: strata 0.2.10 (engine 0.1.56, source build), Fedora 44.
    • RTX 3060 12 GB alone, i7-7800X, 125 GiB RAM.
    • Qwen3.8-Flash-Next UD-Q4_K_XL, native, 65K context, MTP.
  • The engine's choice: expert cache 884 slots, 2.57 GiB of VRAM, then small 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).
  • Prompts: 12.8K-31.6K tokens, 6 with the default and 6 with STRATA_PREFILL_LAYER_MAJOR=0.
    • Every default prompt ran the walk (2-4 super-chunks of up to 8192).
    • No could not copy experts line, no abort.
    • A needle in the middle of the document was answered correctly with the walk on.

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.

<!-- gh-comment-id:6642265776 --> @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. - **Setup:** strata 0.2.10 (engine 0.1.56, source build), Fedora 44. - RTX 3060 12 GB alone, i7-7800X, 125 GiB RAM. - Qwen3.8-Flash-Next UD-Q4_K_XL, native, 65K context, MTP. - **The engine's choice:** `expert cache 884 slots, 2.57 GiB of VRAM`, then `small 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)`. - **Prompts:** 12.8K-31.6K tokens, 6 with the default and 6 with `STRATA_PREFILL_LAYER_MAJOR=0`. - Every default prompt ran the walk (2-4 super-chunks of up to 8192). - No `could not copy experts` line, no abort. - A needle in the middle of the document was answered correctly with the walk on. 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.
Author
Owner

@Bingkool commented on GitHub (Nov 5, 2026):

Root cause confirmed: the layer-major path uses a compile-time NE = 512 as the model's expert count, not g.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:207

constexpr int64_t N = 2560, HC = 4, D = N * HC, LR = 320, K = 10, NE = 512;

The layer-major path uses NE as 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_of and the resident test all use NE.
  • generate.cpp:9068 allocates host_res as g.n_layers * g.n_expert (48 x 256 = 12,288), but the layer-major path indexes it with l * NE + e: with NE = 512 this reads the wrong layer's slots for l >= 1, and past the end for l >= 24.

The stager then rejects the phantom job:

  • src/core/expert_source.cpp:3419 — copy_blobs returns false when e >= n_expert_
  • prefill.cpp:757-759 — prints prefill: the expert source could not copy experts %d.. of layer %d and calls std::abort()

It is a race: prefill.cpp:6822-6823 marks prefetched-but-unrouted jobs with skip(), 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, so copy_blobs accepts 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).

  • Coder IQ1_M native pack: 48 layers, 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 walk
  • a 53-token request was answered; the abort lines follow it in the log:
prefill: the expert source could not copy experts 256.. of layer 0
prefill: the expert source could not copy experts 257.. of layer 0
prefill: the expert source could not copy experts 258.. of layer 0
prefill: the expert source could not copy experts 259.. of layer 0
  • engine exit 3221226505 = 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN, the MSVC fail-fast from abort()); the app reports "the engine stopped unexpectedly (exit code 3221226505)" and unloads the model
  • autotune fails the same way: base_failed / NO_TOKENS / "engine stopped unexpectedly (exit code 3221226505)"
  • with STRATA_PREFILL_LAYER_MAJOR=0 in the model's engine environment, a 4,199-token prompt completes (1,133 tok/s prefill, 1 token generated, exit 0) and no abort
  • IQ3_S (48 layers, n_expert 512) on the same PC: layer-major on, a 6,910-token prompt read at 411.2 tok/s, no abort

Suggested fix

Use g.n_expert in the layer-major path instead of NE:

  • the pf_job size and the prefetch loop bound
  • the host_res stride (l * g.n_expert + e) and every l * NE + e in lm_experts
  • the cnt / off / uniq / job_of sizes and loops

Or, as a smaller immediate change, gate the layer-major walk on n_expert == NE and say why in the log until the path is generalized. (Other NE-sized per-expert buffers in the layer-split path may be worth auditing too.)

Workaround confirmed here as well: STRATA_PREFILL_LAYER_MAJOR=0.

<!-- gh-comment-id:6660931162 --> @Bingkool commented on GitHub (Nov 5, 2026): Root cause confirmed: the layer-major path uses a compile-time `NE = 512` as the model's expert count, not `g.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:207` ```cpp constexpr int64_t N = 2560, HC = 4, D = N * HC, LR = 320, K = 10, NE = 512; ``` The layer-major path uses `NE` as 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_of` and the resident test all use `NE`. - `generate.cpp:9068` allocates `host_res` as `g.n_layers * g.n_expert` (48 x 256 = 12,288), but the layer-major path indexes it with `l * NE + e`: with `NE = 512` this reads the wrong layer's slots for `l >= 1`, and past the end for `l >= 24`. The stager then rejects the phantom job: - `src/core/expert_source.cpp:3419` — `copy_blobs` returns false when `e >= n_expert_` - `prefill.cpp:757-759` — prints `prefill: the expert source could not copy experts %d.. of layer %d` and calls `std::abort()` It is a race: `prefill.cpp:6822-6823` marks prefetched-but-unrouted jobs with `skip()`, 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`, so `copy_blobs` accepts 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). - Coder IQ1_M native pack: 48 layers, `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 walk - a 53-token request was answered; the abort lines follow it in the log: ```text prefill: the expert source could not copy experts 256.. of layer 0 prefill: the expert source could not copy experts 257.. of layer 0 prefill: the expert source could not copy experts 258.. of layer 0 prefill: the expert source could not copy experts 259.. of layer 0 ``` - engine exit `3221226505` = `0xC0000409` (`STATUS_STACK_BUFFER_OVERRUN`, the MSVC fail-fast from `abort()`); the app reports "the engine stopped unexpectedly (exit code 3221226505)" and unloads the model - autotune fails the same way: `base_failed` / `NO_TOKENS` / "engine stopped unexpectedly (exit code 3221226505)" - with `STRATA_PREFILL_LAYER_MAJOR=0` in the model's engine environment, a 4,199-token prompt completes (1,133 tok/s prefill, 1 token generated, exit 0) and no abort - IQ3_S (48 layers, `n_expert 512`) on the same PC: layer-major on, a 6,910-token prompt read at 411.2 tok/s, no abort ### Suggested fix Use `g.n_expert` in the layer-major path instead of `NE`: - the `pf_job` size and the prefetch loop bound - the `host_res` stride (`l * g.n_expert + e`) and every `l * NE + e` in `lm_experts` - the `cnt` / `off` / `uniq` / `job_of` sizes and loops Or, as a smaller immediate change, gate the layer-major walk on `n_expert == NE` and say why in the log until the path is generalized. (Other `NE`-sized per-expert buffers in the layer-split path may be worth auditing too.) Workaround confirmed here as well: `STRATA_PREFILL_LAYER_MAJOR=0`.
Author
Owner

@GruenSein commented on GitHub (Nov 5, 2026):

Can confirm the same issue on RTX 2000 Ada mobile with 8GB

<!-- gh-comment-id:6670129614 --> @GruenSein commented on GitHub (Nov 5, 2026): Can confirm the same issue on RTX 2000 Ada mobile with 8GB
Author
Owner

@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):

  • Every >=16K cold prefill SIGABRTs (exit -6), deterministic across 8 engine boots; 76-token prompts serve fine (46.7/47.1 t/s decode). Log line pattern identical to yours, layer 0 first: 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).
  • Boot-side notes for the pruned pack on a 12 GB card, in case they help triage the family: the IQ3-era --expert-cache 1200 + 196K envelope OOMs the prompt path (50 MiB free; the budget bytes follow the 2.66 MB largest blob), and verify refuses to start without --expert-profile (the IQ3 profile is grid-rejected 48x512 vs 48x256; a neutral make_profile.py --no-base --n-expert 256 file boots it clean).
  • The serve layer's restart-on-demand loop turns the abort into a reload storm (~75 s per request: 30 GB arena reload, then abort again); we had to kill the wrapper to stop it.

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.

<!-- gh-comment-id:6714297076 --> @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): - Every >=16K cold prefill SIGABRTs (exit -6), deterministic across 8 engine boots; 76-token prompts serve fine (46.7/47.1 t/s decode). Log line pattern identical to yours, layer 0 first: `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). - Boot-side notes for the pruned pack on a 12 GB card, in case they help triage the family: the IQ3-era `--expert-cache 1200` + 196K envelope OOMs the prompt path (50 MiB free; the budget bytes follow the 2.66 MB largest blob), and `verify` refuses to start without `--expert-profile` (the IQ3 profile is grid-rejected `48x512 vs 48x256`; a neutral `make_profile.py --no-base --n-expert 256` file boots it clean). - The serve layer's restart-on-demand loop turns the abort into a reload storm (~75 s per request: 30 GB arena reload, then abort again); we had to kill the wrapper to stop it. 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2385
No description provided.