[GH-ISSUE #5199] [Engine] 0.1.56's default --prefill-chunk (16384) lends ~3.5 GB from the expert slots on a 16 GB card: 572 -> 258 slots, decode -12-18% #3096

Open
opened 2026-11-07 14:38:02 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @MingShi350 on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5199

Area

[Engine] — speed, kernels, the server

Desktop app, Terminal or source?

Source (a source tree, started with serve/server.py --engine strata --config <run config>.json). The run config was written by hand, so it holds only the engine arguments listed below.

What happened

Engine 0.1.56 defaults the prompt chunk to 16384 tokens (ds4: ... prompts in chunks of 16384). On a 16 GB card the prompt path lends VRAM out of the expert slots, so the number of experts that stay on the card falls from 572 (0.1.55) to 258 (0.1.56) and decode drops 12–18%, while prompt reading does not gain enough to make up for it.

Setting --prefill-chunk 8192 on 0.1.56 restores 707 expert slots and makes the 16K prompt read 5% faster than 0.1.55. Nothing else has to change.

The same binary shows the effect is the chunk value, not new code: 0.1.55 with --prefill-chunk 16384 given by hand also falls to 240 slots.

Smallest steps or command that reproduce it

Four arms on one machine, same model, same pack, same run config; only the engine binary or --prefill-chunk changes. Each arm: load, one 400-token warm-up, then 3× 4K prompt, 3× 16K prompt, 3× short answer (200 tokens), 2× 700-token answer.

Common arguments:

--pack <pack> --max-context 262144 --eos 1 --dspark auto --dspark-conf 0.65 \
--experts 5 --cpu-threads 16 --vision on [--prefill-chunk N]
env: DS4_STORE_GB=48 DS4_FAT_ROWS=16 DS4_NO_VIEW=0
arm engine chunk expert slots (log) 4K prompt 16K prompt short decode long decode
1 0.1.55 4096 (default) 572 348 767 14.83 12.11
2 0.1.56 16384 (default) 258 325 786 12.68 10.82
3 0.1.56 4096 707 303 657 14.52 11.94
4 0.1.56 8192 707 344 805 14.43 12.05

Control (the point that the chunk alone explains it):

arm engine chunk expert slots
5 0.1.55 16384 (by hand) 240

Log lines, quoted:

0.1.55, default:
ds4: ... prompts in chunks of 4096
ds4: CUDA0 layers [0, 39] + head: weights 5.86 GB, experts 5.95 GB (572 of 15360 in VRAM), caches 0.24 GB, 379 MiB free

0.1.56, default:
ds4: ... prompts in chunks of 16384
ds4: CUDA0 layers [0, 39] + head: weights 5.86 GB, experts 2.89 GB (258 of 15360 in VRAM), caches 0.24 GB, 947 MiB free

0.1.56, --prefill-chunk 8192:
ds4: ... prompts in chunks of 8192
ds4: CUDA0 layers [0, 39] + head: weights 5.86 GB, experts 7.25 GB (707 of 15360 in VRAM), caches 0.24 GB, 403 MiB free

Note the free figure: 0.1.56's default leaves 947 MiB unused instead of filling it with expert slots, i.e. the room is taken by the prompt path's loan, not by a real allocation of the expert cache.

Reproduction status

Reproduced locally (twice; the ordering of arms 1 and 2 was swapped on the second run and the result followed the engine/chunk, not the order).

Strata version

Strata 0.2.10 · Control 0.1.56 · engines strata-dsv41 0.1.55 (f-028-rel, commit 8c1aea4bca1b) and 0.1.56 (f-0291-rc1, commit 06698c674673), both archs [86, 89, 120], CUDA 13.0.

Graphics card, memory and system

RTX 4080 16 GB (sm_89) · 64 GB DDR5-6000 (2×32, dual channel) · Windows 11 · NVIDIA driver 621.01 · model on a WD_BLACK SN770 NVMe.

Model, size and settings

DeepSeek-V4.1-Flash-1017 uncensored GSQ-RCO IQ2_XS 2.25 bpw with the shared 110.6 GB IQ4_NL Engram table, 7 files, 48,786 tensors, vision tower and DSpark drafter in the pack. 262,144 context, pictures on, --experts 5, --cpu-threads 16, RAM store 48 GB, DS4_FAT_ROWS=16, DS4_NO_VIEW=0.

What I think the path is (source reading, not measured)

ds4_model.cu says the prompt path lends VRAM from a device's layers and keeps its last tail_k slots in one buffer (Chunk::borrow), and the chunk rule is picked before the expert slots are placed (min_slots - k). With 16384 the loan is large enough to displace ~314 expert slots of 11.4 MB (about 3.5 GB) on a 16 GB card. The measurement above is of the slot count and the speeds; the borrow itself I read in the source, and I did not trace the allocation.

Why this reaches users

tools/dsv41/tune.py tries only the drafter and the CPU threads (its docstring says the RAM store sizes itself and is left alone); it never tests --prefill-chunk and never reports the expert slot count. A normal install therefore keeps 16384 and the slower decode, and the tuning run reports no change.

Suggestion

Scale the default prompt chunk by the card's VRAM, or cap it at 8192 below about 24 GB. On this card 8192 gives the best of both: 707 slots, 805 tok/s on a 16K prompt (against 786 at 16384 and 767 on 0.1.55) and the decode of 0.1.55.

Workaround

strata launch ... --set-style config or the run config's args: add --prefill-chunk 8192. On 0.1.56 this is strictly better than the default here.

  • #5115 — 0.1.56 decodes 25% slower than 0.1.54 on a 16 GB RTX 5080 (Qwen IQ3_S). That report states the expert slots were nearly the same in both arms, so it looks like a second, independent 0.1.56 regression. This one is the slot-count side.
  • #3310 — "choose how many expert slots a prompt loan keeps" (open PR). That is the knob this report would use; a VRAM-aware default would fix it without a new switch.
  • #4683 — for the Qwen host planner the opposite holds (chunks are capped at 8192 and bigger chunks are faster). That is why a single fixed default can be wrong in both directions: it needs to follow the card.
Originally created by @MingShi350 on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5199 ## Area [Engine] — speed, kernels, the server ## Desktop app, Terminal or source? Source (a source tree, started with `serve/server.py --engine strata --config <run config>.json`). The run config was written by hand, so it holds only the engine arguments listed below. ## What happened Engine 0.1.56 defaults the prompt chunk to 16384 tokens (`ds4: ... prompts in chunks of 16384`). On a 16 GB card the prompt path lends VRAM out of the expert slots, so the number of experts that stay on the card falls from **572 (0.1.55) to 258 (0.1.56)** and decode drops **12–18%**, while prompt reading does not gain enough to make up for it. Setting `--prefill-chunk 8192` on 0.1.56 restores **707** expert slots and makes the 16K prompt read **5% faster than 0.1.55**. Nothing else has to change. The same binary shows the effect is the chunk value, not new code: 0.1.55 with `--prefill-chunk 16384` given by hand also falls to 240 slots. ## Smallest steps or command that reproduce it Four arms on one machine, same model, same pack, same run config; only the engine binary or `--prefill-chunk` changes. Each arm: load, one 400-token warm-up, then 3× 4K prompt, 3× 16K prompt, 3× short answer (200 tokens), 2× 700-token answer. Common arguments: ``` --pack <pack> --max-context 262144 --eos 1 --dspark auto --dspark-conf 0.65 \ --experts 5 --cpu-threads 16 --vision on [--prefill-chunk N] env: DS4_STORE_GB=48 DS4_FAT_ROWS=16 DS4_NO_VIEW=0 ``` | arm | engine | chunk | expert slots (log) | 4K prompt | 16K prompt | short decode | long decode | |---|---|---|---|---|---|---|---| | 1 | 0.1.55 | 4096 (default) | **572** | 348 | 767 | 14.83 | 12.11 | | 2 | 0.1.56 | 16384 (default) | **258** | 325 | 786 | 12.68 | 10.82 | | 3 | 0.1.56 | 4096 | 707 | 303 | 657 | 14.52 | 11.94 | | 4 | 0.1.56 | **8192** | **707** | 344 | **805** | 14.43 | 12.05 | Control (the point that the chunk alone explains it): | arm | engine | chunk | expert slots | |---|---|---|---| | 5 | 0.1.55 | **16384** (by hand) | **240** | Log lines, quoted: ``` 0.1.55, default: ds4: ... prompts in chunks of 4096 ds4: CUDA0 layers [0, 39] + head: weights 5.86 GB, experts 5.95 GB (572 of 15360 in VRAM), caches 0.24 GB, 379 MiB free 0.1.56, default: ds4: ... prompts in chunks of 16384 ds4: CUDA0 layers [0, 39] + head: weights 5.86 GB, experts 2.89 GB (258 of 15360 in VRAM), caches 0.24 GB, 947 MiB free 0.1.56, --prefill-chunk 8192: ds4: ... prompts in chunks of 8192 ds4: CUDA0 layers [0, 39] + head: weights 5.86 GB, experts 7.25 GB (707 of 15360 in VRAM), caches 0.24 GB, 403 MiB free ``` Note the free figure: 0.1.56's default leaves 947 MiB unused instead of filling it with expert slots, i.e. the room is taken by the prompt path's loan, not by a real allocation of the expert cache. ## Reproduction status Reproduced locally (twice; the ordering of arms 1 and 2 was swapped on the second run and the result followed the engine/chunk, not the order). ## Strata version Strata 0.2.10 · Control 0.1.56 · engines `strata-dsv41` 0.1.55 (`f-028-rel`, commit `8c1aea4bca1b`) and 0.1.56 (`f-0291-rc1`, commit `06698c674673`), both `archs [86, 89, 120]`, CUDA 13.0. ## Graphics card, memory and system RTX 4080 16 GB (sm_89) · 64 GB DDR5-6000 (2×32, dual channel) · Windows 11 · NVIDIA driver 621.01 · model on a WD_BLACK SN770 NVMe. ## Model, size and settings DeepSeek-V4.1-Flash-1017 uncensored GSQ-RCO **IQ2_XS 2.25 bpw** with the shared 110.6 GB IQ4_NL Engram table, 7 files, 48,786 tensors, vision tower and DSpark drafter in the pack. 262,144 context, pictures on, `--experts 5`, `--cpu-threads 16`, RAM store 48 GB, `DS4_FAT_ROWS=16`, `DS4_NO_VIEW=0`. ## What I think the path is (source reading, not measured) `ds4_model.cu` says the prompt path lends VRAM from a device's layers and keeps its last `tail_k` slots in one buffer (`Chunk::borrow`), and the chunk rule is picked before the expert slots are placed (`min_slots - k`). With 16384 the loan is large enough to displace ~314 expert slots of 11.4 MB (about 3.5 GB) on a 16 GB card. The measurement above is of the slot count and the speeds; the borrow itself I read in the source, and I did not trace the allocation. ## Why this reaches users `tools/dsv41/tune.py` tries only the drafter and the CPU threads (its docstring says the RAM store sizes itself and is left alone); it never tests `--prefill-chunk` and never reports the expert slot count. A normal install therefore keeps 16384 and the slower decode, and the tuning run reports no change. ## Suggestion Scale the default prompt chunk by the card's VRAM, or cap it at 8192 below about 24 GB. On this card 8192 gives the best of both: 707 slots, 805 tok/s on a 16K prompt (against 786 at 16384 and 767 on 0.1.55) and the decode of 0.1.55. ## Workaround `strata launch ... --set`-style config or the run config's `args`: add `--prefill-chunk 8192`. On 0.1.56 this is strictly better than the default here. ## Related - #5115 — 0.1.56 decodes 25% slower than 0.1.54 on a 16 GB RTX 5080 (Qwen IQ3_S). That report states the expert slots were nearly the same in both arms, so it looks like a second, independent 0.1.56 regression. This one is the slot-count side. - #3310 — "choose how many expert slots a prompt loan keeps" (open PR). That is the knob this report would use; a VRAM-aware default would fix it without a new switch. - #4683 — for the Qwen host planner the opposite holds (chunks are capped at 8192 and bigger chunks are faster). That is why a single fixed default can be wrong in both directions: it needs to follow the card.
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#3096
No description provided.