Repository navigation
docs(memory): WDDM shared memory is the Windows default; record the structural cause (#874) - #876
Merged
Merged
Conversation
…tructural cause Replaces the stale '27x slower than doing nothing' row with the measured result and the mechanism behind it. On qwen14b-zp, solo, byte-identical output: WDDM 8.09/7.78 tok/s with htod_bytes_per_token = 0 (true zero-copy) against managed streaming 0.11 tok/s; main measured 0.05-0.08 minutes earlier, so ~100x end to end on this box. The cause is structural: each weight is read exactly once per decode step, so both paths move the same bytes over the same link, but ours adds a CPU memcpy, a VRAM allocation, a cuMemMap, an eviction and a synchronize to buy residency that is discarded before it is re-read. Copying to VRAM only pays off when the data is re-read from VRAM before eviction. Records why keeping the no-spill arena while disabling offload is not an option (the pool is a hard cap, cuMemCreate cannot spill, so the load fails), the no-device-budget trade of the Compatibility arm, and that Linux is unchanged and must stay so (#783). Supersedes the historical 6.01 tok/s / 27x / capture-disabled figures: capture now runs under offload (#796) and the eviction defect was fixed (#723). Refs #874 #864 #863 #705 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d60eb808-7cc6-4abc-b48d-2a6dd3841624
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #876 +/- ##
==========================================
+ Coverage 77.78% 78.23% +0.45%
==========================================
Files 354 354
Lines 147834 148003 +169
Branches 147834 148003 +169
==========================================
+ Hits 114987 115785 +798
+ Misses 28358 27720 -638
- Partials 4489 4498 +9
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
🔴 Benchmark Regression DetectedComparison of criterion micro-benchmarks: PR head vs merge-base, measured on the same runner in the same job (base first → PR second).
Visual flags: Host infoWhat this cannot catch
|
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.
Replaces the stale
27x slower than doing nothingrow with the measured result from #874 and, more importantly, the mechanism behind it.Measured on
qwen14b-zp, solo withnvidia-smiverified empty before every run, byte-identical output: WDDM 8.09/7.78 tok/s withhtod_bytes_per_token = 0(true zero-copy) against managed streaming 0.11 tok/s.mainmeasured 0.05-0.08 tok/s on the same model minutes earlier, so the end-to-end effect on this box is ~100x.The row now carries the structural cause rather than a bare ratio: each weight is read exactly once per decode step, so both paths move the same bytes over the same link, but ours adds a CPU memcpy into pinned staging, a VRAM allocation, a
cuMemMap, an eviction and a synchronize -- to buy VRAM residency discarded before it is ever re-read. Copying to VRAM only pays off when the data is re-read from VRAM before eviction, and there is no intra-step reuse.Also records three things a future reader needs and would otherwise have to rediscover:
cuMemCreatecannot spill, so with nothing paging the over-budget remainder the load fails outright.Compatibilityarm has no device budget at all, so on a host short of RAM an over-budget model can thrash and the governor cannot see system-wide pressure (WDDM pages out our VMM (cuMemCreate/cuMemMap) granules to host RAM under over-commit — #798 no-spill is an accounting guarantee, not physical residency, on WDDM #863).Supersedes the historical figures the row carried (6.01 tok/s WDDM, 27x behind, the h2d/staging/vram_free/vram_alloc split, capture disabled under offload): capture now runs under offload (#796) and the eviction-policy defect was fixed (#723).
Docs only.