Skip to content

[rl] MTP on GDN models: FULL CUDA graphs for steps with prefill - #6403

Closed
felipemello1 wants to merge 3 commits into
felipemello1/mtp-verify-stepsfrom
felipemello1/mtp-full-graphs-prefill
Closed

felipemello1 wants to merge 3 commits into
felipemello1/mtp-verify-stepsfrom
felipemello1/mtp-full-graphs-prefill

Conversation

@felipemello1

@felipemello1 felipemello1 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary (human-written)

Agent details

Stack, bottom to top:

  1. "[rl] GDN builder: stage steps with drafts in fixed buffers"
  2. "[rl] MTP: replay the verify CUDA graph only when every row verifies"
  3. "[rl] GDN layer: run steps with drafts from TorchTitan's builder"
  4. "[rl] MTP speculative decoding in the vLLM generator"
  5. "[rl] MTP verify steps: run verify rows on FA4's decode kernel"
  6. this PR
  7. "[rl] vLLM generator: fp8 KV cache through FA4's fp8 forward, MTP verify steps included"

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).

Before this PR, drafts needed FULL_DECODE_ONLY, so steps with prefill and the MTP drafter ran eagerly, and this PR replays one FULL mixed graph for those steps and vLLM's breakable piecewise graphs for the drafter (earlier runs: 1,387 vs 1,305 output tok/s against piecewise graphs for steps with prefill, +6.3%, Qwen3.8-27B, 26 sessions, one GB300).

k = 3 drafts:              FULL_DECODE_ONLY (below this PR)   FULL (this PR)
every row verifies         FULL verify graph                  FULL verify graph
step with prefill          eager                              FULL mixed graph (GDN packed path)
MTP drafter                eager                              piecewise graphs, attention eager

Problem

  1. With drafts, a step can hold verify rows (1 + k tokens), 1-token rows and prefill rows.
  2. The MTP PR (4) refuses FULL with drafts, so drafts run FULL_DECODE_ONLY: steps with prefill run eagerly.
  3. vLLM's V1 runner captures drafter graphs only while the target captures piecewise graphs. Under a FULL target, the drafter runs eagerly.
  4. vLLM's graph-memory estimate charges FULL graphs like a mixed graph. Main keeps decode graphs out of the estimate, since they are small. With drafts, decode graphs are verify graphs (1 + k tokens per row), and they are not small.

Solution

  1. VLLMCudaGraphConfig: FULL with drafts is vLLM's FULL.
  2. For FULL with drafts, VLLMEngine._setup sets VLLM_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.
  3. TorchTitanEagleProposer.dummy_run captures the drafter's graphs at start-up under a FULL target.
  4. capture_model raises instead of replaying wrong state:
    • a requested FULL that vLLM lowered (it does when an attention backend lacks AttentionCGSupport.ALWAYS);
    • a drafter that is not breakable.
      No mode puts GDN inside piecewise target graphs: TorchTitan compiles with CompilationMode.NONE, so vLLM lowers to FULL_DECODE_ONLY or NONE.
  5. The verify graphs stay in vLLM's graph-memory estimate. Left out, 145 of them put the capture 0.79 GiB over the estimate (Qwen3.8-27B, k = 3, GB300).
  6. The MTP PR's refusal of FULL with drafts goes.
  7. Unchanged: runs without drafts. With drafts, FULL_DECODE_ONLY and NONE.

Results

Numerics: FULL graphs replay bitwise vs eager (engine test with M-invariant GEMMs).

test_gdn_cudagraph.py::test_gdn_full_runner_matches_eager[drafts], Qwen3.5-0.8B, k = 3, one GB300: passed
  FULL vs eager: token ids, logprobs and GDN states bitwise equal
  FULL replays every step kind: prefill, mixed and verify; a mixed step takes the packed graph
  a verify-graph replay where a row accepted 2+ tokens (it reads its state past slot 0)
  every drafter graph captured at start-up (none captured while serving)
