Repository navigation
[rl] MTP on GDN models: FULL CUDA graphs for steps with prefill - #6478
Draft
liangel-02 wants to merge 3 commits into
Draft
liangel-02 wants to merge 3 commits into
liangel-02 wants to merge 3 commits into
Conversation
cuda_graph.mode="FULL" with MTP drafts maps to vLLM's FULL: verify-only steps replay the uniform verify graph, steps with prefill the packed mixed graph. The drafter replays breakable piecewise graphs (VLLM_USE_BREAKABLE_CUDAGRAPH). capture_model refuses piecewise modes and a lowered FULL, the graph-memory estimate keeps verify graphs charged, and the drafter captures under a FULL target.
…er the checks capture_model's mode check keeps one condition: with drafts, a requested FULL must stay FULL. TorchTitan compiles with CompilationMode.NONE, so vLLM never resolves a mode with piecewise target graphs.
3 tasks
This branch has not been deployed
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.
Supersedes #6403 (originally by felipemello1).
Summary (human-written)
Agent details
Stack, bottom to top:
The stack lands after the vLLM 0.33 PRs ("[rl] generator: vLLM 0.33 API fixes and TP padding in the model wrapper", "[rl] Install vLLM 0.33.0 on the torch nightly"). "[rl] generator: run on vLLM's model runner V2 (vLLM 0.34)" rebases on it.
TLDR:
cuda_graph.mode="FULL"now works with MTP drafts. Steps that mix prefill rows and verify rows replay one FULL CUDA graph, using the GDN builder's packed path (PR 1). The MTP drafter replays vLLM's breakable piecewise graphs. Below this PR, drafts need FULL_DECODE_ONLY, which runs every step with prefill eagerly. In multi-turn agent loads, every new turn starts with such a step. Earlier runs: +6.3% output tok/s over piecewise graphs for those steps (Qwen3.8-27B, 26 sessions, NOTE).Problem
Solution
VLLMCudaGraphConfig: FULL with drafts is vLLM's FULL.VLLMEngine._setupsetsVLLM_USE_BREAKABLE_CUDAGRAPH=1(_enable_breakable_cuda_graphs), after the config checks and before vLLM registers the model. vLLM makes its attention op a graph break only if the variable is set when it imports the op, so the engine checks the op and raises if it isn't one.TorchTitanEagleProposer.dummy_runcaptures the drafter's graphs at start-up under a FULL target.capture_modelraises instead of replaying wrong state:AttentionCGSupport.ALWAYS);No mode puts GDN inside piecewise target graphs: TorchTitan compiles with
CompilationMode.NONE, so vLLM lowers to FULL_DECODE_ONLY or NONE.Results
You may ask:
TorchTitanGPUWorker.init_deviceraises on V2). "[rl] generator: run on vLLM's model runner V2 (vLLM 0.34)" rebases on this stack.NOTE:
test_gdn_cudagraph.pyruns in CI's RL 1 GPU job (A10G) when the PR has theciflow/rllabel. That job was green at the old head of "[rl] MTP on GDN models: FULL CUDA graphs for steps with prefill" (tagciflow/rl/6403), which had these cases. There they skip only without CUDA or the model path, which the workflow sets, so they most likely ran. Its log was not read. Not run there at this head yet. A TODO at the test says to add it to the B200 RL workflow once the fused-kernel PR lands.Follow up / TODO (each has a
# TODOat its site)_enable_breakable_cuda_graphsonce the vLLM pin reaches v0.33+, which decides graph breaks at call time. Keep the variable until vLLM honors an explicitCompilationConfig.use_breakable_cudagraph.dummy_runoverride with the move to vLLM's V2 model runner.test_gdn_cudagraph.pyin the B200 RL workflow once the fused-kernel PR lands.Test plan