Repository navigation
[Worker] Load weights without the split limit under expandable segments (canonical twin of #980) - #981
[Worker] Load weights without the split limit under expandable segments (canonical twin of #980)#981voipmonitor wants to merge 2 commits into
Conversation
not fragment. With expandable segments the allocator releases free pages instead of whole blocks, and the limit instead strands the pages that persistent weights share with freed loading temporaries: empty_cache() cannot unmap them, and the memory profile then charges them against the KV cache. Measured with torch.cuda.memory_reserved() - memory_allocated() after loading, per GPU: - GLM-5.3-Flash glm53-tp2 (NVFP4-CSF, stage-read scales): 0.59 -> 0.08 GiB; with per-layer expansion 0.42 -> 0.12 GiB. Both start and serve; the preset's fixed KV cache leaves that much more headroom. - DeepSeek-V4.1-Flash TP4 with b12x#479's inline scales before its own allocator fix: 1.01 -> 0.04 GiB, KV cache 11.96M -> 12.86M tokens, weight loading 143 -> 120 s. The classic allocator keeps the limit. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Martin Vit <martin@voipmonitor.org> (cherry picked from commit f2d1272)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Martin Vit <martin@voipmonitor.org> (cherry picked from commit ffb0d84)
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe worker now skips setting a temporary allocator split limit when ChangesAllocator loading
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change preserves classic allocator behavior and avoids applying the temporary split limit to expandable segments. No concrete current-head merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Closing: |
Canonical twin of #980 (merged into the Karmic beta as
00a33e2314), ondev/karmic-kraken. The same change and release fragment; the cherry-pick conflicted only in test context (this branch lacks beta's startup-plan test), and the added and removed lines are identical.Summary
Upstream vllm-project#41268 loads weights under
max_split_size_mb:20so that cached blocks do not fragment. Withexpandable_segments:True, which our presets set, the allocator releases free pages rather than whole cached blocks, and the split limit instead strands pages that persistent weights share with freed loading temporaries.empty_cache()cannot unmap them, and the memory profile then counts them as consumed: a smaller KV cache, or with a fixed KV size, less headroom._scoped_allocator_max_splitnow leaves the allocator settings alone whenPYTORCH_CUDA_ALLOC_CONFenables expandable segments. The classic allocator keeps the limit.Measurements
Instrumented
gpu_worker.py(allocator stats after loading, before the profile run), rank 0:GLM on 2× RTX PRO 6000 Max-Q (.4, GPUs 5-8, beta code b12x
d4b73caf/ vLLMff292a9c63); DS4.1 on 4× RTX PRO 6000 (aiserver, GPUs 10-13). Both GLM servers started healthy without the limit (341 s), no OOM; model memory unchanged (83.76 / 83.21 GiB).Tests
tests/v1/worker/test_gpu_worker.pyin the beta image with the beta file overlaid: 79 passed; with this branch'sgpu_worker.pyand test file: the 4 new cases pass. The newtest_weight_loading_split_limit_skips_expandable_segments(4 cases: expandable on, expandable with other options, empty, expandable off) fails on the two expandable cases without the change.Notes
_scoped_allocator_max_split; upstream still applies the limit unconditionally.🤖 Generated with Claude Code
Summary by CodeRabbit