Earlier runs: Qwen3.8-27B, fp8 KV cache, k = 3, one GB300, cuda_graph FULL, one run per arm, output tok/s.
"MTP-3 piecewise" is an earlier version of the stack, where steps with prefill replayed piecewise graphs:
load                            no MTP    MTP-3 piecewise    MTP-3 FULL (this PR)
26 multi-turn sessions          1,028     1,305              1,387 (+6.3%)
128 sessions, KV cache full     1,766     1,397              1,458 (+4.4%)
start-up graph capture, 26 sessions:   55 s, 3.99 GiB  ->  75 s, 5.26 GiB
  • Acceptance length is equal across the MTP arms (2.40 vs 2.40, 2.19 vs 2.18), so the gain is per step.
  • No run compares FULL with FULL_DECODE_ONLY, what the PRs below run, on one base. Two earlier runs, 26 sessions: FULL_DECODE_ONLY 1,008 -> piecewise 1,106 tok/s (bf16 KV), and piecewise 1,305 -> FULL 1,387 (fp8 KV, the table).

You may ask:

  • Why not vLLM's FULL_AND_PIECEWISE for steps with prefill? GDN and attention would run eagerly between the pieces, and vLLM would also capture about 155 piecewise target graphs (estimated). FULL beat it by 6.3% above.
  • Why not vLLM's V2 model runner, which graphs mixed steps? TorchTitan runs the V1 runner (TorchTitanGPUWorker.init_device raises on V2). "[rl] generator: run on vLLM's model runner V2 (vLLM 0.34)" rebases on this stack.

NOTE:

  • The throughput numbers ran an earlier version of this stack's FULL path with an fp8 KV cache, on a base that also carried other unmerged PRs; both arms shared it. Not re-measured on this stack; bf16 KV not measured.
  • The GPU run above applies "[models] GDN/KDA chunk kernels: always fused" (open), so GDN prefill runs the fused kernels. On GB300, the default warpdrive kernel fails to build with cutlass DSL 4.7.1. Warpdrive runs only on SM100/SM103, so CI's A10G takes the fused kernels anyway.
  • test_gdn_cudagraph.py runs in CI's RL 1 GPU job (A10G) when the PR has the ciflow/rl label. That job was green at the old head of "[rl] MTP on GDN models: FULL CUDA graphs for steps with prefill" (tag ciflow/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 # TODO at its site)

  • Drop the import check in _enable_breakable_cuda_graphs once the vLLM pin reaches v0.33+, which decides graph breaks at call time. Keep the variable until vLLM honors an explicit CompilationConfig.use_breakable_cudagraph.
  • Drop the dummy_run override with the move to vLLM's V2 model runner.
  • List test_gdn_cudagraph.py in the B200 RL workflow once the fused-kernel PR lands.

Test plan

pytest tests/rl/unit_tests/cpu
pytest tests/rl/unit_tests/gpu/test_gdn_graph_metadata.py tests/rl/unit_tests/gpu/test_gdn_cudagraph.py   # 1 GPU (GB300)
pre-commit run --files <changed files>
RL CPU suite   788 passed, 0 failed, 8 skipped on the pinned vLLM (1.0.0.dev20261107; PR 5: the same), main merged in.
GPU            at the stack top (PR 7 on this PR): test_gdn_graph_metadata.py 38 passed (31 s);
               test_gdn_cudagraph.py (with the fused-kernel PR) 5 passed (497 s)
               VLLMEngine through its entry point (Qwen3.5-0.8B, k = 3, FULL, fp8 KV, one GB300): starts with
               breakable graphs on and FULL kept; 8 requests, 4 arriving next to verify rows, all finish
pre-commit     all hooks pass (pyrefly and lychee skipped)

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 26, 2026
@felipemello1
felipemello1 added this pull request to stack #6404 November 26, 2026 02:13
@felipemello1

Copy link
Copy Markdown
Contributor Author

@claude please review. Also find opportunities, if any, to reduce the amount of lines or to break this pr further. If its not possible or unreasonable, it is ok.

@claude

claude Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 8m 8s —— View job


Needs discussion -- see the review on this PR. It proposes a split (A: GDN drafts on the TorchTitan builder, which changes numerics; B: FULL graph mode, bitwise) and ~60 lines of trims.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Needs discussion -- I found no confirmed bug. The trimmed-draft path relies on a vLLM runner contract I couldn't verify. Whether to split the PR at its numerics seam is the author's and maintainers' call.

