Repository navigation
[Other] setup: keep 3 GB of VRAM for the desktop on an AMD card under Windows - #258
Draft
okada-shogo wants to merge 1 commit into
Draft
okada-shogo wants to merge 1 commit into
okada-shogo wants to merge 1 commit into
Conversation
Windows' video memory budget lets strata-poly take nearly the whole card (15,419 of an RX 9070 XT's 16,304 MiB) while the desktop's programs hold 2-3 GB of it, and the engine filled that budget. Prompts were then read at a third of their speed. Setup now writes --vram-reserve-mib DESKTOP_RESERVE_MIB (3072, the reserve that already keeps a Linux desktop alive beside a full expert cache) into a strata-poly config on an AMD card under Windows, unless --vram-reserve-mib was given. Inkling 2 Mini IQ4_NL on that card (Windows 11, ROCm 10.2.0a20260930), a warm request first, mean of 3 runs: prompts of 302 / 2,048 / 8,192 tokens 151 / 290 / 323 -> 360 / 670 / 1,026 tokens/s; decode after 302 tokens 34.2 -> 33.0, after 8,192 tokens 33.5 -> 29.2 tokens/s (9.3 GiB of experts on the card instead of 11.8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
On Windows with an AMD card, strata-poly fills the VRAM budget Windows gives it (15,419 of an RX 9070 XT's 16,304 MiB),
while the desktop's programs hold 2-3 GB of the same card. Prompts were then read at a third of their speed. Setup
now writes
--vram-reserve-mib 3072(DESKTOP_RESERVE_MIB, the reserve that already keeps a Linux desktop alive) intoa strata-poly config on an AMD card under Windows, unless
--vram-reserve-mibwas given.Prompt speed, tokens per second (tok/s), higher is better. Windows 11, RX 9070 XT 16 GB, Inkling 2 Mini IQ4_NL,
--kv fp16, 16K context, no expert profile, each process sent a warm request first, mean of 3 runs:Decode speed, tokens per second (tok/s), higher is better. Same runs:
Experts in VRAM: 11.8 GiB → 9.3 GiB. Decode is slower because fewer experts fit; prompts are faster because the card
is no longer over its budget. After 8,192 tokens + 256 written, a request takes 17 s instead of 33 s.
Each run (tok/s)
Prompt tok/s, higher is better, each run:
Decode tok/s, higher is better, each run:
The two settings alternated. The engine was combined/ready (this repo's main plus our open PRs, #217 among them),
built by setup on that PC. VRAM free at the end: 0 MiB in every default run, 2,436-2,938 MiB with 3072.
Why 3072 and not less: 8,192-token prompts with other reserves
Same card and model, 8,192 tokens + 256 written, 2 runs each, the settings alternated.
As the second request of a process (a 302-token request first). Prompt tok/s, higher is better:
Decode tok/s, higher is better:
As the first request of a process (the engine with #257, so no one-time BLAS wait). Prompt tok/s, higher is
better:
Decode tok/s, higher is better:
MiB helps there (493-557 MiB free at the end).
requests (28.4 against 33.9-37.4).
strata-poly --tokens, no warm request) read 96.3%, 90.8% and 87.1% of their experts from VRAM at default, 2048 and 3072, withthe same decode speed (31.9, 32.1, 32.9 tok/s). So fewer resident experts alone does not explain the later
requests' loss; I have not found the cause yet.
Related discussion
none.
Approach
win_hip_reserve()returns--vram-reserve-mib DESKTOP_RESERVE_MIBon Windows with the HIP backend, and nothingelsewhere.
poly_setup()uses it only when the person gave no--vram-reserve-mib, so an explicit value still winsand is kept as before. Linux, NVIDIA and the main engine's configs are unchanged. A config written by an earlier setup
gets the reserve on its next setup run, not on a plain start.
Class: placement (fewer experts on the card).
Validation
Passed:
cd terminal && python3 -m unittest discover -s tools -p 'test_setup*.py': 1358 tests OK (skipped 1), including thenew
VramReserve.test_windows_amd_default.python3 tools/check --only docs: passed.Failed: none observed.
Not run:
this branch writes.
VRAM loses experts for no gain.
Limits
fewer experts fit, but one-shot runs with the same reserve decode at full speed, so the cause is not found yet.
2048 MiB keeps the later requests' prompt gain with less decode loss, but does not help the first long request.
one with fewer loses experts for nothing. Reading Windows' per-process usage at start would size it better; that is
an engine change, not done here.
🤖 Generated with Claude Code