Repository navigation
docs: correct stale memory/offload/KV claims against measurement - #781
Conversation
Truth pass over the memory/offload/KV/capture docs, correcting claims that hardware measurement has overturned and marking aspirational design text as proposals rather than implemented capability. - ORT2.md 30.4-30.8: prefetch/compute overlap was measured ineffective and removed (PR #715, corroborated by AirLLM #718); h2d transfer corrected from the withdrawn 1.7% to 18.8%. - DESIGN.md 39.5: replace the wrong 'tokens per granule' KV framing with the per-object granule floor and the model-size-independent crossover granule/(head_dim*sizeof(dtype)) (PR #776). - MEMORY_ARCHITECTURE.md: add the central KV reservation-geometry section (facts on granule floor, crossover, 2 MiB min==recommended, read-bounded commit #772, offload/capture mutual exclusion #716, prefetch deletion #715); augment KV-page-storage row with VMM device ownership (#740/#745/#748); add a documentation-hygiene note on citing measurements. - WEIGHT_OFFLOAD.md: mark prefetch as superseded design (#715/#718); add offload/capture mutual exclusion (#716), residency-cache 0%-hit fix (#723), and committed-physical-bytes budgeting. - CUDA_GRAPH_CAPTURE.md: add offload/capture mutual exclusion (#716) and captured-graph VMM remap survival (#727). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Coordinator review — approving and merging. The find that justifies this pass on its own is \DESIGN.md\ §39.5: it modelled KV virtual-memory cost as tokens per granule, with a table claiming a 2 MiB granule holds ~1024 tokens and a sequence floors at The correction style is what I asked for and is the reason this is safe to merge: the falsified prefetch design in \ORT2.md\ §30.5 and the \prefetch_weights_async\ sketch are retained and labelled as discarded design with the superseding PR cited, rather than silently deleted. A reader who remembers the old claim can see it was tested and overturned. KV geometry is consolidated into \MEMORY_ARCHITECTURE.md\ as the single source with the other documents linking to it, which is what should stop this from drifting again. Verified docs-only: all 5 changed files are markdown, no code or tests touched. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #781 +/- ##
=======================================
Coverage 79.40% 79.40%
=======================================
Files 331 331
Lines 137528 137528
Branches 137528 137528
=======================================
Hits 109199 109199
Misses 23985 23985
Partials 4344 4344
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
|
## Summary - record the three-slice over-reservation finding and path-first audit guidance - refresh governed and raw workspace status from current CUDA/session code - correct the default-domain Attention score sizing/lifetime and name it as the next slice ## Validation - `git diff --check` - confirmed exactly one Markdown file changed and no non-Markdown files changed References #736 References #751 References #753 References #795 References #799 References #745 References #750 References #777 References #781 References #791 Co-authored-by: justinchuby <223556219+Copilot@users.noreply.github.com>
Summary
A truth pass over the memory / offload / KV / capture documentation. Over the
past days a series of hardware measurements (RTX 4060 Laptop GPU, Windows/WDDM)
overturned several claims still asserted as fact in
docs/. This PR finds thoseclaims, corrects them against what was measured, and — where a document described
an intended design in the present tense as though it were implemented — marks it
as a design proposal with its current status. No wrong claim is silently deleted:
each is replaced with what was measured and the PR/issue that superseded it, so a
reader who remembers the old number can see it was tested and retired.
Docs-only. No code or tests changed.
Corrected claims
ORT2.md§30.4–30.8// Async prefetch next layer's weights (overlaps with current compute)ORT2.md§30.6 / §30.7memory.prefetch_layerspresented as an active knobDESIGN.md§39.5num_layers × 2 × 2 MiBgranule/(head_dim × sizeof(dtype)), model-size independent (~8,192 tok @ head_dim 128/fp16; ~16,384 @ 64/fp16); quantized KV doubles it. 2 MiB is min and recommended — no finer granule on this device.MEMORY_ARCHITECTURE.mdMEMORY_ARCHITECTURE.md(KV page storage row)CudaVmmAllocator, #740 pool), with committed-granule admission (#745) and growth grants (#748);native_decode/cuda.rshas noPageTableconsumer andpaged_gqa.rsis a batch-1 CPU primitive.WEIGHT_OFFLOAD.md§7.3, Phase 4WEIGHT_OFFLOAD.md§0.4CUDA_GRAPH_CAPTURE.mdcuMemMap-during-capture are not proven.Deliberately left unchanged
GQA_KV_MATERIALIZATION_DESIGN.md,KV_INSERTION_DESIGN.md,DECODE_POOL_RESIDENCY_DESIGN.md,NATIVE_CUDA_DECODE.md,CUDA_STRATEGY.md,native-ort-kv-capacity.md— checked against the relevant facts and foundaccurate/self-consistent for their scope (CPU-kernel data movement, CPU
decode-pool threading, the native-decode milestone plan, the KV-capacity policy).
Correct docs were not restructured, and subject areas outside this pass (CPU EP,
quantization formats, CLI, diffusion) were not touched.
Preventing recurrence
Added a documentation-hygiene note to
MEMORY_ARCHITECTURE.md: a performanceclaim in docs must cite the measurement that produced it; when measurement
overturns a claim, correct it in place and name what superseded it rather than
deleting it; and keep measured fact, design intent, and not-yet-built visibly
distinct.
Refs #715, #716, #718, #721, #723, #727, #740, #745, #748, #772, #776.