What this PR does. It replaces the GDN-with-drafts path (vLLM's GDN builder plus an eager graph break) with TorchTitanLinearAttentionMetadataBuilder staging every step in fixed buffers. Every kernel runs every row, with the null slot (0) on the rows it doesn't own, so one FULL graph per token count replays any mix of verify, 1-token and prefill rows. cuda_graph.mode="FULL" with drafts becomes vLLM's FULL instead of FULL_AND_PIECEWISE. The drafter keeps breakable piecewise graphs, now captured at start-up by TorchTitanEagleProposer.dummy_run.

Example. k = 3, max_num_seqs 5, one step with rows [verify 4, verify 4, 1-token resume, prefill 13] padded to 24 tokens:

before: piecewise graph; GDN and attention eager; index_select/index_copy_ splits rows
after:  PACKED graph, S = min(24, 4 x 5) = 20
        prefill conv + chunk on all 24 tokens (rows 0-2 = one null interval, slot 0)
        verify conv + GDN on tokens 0-19 (rows 3+ have slot 0, so the kernels skip them)
        out[:20] = where(spec_token_mask, verify_out, chunk_out)

Must fix

  1. PR description: "Summary (human-written)" is empty. The author has to write it (CONTRIBUTING.md, "AI-assisted contributions").
  2. linear_attention.py:335-343: steps with every draft trimmed read runner_num_accepted_tokens, and the only test sets that buffer by hand. Cite the vLLM line that refreshes it on every step, or copy the counts in the runner (inline).

Should consider

  • gdn.py:365: unreachable RuntimeError; make it an assert (inline).
  • linear_attention.py:79: KDA now runs GDNAttentionMetadataBuilder.__init__, and no GPU test starts a KDA engine (inline).
  • test_gdn_graph_metadata.py:924-938: the NaN-poison probe is fragile and already covered; delete it (inline).
  • test_gdn_cudagraph.py:55-67: the fp8 engine case runs in no CI job (inline).
  • linear_attention.py:472,488: _check_uniform_rows and _check_verify_kernel_rows_fit each have one caller. Inline them into _build_with_drafts (design.md: no single-call-site functions).

Questions

  • worker.py:414 TorchTitanEagleProposer.dummy_run forces use_cudagraphs whenever vLLM captures, including FULL_DECODE_ONLY targets, where the drafter isn't breakable. Does vLLM's drafter then stay eager there, as before? If unsure, gate capture on isinstance(self.model, BreakableCUDAGraphWrapper).
Reducing lines / splitting the PR

Split (feasible, optional). The PR has two separable changes:

PR Contents Numerics Approx. size
A: GDN drafts on the TorchTitan builder builder subclass, _build_with_drafts, _update_block_table_with_drafts, new _forward_speculative (VERIFY/PACKED), FA4 reorder threshold 1 + k, runner flags, 1-token rejection, DP > 1 ban, layer tests changes (Attention Gym conv for prefill rows; verify kernels for 1-token rows after context) ~550 code + ~350 test
B: FULL instead of FULL_AND_PIECEWISE VLLMCudaGraphConfig mode, drafter dummy_run capture, capture_model checks, memory-estimate change, deleting the eager break, engine test drafts case bitwise vs A's eager path ~150 code + ~150 test

A keeps _forward_speculative_eager / eager_break_during_capture, which are already on the base, so its piecewise steps still run GDN eagerly with metadata. B deletes them. This puts the numerics change and the drift numbers in A, and the graph-mode change and the +6.3% in B. The cost: A still needs its own GPU validation, and A alone gives no throughput gain. If the stack is reviewed as a whole anyway, keeping it as one PR is reasonable.

Smaller trims (~60 lines total): the NaN probe (-15), the fp8 engine case (-20), the gdn.py check as an assert (-3), and inlining the two _check_* helpers (-6). The two new graph tests in test_gdn_graph_metadata.py duplicate ~20 lines of capture setup (two layers, a cloned kv_cache, warm-up plus torch.cuda.graph). A shared _capture_gdn_graph(layer, metadata, static_tokens, weights) would remove that.

Not worth cutting: the start-up checks in capture_model / calculate_reorder_batch_threshold. Each guards a failure that would otherwise be silent (GDN inside a piecewise capture replays zeros; a wrong reorder threshold puts verify rows past S). The run-merging in _build_with_drafts also stays: without it, the chunk kernel would see one null sequence per verify row (up to max_num_seqs) instead of one per run.

Gate notes. The problem is real and measured (+6.3% / +4.4% output tok/s). GDN integration inside vLLM belongs to torchtitan's generator. Private vLLM dependencies (V1 builder-class dispatch, _init_reorder_batch_threshold, drafter capture) carry TODOs pointing at the V2 runner. The design is generator-only by nature (inference CUDA graphs), so question 7 doesn't apply.

Not verified: vLLM kernel and runner contracts (whether the conv and verify kernels skip slot 0, whether num_accepted_tokens is refreshed every step, drafter capture under FULL_DECODE_ONLY); vLLM sources weren't available in this run, and nothing ran on GPU. A maintainer still needs to review.

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.
@felipemello1
felipemello1 removed this pull request from stack #6404 November 28, 2026 17:44
@felipemello1
felipemello1 changed the base branch from felipemello1/vllm-fp8-kv-cache to felipemello1/mtp-verify-steps November 28, 2026 17:45
@felipemello1
felipemello1 force-pushed the felipemello1/mtp-full-graphs-prefill branch from dc7d9c3 to 3c1f835 Compare November 28, 2026 17:45
@felipemello1
felipemello1 added this pull request to stack #6434 November 28, 2026 17:50
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 4m 31s —— View job


Approve, with two small fixes to make before merging. See the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- please address the items below before merging. After the split, this PR is only the graph-mode change. The silent failure modes it opens (GDN inside a piecewise graph, vLLM lowering FULL, a drafter that isn't breakable) now raise at start-up. What remains is mechanical.

What this PR does. It drops the ValueError for cuda_graph.mode="FULL" with drafts. With FULL and drafts, VLLMEngine sets VLLM_USE_BREAKABLE_CUDAGRAPH=1, and raises if vLLM's attention op was imported before that. TorchTitanEagleProposer.dummy_run captures the drafter's piecewise graphs at start-up. capture_model raises on the graph modes that would replay wrong state. Verify graphs stay in vLLM's graph-memory estimate.

Example. Qwen3.5 with k = 3 and cuda_graph.mode="FULL":

before: VLLMEngine.Config.__post_init__ raises; use FULL_DECODE_ONLY -> steps with prefill and the drafter run eagerly
after:  verify-only step -> FULL verify graph; step with prefill -> FULL mixed graph (packed path, PR 1)
        drafter -> breakable piecewise graphs captured at start-up, attention eager
        vLLM lowers FULL (a backend without ALWAYS support) -> RuntimeError at capture_model

Must fix

  1. config.py:189 -- uses_breakable_cuda_graphs has one caller. Inline it at engine.py:354 (inline).
  2. test_generator.py:1571 -- the new assertion only reads back the mode it just set, and the mapping it checks is unchanged on the base branch. Delete it (inline).

Should consider

  • engine.py:354 -- the env var is set in the middle of the ValueError checks. Move the call into _setup (inline).
  • worker.py:138-150 -- the mode check can likely be a single condition (inline, unverified).
  • worker.py:443 -- gate the forced drafter capture on isinstance(self.model, BreakableCUDAGraphWrapper) (inline). This was the open question from the last review.

Questions

  • Has a VLLMEngine (e.g. generate.py or an RL recipe) with num_speculative_tokens > 0 and FULL started at this head? test_gdn_cudagraph.py sets VLLM_USE_BREAKABLE_CUDAGRAPH=1 at process start and drives LLMEngine directly, so no test runs _enable_breakable_cuda_graphs. If the top-level vLLM imports in engine.py already import vLLM's attention module, every such engine raises at init. That failure is loud, but it would block the feature from its real entry point.
Details

Earlier review (2026-11-26). Must-fix 2, the accepted-count contract, now has a citation (worker.py:168, GPUModelRunner._prepare_inputs). The split it proposed (A: builder, B: graph mode) is done: this PR is B, and the builder, layer and test_gdn_graph_metadata.py changes moved down the stack. The should-consider items on gdn.py, linear_attention.py and the NaN probe went with them and weren't re-checked here. The fp8 engine case is gone from test_gdn_cudagraph.py.

Gate. The problem is real: with drafts, every new turn's prefill step runs eagerly under FULL_DECODE_ONLY. The measured gain (+6.3% / +4.4% output tok/s) comes from an earlier version of the stack, as the description says. The change is generator-only by nature. The private vLLM dependencies (drafter capture in V1's _dummy_run, the import-time graph break) have TODOs pointing at #5956 and the v0.33 pin.

Overlap search. Searched open PRs for "breakable cuda graph", "MTP drafter" and "worker.py vllm cudagraph". Found #5956 (V2 runner, rebases on this stack), #6287, #6364 and #6366 (the stack itself), and the SGLang breakable-graph PRs #6415, #6200 and #6425 (a different engine). None rewrites this code.

Net LoC. +227/-41, of which about 106 is the GPU test's drafts case. The trims above save about 15 lines.

Not verified: vLLM's EagleProposer.dummy_run behaviour with use_cudagraphs=True on an unwrapped drafter, and whether engine.py's imports load vLLM's attention op early (vLLM sources weren't available; nothing ran on GPU). A maintainer still needs to review.

