Repository navigation
docs(memory): correct the zero-copy cold-path figure 11.4 -> 5.6 GB/s (#880) - #881
Merged
Merged
Conversation
…#880) The 11.41 GB/s I recorded from #877 was measured with a sequential cuMemcpyDtoD from mapped host memory. #880 ran the REAL strided int4 GEMV -- the exact kernel and launch config the engine selects -- with only the weight pointer differing, and measured ~5.6 GB/s steady-state from host-mapped memory against ~100-133 GB/s resident, outputs bit-identical at every size. The proxy was optimistic by ~2x; size the hybrid's cold path at 5.6, not 11.4. Corroborated independently: WDDM reaches ~8 tok/s on qwen14b-zp by keeping ~7.7 GB resident and reading the ~0.6 GB remainder from host each step, which is ~4.8 GB/s of PCIe traffic -- the same order, and impossible if zero-copy were ~1 GB/s. Also records that sweeping the packed size mattered (the realistic ~12 MiB per-tensor read fits L2, so a single point there compares a cached read against a PCIe read) and that CUDA graph capture with a host-mapped weight pointer is SUPPORTED and replays bit-identically, so the cold path does not forfeit the #796 capture gates. The ~2x penalty is not the ~10x that would have killed the design: the zero-copy half of the hybrid survives, and residency remains the dominant lever at ~9.7x realistic / ~15-24x at large N. Refs #880 #877 #864 #874 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 #881 +/- ##
==========================================
- Coverage 78.39% 77.79% -0.61%
==========================================
Files 354 354
Lines 148003 148003
Branches 148003 148003
==========================================
- Hits 116027 115133 -894
- Misses 27480 28378 +898
+ Partials 4496 4492 -4
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.
I published 11.41 GB/s for host-mapped weight reads on #877 and labelled it an upper bound. #880 measured the real thing and it was a meaningfully loose bound — correcting it here rather than leaving the optimistic number in the single-source doc.
What changed. #877 used a sequential
cuMemcpyDtoDfrom mapped host memory. #880 ran the real strided int4 GEMV — the exact kernel and launch config the engine selects forqwen14b-zp— with only the weight pointer differing, activation/scales/zero-points/output resident in both arms. Result: ~5.6 GB/s steady-state host-mapped against ~100–133 GB/s resident, outputs bit-identical at every size. I reproduced it independently before merging #880.Size the hybrid's cold path at 5.6 GB/s, not 11.4.
Why the correction is trustworthy. It cross-checks against a measurement taken for an entirely different purpose: WDDM reaches ~8 tok/s on
qwen14b-zpby keeping ~7.7 GB resident and reading the ~0.6 GB over-budget remainder from host each step — ~4.8 GB/s of PCIe traffic, the same order. If zero-copy were really ~1 GB/s, #874's result would be impossible. Two independent paths landing on the same order is much stronger than either alone.Also recorded:
captures > 0/fallbacks == 0gates (Page offloaded weights under a stable VA so offload keeps CUDA graph capture (#716) #796), which I had flagged as an open design risk.The design survives. A ~2× penalty is not the ~10× that would have killed it. Residency remains the dominant lever (~9.7× at the realistic per-op shape, ~15–24× at large N), so the priority order from #877 stands: maximise the resident fraction first, de-copy the remainder second.
Docs only.