Repository navigation
feat(vllm): MTP spec dec inference for nemotron super/ultra with refit drafter - #2999
Merged
Merged
Conversation
- vLLM backend/worker support for MTP spec-decode (drafter arrives via refit) - super_launch.sh: ENABLE_MTP_INFERENCE gating (prefix caching off, chunked prefill, mamba_cache_mode=align, drop cudagraph sizes, speculative_config) - spec-decode acceptance metrics wired into async_grpo_train - detect MTP training (trains_mtp) in run_grpo_nemo_gym.py Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
youngeunkwon0405
self-requested a review
June 30, 2026 05:19
Resolve conflicts:
- vllm_backend.py: keep the class-level _mtp_drafter_from_disk attribute alongside
main's bind_numa(); in update_weights_from_collective run main's
process_weights_after_loading for the main model then the MTP drafter finalize.
- run_grpo_nemo_gym.py: keep the trains_mtp/has_refit_draft_weights wiring inside
main's rl_init_timer.time("tokenizer") block.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
Unit-test the refit-into-drafter path added for co-trained MTP speculative decoding, using the existing mocked-drafter harness (no GPU): - _mtp_drafter_refit_enabled: gating matrix over spec method (mtp/deepseek_mtp vs eagle3/none), disk-load flag, and drafter presence. - _maybe_refit_mtp_drafter: feeds vocab-trimmed policy weights to the drafter when enabled; no-op for the disk-load path and non-MTP drafters. - _maybe_process_mtp_drafter_after_loading: finalizes against the draft model config when enabled; skipped for the disk-load path. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
…emotron-3-Super 120B Add MTP-inference variants of the Nemotron-3-Super 120B-A12B GRPO recipes so the co-trained MTP drafter refit path is exercised on both weight transports: - grpo-nemotron3-super-120BA12B-16n8g-megatron-mtp: inherits the base recipe (already trains MTP) and enables speculative_config.method=mtp. Colocated -> IPC refit transport. - grpo-nemotron3-super-120BA12B-8n4g-megatron-mtp: additionally co-trains the MTP layer (mtp_num_layers=5, matching 16n8g) so the drafter is refit rather than disk-loaded. Non-colocated -> collective refit transport. Both keep load_format=dummy: trains_mtp=True routes the MTP weights through refit. Drivers mirror the base ones with extra startup headroom for the MTP drafter compile, and both are added to nightly.txt. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
Contributor
Author
|
/ok to test 6a0d514 |
…3-Super 120B math recipes Fold MTP speculative-decoding inference into the existing 16n8g and 8n4g Nemotron-3-Super math recipes instead of shipping separate -mtp recipes and drivers (removed): - 16n8g already co-trains the MTP layer; add speculative_config.method=mtp plus prefix caching / chunked prefill / mamba_cache_mode=align. - 8n4g additionally co-trains the MTP layer (mtp_num_layers=5) so the vLLM drafter is refreshed via refit (non-colocated / collective transport). Validated end-to-end on GB200 8n4g: MTP speculative decoding active with ~44% draft acceptance (mean accept length 3.21). Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
…ecipe The colocated 16n8g recipe (gpu_memory_utilization=0.5 shared with training) leaves vLLM limited memory on H100, yielding fewer Mamba cache blocks than vLLM's default max_num_seqs=1024. With mamba_cache_mode=align each decode sequence needs one Mamba block, so CUDA graph capture fails. Cap at max_num_seqs=16, matching the proven Nemotron-3-Super H100 gym config (stage1_rlvr_convergence_27node_h100.yaml). GB200 8n4g is non-colocated with far more memory, so it is unaffected. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
youngeunkwon0405
removed their request for review
July 17, 2026 23:56
Contributor
Author
|
/ok to test 7ac4824 |
`_get_drafter_model` returns a dynamic vLLM drafter model (Eagle3/MTP head), not a plain `nn.Module`. Annotating it `Optional[torch.nn.Module]` made pyrefly resolve `.load_weights` and `.mtp_start_layer_idx` through `nn.Module.__getattr__` (typed `Module | Tensor`), producing spurious not-callable / no-matching-overload errors. Return `Any` (matching the pre-refactor raw `getattr` behavior), which clears all 6 errors. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
yfw
force-pushed
the
yifu/super_mtp_rebased
branch
from
July 20, 2026 16:47
8c3034c to
cecd98d
Compare
Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
Contributor
Author
|
/ok to test 84d2aa9 |
ashors1
reviewed
Jul 20, 2026
ashors1
left a comment
Contributor
There was a problem hiding this comment.
This PR adds MTP speculative-decoding support for vLLM inference with a refit-based drafter weight update path. The core gating logic (_mtp_drafter_refit_enabled) correctly handles all cases (co-trained vs disk-loaded MTP, Eagle3, disabled spec-decode). Six comments below — one correctness concern and five suggestions.
Generated by Claude Code
Signed-off-by: Yi-Fu Wu <[email protected]>
# Conflicts: # nemo_rl/models/generation/vllm/vllm_backend.py
Signed-off-by: Yi-Fu Wu <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]> # Conflicts: # nemo_rl/models/generation/vllm/vllm_backend.py
Contributor
Author
|
/ok to test 7684a73 |
ashors1
previously approved these changes
Jul 21, 2026
Signed-off-by: Yi-Fu Wu <[email protected]>
Contributor
Author
|
/ok to test fee9f80 |
Signed-off-by: Yi-Fu Wu <[email protected]>
Contributor
Author
|
/ok to test 574732c |
ashors1
approved these changes
Jul 22, 2026
This was referenced Jul 30, 2026
4 tasks done
3 of 4 tasks
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.
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information