Repository navigation
[Bugfix][DCP] Support strided LSE in direct A2A reduction - #60373
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment Once the PR is approved or has the If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. Agent GuidelinesIMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban. 🚀 |
|
@zyongye @WoosukKwon @GirasoleY @ywang96. could you take a look, given your review of #54472 and #50484. |
|
@ZJY0516 @NickLucche please review and help us merge, thx! |
|
@zyongye @WoosukKwon @GirasoleY @ywang96 can u please review and merge? |
Read both LSE strides so FlashAttention MLA transposed views, including single-token views, work without a materializing copy. Cover transposed FP32 LSE alongside existing packed/padded BF16 inputs, empty shards, and CUDA graph replay. Co-authored-by: Codex Signed-off-by: John-Evan Karcenty <jkarcenty@yokbvdijkarcenty01.nvidia.com>
Specify the cumsum dtype: PyTorch otherwise promotes the int32 query lengths to int64, violating the direct A2A metadata contract before empty-shard and graph checks can run. Co-authored-by: Codex Signed-off-by: John-Evan Karcenty <jkarcenty@yokbvdijkarcenty01.nvidia.com>
Compare packed and strided inputs with identical values in eager execution and CUDA graph replay, separately from the floating-point reference tolerance. Co-authored-by: Codex Signed-off-by: John-Evan Karcenty <jkarcenty@yokbvdijkarcenty01.nvidia.com>
Add the targeted layout regression tests to the existing two-H100 distributed job and remove their obsolete test-tethering exemption. Four-GPU cases remain part of local validation. Co-authored-by: Codex Signed-off-by: John-Evan Karcenty <jkarcenty@yokbvdijkarcenty01.nvidia.com>
|
This pull request has merge conflicts that must be resolved before it can be |
55bec3c to
75f97e5
Compare
|
@hmellor @Harry-Chen @khluu can you please review and merge? |
wzhao18
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks!
|
/ci run |
|
✅ Triggered Buildkite CI #95980 for commit |
|
✅ @john-evan08, CI is now available for this PR.
|
|
/ci retry |
|
✅ Queued 2 failed job(s) for retry in Buildkite CI #95980. |
Overview
Fix the
partial LSE must have packed headserror when usingVLLM_USE_DIRECT_DCP_A2A=1with transposed FlashAttention MLA LSE tensors, as encountered with DeepSeek-V2-Lite. The direct P2P kernel now reads both tensor strides, without a contiguous copy.Unlike the NCCL fallback proposed in #54472, this enables the direct path for these LSE layouts.
Claims
Validation
Serving performance
DeepSeek-V2-Lite, 8 x H100 80 GB, TP=DCP=8, expert parallelism enabled, Q/KV gather through NCCL. Both arms use the same image and Mooncake agentic workload; only
VLLM_USE_DIRECT_DCP_A2Achanges between 0 and 1.Metric: generated output tokens/second/GPU; higher is better. Three nodes, two order-balanced repetitions per node: six paired measurements per concurrency.
At c512, the interval includes small slowdowns and improvements: zero regression is not established. These points vary concurrency, not context length.
Performance was measured before rebasing, with the same kernel fix; the newer build was revalidated for correctness, not rebenchmarked.
Benchmark methodology and versions
Maximum context 163,840; 60 GiB KV cache/GPU; FlashInfer autotune off; AIperf 0.12.0; fresh server/cold prefix cache; no timed profiling. Request counts: 128/256/1,024; all 16,896 requests succeeded.
Trace:
64k_400_90kv_agent_new_noschedule_short_15perc.jsonl, filtered to input plus output lengths <=163,840. Model revision:604d5664dddd88a0433dbae533b7fe9472482de0.Throughput: arithmetic means. Gains: paired log ratios averaged per node, with a t(2) interval over three node means. Output-token totals differ by <=0.147% within pairs.
Benchmark upstream base:
f3b77eff640b5ed5cc9221a4f5f402ab65adc021; patched source:132c7f5fc41094d91aecb72cd03389326ff80431.Correctness
Test command and numerical limitations
On at least four peer-access-capable H100 GPUs, with the patched build:
--noconftestavoids unrelated dependencies. CI is configured for the two-rank cases on two H100s; four-rank cases passed locally. Upstream CI has not run for this branch. Lint, syntax, andgit diff --checkpassed.Six prompts, 32 tokens each; comparable logprob bounds: 0.5 maximum / 0.1 per-prompt mean. First divergences require mutual top-five membership and greedy gap <=0.25; later, different contexts are not compared. This is not broad accuracy evaluation or bitwise NCCL/P2P equivalence.
One default-scheduling comparison exceeded these bounds; unchanged reruns and fixed-scheduling controls passed. NCCL itself varied across runs, and its rejected output also exceeds the gap bound against packed-copy P2P. The precise cause remains unisolated; tolerances were not relaxed.
Details
FlashAttention MLA's
[heads, tokens]LSE becomes a strided[tokens, heads]view after transpose. Reading both strides fixes addressing without adding copies, allocations, or synchronization. The receive buffer and combine kernel are unchanged.Output-layout/capacity restrictions and oversized-prefill fallback remain. This does not fix the separate GLM attention-output layout issue #54305. If #54472 lands first, relax only its LSE guard for this newly supported layout.
Related test-fixture/CI work: #55492; consolidate overlapping support changes if it lands first.
AI assistance was used for implementation, tests, validation.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.