[GH-ISSUE #3693] [Engine] An explicit --expert-cache N is not a cap: the fill overshoots it (4497 -> 5118 slots, 56 MiB free) and is slower than a smaller cache #1532

Closed
opened 2026-11-04 01:52:02 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @dai8647 on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3693

Area

[Engine]

Desktop app, Terminal or source?

Source (engine built from the release tag on Windows, HIP build).

What happened

An explicit --expert-cache N is not treated as a cap: the engine fills
more slots than were asked for, lands in the "the card is this full" danger
zone, and is slower than a smaller cache.

Windows 11 / RX 7800 XT (gfx1101, 16 GB), engine 0.1.44.1, same pack and
profile, one arm per engine boot:

--expert-cache slots the engine ended up with free VRAM decode (200-token median)
auto 4,480 1,158 MiB 34.98 tok/s
4497 5,118 (asked for 4,497) 56 MiB 33.70 tok/s

The engine's own boot lines for the explicit arm:

strata generate: expert cache auto: 9.57 GiB free, 1280 MiB reserved (+3 MiB for the draft head, +675 MiB for its q2_0 experts) -> 3530 slots
strata generate: only 1192 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache
strata generate: expert cache 5118 slots, 8.32 GiB of VRAM; policy is
strata serve: 56 MiB of VRAM free with everything loaded

Two things go wrong at once:

  1. The requested 4,497 slots became 5,118 - the fill overshot the request by
    621 slots (1.0 GiB of VRAM), so the engine's own LOW warning fires on the
    next request ("only 56 MiB of VRAM free ... when the card is this full the
    driver can page GPU memory to system RAM, decode falls to a few tok/s").
  2. Even with the smaller, correct-sized cache the arm was slower
    (33.70 vs 34.98 tok/s) - the extra slots cost more than they bought.

This is not specific to 0.1.44.1: on 0.1.45 (--expert-cache 3950 and
4490) the fill again ended at 5,118 slots / 8.32 GiB with ~0.4 GiB free, and
the same expert cache auto line shrinks to 3,087 slots with "only 0 MiB free
once the slots are written".

Smallest steps or command that reproduce it

  1. Windows 11, RX 7800 XT 16 GB (gfx1101), 96 GB RAM.
  2. Engine 0.1.44.1 (HIP build), Swift-Qwen3.8-Flash-Next IQ3_XXS pack.
  3. Serve with --expert-cache 4497 --vram-reserve-mib 1280 and read the
    expert cache N slots line in the engine log.
  4. Compare with --expert-cache auto on a fresh boot.

Reproduction status

Reproduces on every boot with an explicit value: the fill lands on the same
5,118 slots / 8.32 GiB whatever number between 3950 and 4497 is asked for.
The auto arm is stable at 4,400-4,700 slots on the same machine and the same
pack.

Strata version

0.1.44.1 (the same overshoot happens on 0.1.45 and 0.2.0-beta).

Graphics card, memory and system

RX 7800 XT 16 GB (gfx1101) · 96 GB RAM · Ryzen 5 5500 (AVX2) · Windows 11

Model, size and settings

Swift-Qwen3.8-Flash-Next IQ3_XXS (Swift-abliterated), pack packs/swift_mmap,
--expert-cache 4497 --vram-reserve-mib 1280 --resident-budget-gib 40

Logs

[strata] 2026-10-22 03:12:41 engine started: ... --expert-cache 4497 --vram-reserve-mib 1280 ...
strata generate: expert cache auto: 9.57 GiB free, 1280 MiB reserved (+3 MiB for the draft head, +675 MiB for its q2_0 experts) -> 3530 slots
strata generate: only 1192 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache
strata generate: expert cache 5118 slots, 8.32 GiB of VRAM; policy is
strata serve: 56 MiB of VRAM free with everything loaded
strata serve: WARNING: only 56 MiB of VRAM free at the start of this request (below 1024 MiB): when the card is this full the driver can page GPU memory to system RAM, decode falls to a few tok/s and a window may never finish (#2065).

A suggestion: treating --expert-cache N as a cap on the number of slots (and
warning when the fill would exceed it) would make the flag mean what it says
and would keep the engine out of the #2065 range. auto already produces a
sane size on a card with room, so an explicit smaller number should be honoured
rather than overshot.

Originally created by @dai8647 on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3693 ### Area [Engine] ### Desktop app, Terminal or source? Source (engine built from the release tag on Windows, HIP build). ### What happened An explicit `--expert-cache N` is not treated as a **cap**: the engine fills more slots than were asked for, lands in the "the card is this full" danger zone, and is slower than a smaller cache. Windows 11 / RX 7800 XT (gfx1101, 16 GB), engine 0.1.44.1, same pack and profile, one arm per engine boot: | `--expert-cache` | slots the engine ended up with | free VRAM | decode (200-token median) | |---|---|---|---| | `auto` | 4,480 | 1,158 MiB | 34.98 tok/s | | `4497` | **5,118** (asked for 4,497) | **56 MiB** | 33.70 tok/s | The engine's own boot lines for the explicit arm: ``` strata generate: expert cache auto: 9.57 GiB free, 1280 MiB reserved (+3 MiB for the draft head, +675 MiB for its q2_0 experts) -> 3530 slots strata generate: only 1192 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache strata generate: expert cache 5118 slots, 8.32 GiB of VRAM; policy is strata serve: 56 MiB of VRAM free with everything loaded ``` Two things go wrong at once: 1. The requested 4,497 slots became 5,118 - the fill overshot the request by 621 slots (1.0 GiB of VRAM), so the engine's own LOW warning fires on the next request ("only 56 MiB of VRAM free ... when the card is this full the driver can page GPU memory to system RAM, decode falls to a few tok/s"). 2. Even with the smaller, correct-sized cache the arm was slower (33.70 vs 34.98 tok/s) - the extra slots cost more than they bought. This is not specific to 0.1.44.1: on 0.1.45 (`--expert-cache 3950` and `4490`) the fill again ended at 5,118 slots / 8.32 GiB with ~0.4 GiB free, and the same `expert cache auto` line shrinks to 3,087 slots with "only 0 MiB free once the slots are written". ### Smallest steps or command that reproduce it 1. Windows 11, RX 7800 XT 16 GB (gfx1101), 96 GB RAM. 2. Engine 0.1.44.1 (HIP build), Swift-Qwen3.8-Flash-Next IQ3_XXS pack. 3. Serve with `--expert-cache 4497 --vram-reserve-mib 1280` and read the `expert cache N slots` line in the engine log. 4. Compare with `--expert-cache auto` on a fresh boot. ### Reproduction status Reproduces on every boot with an explicit value: the fill lands on the same 5,118 slots / 8.32 GiB whatever number between 3950 and 4497 is asked for. The `auto` arm is stable at 4,400-4,700 slots on the same machine and the same pack. ### Strata version 0.1.44.1 (the same overshoot happens on 0.1.45 and 0.2.0-beta). ### Graphics card, memory and system RX 7800 XT 16 GB (gfx1101) · 96 GB RAM · Ryzen 5 5500 (AVX2) · Windows 11 ### Model, size and settings Swift-Qwen3.8-Flash-Next IQ3_XXS (Swift-abliterated), pack `packs/swift_mmap`, `--expert-cache 4497 --vram-reserve-mib 1280 --resident-budget-gib 40` ### Logs ``` [strata] 2026-10-22 03:12:41 engine started: ... --expert-cache 4497 --vram-reserve-mib 1280 ... strata generate: expert cache auto: 9.57 GiB free, 1280 MiB reserved (+3 MiB for the draft head, +675 MiB for its q2_0 experts) -> 3530 slots strata generate: only 1192 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache strata generate: expert cache 5118 slots, 8.32 GiB of VRAM; policy is strata serve: 56 MiB of VRAM free with everything loaded strata serve: WARNING: only 56 MiB of VRAM free at the start of this request (below 1024 MiB): when the card is this full the driver can page GPU memory to system RAM, decode falls to a few tok/s and a window may never finish (#2065). ``` A suggestion: treating `--expert-cache N` as a cap on the number of slots (and warning when the fill would exceed it) would make the flag mean what it says and would keep the engine out of the #2065 range. `auto` already produces a sane size on a card with room, so an explicit smaller number should be honoured rather than overshot.
Author
Owner

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

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Fill in "Reproduction status".
  • Fill in "Strata version".
  • Fill in "Graphics card, memory and system".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6333936851 --> @github-actions[bot] commented on GitHub (Oct 22, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Fill in "Reproduction status". - [ ] Fill in "Strata version". - [ ] Fill in "Graphics card, memory and system". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

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

Thanks, this follows the format now.

<!-- gh-comment-id:6334491455 --> @github-actions[bot] commented on GitHub (Oct 22, 2026): Thanks, this follows the format now.
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:6659628361 --> @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#1532
No description provided.