Skip to content

[MRV2][Spec Decode]Adapt cudagraph for draft model - #60989

Open
wxsIcey wants to merge 4 commits into
vllm-project:mainfrom
wxsIcey:wxs/draft-model/cudagraph
Open

wxsIcey wants to merge 4 commits into
vllm-project:mainfrom
wxsIcey:wxs/draft-model/cudagraph

Conversation

@wxsIcey

@wxsIcey wxsIcey commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Enable CUDA graph capture and replay for Model Runner V2 draft-model speculators, as follow-up work to #43091.

Claims

  • Move SpeculatorCudaGraphManager into the shared spec_decode package and initialize prefill/decode managers in DraftModelSpeculator.
  • Capture standalone AR prefill and multi-step decode with the selected CUDA graph mode, including full-graph replay and piecewise execution.

Validation

Ran the offline draft-model spec-decode evaluation with FULL_AND_PIECEWISE on Qwen3-32B / Qwen3-1.7B using 400 MT-Bench prompts, temperature 0, and 256 output tokens:

python examples/features/speculative_decoding/spec_decode_offline.py \
  --method draft_model \
  --model-dir /shared/models/modelscope/models/Qwen/Qwen3-32B \
  --draft-model /shared/models/modelscope/models/Qwen/Qwen3-1.7B \
  --num-spec-tokens 3 \
  --dataset-name hf \
  --dataset-path philschmid/mt-bench \
  --num-prompts 400 \
  --temp 0 \
  --output-len 256 \
  --max-model-len 10000 \
  --cudagraph-mode FULL_AND_PIECEWISE \
  --gpu-memory-utilization 0.95
--------------------------------------------------
total_num_output_tokens: 102356
num_drafts: 36343
num_draft_tokens: 109029
num_accepted_tokens: 65551
mean acceptance length: 2.80
--------------------------------------------------
acceptance at token 0: 0.76
acceptance at token 1: 0.58
acceptance at token 2: 0.46

@mergify mergify Bot added the mrv2 Model Runner V2 specific label Oct 10, 2026
@mergify

mergify Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @wxsIcey.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 10, 2026
Signed-off-by: Icey <1790571317@qq.com>
Signed-off-by: Icey <1790571317@qq.com>
@wxsIcey
wxsIcey force-pushed the wxs/draft-model/cudagraph branch from 180e82d to 249fd7f Compare October 12, 2026 11:35
@wxsIcey
wxsIcey marked this pull request as ready for review October 12, 2026 11:44

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot removed the needs-rebase label Oct 12, 2026
Signed-off-by: Icey <1790571317@qq.com>
@njhill
njhill requested a review from TheEpicDolphin October 12, 2026 21:53
Signed-off-by: Icey <1790571317@qq.com>
@wxsIcey

wxsIcey commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

May I ask you to take a look? Thank you. @TheEpicDolphin

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants