Repository navigation
Conversation
cobra91
force-pushed
the
wddm-shrink-cap
branch
from
November 16, 2026 12:54
141e6a0 to
0ab5ff7
Compare
cobra91
force-pushed
the
wddm-shrink-cap
branch
from
November 19, 2026 08:50
0ab5ff7 to
b04d772
Compare
Contributor
Author
|
Verified and benchmarked in isolation on Strata v0.2.17 ( In
Clean, fully mergeable, and confirms stability on v0.2.17. |
This was referenced Nov 24, 2026
cobra91
force-pushed
the
wddm-shrink-cap
branch
from
November 26, 2026 14:01
b04d772 to
c234774
Compare
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
Under Windows WDDM, when the engine sizes the primary expert cache and queries
device_free_bytes()right after initial allocation, WDDM's memory reporting can lag, occasionally returningfree_b < 16 MiB.In Vanilla upstream (
src/program/generate.cpp:9022), whenfree_bis near 0,giveis computed as:Because
wantincludes--vram-reserve-mibpluspipe_first,givedrops 1.0 to 1.4 GiB in a single iteration. If WDDM driver reporting remains low on the second check, it chops another 1.4 GiB (losing up to 2.8 GiB of VRAM).In multi-GPU configurations (
--layer-split auto), this over-reduction tricks the layer-split cost model into believing GPU0 lacks capacity, causing it to push excessive layers to secondary cards (e.g., dropping K from 22 to 17 on an RTX 5080 + 4060 Ti rig). In single-GPU or dual-GPU setups, it leaves hundreds of MiB (or even GiB) of dead VRAM space above the requested reserve, unnecessarily spilling expert slots to host RAM or disk.Solution
free_b < 16 MiB, step down by 256 MiB per read for up to 4 iterations (++zero_reads <= 4 ? 256ll << 20 : xcache.bytes() / 4).free_b >= 16 MiB, cap the shrink tostd::min(give, 256ll << 20).shrinking the expert cache by %lld MiB.Validation
Tested on a physical dual NVIDIA rig:
upstream/main(c77572806)Swift-Qwen3.8-Flash-Next(IQ2_XS), 64K context,q4_0KV,--layer-split auto --pipeline-windows 2A/B Observations during startup & load:
v0.2.15)Sustained Generation Benchmark (10,000 Continuous Tokens, Cold + Warm, 40,000 Tokens Total):
Tested under continuous heavy dual-GPU load (~260W total across both cards):
c775728) Cold