[GG] Fix MRV2 high-utilization startup memory profiling#172
Conversation
📝 WalkthroughWalkthroughChangesThe worker now performs guarded one-time kernel warmup and replays model profiling around persistent warmup allocations. MLA sparse profiling skips synthetic workspace allocation during CUDA graph capture. FlashInfer warmup safely handles runners without optional attention metadata. Kernel warmup and profiling
Sequence Diagram(s)sequenceDiagram
participant Worker
participant ModelRunner
participant Compressor
participant KernelWarmup
Worker->>ModelRunner: profile_run()
Worker->>Compressor: deepseek_v4_compressor_triton_warmup()
Worker->>KernelWarmup: _warmup_kernels_once()
Worker->>ModelRunner: profile_run()
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9569e89 to
cffd278
Compare
|
Data point from the same high-utilization regime, in case it is useful for sizing this fix. On 4x RTX PRO 6000 Blackwell (96 GB, no NVLink, all- v19 ( v20 ( Two contributions, and the profiler is the smaller one:
The in-log suggestion ( Question: after this PR, is the expectation that the profile reports the persistent Note this is specific to large-weight checkpoints already near the ceiling — the |
cffd278 to
0c05ab9
Compare
|
Answer to the capacity question after the completed investigation: this PR makes persistent kernel/DCP allocations visible before KV sizing; it does not reclaim them. The companion graph-pool fix is now #180, and it also reserves the full graph high-water mark because retained private-pool pages are PyTorch-reserved and were previously omitted by |
Problem
MRV2 can size KV cache before persistent DCP/JIT kernel resources exist. At
high GPU utilization this can over-allocate KV and fail later during kernel
warmup or CUDA graph capture.
A single model profile is insufficient after warmup moves earlier: it observes
either the transient activation peak or newly persistent resources, not their
simultaneous high-water mark.
Fix
profiling, before KV allocation;
top of the persistent baseline;
attn_groupsyet;capture while retaining it during ordinary memory profiling.
This PR does not change the inference hot path, backend selection, or requested
GPU utilization.
Related fixes
This PR addresses persistent-resource ordering only. The full high-utilization
startup fix also needs:
high-water accounting;
default-output workspace.
Those responsibilities remain separate so kernel warmup, graph-pool lifecycle,
and communication-buffer ownership can be reviewed independently.
Validation
and FlashInfer pre-KV warmup: passed;
TP4/DCP4/MTP3 NF3, MNS 16, graph 64, max model length 350,208, batched tokens
2,048, GMU 0.98 reached READY with 563,712 KV tokens and completed a
300,017-token prefill plus decode; health remained OK;
300,066-token prefill plus 512 decode in 65.924 seconds and remained healthy.
The tested graph-pool profile measured 1.00 GiB total, with 0.72 GiB already
retained in the reusable pool. vLLM #180 intentionally reserves that full
high-water mark; the older
gross - retainedresult omitted livePyTorch-reserved pages and could overstate KV capacity.
Capacity interpretation
This change makes persistent memory visible rather than reclaiming it. A lower
reported KV capacity can therefore be the correct result. The helper's logged
GMU adjustment can recover capacity only when physical headroom exists; it
cannot compensate for genuinely persistent model or DCP allocations.
The earlier 480k/GMU 0.98 failure was not rerun with the complete #180/#76
stack. Only the 350,208-token profile above is validated here, so this PR does
not claim 480k is safe.
AI assistance disclosure
The implementation review, tests, hardware validation, and this write-up were
prepared with OpenAI Codex assistance and reviewed by the human submitter.