[GH-ISSUE #3065] [Engine] Windows low-RAM mode (--mmap-experts): prompt reads are page-fault bound - opt-in changes in #3072 and #3086 #1230

Closed
opened 2026-11-04 01:49:33 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @As7656431 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3065

Update, 2026-10-23: re-tested on 0.2.3.1. The problem is still there. Nothing in 0.2.3.1 changes this path on Windows: open_prompt_direct is still Linux only, STRATA_PROMPT_DIRECT is still read only with a RAM budget, and the io prefetch that 0.2.1 turned on by default for experts.bin packs is Linux only.

Same PC (RTX 5070 12 GB, i5-14600KF, 31.8 GiB DDR4, Windows 10 22H2, Flash-Next IQ2_XS on a drive of about 1.5 GB/s) and settings as below, everything built from main 7ddc17a3 (v0.2.3.1, engine 0.1.48.1), tools/strata_bench.py of that commit, medians of 3, all on the same day:

0.2.3.1 + #3072 + #3086 + both
4K prompt 87.0 tok/s, first token 46.3 s 414.6 tok/s, 9.7 s 112.6 tok/s, 35.8 s 409.1 tok/s, 9.9 s
16K prompt 101.3 tok/s, first token 158.7 s 846.6 tok/s, 19.0 s 94.5 tok/s, 169.9 s 830.9 tok/s, 19.3 s
agent follow-up turn, first token 62.8 s 7.2 s 47.1 s 7.3 s
agent decode 5.7 tok/s 48.7 tok/s 5.1 tok/s 62.8 tok/s
short-chat decode 55.8 tok/s 55.9 tok/s 75.2 tok/s 76.5 tok/s

#3086 alone with the bench script and the daily settings of the original report below (a short question, another, a real 20K-token English document, a short question; four interleaved rounds, averages): first request after a start 32.2 to 43.4 tok/s (+35%), decode right after the document 14.7 to 23.9 tok/s (+62%), a short question after it 34.0 to 46.2 tok/s (+36%), warm chat 60.2 to 67.9 tok/s (+13%), each faster in 4 of 4 rounds; reading the document unchanged (186.1 against 184.5 s).

  • The three changes below are now two pull requests: #3072 (changes 1 and 2, STRATA_PROMPT_DIRECT=1 and STRATA_PREFILL_DIRECT_RAM) and #3086 (change 3, STRATA_MMAP_PREFETCH). Both are rebased on main, independent of each other, off by default, and each has a small regression test in tests/core/file_expert_source_test.cpp.
  • STRATA_DUMP_FIRST_LOGITS after an 8K document and a 300-token prompt, two runs per build and setting: for each prompt the 12 runs gave two outputs, which differ no more than main's own runs differ from each other (300 tokens: main's two runs gave both, KL 1.9e-4; 8K: KL 1.24e-3, as between two runs of the 0.1.45 release). The first choice was the same in every run.
  • Built and tested with CUDA on Windows only, so both PRs stay drafts until HIP and SYCL have been built; help with that is welcome.
  • The 0.2.3.1 report of this PC: #3063. The reproduction steps in the first comment below still apply; on 0.2.3.1 the bench tool needs only PYTHONUTF8=1 (#2792) on a Chinese-locale Windows.

Original report (2026-10-18, measured on 0.1.44.1 and 0.1.45):

Goal: on a Windows PC whose RAM cannot hold the experts (low-RAM mode, --mmap-experts), read prompts without millions of page faults, and keep the decode's cached experts in RAM afterwards. I have three opt-in changes for this, measured on one PC, and would like to know whether you would take them as pull requests, or prefer another approach.

The PC: RTX 5070 12 GB, i5-14600KF, 31.8 GiB DDR4-3600, Windows 10 22H2, model files on an aigo P2000 NVMe (about 1.4-1.6 GB/s). Original Flash-Next IQ2_XS (35.5 GB of experts), --mmap-experts, 32K context, --kv int8, MTP. Results-only report for 0.1.45 on this PC: #3063.

