[GH-ISSUE #3692] [Engine] Windows HIP: expert cache auto shrinks to ~3,100 slots while ~4.4 GiB of VRAM sit free - the free-VRAM read after the memset reports near zero under WDDM, and the size follows the pagefile state #1531

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/3692

Area

[Engine]

Desktop app, Terminal or source?

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

What happened

expert cache auto can shrink the cache far below what the card actually has
free
, and how far it shrinks depends on the machine's pagefile/commit state
rather than on the model.

Same binary, same config, same card, two days:

date pagefile boot line free VRAM after load
2026-10-18 paging file off, commit limit 107.8 GiB with 19.0 GiB left expert cache 3087 slots, 4,456 MiB free ~4.4 GiB
2026-10-21 System-managed 9 GiB, commit 109.9 GiB expert cache 4480 slots, 7.29 GiB of VRAM 1,158 MiB

On the 18th the engine gave itself 1,393 fewer expert slots (about 30% of
the cache) while roughly 4.4 GiB of VRAM sat unused. The engine's own log
shows the mechanism:

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 1119 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache
strata generate: expert cache 3985 slots, 6.42 GiB of VRAM; policy is

The free-VRAM read that happens after the slots are written reports close
to zero under WDDM, so the shrink loop steps the cache down by quarters. On
the 18th the same read said "only 4,456 MiB free" and the loop stopped at
3,087 slots; on the 21st it said 1,119 MiB and it stopped at 4,480. The
difference between the two days was the pagefile/commit state, not the GPU.

Why it matters: the expert cache is what keeps the decode fast, and the engine
also warns about the opposite extreme ("only 996 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"). The same read
that overshoots on one day produces an under-filled cache, and on another day
it produces the driver-paging warning.

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), any pack, --expert-cache auto,
    --vram-reserve-mib 1280.
  3. Boot once with the paging file set to "No paging file" (or a small fixed
    size), then boot again after restoring a System-managed paging file.
  4. Compare the expert cache N slots line between the two boots.

Reproduction status

Reproduces on every boot while the paging file is off or small; the same
binary on the same card boots at 4,400+ slots once a System-managed paging file
is back. Two boots on the same day with the same paging-file setting gave the
same number, so it follows the memory state, not the day.

Strata version

0.1.44.1 (the shape is the same on 0.1.45 and 0.2.0-beta, which shrink to
3,087 slots with "only 0 MiB free once the slots are written").

Graphics card, memory and system

RX 7800 XT 16 GB (gfx1101) · 96 GB RAM · Ryzen 5 5500 (AVX2) · Windows 11
(pagefile off in the first run, System-managed 9 GiB in the second)

Model, size and settings

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

Logs

[strata] 2026-10-18 08:41:12 engine started: ... --expert-cache auto --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 4456 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache
strata generate: expert cache 3087 slots, 4.90 GiB of VRAM; policy is
strata serve: 4368 MiB of VRAM free with everything loaded

[strata] 2026-10-21 07:12:04 engine started: ... --expert-cache auto --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 1163 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache
strata generate: expert cache 4480 slots, 7.29 GiB of VRAM; policy is
strata serve: 1158 MiB of VRAM free with everything loaded

A suggestion: the free-VRAM read right after the memset decides the final
size, and under WDDM it is the least reliable number of the whole boot. A
read taken a moment later (after the driver has settled), or one that compares
the free amount against the amount the slots actually reserved, would keep the
cache near the card's real capacity in both situations. Alternatively the
shrink could stop at the size the earlier auto estimate already proposed
(3,530 slots here) instead of going below it.

Originally created by @dai8647 on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3692 ### Area [Engine] ### Desktop app, Terminal or source? Source (engine built from the release tag on Windows, HIP build). ### What happened `expert cache auto` can shrink the cache **far below what the card actually has free**, and how far it shrinks depends on the machine's pagefile/commit state rather than on the model. Same binary, same config, same card, two days: | date | pagefile | boot line | free VRAM after load | |---|---|---|---| | 2026-10-18 | paging file off, commit limit 107.8 GiB with 19.0 GiB left | `expert cache 3087 slots, 4,456 MiB free` | ~4.4 GiB | | 2026-10-21 | System-managed 9 GiB, commit 109.9 GiB | `expert cache 4480 slots, 7.29 GiB of VRAM` | 1,158 MiB | On the 18th the engine gave itself **1,393 fewer expert slots** (about 30% of the cache) while roughly 4.4 GiB of VRAM sat unused. The engine's own log shows the mechanism: ``` 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 1119 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache strata generate: expert cache 3985 slots, 6.42 GiB of VRAM; policy is ``` The free-VRAM read that happens **after the slots are written** reports close to zero under WDDM, so the shrink loop steps the cache down by quarters. On the 18th the same read said "only 4,456 MiB free" and the loop stopped at 3,087 slots; on the 21st it said 1,119 MiB and it stopped at 4,480. The difference between the two days was the pagefile/commit state, not the GPU. Why it matters: the expert cache is what keeps the decode fast, and the engine also warns about the opposite extreme ("only 996 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"). The same read that overshoots on one day produces an under-filled cache, and on another day it produces the driver-paging warning. ### 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), any pack, `--expert-cache auto`, `--vram-reserve-mib 1280`. 3. Boot once with the paging file set to "No paging file" (or a small fixed size), then boot again after restoring a System-managed paging file. 4. Compare the `expert cache N slots` line between the two boots. ### Reproduction status Reproduces on every boot while the paging file is off or small; the same binary on the same card boots at 4,400+ slots once a System-managed paging file is back. Two boots on the same day with the same paging-file setting gave the same number, so it follows the memory state, not the day. ### Strata version 0.1.44.1 (the shape is the same on 0.1.45 and 0.2.0-beta, which shrink to 3,087 slots with "only 0 MiB free once the slots are written"). ### Graphics card, memory and system RX 7800 XT 16 GB (gfx1101) · 96 GB RAM · Ryzen 5 5500 (AVX2) · Windows 11 (pagefile off in the first run, System-managed 9 GiB in the second) ### Model, size and settings Swift-Qwen3.8-Flash-Next IQ3_XXS (Swift-abliterated), pack `packs/swift_mmap`, `--expert-cache auto --vram-reserve-mib 1280 --resident-budget-gib 40` ### Logs ``` [strata] 2026-10-18 08:41:12 engine started: ... --expert-cache auto --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 4456 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache strata generate: expert cache 3087 slots, 4.90 GiB of VRAM; policy is strata serve: 4368 MiB of VRAM free with everything loaded [strata] 2026-10-21 07:12:04 engine started: ... --expert-cache auto --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 1163 MiB free once the slots are written (reserve 1280 MiB); shrinking the expert cache strata generate: expert cache 4480 slots, 7.29 GiB of VRAM; policy is strata serve: 1158 MiB of VRAM free with everything loaded ``` A suggestion: the free-VRAM read right after the memset decides the final size, and under WDDM it is the least reliable number of the whole boot. A read taken a moment later (after the driver has settled), or one that compares the free amount against the amount the slots actually reserved, would keep the cache near the card's real capacity in both situations. Alternatively the shrink could stop at the size the earlier auto estimate already proposed (3,530 slots here) instead of going below it.
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:6333935589 --> @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:6334490538 --> @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:6659622602 --> @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#1531
No description provided.