Conversation
GLM MTP checkpoints reuse the target model's lm_head, but model construction still allocates a draft ParallelLMHead that the proposer immediately replaces. Defer only that GLM allocation behind an opt-in, fail-closed placeholder while preserving SharedHead's default behavior. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Luca Motz <luca.motz@icloud.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. WalkthroughThe change adds deferred LM-head support to ChangesDeferred MTP Shared Head
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to GLM MTP loading now avoids allocating a disposable language-model head and replaces the placeholder with the target head before inference. The default shared-head behavior remains intact, and covered replacement and fail-fast paths leave no actionable merge risk. Sequence Diagram(s)sequenceDiagram
participant GLM MTP layer
participant SharedHead
participant MTP loader
participant Target model
GLM MTP layer->>SharedHead: construct with defer_lm_head=true
SharedHead-->>GLM MTP layer: provide DeferredLMHead
MTP loader->>Target model: read lm_head
MTP loader->>GLM MTP layer: replace shared_head.head
Target model-->>GLM MTP layer: provide target lm_head
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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 |
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Luca Motz <luca.motz@icloud.com>
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment Once the PR is approved or has the If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. Agent GuidelinesIMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban. 🚀 |
Signed-off-by: Luca Motz <luca.motz@icloud.com>
a4694bd to
a3d341f
Compare
Purpose
GLM MTP constructs a
ParallelLMHeadduring loading, then the proposer replaces it with the target model's head. This disposable vocabulary projection increases the loading peak before sharing takes effect.Defer that GLM allocation with an opt-in, parameter-free
DeferredLMHeadplaceholder that fails if called before replacement. The existing proposer attaches the target head before inference; otherSharedHeadusers keep their current construction behavior.No equivalent open GLM fix was found. #54201 addresses Qwen3.5 vocabulary allocations; #55448, #55449, and #55450 address renderer warmup and KV-cache management. None defers this GLM head. AI-assisted contribution.
Test Plan
Test Result
4 passed on base
8369affa. Tests cover default construction, parameter-free deferral, failure before replacement, GLM opt-in, and the proposer's target-head sharing.DGX Spark, GLM-5.3-Flash TP2/MTP5 NVFP4; isolated
SharedHeadconstruction:8369affa3d341fBoth ranks saved 170.907 MiB of constructor allocation; the disposable head's measured storage was 170.156 MiB, including scales. PR
a3d341freached READY and served a completion.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.