[Perf] Narrow DeepSeek V3.2 eager CUDA graph region - #51425
Merged
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
WoosukKwon
marked this pull request as ready for review
August 7, 2026 17:01
WoosukKwon
requested review from
dllehr-amd,
hongxiayang and
tjtanaa
as code owners
August 7, 2026 17:01
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Collaborator
Author
|
/ci run |
|
✅ CI is already running for this commit: https://buildkite.com/vllm/ci/builds/82887 |
zyp2014
pushed a commit
to zyp2014/vllm
that referenced
this pull request
Aug 21, 2026
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
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.
Purpose
The portable DeepSeek-V3.2 attention path currently decorates the entire fused attention method with
eager_break_during_capture. Only the sparse indexer and backendforward_mqacall require that eager boundary, so query preparation, fused norm/RoPE, and other graph-safe work are replayed as direct launches on every layer.This change:
_fused_attentionintoforward;_sparse_indexer_and_attn;A one-request kernel trace showed 333 fewer direct launches while retaining 79 CUDA graph launches. The launches moved into graphs were 78 fused norm/RoPE kernels, 78 W_UK BMMs, 99 query/indexer GEMMs, and 78 fused-Q kernels.
Non-duplication
I searched open PRs for DeepSeek-V3.2/GLM CUDA graph, sparse-indexer, and
eager_break_during_capturechanges. Related PRs such as #50005 (NVIDIA DCP correctness), #47355 (indexer side-stream overlap), and #47335 (ROCm fused indexer-Q) address different paths or concerns. None narrows the eager-break boundary in the portable DeepSeek-V3.2 attention implementation.Test Plan
Test Result
GLM-5.2 TTFT, Rust frontend, dummy weights, TP4/EP4, concurrency 1, prefix caching disabled:
All 256 requests completed successfully in both runs.
An explicit PIECEWISE-only comparison found that copying the attention output and capturing the UV BMM was another 7.43% faster than the no-copy form (26.51 ms versus 28.64 ms mean TTFT). However, that variant failed with OOM during the FULL capture phase of the default
FULL_AND_PIECEWISEinitialization. This PR retains the no-copy form, which successfully initializes in the default mode and does not require backend output-buffer support.The refactor does not change the attention equations or checkpoint loading, so no model-quality evaluation was required.
AI assistance
OpenAI Codex assisted with implementation, kernel-trace analysis, benchmarking, validation orchestration, and drafting this description. The human submitter must review every changed line and be able to explain and defend the eager-boundary and backend-output trade-offs before marking this PR ready for review.
Essential Elements of an Effective PR Description Checklist