Port DeepSeek-V4 optimization PR #174 to v0.26 and fix MTP multi-batch Graph staging - #178
Open
Joey-gvwal wants to merge 4 commits into
Open
Conversation
Cherry-picked from v0.24.0-dev commit becb11a and adapted to the v0.26 patch layout.
Collaborator
Author
|
While validating MTP, I found that the acceptance rate with multiple batches is significantly lower than in |
Preserve the PR MooreThreads#178 token-to-request cache fix while completing the query-layout fingerprint, graph-builder buffer ownership, and MUSA stream visibility handling. Keep the repair effective across MTP verification and draft transitions.
Joey-gvwal
force-pushed
the
port/musa-dsv4-v026-pr174-final
branch
from
August 14, 2026 03:15
a2fb537 to
0162927
Compare
Collaborator
Author
|
After fixing the MTP issue, the acceptance rate is now stable:
|
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.
Summary
The PR is therefore a v0.26 port plus compatibility/robustness fixes; the
Graph-staging changes are not a separate performance optimization series.
The five kernel optimizations and the required v0.26 compatibility changes are
part of commit 1. Commits 2 and 3 are correctness/robustness fixes for the
v0.26 port, not additional independent performance claims.
Optimizations carried from PR #174
M=1to the GEMV pathThe optimized paths remain narrowly guarded to the validated
DeepSeek-V4-Flash-Base TP8, FP8 KV-cache, FLASHMLA, FULL_DECODE_ONLY contract.
Generic models and non-matching configurations fail closed to their existing
paths.
v0.26 port compatibility
The v0.26 branch does not contain the v0.24 PR #166 model-wide DeepSeek-V4
optimization contract on which part of the source PR was based. These are
mechanical adaptations required to make the one-commit cherry-pick usable on
v0.26; they are not additional independent optimizations:
paths instead of importing the unavailable v0.24 contract.
the fused shared-expert path is actually installed into vLLM 0.26.
source layout.
vllm-musa kernels and dispatch policies from PR DSV4 optimization #174.
Root cause of the v0.26 MTP BS64 failure
The failure was caused by an incomplete v0.26 adaptation, not by an inherent
BS64 or DeepSeek-V4 model limit.
1. Temporary Graph profiling sealed the persistent CAR arena
vLLM 0.26 first captures throwaway graphs in
profile_cudagraph_memory()and clears them before the persistentcapture_model()pass. The original PR #174 staging logic assumed a singlepersistent capture and sealed the custom-all-reduce arena after the profiling
capture.
The later persistent capture then failed with:
The port now recognizes the temporary profiling phase through
compilation_counter.num_gpu_runner_capture_triggers == 0. A successfulprofiling capture may release and reuse its staging slots; only the persistent
model capture seals the arena against unsafe recapture.
2. MTP staging descriptors stopped at BS16
MTP4 schedules five model tokens per request: one target token plus four draft
tokens. A production capture ladder for request batches
[1, 2, 4, 8, 16, 32, 64]therefore uses Graph token sizes[5, 10, 20, 40, 80, 160, 320].The original staging policy only covered:
BS32 and BS64 fell back to the standard collective path inside the captured
Graph. In the BS64 test that path stopped making useful progress and produced
only 226 of the required 65,536 output tokens before the engine was
terminated.
The final policy covers all seven descriptors:
The complete communicator arena remains exactly 512 MiB, which is the existing
DeepSeek-V4 MTP upper bound. The fix does not raise that limit.
Files changed by the v0.26 Graph follow-up
The vendored vLLM checkout was reset to its pinned commit before installation;
the expected TorchAda/vllm-musa source mappings and patches were then applied
by the source install. The local vllm-musa sources and the four modified files
inside the validation container were hash-checked before serving.
Common environment
No PR #174 optimization requires an additional DeepSeek-V4 A/B-test
environment gate in these commands.
No-MTP serve command
The no-MTP service captures the complete request-batch ladder in one process;
BS1 is not run through a dedicated capture-[1]-only service.
Startup evidence:
MTP4 serve command
Final MTP startup evidence:
Benchmark command
Each row used random inputs of exactly 4,096 tokens and generated exactly
1,024 tokens per successful request.
No-MTP results
All requests completed successfully with zero failures and the exact requested
output length.
56.87 / 57.09 / 57.34)