What happens

  • A 4K prompt reads at 58 tok/s and a 16K prompt at 128 tok/s (0.1.45, tools/strata_bench.py); agent follow-up turns wait 48 s for the first token and then decode at 6.4 tok/s.
  • With Windows performance counters during a 20K-token prompt (0.1.39), the drive read only 0.2-0.5 GB/s while about 300 MB of RAM stayed available: the stager's copies out of the mapped experts.bin are page faults, not drive-bound reads. They also push the decode's cached experts out of RAM, so the answer after a long prompt decodes at 13-19 tok/s, against about 70 tok/s for a warm chat.
  • #2004 (RTX 4060 8 GB, 32 GB, Windows 10, IQ2_XS low-RAM) describes the same thing: about 31-36 tok/s on a 9.7K prompt, one stall "with heavy paging of expert file pages". #1520 attacks it from another side (releasing the copied pages).

Why the existing switches do not cover it

  • STRATA_PROMPT_DIRECT=1 is read only in the RAM-budget branch of generate.cpp, and FileExpertSource::open_prompt_direct is Linux only ("NTFS serves unbuffered reads of a mapped file one at a time").
  • FileExpertSource::prefetch returns at once unless staged(), so a plain mapped experts.bin gets no batch prefetch in decode; each CPU expert faults in page by page.
  • A RAM budget (--resident-budget-gib 8 / 14, 0.1.44.1) reads a 20K prompt in 80 s instead of about 170 s, but decodes at about 14 tok/s on this PC, so it is not an alternative here.

The changes (on 0.1.44.1; every one off by default)

  1. STRATA_PROMPT_DIRECT=1 on Windows and without a RAM budget. A Windows branch in open_prompt_direct (a second handle on experts.bin with FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED; read_direct uses these handles when the tier itself is not unbuffered), the switch honoured in the mmap mode without a budget, and a new ExpertSource::prompt_reads() so the stager hands unpinned blobs to copy_blobs (8 per batch) without touching transient(): the decode and the prompt CPU share behave exactly as before.
  2. STRATA_PREFILL_DIRECT_RAM=3. In that copy_blobs path, a blob whose pages are all in the process working set (QueryWorkingSetEx) is copied from the mapping; the rest are read through the file cache as merged runs of neighbouring blobs (the standby list still holds many of them). On this PC about 70-77% of the prompt's expert bytes came from the working set and none had to be read unbuffered.
  3. STRATA_MMAP_PREFETCH=2. For a plain mapped experts.bin, the layer's CPU experts go to PrefetchVirtualMemory as one batch on a helper thread (the call costs about 0.2 ms even when every page is resident, so the decode thread does not wait for it).

Together with two switches that already exist: STRATA_PREFILL_STREAM_MIN=8193 (stream only the routed experts for chunks up to 8,192 tokens) and STRATA_WATCHDOG_S=180. About 300 lines in expert_source.cpp/hpp, prefill.cpp and generate.cpp. Built and tested only with CUDA on Windows; the new code is Windows file I/O, not GPU code, but I have not built HIP or SYCL.

Measurements (same PC, same day, the same settings apart from the switches)

tools/strata_bench.py (the 0.1.45 tool as the client), 0.1.44.1 against 0.1.44.1 with the switches, medians of 3:

0.1.44.1 with the switches
4K prompt 70.7 tok/s, first token 56.9 s 978.5 tok/s, first token 4.1 s
16K prompt 95.7 tok/s, first token 167.9 s 1455.9 tok/s, first token 11.1 s
agent follow-up turn, first token 49.1 s 5.7 s
agent decode 10.9 tok/s 66.1 tok/s
short-chat decode 63.9 tok/s 61.8 tok/s

The tool's prompts are generated word lists, which probably route to fewer experts than real text and so flatter STRATA_PREFILL_STREAM_MIN. With a real 20K-token English document (four versions in one run, four rounds, a different version first in each round; averages of the four rounds):

0.1.39 0.1.44.1 0.1.44.1 with the switches
read the 20K document 173.6 s 162.5 s 33.1 s
decode right after it 13.3 tok/s 17.4 tok/s 42.0 tok/s
a short question after it 26.0 tok/s 40.1 tok/s 65.0 tok/s
warm short chat 54.2 tok/s 71.3 tok/s 74.4 tok/s
first request after a start 31.6 tok/s 41.2 tok/s 48.1 tok/s