Before merge: fill in the human-written summary.

Comment thread torchtitan/rl/generator/vllm/config.py Resolved
Comment thread torchtitan/rl/generator/vllm/engine.py Resolved
Comment thread torchtitan/rl/generator/vllm/worker.py Resolved
# TODO: drop with the move to vLLM's V2 model runner (pytorch/torchtitan#5956); V1's
# GPUModelRunner._dummy_run captures drafter graphs only for piecewise targets
# ("Eagle currently only supports PIECEWISE cudagraphs").
capture = is_graph_capturing and not self.speculative_config.enforce_eager

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still open from the last review. capture forces use_cudagraphs=True for every graph-capturing target, FULL_DECODE_ONLY included, but there the drafter isn't breakable and the comment above doesn't apply. Whether vLLM's EagleProposer.dummy_run then pads or dispatches differently for an unwrapped drafter is unverified. FULL_DECODE_ONLY is the default mode with drafts in the PRs below, and the GPU test here runs only eager and FULL. Tie the forcing to the condition the comment describes, which is also the one capture_model checks:

Suggested change
capture = is_graph_capturing and not self.speculative_config.enforce_eager
capture = is_graph_capturing and isinstance(self.model, BreakableCUDAGraphWrapper)

If that change is wrong, please say what vLLM does with use_cudagraphs=True on an unwrapped drafter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from claude: Kept: under FULL_DECODE_ONLY the forcing changes nothing, because the drafter has no graphs to replay there. At our pin (vLLM 9f03b510c):

  • The drafter's dispatcher gets PIECEWISE keys only if the target's mixed mode is PIECEWISE or FULL. Under FULL_DECODE_ONLY the mixed mode is NONE, so it gets NONE keys (vllm/v1/spec_decode/llm_base_proposer.py:431-440).
  • dummy_run then dispatches with valid_modes=None instead of {NONE} (:1803-1806). With only NONE keys, both give NONE, and the drafter runs eagerly.

