[GH-ISSUE #4695] [Engine] Windows: layer-major prefill crashes with 'expert source has no blob' on long prompts (>8K) when unbuffered I/O drops file mapping #2146

Open
opened 2026-11-04 01:57:03 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @H-Jeffreys on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4695

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

On a dual-NVIDIA GPU CUDA layer split under Windows, prompts long enough to activate layer-major prefill (>8K tokens) crash the engine with prefill (layer-major): expert source has no blob (exit code 1). Shorter turns (<8K tokens) and generation work normally (~140–149 tok/s, 99.9% cache hit rate).

Expected: Long prompts complete prefill without terminating the engine.
Actual: The engine terminates with exit code 1:

[strata] the engine reported an error: prefill (layer-major): expert source has no blob
[strata] done: 0 tokens in 2 s (no speed) (error, cancel=False)
[strata] the engine had stopped (exit code 1); starting it again (a minute or two) ...

Smallest steps or command that reproduce it

  1. Start Strata on Windows with a two-card CUDA layer split and unbuffered direct I/O (default).
  2. Run a coding session with multiple turns. Short turns (<8K tokens) and decode generate normally.
  3. Submit a long prefill request (~90K tokens, e.g. OpenCode context compaction).
  4. The prompt length crosses the min_s threshold in lm_prepare(), engaging the layer-major prefill path.
  5. The engine terminates with exit code 1.

Root Cause Analysis (Static Inspection):

  1. On Windows with unbuffered direct I/O, src.drop_mapping() is called in src/program/generate.cpp:9204 to prevent NTFS from serializing concurrent direct reads, setting unmapped_ = true on FileExpertSource.
  2. When unmapped_ == true, FileExpertSource::mapped_blob() in src/core/expert_source.cpp:3397 returns nullptr.
  3. In src/prefill/prefill.cpp:6243-6253:
    const bool pdirect = false;   // (STRATA_PREFILL_DIRECT, #1670's other commit, is not ported)
    ...
    const uint8_t* b = m.src->blob_stable(l, e);
    if (!b) { err = "prefill (layer-major): expert source has no blob"; return false; }
    
    Because direct prefill (pdirect) is hardcoded to false and monolithic weights files are not marked transient(), layer-major prefetch unconditionally calls blob_stable(), which returns nullptr because the mapped view was dropped.
  4. Setting STRATA_PREFILL_LAYER_MAJOR=0 routes long prompts through standard chunked prefill (which handles unmapped reads), avoiding the crash but losing layer-major prefill throughput.

Reproduction status

Reproduced locally

Strata version

Strata 0.2.7.1 · engine 0.1.52

Graphics card, memory and system

RTX 5090 32 GB + RTX 4090 24 GB · 64 GB RAM · Windows 11 (NTFS)

Model, size and settings

Qwen3.8-Flash-Next Coder IQ1_M · 131K context · dual CUDA layer split (gpu: [1, 0], --layer-split auto) · native experts · MTP drafter · KV cache int8

Logs

[strata] thinking: 4205 of max 16384 tokens, 145.4 tok/s, 29 s
[strata] writing a tool call: write: 4754 of max 16384 tokens, 148.8 tok/s, 32 s
[strata] done: 4804 tokens in 33 s (149.1 tok/s) (stop, cancel=False), expert cache 99.9% hit
[strata] the engine reported an error: prefill (layer-major): expert source has no blob
[strata] done: 0 tokens in 2 s (no speed) (error, cancel=False)
[strata] the engine had stopped (exit code 1); starting it again (a minute or two) ...
Originally created by @H-Jeffreys on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4695 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Source (START-HERE.bat, setup.sh or a build) ### What happened On a dual-NVIDIA GPU CUDA layer split under Windows, prompts long enough to activate layer-major prefill (>8K tokens) crash the engine with `prefill (layer-major): expert source has no blob` (exit code 1). Shorter turns (<8K tokens) and generation work normally (~140–149 tok/s, 99.9% cache hit rate). Expected: Long prompts complete prefill without terminating the engine. Actual: The engine terminates with exit code 1: ```text [strata] the engine reported an error: prefill (layer-major): expert source has no blob [strata] done: 0 tokens in 2 s (no speed) (error, cancel=False) [strata] the engine had stopped (exit code 1); starting it again (a minute or two) ... ``` ### Smallest steps or command that reproduce it 1. Start Strata on Windows with a two-card CUDA layer split and unbuffered direct I/O (default). 2. Run a coding session with multiple turns. Short turns (<8K tokens) and decode generate normally. 3. Submit a long prefill request (~90K tokens, e.g. OpenCode context compaction). 4. The prompt length crosses the `min_s` threshold in `lm_prepare()`, engaging the layer-major prefill path. 5. The engine terminates with exit code 1. Root Cause Analysis (Static Inspection): 1. On Windows with unbuffered direct I/O, `src.drop_mapping()` is called in `src/program/generate.cpp:9204` to prevent NTFS from serializing concurrent direct reads, setting `unmapped_ = true` on `FileExpertSource`. 2. When `unmapped_ == true`, `FileExpertSource::mapped_blob()` in `src/core/expert_source.cpp:3397` returns `nullptr`. 3. In `src/prefill/prefill.cpp:6243-6253`: ```cpp const bool pdirect = false; // (STRATA_PREFILL_DIRECT, #1670's other commit, is not ported) ... const uint8_t* b = m.src->blob_stable(l, e); if (!b) { err = "prefill (layer-major): expert source has no blob"; return false; } ``` Because direct prefill (`pdirect`) is hardcoded to `false` and monolithic weights files are not marked `transient()`, layer-major prefetch unconditionally calls `blob_stable()`, which returns `nullptr` because the mapped view was dropped. 4. Setting `STRATA_PREFILL_LAYER_MAJOR=0` routes long prompts through standard chunked prefill (which handles unmapped reads), avoiding the crash but losing layer-major prefill throughput. ### Reproduction status Reproduced locally ### Strata version Strata 0.2.7.1 · engine 0.1.52 ### Graphics card, memory and system RTX 5090 32 GB + RTX 4090 24 GB · 64 GB RAM · Windows 11 (NTFS) ### Model, size and settings Qwen3.8-Flash-Next Coder IQ1_M · 131K context · dual CUDA layer split (`gpu: [1, 0]`, `--layer-split auto`) · native experts · MTP drafter · KV cache int8 ### Logs ```text [strata] thinking: 4205 of max 16384 tokens, 145.4 tok/s, 29 s [strata] writing a tool call: write: 4754 of max 16384 tokens, 148.8 tok/s, 32 s [strata] done: 4804 tokens in 33 s (149.1 tok/s) (stop, cancel=False), expert cache 99.9% hit [strata] the engine reported an error: prefill (layer-major): expert source has no blob [strata] done: 0 tokens in 2 s (no speed) (error, cancel=False) [strata] the engine had stopped (exit code 1); starting it again (a minute or two) ... ```
Author
Owner

@Niko1221 commented on GitHub (Oct 31, 2026):

0.2.9 has a change for this: when the engine can't use the shortcut, it reads that part from its source file instead of ending the request. We only compiled it. The case happens only on Windows, and we haven't run it there, so we don't know yet that it's fixed. Please try 0.2.9 and tell us if the long prompt works. Keeping this open until then.

<!-- gh-comment-id:6541140630 --> @Niko1221 commented on GitHub (Oct 31, 2026): [0.2.9](https://github.com/Niko1221/Strata/releases/tag/v0.2.9) has a change for this: when the engine can't use the shortcut, it reads that part from its source file instead of ending the request. We only compiled it. The case happens only on Windows, and we haven't run it there, so we don't know yet that it's fixed. Please try 0.2.9 and tell us if the long prompt works. Keeping this open until then.
Author
Owner

@H-Jeffreys commented on GitHub (Nov 1, 2026):

Tested on 0.2.9 (engine 0.1.55, commit 99866a47a2b8 / 08e8770c) on Windows 11 with the dual-GPU setup (RTX 5090 32 GB + RTX 4090 24 GB, 64 GB RAM):

  • Hardware/Config: Qwen3.8-Flash-Next IQ3_S, 131K context, dual-card auto layer split across [1, 0], unbuffered direct I/O, layer-major prefill re-enabled (STRATA_PREFILL_LAYER_MAJOR=1).
  • Tested with a 14,774-token prompt: prefilled in 8.38 s (1,763.6 tok/s) with 0 blob reads from the file and completed without error.
  • Verified in continuous operation with a live 16,561-token prompt: prefilled cleanly across chunk boundaries and began streaming generation at ~92 tok/s.

The expert source has no blob crash is gone, and layer-major prefill works properly with long prompts on Windows. Thank you for the quick fix!

<!-- gh-comment-id:6565611754 --> @H-Jeffreys commented on GitHub (Nov 1, 2026): Tested on 0.2.9 (engine 0.1.55, commit `99866a47a2b8` / `08e8770c`) on Windows 11 with the dual-GPU setup (RTX 5090 32 GB + RTX 4090 24 GB, 64 GB RAM): - Hardware/Config: Qwen3.8-Flash-Next IQ3_S, 131K context, dual-card auto layer split across `[1, 0]`, unbuffered direct I/O, layer-major prefill re-enabled (`STRATA_PREFILL_LAYER_MAJOR=1`). - Tested with a 14,774-token prompt: prefilled in 8.38 s (1,763.6 tok/s) with `0 blob reads from the file` and completed without error. - Verified in continuous operation with a live 16,561-token prompt: prefilled cleanly across chunk boundaries and began streaming generation at ~92 tok/s. The `expert source has no blob` crash is gone, and layer-major prefill works properly with long prompts on Windows. Thank you for the quick fix!
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#2146
No description provided.