STRATA_MMAP_PREFETCH=2 alone, four interleaved rounds: first request after a start +22% (4 of 4 rounds faster), a short question after the long document +11% (3 of 4), warm chat +7% (4 of 4), prompt reading unchanged.

Correctness

The switches change where the bytes come from, not what is computed. Checked with STRATA_DUMP_FIRST_LOGITS (the logits after the prompt) on an 8K document and a 300-token prompt:

  • 8K document: all six runs with switches 1 and 2 (alone and with the existing switches) were bit-identical to one of the two official runs.
  • 300-token prompt: the four runs with switches 1 and 2 were bit-identical to the official runs. One of the runs with all switches gave an output no official run gave, but so did the official binary with only the existing STRATA_PREFILL_STREAM_MIN / STRATA_WATCHDOG_S switches, and the official binary alone gave three different outputs in seven runs. The extra output is within that spread (KL up to 1.8e-4 against the official outputs, which differ from each other by up to 2.1e-4); the first choice was the same in every run.
  • STRATA_MMAP_PREFETCH only asks the OS for pages ahead of time, so the bytes the pool reads are the same.

So one thing I noticed on the way: the official binary itself is not bit-reproducible between runs on this PC (two runs of the 8K document differ by a KL of 2.4e-3).

Not tested

Linux; other GPUs; a fast NVMe (your note in read_direct measured unbuffered reads of a mapped file at 3.4 GB/s on a PCIe 5 drive; on this drive they still beat the page faults, but on a fast drive the official path is already much faster, see #2791); a RAM budget together with the switches; GGUF-in-place packs; HIP and SYCL builds; output quality beyond the logits check (no change is expected, since the computation is the same).

If this is welcome, I would send three separate PRs (1, 2, 3 above) on top of current main, each off by default with the default path unchanged.

Originally created by @As7656431 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3065 **Update, 2026-10-23: re-tested on 0.2.3.1.** The problem is still there. Nothing in 0.2.3.1 changes this path on Windows: `open_prompt_direct` is still Linux only, `STRATA_PROMPT_DIRECT` is still read only with a RAM budget, and the io prefetch that 0.2.1 turned on by default for `experts.bin` packs is Linux only. Same PC (RTX 5070 12 GB, i5-14600KF, 31.8 GiB DDR4, Windows 10 22H2, Flash-Next IQ2_XS on a drive of about 1.5 GB/s) and settings as below, everything built from main 7ddc17a3 (v0.2.3.1, engine 0.1.48.1), `tools/strata_bench.py` of that commit, medians of 3, all on the same day: | | 0.2.3.1 | + #3072 | + #3086 | + both | |---|---|---|---|---| | 4K prompt | 87.0 tok/s, first token 46.3 s | 414.6 tok/s, 9.7 s | 112.6 tok/s, 35.8 s | 409.1 tok/s, 9.9 s | | 16K prompt | 101.3 tok/s, first token 158.7 s | 846.6 tok/s, 19.0 s | 94.5 tok/s, 169.9 s | 830.9 tok/s, 19.3 s | | agent follow-up turn, first token | 62.8 s | 7.2 s | 47.1 s | 7.3 s | | agent decode | 5.7 tok/s | 48.7 tok/s | 5.1 tok/s | 62.8 tok/s | | short-chat decode | 55.8 tok/s | 55.9 tok/s | 75.2 tok/s | 76.5 tok/s | #3086 alone with the bench script and the daily settings of the original report below (a short question, another, a real 20K-token English document, a short question; four interleaved rounds, averages): first request after a start 32.2 to 43.4 tok/s (+35%), decode right after the document 14.7 to 23.9 tok/s (+62%), a short question after it 34.0 to 46.2 tok/s (+36%), warm chat 60.2 to 67.9 tok/s (+13%), each faster in 4 of 4 rounds; reading the document unchanged (186.1 against 184.5 s). - The three changes below are now two pull requests: #3072 (changes 1 and 2, `STRATA_PROMPT_DIRECT=1` and `STRATA_PREFILL_DIRECT_RAM`) and #3086 (change 3, `STRATA_MMAP_PREFETCH`). Both are rebased on main, independent of each other, off by default, and each has a small regression test in `tests/core/file_expert_source_test.cpp`. - `STRATA_DUMP_FIRST_LOGITS` after an 8K document and a 300-token prompt, two runs per build and setting: for each prompt the 12 runs gave two outputs, which differ no more than main's own runs differ from each other (300 tokens: main's two runs gave both, KL 1.9e-4; 8K: KL 1.24e-3, as between two runs of the 0.1.45 release). The first choice was the same in every run. - Built and tested with CUDA on Windows only, so both PRs stay drafts until HIP and SYCL have been built; help with that is welcome. - The 0.2.3.1 report of this PC: #3063. The reproduction steps in the first comment below still apply; on 0.2.3.1 the bench tool needs only `PYTHONUTF8=1` (#2792) on a Chinese-locale Windows. --- **Original report (2026-10-18, measured on 0.1.44.1 and 0.1.45):** **Goal:** on a Windows PC whose RAM cannot hold the experts (low-RAM mode, `--mmap-experts`), read prompts without millions of page faults, and keep the decode's cached experts in RAM afterwards. I have three opt-in changes for this, measured on one PC, and would like to know whether you would take them as pull requests, or prefer another approach. **The PC:** RTX 5070 12 GB, i5-14600KF, 31.8 GiB DDR4-3600, Windows 10 22H2, model files on an aigo P2000 NVMe (about 1.4-1.6 GB/s). Original Flash-Next IQ2_XS (35.5 GB of experts), `--mmap-experts`, 32K context, `--kv int8`, MTP. Results-only report for 0.1.45 on this PC: #3063. ## What happens - A 4K prompt reads at 58 tok/s and a 16K prompt at 128 tok/s (0.1.45, `tools/strata_bench.py`); agent follow-up turns wait 48 s for the first token and then decode at 6.4 tok/s. - With Windows performance counters during a 20K-token prompt (0.1.39), the drive read only 0.2-0.5 GB/s while about 300 MB of RAM stayed available: the stager's copies out of the mapped `experts.bin` are page faults, not drive-bound reads. They also push the decode's cached experts out of RAM, so the answer after a long prompt decodes at 13-19 tok/s, against about 70 tok/s for a warm chat. - #2004 (RTX 4060 8 GB, 32 GB, Windows 10, IQ2_XS low-RAM) describes the same thing: about 31-36 tok/s on a 9.7K prompt, one stall "with heavy paging of expert file pages". #1520 attacks it from another side (releasing the copied pages). ## Why the existing switches do not cover it - `STRATA_PROMPT_DIRECT=1` is read only in the RAM-budget branch of `generate.cpp`, and `FileExpertSource::open_prompt_direct` is Linux only ("NTFS serves unbuffered reads of a mapped file one at a time"). - `FileExpertSource::prefetch` returns at once unless `staged()`, so a plain mapped `experts.bin` gets no batch prefetch in decode; each CPU expert faults in page by page. - A RAM budget (`--resident-budget-gib 8` / `14`, 0.1.44.1) reads a 20K prompt in 80 s instead of about 170 s, but decodes at about 14 tok/s on this PC, so it is not an alternative here. ## The changes (on 0.1.44.1; every one off by default) 1. **`STRATA_PROMPT_DIRECT=1` on Windows and without a RAM budget.** A Windows branch in `open_prompt_direct` (a second handle on `experts.bin` with `FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED`; `read_direct` uses these handles when the tier itself is not unbuffered), the switch honoured in the mmap mode without a budget, and a new `ExpertSource::prompt_reads()` so the stager hands unpinned blobs to `copy_blobs` (8 per batch) without touching `transient()`: the decode and the prompt CPU share behave exactly as before. 2. **`STRATA_PREFILL_DIRECT_RAM=3`.** In that `copy_blobs` path, a blob whose pages are all in the process working set (`QueryWorkingSetEx`) is copied from the mapping; the rest are read through the file cache as merged runs of neighbouring blobs (the standby list still holds many of them). On this PC about 70-77% of the prompt's expert bytes came from the working set and none had to be read unbuffered. 3. **`STRATA_MMAP_PREFETCH=2`.** For a plain mapped `experts.bin`, the layer's CPU experts go to `PrefetchVirtualMemory` as one batch on a helper thread (the call costs about 0.2 ms even when every page is resident, so the decode thread does not wait for it). Together with two switches that already exist: `STRATA_PREFILL_STREAM_MIN=8193` (stream only the routed experts for chunks up to 8,192 tokens) and `STRATA_WATCHDOG_S=180`. About 300 lines in `expert_source.cpp/hpp`, `prefill.cpp` and `generate.cpp`. Built and tested only with CUDA on Windows; the new code is Windows file I/O, not GPU code, but I have not built HIP or SYCL. ## Measurements (same PC, same day, the same settings apart from the switches) `tools/strata_bench.py` (the 0.1.45 tool as the client), 0.1.44.1 against 0.1.44.1 with the switches, medians of 3: | | 0.1.44.1 | with the switches | |---|---|---| | 4K prompt | 70.7 tok/s, first token 56.9 s | 978.5 tok/s, first token 4.1 s | | 16K prompt | 95.7 tok/s, first token 167.9 s | 1455.9 tok/s, first token 11.1 s | | agent follow-up turn, first token | 49.1 s | 5.7 s | | agent decode | 10.9 tok/s | 66.1 tok/s | | short-chat decode | 63.9 tok/s | 61.8 tok/s | The tool's prompts are generated word lists, which probably route to fewer experts than real text and so flatter `STRATA_PREFILL_STREAM_MIN`. With a real 20K-token English document (four versions in one run, four rounds, a different version first in each round; averages of the four rounds): | | 0.1.39 | 0.1.44.1 | 0.1.44.1 with the switches | |---|---|---|---| | read the 20K document | 173.6 s | 162.5 s | 33.1 s | | decode right after it | 13.3 tok/s | 17.4 tok/s | 42.0 tok/s | | a short question after it | 26.0 tok/s | 40.1 tok/s | 65.0 tok/s | | warm short chat | 54.2 tok/s | 71.3 tok/s | 74.4 tok/s | | first request after a start | 31.6 tok/s | 41.2 tok/s | 48.1 tok/s | `STRATA_MMAP_PREFETCH=2` alone, four interleaved rounds: first request after a start +22% (4 of 4 rounds faster), a short question after the long document +11% (3 of 4), warm chat +7% (4 of 4), prompt reading unchanged. ## Correctness The switches change where the bytes come from, not what is computed. Checked with `STRATA_DUMP_FIRST_LOGITS` (the logits after the prompt) on an 8K document and a 300-token prompt: - 8K document: all six runs with switches 1 and 2 (alone and with the existing switches) were bit-identical to one of the two official runs. - 300-token prompt: the four runs with switches 1 and 2 were bit-identical to the official runs. One of the runs with all switches gave an output no official run gave, but so did the official binary with only the existing `STRATA_PREFILL_STREAM_MIN` / `STRATA_WATCHDOG_S` switches, and the official binary alone gave three different outputs in seven runs. The extra output is within that spread (KL up to 1.8e-4 against the official outputs, which differ from each other by up to 2.1e-4); the first choice was the same in every run. - `STRATA_MMAP_PREFETCH` only asks the OS for pages ahead of time, so the bytes the pool reads are the same. So one thing I noticed on the way: the official binary itself is not bit-reproducible between runs on this PC (two runs of the 8K document differ by a KL of 2.4e-3). ## Not tested Linux; other GPUs; a fast NVMe (your note in `read_direct` measured unbuffered reads of a mapped file at 3.4 GB/s on a PCIe 5 drive; on this drive they still beat the page faults, but on a fast drive the official path is already much faster, see #2791); a RAM budget together with the switches; GGUF-in-place packs; HIP and SYCL builds; output quality beyond the logits check (no change is expected, since the computation is the same). If this is welcome, I would send three separate PRs (1, 2, 3 above) on top of current main, each off by default with the default path unchanged.
Author
Owner

@As7656431 commented on GitHub (Oct 19, 2026):

How to reproduce #3072 and #3086 (one set of steps for both)

Where it shows. The gain needs all of these: Windows, a pack whose experts do not fit in RAM (here 35.5 GB of IQ2_XS experts and 31.8 GiB of RAM), the low-RAM mode (--mmap-experts, no --resident-budget-gib), and a drive that is not very fast (here about 1.4-1.6 GB/s). On a PC whose RAM holds the experts, or on Linux, the switches change nothing; on a fast NVMe the default path is already much faster (#2791), so expect less. To try it on a PC with more RAM, a bigger pack (its experts larger than the free RAM) should give the same situation; I have not tried that myself.

Build both together (they merge without conflicts):

git fetch origin pull/3072/head:pr-3072 pull/3086/head:pr-3086
git checkout -b try-3065 pr-3072
git merge pr-3086

then build the CUDA engine as usual.

Engine arguments (my config, paths shortened):

--pack iq2_xs --native Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf --ple-gguf Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf --expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --mtp rt --max-context 32768 --kv int8 --mmap-experts --pcie-frac 0.55 --spec-min-p 0.70

with STRATA_FETCH_THREADS=16 in the config's env. Then add, in the same env:

measuring set
#3072, first commit STRATA_PROMPT_DIRECT=1
#3072, both commits STRATA_PROMPT_DIRECT=1, STRATA_PREFILL_DIRECT_RAM=3
#3086 STRATA_MMAP_PREFETCH=2
all of it the three above

At start the engine log should say the prompt path's expert reads go unbuffered (STRATA_PROMPT_DIRECT=1, mmap mode) when STRATA_PROMPT_DIRECT=1 takes effect.

Measure with tools/strata_bench.py. While #2864 is open, start the server yourself and point the tool at it with --url; while #2792 is open, on a Chinese- or Japanese-locale Windows also set PYTHONUTF8=1:

python serve/server.py --engine strata --config <config> --port 8080
set PYTHONUTF8=1
python tools/strata_bench.py --url http://127.0.0.1:8080 --config <config>

What I got (RTX 5070 12 GB, i5-14600KF, 31.8 GiB DDR4-3600, Windows 10, model on an aigo P2000; every column is current main / 0.1.45 plus the switches named; medians of 3):

0.1.45 (#3063) STRATA_PROMPT_DIRECT=1 + STRATA_PREFILL_DIRECT_RAM=3 + STRATA_MMAP_PREFETCH=2 (all)
4K prompt 58.3 tok/s, first token 69.0 s 160.6 tok/s, 25.0 s 437.1 tok/s, 9.2 s 435.1 tok/s, 9.3 s
16K prompt 127.5 tok/s, 126.0 s 310.8 tok/s, 51.7 s 863.6 tok/s, 18.6 s 871.1 tok/s, 18.5 s
agent follow-up turn, first token 48.2 s 25.0 s 7.2 s 6.9 s
agent decode 6.4 tok/s 51.8 tok/s 36.1 tok/s 51.9 tok/s

STRATA_MMAP_PREFETCH=2 alone (its own A/B, four interleaved rounds, short question / short question / 20K-token document / short question): first request after a start +33%, a short question after the document +34%, decode right after the document +50%, warm chat +10%, prompt reading unchanged. Adding the existing STRATA_PREFILL_STREAM_MIN=8193 on top reads short and medium prompts faster again (in #3065, on 0.1.44.1: 4K at 978 tok/s, 16K at 1456 tok/s); it is not part of these PRs.

Check that the computation is the same: run the CLI engine with the same arguments plus --tokens-file <ids> --max-new 1 and STRATA_DUMP_FIRST_LOGITS=<out.bin> (float32 logits after the prompt), a few times with and without the switches, and compare the files. The release itself is not bit-reproducible between runs on this PC (two runs of an 8K document differ by KL 1e-3 to 2.4e-3), so compare against several release runs: in my runs every output with the switches was either bit-identical to a release run or as far from the release runs as they are from each other, and the first choice never changed.

<!-- gh-comment-id:6264110228 --> @As7656431 commented on GitHub (Oct 19, 2026): **How to reproduce #3072 and #3086** (one set of steps for both) **Where it shows.** The gain needs all of these: Windows, a pack whose experts do not fit in RAM (here 35.5 GB of IQ2_XS experts and 31.8 GiB of RAM), the low-RAM mode (`--mmap-experts`, no `--resident-budget-gib`), and a drive that is not very fast (here about 1.4-1.6 GB/s). On a PC whose RAM holds the experts, or on Linux, the switches change nothing; on a fast NVMe the default path is already much faster (#2791), so expect less. To try it on a PC with more RAM, a bigger pack (its experts larger than the free RAM) should give the same situation; I have not tried that myself. **Build both together** (they merge without conflicts): ``` git fetch origin pull/3072/head:pr-3072 pull/3086/head:pr-3086 git checkout -b try-3065 pr-3072 git merge pr-3086 ``` then build the CUDA engine as usual. **Engine arguments** (my config, paths shortened): ``` --pack iq2_xs --native Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf --ple-gguf Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf --expert-profile expert-profile.bin --expert-cache auto --prefill auto --spec 4 --mtp rt --max-context 32768 --kv int8 --mmap-experts --pcie-frac 0.55 --spec-min-p 0.70 ``` with `STRATA_FETCH_THREADS=16` in the config's `env`. Then add, in the same `env`: | measuring | set | |---|---| | #3072, first commit | `STRATA_PROMPT_DIRECT=1` | | #3072, both commits | `STRATA_PROMPT_DIRECT=1`, `STRATA_PREFILL_DIRECT_RAM=3` | | #3086 | `STRATA_MMAP_PREFETCH=2` | | all of it | the three above | At start the engine log should say `the prompt path's expert reads go unbuffered (STRATA_PROMPT_DIRECT=1, mmap mode)` when `STRATA_PROMPT_DIRECT=1` takes effect. **Measure** with `tools/strata_bench.py`. While #2864 is open, start the server yourself and point the tool at it with `--url`; while #2792 is open, on a Chinese- or Japanese-locale Windows also set `PYTHONUTF8=1`: ``` python serve/server.py --engine strata --config <config> --port 8080 set PYTHONUTF8=1 python tools/strata_bench.py --url http://127.0.0.1:8080 --config <config> ``` **What I got** (RTX 5070 12 GB, i5-14600KF, 31.8 GiB DDR4-3600, Windows 10, model on an aigo P2000; every column is current main / 0.1.45 plus the switches named; medians of 3): | | 0.1.45 (#3063) | `STRATA_PROMPT_DIRECT=1` | `+ STRATA_PREFILL_DIRECT_RAM=3` | `+ STRATA_MMAP_PREFETCH=2` (all) | |---|---|---|---|---| | 4K prompt | 58.3 tok/s, first token 69.0 s | 160.6 tok/s, 25.0 s | 437.1 tok/s, 9.2 s | 435.1 tok/s, 9.3 s | | 16K prompt | 127.5 tok/s, 126.0 s | 310.8 tok/s, 51.7 s | 863.6 tok/s, 18.6 s | 871.1 tok/s, 18.5 s | | agent follow-up turn, first token | 48.2 s | 25.0 s | 7.2 s | 6.9 s | | agent decode | 6.4 tok/s | 51.8 tok/s | 36.1 tok/s | 51.9 tok/s | `STRATA_MMAP_PREFETCH=2` alone (its own A/B, four interleaved rounds, short question / short question / 20K-token document / short question): first request after a start +33%, a short question after the document +34%, decode right after the document +50%, warm chat +10%, prompt reading unchanged. Adding the existing `STRATA_PREFILL_STREAM_MIN=8193` on top reads short and medium prompts faster again (in #3065, on 0.1.44.1: 4K at 978 tok/s, 16K at 1456 tok/s); it is not part of these PRs. **Check that the computation is the same:** run the CLI engine with the same arguments plus `--tokens-file <ids> --max-new 1` and `STRATA_DUMP_FIRST_LOGITS=<out.bin>` (float32 logits after the prompt), a few times with and without the switches, and compare the files. The release itself is not bit-reproducible between runs on this PC (two runs of an 8K document differ by KL 1e-3 to 2.4e-3), so compare against several release runs: in my runs every output with the switches was either bit-identical to a release run or as far from the release runs as they are from each other, and the first choice never changed.
Author
Owner

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

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271452550 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Author
Owner

@As7656431 commented on GitHub (Oct 24, 2026):

/reopen

<!-- gh-comment-id:6382630102 --> @As7656431 commented on GitHub (Oct 24, 2026): /reopen
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

Reopened, thank you. A maintainer will pick it up from here.

<!-- gh-comment-id:6382631598 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): Reopened, thank you. A maintainer will pick it up from here.
Author
Owner

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

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6659383076 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1230
No description provided.