…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.
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: Yes. A VLLMEngine with drafts and FULL starts through its real entry point and serves requests at the stack's top. Fixes in a535ef9: the read-back assertion and uses_breakable_cuda_graphs are gone, the env var moved into _setup, and the mode check is one condition. The drafter-capture gate is kept; the reason is in its thread.

VLLMEngine.Config(num_speculative_tokens=3, cuda_graph=VLLMCudaGraphConfig(mode="FULL"), kv_cache_dtype="fp8")
Qwen3.5-0.8B, TP 1, one GB300:
  built in 66 s; VLLM_USE_BREAKABLE_CUDAGRAPH=1, cudagraph_mode FULL (not lowered)
  4 requests, then 4 more at step 6 (prefill rows next to verify rows): all 8 finished, 128 tokens each

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 40s —— View job


Approve -- see the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- every item from the 11-28 review is resolved at a535ef9, and the new commit adds no must-fix problems.

What this PR does. It lifts the ban on cuda_graph.mode="FULL" with MTP drafts. VLLMEngine._setup turns on vLLM's breakable CUDA graphs, which the drafter uses, and raises if vLLM's attention op was imported too early. TorchTitanEagleProposer.dummy_run captures the drafter's piecewise graphs at start-up. capture_model raises if vLLM lowers a requested FULL or the drafter isn't breakable. Verify graphs stay in vLLM's graph-memory estimate.

