Repository navigation
Conversation
Reuse local worker device resolution and preserve subgroup broadcast source ranks so multiple 310P replicas can start and serve requests. Cover both DP engines in a four-device online regression. Signed-off-by: _zheng_ <2484305897@qq.com>
Signed-off-by: _zheng_ <2484305897@qq.com>
Check passthrough against the PyTorch broadcast signature and document the global and group-relative source rank conventions. Drop the release note fragment for this PR. Signed-off-by: _zheng_ <2484305897@qq.com>
Signed-off-by: _zheng_ <2484305897@qq.com>
Remap routes to rank-local expert IDs so 310P grouped matmuls process only local experts. Cover routing and single-host DP plus EP serving. Signed-off-by: _zheng_ <2484305897@qq.com>
Signed-off-by: _zheng_ <2484305897@qq.com>
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. 🤖 How to trigger CI
Note Until the CI gate has run on a commit, the required Tip 💡 Consider Linking a Related Issue or RFCYour PR title contains the [Feature] tag, indicating a bug fix or new feature. Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:
🙏 Thanks for helping us keep the project well-organized! |
There was a problem hiding this comment.
Code Review
This pull request introduces support for data parallelism in the 310P model runner, updates the MoE token dispatcher to handle remote expert routing, and refines distributed communication patches. It also includes comprehensive unit tests for the new parallelism configurations and the MoE dispatcher logic. I have no feedback to provide as the changes align with the repository's architecture and testing requirements.
Signed-off-by: _zheng_ <2484305897@qq.com>
Diff Coverage
More info see: Summary |
Tflowers-0129
left a comment
There was a problem hiding this comment.
The large-rank combine path relies on an index pattern outside the documented unpermute input contract.
| # Redirect remote routes to the last row and clear it only | ||
| # when at least one route is remote. | ||
| indices = combine_metadata.expanded_row_idx | ||
| indices = indices.masked_fill(indices >= local_rows, num_rows - 1) |
There was a problem hiding this comment.
When multiple expert routes are remote, this maps them to the same row index. The parent forwards that map to npu_moe_token_unpermute, whose documented sortedIndices contract requires unique indices. The mocked gather accepts repeats, so it cannot validate that contract. Please keep the original permutation and zero the remote outputs, or use a gather that explicitly supports repeated indices.
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
What this PR does / why we need it?
Refs #22001. Consolidates the closed #22406 (native data parallelism, which superseded #21997) with expert parallelism into a single PR so reviewers can evaluate single-host DP and EP on Ascend 310P Model Runner V2 together.
Data Parallelism (DP, from #22406):
--device-idsassignment is respected.srcand group-relativegroup_srcarguments when forwarding CPU broadcasts. The 310P device fallback indexes its AllGather result by the source rank within the group, fixing Gloo initialization for TP subgroups whose ranks start above zero.Expert Parallelism (EP):
MoeInitRoutingV2requires the full routing range. The 310P all-gather dispatcher remaps routes through the rank-local expert map and places routes owned by other ranks in a final group.Does this PR introduce any user-facing change?
Yes. On Ascend 310P with Model Runner V2 (
VLLM_USE_V2_MODEL_RUNNER=1), users can:--data-parallel-size 2 --tensor-parallel-size 2or--data-parallel-size 4 --tensor-parallel-size 1).--enable-expert-parallel), including combined DP + EP (e.g.,DP2×TP2 + EP4).FULL_DECODE_ONLYcapture matched to per-replica concurrency is recommended (capturing two buckets in[4, 8]or[8, 16]exhausted 310P runtime event resources in the tested environment).How was this patch tested?
Unit & E2E tests
group_src=0,src=2, andbroadcast_object_liston subgroup[1, 2]. Four-devicetests/e2e/pull_request/four_card/_310p/test_dense_model_310p.pypassed on 310P hardware forQwen3.5-4Bwith TP2 and DP sizes 1 and 2.tests/e2e/pull_request/four_card/_310p/test_expert_parallel_310p.pypassed on 310P hardware withQwen3.6-35B-A3B W8A8(DP2×TP2 + EP4), covering requests on both DP engines, streaming disconnect recovery, and 640-token prefill generation.Performance on 4× Ascend 310P3 (Model Runner V2, vLLM
ba15685ab7, no prefix caching)1. Qwen3.6-35B-A3B W8A8 (MoE) — High-concurrency & bucket-matched advantage cases (512/512, no MTP)
Matching the DP2 decode capture bucket to per-replica concurrency (
BS / dp_size) removes cross-DP AllGather padding waste: at BS=8, shrinking the DP2 bucket[16] -> [4]increased throughput by +32.5% (122.37 -> 162.18 tok/s) and lowered TPOT P50 by -15.6 ms (59.9 -> 44.3 ms).Across concurrency BS 8–64 (each layout using its matched single
FULL_DECODE_ONLYbucket):[8])[4])[4])[16])[8])[8])[32])[16])[16])[64])[32])[32])Full latency breakdown at the high-concurrency crossover points (512/512):
[32])[16], EP off)[16])[64])[32], EP off)[32])High-concurrency standard exit lengths (BS=16 and BS=32 × 5 standard input/output lengths, 4× 310P3,
--max-model-len 10240,--gpu-memory-utilization 0.80, matched single decode bucket per layout):BS = 16
[16]) tok/s[8]) tok/s (Δ)[8]) tok/s (Δ)BS = 32
[32]) tok/s[16]) tok/s (Δ)[16]) tok/s (Δ)Note: The three
*-markedDP2×TP2points (BS=168192/1024, BS=321024/1024and2048/1024) fell back to eager execution (TPOT ~280–306 ms) due to a slight 1-request DP load-balance skew (e.g., 9/7 or 17/15) exceeding the exact-fit single capture bucket[8]/[16]; leaving 1–2 slots of headroom avoids this fallback.DP2×TP2 + EP4stayed on graph for all 10/10 points and outperformed TP4 on3584/1536and8192/1024at both BS=16 (up to +16.4%) and BS=32 (up to +17.6%).Additional short-output EP advantage workloads (Qwen3.6-35B-A3B W8A8, 4× 310P3, capture size
[16], median of 3 runs, output tok/s):Qwen3.6-35B-A3B W8A8 — Full 20-point standard low-concurrency exit matrix (DP2×TP2 vs TP4, shared [16] bucket, EP off, no MTP)
2. Qwen3.6-27B W8A8 (Dense) — Full 20-point standard exit matrix + MTP long-context retest
[16]bucket),DP2×TP2ranged from -10.8% to -33.7% vsTP4(0/20 throughput wins; decode is HBM weight-bandwidth bound asTP4 -> TP2doubles weight reads per chip, though TTFT P50 improved on most BS ≥ 2 cases by 12%–52%).4requests/replica) at 8192/1024 BS=8 (3 runs),DP2×TP2outperformedTP4by +9.0% median throughput (45.67 / 46.05 / 47.15vs50.21 / 49.84 / 50.61 tok/s; TTFT P50-27.4%, E2E P95-8.3%).Qwen3.6-27B W8A8 — Full 20-point standard exit matrix (DP2×TP2 vs TP4, shared [16] bucket, no MTP)
3. Qwen3.5-4B W8A8 (Dense) — Full 20-point standard exit matrix (TP4 vs DP2×TP2 vs DP4×TP1)
Tested on the same four Ascend 310P3 devices (
1,3,4,5),--max-model-len 10240,--gpu-memory-utilization 0.65,FULL_DECODE_ONLYmatched buckets (TP4: [4,8],DP2×TP2: [2,4],DP4×TP1: [2,4]), no prefix caching, no MTP:DP2×TP21/20 (+5.0% at8192/1024 BS=8,148.98vs141.85 tok/s);DP4×TP10/20.DP2×TP215/20,DP4×TP112/20 (up to-57.6%faster TTFT at BS=4/8).Qwen3.5-4B W8A8
4. Numerics & Accuracy
30/32vs31/32(Dense 27B) and30/32vs30/32(MoE 35B); all 28/28 naturally-stopped examples matched per model.67/69(TP4) and65/69(DP2×TP2); P95 target log-prob abs diff0.183/0.198.87/96(EP off) vs84/96(EP on); rerunning the 3 capped disagreements at 1024 tokens gave3/3natural-stop agreement.Checklist
Testing
Boundary / edge-case coverage
Regression test (subgroup broadcast source rank & dual-engine DP serving)
Error / failure path coverage
Meaningful & reliable tests
Performance impact (A/B results above)
vLLM main: vllm-project/vllm@c410543