Repository navigation
[rl] MTP: replay the verify CUDA graph only when every row verifies - #6474
Draft
liangel-02 wants to merge 2 commits into
Draft
liangel-02 wants to merge 2 commits into
liangel-02 wants to merge 2 commits into
Conversation
…y row verifies vLLM calls a step uniform when every row has 1 + k tokens, so a 1 + k token prefill row could replay the uniform verify graph, which runs only GDN's verify kernels. The runner now asks for the uniform graph only when every row verifies k drafts, and resets vLLM's draft counts on steps without drafts.
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 #6402 (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: With MTP drafts, vLLM replays the uniform "verify" CUDA graph for any step whose rows all have 1 + k tokens. A prefill row of exactly 1 + k tokens passes that test. The verify graph runs only GDN's verify kernels, so the GDN builder (PR 1) raises on such a step. Now the runner calls a step uniform only when every row verifies k drafts.
Problem
kdrafts, each decode step verifies 1 + k tokens per row. FULL and FULL_DECODE_ONLY replay a FULL "uniform" graph for these steps.Solution
_determine_batch_execution_and_paddingpasses vLLM'sforce_uniform_decode: True only when every row has k drafts. vLLM uses it in place of its shape test._prepare_inputsresetsnum_decode_draft_tokensto -1 on steps without drafts. vLLM writes it only on steps with drafts, so it would keep the last step's counts.force_uniform_decode.Results
You may ask: why not fix vLLM? vLLM's V2 model runner already keeps steps with a prefill row off decode graphs (
decode_graph_eligible). TorchTitan runs the V1 runner, and vLLM main deleted it, so a fix there would not land. The TODO at the override says to drop it with the move to V2.NOTE:
test_draft_builder_rejects_rows_it_cannot_stage) covers what the wrong choice would hit.Test plan