Example. Qwen3.5 with k = 3, cuda_graph.mode="FULL":

before: Config.__post_init__ raises -> FULL_DECODE_ONLY: steps with prefill and the drafter run eagerly
after:  verify-only step -> FULL verify graph; step with prefill -> FULL mixed graph (packed path)
        drafter -> breakable piecewise graphs, captured at start-up
        vLLM lowers FULL, or the attention op was imported before the env var -> RuntimeError at start-up

Earlier items (11-28 review)

  • uses_breakable_cuda_graphs inlined: resolved (engine.py:382).
  • Read-back assertion in test_generator.py: resolved (deleted).
  • Env var set mid-validation: resolved (moved to _setup, after every check).
  • Mode check as one condition: resolved (worker.py:163-171). The vLLM citation (compilation.py:1152-1155, :1424-1425) supports it.
  • Drafter-capture gate: kept. The author's argument holds. Under FULL_DECODE_ONLY the drafter's dispatcher has only NONE keys (llm_base_proposer.py:431-440), so forcing use_cudagraphs still dispatches to NONE.
  • Real entry point: answered with a VLLMEngine run (k = 3, FULL, 8 requests next to verify rows).

Should consider

  • worker.py:259-262 -- the comment rewrite dropped the sentence that says why filtering the profiling keys is safe (inline).
Details

Re-review scope. I re-read the full diff at a535ef9, not just the fix commit: _enable_breakable_cuda_graphs, _setup, capture_model, initialize_kv_cache, dummy_run, the config and engine docstrings, and the drafts case in test_gdn_cudagraph.py. The test subprocess already sets VLLM_USE_BREAKABLE_CUDAGRAPH=1 at start (test_gdn_cudagraph.py:72, unchanged), so the test doesn't run _enable_breakable_cuda_graphs. The author's manual VLLMEngine run covers that path, and if it breaks, capture_model raises at start-up rather than failing silently.

Overlap search. I searched open PRs for "breakable cuda graph" and "worker.py drafter dummy_run". I found #5956 (V2 runner, rebases on this stack), #6364 (below this PR), and the SGLang breakable-graph PRs #6415, #6200 and #6425 (a different engine). None of them rewrites this code.

Not verified: the vLLM line citations in the author's replies (I don't have vLLM's sources here), and nothing ran on a GPU. A maintainer still needs to review.

Before merge: fill in the human-written summary.

Comment on lines +259 to +262
# vLLM's graph-memory estimate, taken out of the KV cache, charges every FULL graph like the second largest
# (a mixed graph). 1-token decode graphs take far less (Qwen3-8B TP2: 11 added 0.03 GiB to 1.57), so profile
# only the mixed graphs. Verify graphs (1 + k tokens per row) stay charged: left out, 145 of them put the
# capture 0.79 GiB over the estimate (Qwen3.8-27B, k = 3, GB300).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rewrite dropped the sentence that says why filtering the keys is safe: "vLLM drops these profiling keys afterwards; the real call rebuilds them, decode keys included (test_generator_dp_cudagraph.py checks a decode graph still replays)." Without it, a reader can't tell whether the real capture loses its decode graphs. Since it isn't related to drafts, consider restoring it after the new verify-graph sentence.

@liangel-02

Copy link
Copy Markdown
Contributor

Superseded by #6478

@liangel-02 liangel-02 closed this Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants