Skip to content

Commit 98c55ca

Browse files
committed
Merge upstream main into kv_pool_pd
2 parents c14f004 + 53fb966 commit 98c55ca

322 files changed

Lines changed: 10367 additions & 10004 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/CODEOWNERS‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
# examples
6666
/examples/ @MrZ20
6767
/examples/rl/ @Ronald1995 @Liccol
68-
/examples/eplb/ @freyfwt
6968
/examples/rfork/ @yangsonglin13
7069

7170
# c++ source code
@@ -129,7 +128,7 @@
129128
/vllm_ascend/ops/triton/msa @CXY-Katrina
130129
/vllm_ascend/ops/triton/kda/recoverssm.py @drslark @chenxi-hh
131130
/vllm_ascend/ops/triton/docs/kda_recoverssm.md @drslark @chenxi-hh
132-
/vllm_ascend/ops/fused_moe @weijinqian0 @Tflowers-0129 @ZT-AIA @zhenwenqi2024 @linfeng-yuan
131+
/vllm_ascend/ops/fused_moe @weijinqian0 @Tflowers-0129 @ZT-AIA @zhenwenqi2024 @linfeng-yuan @freyfwt
133132
/vllm_ascend/ops/fused_moe/eplb.py @freyfwt
134133
/vllm_ascend/ops/fused_moe/force_eplb.py @freyfwt
135134
/vllm_ascend/ops/kimi_kda.py @Dawn952 @drslark @chenxi-hh @hust17yixuan
@@ -177,6 +176,9 @@
177176
/vllm_ascend/patch/platform/patch_replayssm_config.py @drslark @chenxi-hh
178177
/vllm_ascend/patch/worker/patch_kda_recoverssm.py @drslark @chenxi-hh
179178
/vllm_ascend/patch/platform/patch_eplb.py @freyfwt
179+
/vllm_ascend/patch/platform/patch_fused_moe.py @freyfwt
180+
/vllm_ascend/patch/worker/patch_fused_moe.py @freyfwt
181+
/vllm_ascend/patch/worker/patch_routed_experts_capture.py @freyfwt
180182
/vllm_ascend/patch/worker/patch_kimi_k25.py @Dawn952 @hust17yixuan
181183
/vllm_ascend/patch/worker/patch_minimax_m2.py @CXY-Katrina
182184
/vllm_ascend/patch/worker/patch_step3p5.py @earthmanylf
@@ -257,13 +259,8 @@
257259
/tests/ut/models/test_kimi_recoverssm_metadata.py @drslark @chenxi-hh
258260
/tests/ut/ops/test_kimi_kda_recoverssm.py @drslark @chenxi-hh
259261

260-
# EPLB
261-
/vllm_ascend/eplb @freyfwt
262-
263262
# observability
264263
# /vllm_ascend/observability
265-
/vllm_ascend/observability/ms_metrics/config/eplb_metrics.yaml @freyfwt
266-
/vllm_ascend/observability/ms_metrics/handlers/eplb.py @freyfwt
267264

268265
# profiler
269266
# /vllm_ascend/profiler

‎.github/agent-review/allowlist.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ lcfenglinwan
1717
wangxiyuan
1818
zhangxinyuehfad
1919
MrZ20
20+
liqian79

‎.github/agent-review/context/architecture.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ important thing to keep in mind when reviewing a diff here.
2525
- `vllm_ascend/compilation/` — ACL graph capture/replay (ACLGraphWrapper, API-compatible with CUDA graph) and the inductor compiler bridge (AscendCompiler, graph fusion passes)
2626
- `vllm_ascend/core/` — scheduler extensions and Ascend KV-cache specs (batch-job-aware scheduler, dyntra LB, kv_cache_interface)
2727
- `vllm_ascend/device/`, `device_allocator/` — hardware profiles (A2/A3/A5/310P) and the CaMem allocator
28-
- `vllm_ascend/distributed/` — parallel state, NPUCommunicator, MC2/MLP-TP, KV transfer (Mooncake/AscendStore/UCM), EPLB-related comms
28+
- `vllm_ascend/distributed/` — parallel state, NPUCommunicator, MC2/MLP-TP, KV transfer (Mooncake/AscendStore/UCM), EPLB state/policies/comms, expert offload
2929
- `vllm_ascend/quantization/` — W8A8/W4A8/W4A4/WNA16 and KV-cache quant methods
3030
- `vllm_ascend/models/` — Ascend-specific model implementations registered into ModelRegistry (deepseek_v4/v41, glm5*, kimi_k3, llama_eagle3, ...)
3131
- `vllm_ascend/ops/` — operator layer: fused MoE (routers/dispatchers/quant/eplb), triton kernels, custom op registration
3232
- `vllm_ascend/patch/` — upstream monkey-patches; `platform/` = global (pre-worker), `worker/` = per-worker; catalog in `patch/__init__.py`
3333
- `vllm_ascend/model_executor/` — weight offloader/prefetch and kernel warmup
3434
- `vllm_ascend/model_loader/` — non-standard loaders (netloader, rfork, bigtensorloader)
35-
- `vllm_ascend/eplb/`, `ec_manager/` — EPLB policies and expert-parallel manager
35+
- `vllm_ascend/ec_manager/` — score-based encoder cache manager
3636
- `vllm_ascend/_cann_ops_custom/` — CANN custom operator kernels and compilation pass utilities
3737
- `vllm_ascend/ascend_config.py` — AscendConfig singleton and typed sub-configs (`--additional-config`)
3838
- `vllm_ascend/envs.py` — the ONLY place VLLM_ASCEND_* env vars are defined

‎.github/workflows/configs/nightly_config.yaml‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ a2:
5454
config_file_path: Qwen3-235B-A22B-A2.yaml
5555
config_base_path: tests/SIT/cases/models/configs/Qwen
5656
size: 2
57-
- name: multi-node-GLM-5.1-w8a8-A2
58-
config_file_path: GLM5_1-W8A8-A2-dual-nodes.yaml
59-
config_base_path: tests/SIT/cases/models/configs/GLM
60-
size: 2
6157
accuracy:
6258
nightly:
6359
- name: accuracy-group-1
@@ -103,11 +99,6 @@ a3:
10399
config_file_path: GLM-5.3-W8A8C8-A3-ALL-COMBINED.yaml
104100
config_base_path: tests/SIT/cases/models/configs/GLM/full_model
105101
size: 4
106-
- name: glm53-w8a8c8-pd-memcache-64k
107-
tests: tests/SIT/cases/features/kv_pool/test_pool_ab.py::test_pool_ab
108-
config_file_path: GLM53-W8A8C8-PD-KVPool.yaml
109-
config_base_path: tests/SIT/cases/features/kv_pool
110-
size: 4
111102
- name: DeepSeek-V4-Pro-w4a8-prefix-cache-PD
112103
config_file_path: DeepSeek-V4-Pro-w4a8-prefix-cache-PD.yaml
113104
config_base_path: tests/SIT/cases/models/configs/DeepSeek
@@ -126,10 +117,6 @@ a3:
126117
config_file_path: Kimi-K3.1-Pro-W4A8-E256-A3-1P1D.yaml
127118
config_base_path: tests/SIT/cases/models/configs/Kimi
128119
size: 2
129-
- name: multi-node-GLM-5.1-W8A8C8-MTP-A3_198k_function
130-
config_file_path: GLM-5.1-W8A8C8-A3_198k_function.yaml
131-
config_base_path: tests/SIT/cases/models/configs/GLM
132-
size: 2
133120
- name: Kimi-K2.6-W4A8-64k-1k-TPOT50-PD
134121
config_file_path: Kimi-K2.6-W4A8-64k-1k-TPOT50-PD.yaml
135122
config_base_path: tests/SIT/cases/models/configs/Kimi
@@ -154,10 +141,6 @@ a3:
154141
config_file_path: DeepSeek-V4-flash-w8a8-PD-prefix-MRV2.yaml
155142
config_base_path: tests/SIT/cases/models/configs/DeepSeek
156143
size: 2
157-
- name: multi-node-GLM-5.1-W8A8C8-A3_128k_90_50
158-
config_file_path: GLM-5.1-W8A8C8-A3_128k_90_50.yaml
159-
config_base_path: tests/SIT/cases/models/configs/GLM
160-
size: 2
161144
- name: dsv41-pd-memcache-128k
162145
tests: tests/SIT/cases/features/kv_pool/test_pool_ab.py::test_pool_ab
163146
config_file_path: DSv41-Flash-PD-KVPool.yaml
@@ -223,10 +206,6 @@ a3-560t:
223206
os: linux-aarch64-a3-800i-16
224207
config_file_path: Kimi-K2.6-w4a8-A3.yaml
225208
config_base_path: tests/SIT/cases/models/configs/Kimi
226-
- name: glm-5.1-w8a8-prefill-mc2
227-
os: linux-aarch64-a3-800i-16
228-
config_file_path: GLM-5.1-W8A8-PrefillMC2.yaml
229-
config_base_path: tests/SIT/cases/models/configs/GLM
230209
- name: MiniMax-M3-BF16-A3
231210
os: linux-aarch64-a3-800i-16
232211
config_file_path: MiniMax-M3-BF16-A3.yaml

‎.github/workflows/scripts/estimated_times.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ estimated_times:
100100
tests/e2e/pull_request/two_card/rlhf/state_transitions/test_pause_device_idle.py: 300
101101
tests/e2e/pull_request/two_card/rlhf/state_transitions/test_weight_checker.py: 1200
102102
tests/e2e/pull_request/one_card/rlhf/state_transitions/test_sleep_wake.py: 300
103+
tests/e2e/pull_request/one_card/rlhf/state_transitions/test_sleep_level2_reload.py: 120
103104
tests/e2e/pull_request/one_card/test_sampler.py: 190
104105
tests/e2e/pull_request/one_card/test_turboquant_finalize.py: 30
105106
tests/e2e/pull_request/one_card/test_vlm.py: 480
@@ -132,6 +133,7 @@ estimated_times:
132133
tests/e2e/pull_request/two_card/test_ec_mooncake_encoder_output.py: 900
133134
tests/e2e/pull_request/two_card/test_gpt_oss_distributed.py: 290
134135
tests/e2e/pull_request/two_card/test_hixl_eplb_registration.py: 300
136+
tests/e2e/pull_request/two_card/test_group_coordinator_destroy_npu.py: 120
135137
tests/e2e/pull_request/two_card/rlhf/consistency/test_moe_routing_replay.py: 650
136138
tests/e2e/pull_request/two_card/test_pipeline_parallel.py: 280
137139
tests/e2e/pull_request/two_card/test_prefix_caching.py: 470
@@ -216,6 +218,7 @@ estimated_times:
216218
tests/e2e/pull_request/two_card/ops/test_kda_gate_cumsum_vllm.py: 30
217219
tests/e2e/pull_request/two_card/ops/test_kda_layout_swap12.py: 30
218220
tests/e2e/pull_request/two_card/ops/test_moe_gating_top_k_hash.py: 30
221+
tests/e2e/pull_request/two_card/ops/test_pcp_quantized_routing.py: 40
219222
tests/e2e/pull_request/two_card/ops/triton/test_bad_words.py: 40
220223
tests/e2e/pull_request/two_card/ops/triton/test_batch_memcpy.py: 30
221224
tests/e2e/pull_request/two_card/ops/triton/test_bincount.py: 50

‎.github/workflows/scripts/po_translate.py‎

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,69 +99,74 @@
9999
- 'vLLM Ascend' → 'vLLM Ascend'
100100
- 'vllm-ascend' → 'vllm-ascend'
101101
- vLLM, CANN, Huawei, Atlas, etc..
102+
9. Preserve the EXACT leading spaces of every line after a "\n" in msgid.
103+
These spaces encode Markdown nesting (tabs, ordered/unordered list items,
104+
nested code fences). Never trim, never re-wrap, never normalize them.
105+
Example: msgid "...\n Keep the remaining flags ..." must produce
106+
msgstr "....\n 保留其余标志 ..." with the same 7-space indent.
102107
103108
--- CONTENT THAT SHOULD NOT BE TRANSLATED ---
104-
9. DO NOT translate contributor names, GitHub usernames, or dates.
109+
10. DO NOT translate contributor names, GitHub usernames, or dates.
105110
These should be copied verbatim from msgid to msgstr.
106111
Example: "Xiyuan Wang [@wangxiyuan] 2025-01-15" → keep as-is.
107112
108-
10. Translate text in all table header rows. Preserve row order, indentation,
113+
11. Translate text in all table header rows. Preserve row order, indentation,
109114
separators, URLs, code, and identifiers.
110115
Keep || (merged columns), ^^ (merged rows), and | | (a blank cell) unchanged.
111116
Example: "| Model | Graph Mode ||" → "| 模型 | 图模式 ||".
112117
Example: "|:-----------:|:-----:|:-----:|" → keep as-is.
113118
114-
11. DO NOT translate code identifiers, variable names, CLI flags, or shell
119+
12. DO NOT translate code identifiers, variable names, CLI flags, or shell
115120
commands. Copy them verbatim.
116121
Example: "--data-parallel-size" → keep as-is.
117122
Example: "vllm serve /path/to/model" → keep as-is.
118123
119-
12. DO NOT translate URLs, email addresses, or paths.
124+
13. DO NOT translate URLs, email addresses, or paths.
120125
Copy them verbatim from msgid to msgstr.
121126
122127
--- TERMINOLOGY (MUST TRANSLATE) ---
123128
124-
13. standalone 'Ascend' → '昇腾'
125-
14. '950PR&950DT Products' → 'Ascend 950PR&950DT系列产品'
126-
15. '950DT Products' → 'Ascend 950DT系列产品'
127-
16. '950PR Products' → 'Ascend 950PR系列产品'
128-
17. 'Atlas A2 Products' → 'Atlas A2系列产品'
129-
18. 'Atlas A3 Products' → 'Atlas A3系列产品'
130-
19. 'Atlas 850E SuperPoD (Air-Cooled)' → 'Atlas 850E 风冷超节点'
129+
14. standalone 'Ascend' → '昇腾'
130+
15. '950PR&950DT Products' → 'Ascend 950PR&950DT系列产品'
131+
16. '950DT Products' → 'Ascend 950DT系列产品'
132+
17. '950PR Products' → 'Ascend 950PR系列产品'
133+
18. 'Atlas A2 Products' → 'Atlas A2系列产品'
134+
19. 'Atlas A3 Products' → 'Atlas A3系列产品'
135+
20. 'Atlas 850E SuperPoD (Air-Cooled)' → 'Atlas 850E 风冷超节点'
131136
132137
--- MkDocs MATERIAL EXTENSIONS ---
133-
20. ADMONITIONS (!!! type): Keep "!!!" and type keyword (note, warning, tip)
138+
21. ADMONITIONS (!!! type): Keep "!!!" and type keyword (note, warning, tip)
134139
in English. Only translate the title text after type.
135140
Example: msgid "!!! note" → msgstr "!!! note"
136141
Example: msgid "!!! note \"Important\"" → msgstr "!!! note \"重要\""
137142
138-
21. COLLAPSIBLE BLOCKS (??? type / ???+ type): Keep the exact "???" or
143+
22. COLLAPSIBLE BLOCKS (??? type / ???+ type): Keep the exact "???" or
139144
"???+" marker, the type keyword, and quote syntax unchanged. The "+"
140145
means expanded by default and MUST NOT be added or removed. Translate only
141146
the title text inside quotes.
142147
Example: msgid "??? note \\"Click here...\\"" → msgstr "??? note \\"点击这里...\\""
143148
Example: msgid "???+ warning \\"Important\\"" → msgstr "???+ warning \\"重要\\""
144149
145-
22. CONTENT TABS (===): Keep "===" and quote syntax. Translate only the label.
150+
23. CONTENT TABS (===): Keep "===" and quote syntax. Translate only the label.
146151
Example: msgid "=== \"Before using pip\"" → msgstr "=== \"使用pip之前\""
147152
148153
149154
150155
--- TRANSLATION QUALITY ---
151-
23. Use natural, fluent Chinese technical documentation style. Avoid word-by-word
156+
24. Use natural, fluent Chinese technical documentation style. Avoid word-by-word
152157
literal translation.
153-
24. Use standard Chinese technical terminology consistently.
154-
25. For markdown links [text](url): translate the display text in [] but keep
158+
25. Use standard Chinese technical terminology consistently.
159+
26. For markdown links [text](url): translate the display text in [] but keep
155160
the URL in () exactly as-is.
156161
Example: [Quick Start](quick_start.md) → [快速开始](quick_start.md)
157-
26. For headings: translate the heading text but KEEP the "#" / "##" / "###"
162+
27. For headings: translate the heading text but KEEP the "#" / "##" / "###"
158163
prefix exactly as in the msgid.
159164
Example: msgid "# Quick Start" → msgstr "# 快速开始"
160165
Example: msgid "## Overview" → msgstr "## 概述"
161-
27. DO NOT add "#, fuzzy" markers.
162-
28. If a msgid is purely structural (symbols, code, file paths only), copy it
166+
28. DO NOT add "#, fuzzy" markers.
167+
29. If a msgid is purely structural (symbols, code, file paths only), copy it
163168
verbatim to msgstr.
164-
29. Never invent or guess content. If unsure about a term, leave it in English.
169+
30. Never invent or guess content. If unsure about a term, leave it in English.
165170
166171
{content}"""
167172

‎.github/workflows/scripts/test_codeowner_gate.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# comment, ignored
1919
/vllm_ascend/device @alice @bob
2020
/vllm_ascend/ops/*.py @carol
21-
# TODO(owner): /vllm_ascend/eplb
22-
# /vllm_ascend/eplb @dave
21+
# TODO(owner): /vllm_ascend/example_feature
22+
# /vllm_ascend/example_feature @dave
2323
# SKIP(owner): /tests/ut/
2424
/docs @erin
2525
"""
@@ -39,7 +39,7 @@ def test_active_rules(self, rules):
3939
def test_todo_rule_with_owners(self, rules):
4040
todo = [r for r in rules if r.status == "todo"]
4141
assert len(todo) == 1
42-
assert todo[0].pattern == "vllm_ascend/eplb"
42+
assert todo[0].pattern == "vllm_ascend/example_feature"
4343
assert todo[0].owners == ["@dave"]
4444

4545
def test_skip_rule(self, rules):
@@ -109,7 +109,7 @@ def test_todo_owner_approval_counts(self, rules):
109109
# dave is a TODO owner; the check accepts their approve (gate is
110110
# permission-model independent on purpose).
111111
failures, _unclaimed, _self_owned, _ignored = gate.check_approvals(
112-
1, "author", rules, ["vllm_ascend/eplb/x.py"], {"dave": "APPROVED"}
112+
1, "author", rules, ["vllm_ascend/example_feature/x.py"], {"dave": "APPROVED"}
113113
)
114114
assert failures == []
115115

@@ -361,7 +361,7 @@ def test_skip_before_active_does_not_win(self):
361361

362362
def test_todo_owner_approval_counts(self, rules):
363363
failures, _unclaimed, _self_owned, _ignored = gate.check_approvals(
364-
1, "author", rules, ["vllm_ascend/eplb/x.py"], {"dave": "APPROVED"}
364+
1, "author", rules, ["vllm_ascend/example_feature/x.py"], {"dave": "APPROVED"}
365365
)
366366
assert failures == []
367367

‎.github/workflows/scripts/test_config.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ curated_tests:
4848
- tests/e2e/pull_request/one_card/test_mla_fp8_decode_layout_a5.py
4949
- tests/e2e/pull_request/one_card/test_flash_attn_precision.py
5050
- tests/e2e/pull_request/one_card/test_swiglu_mx_quant.py
51+
- tests/e2e/pull_request/two_card/ops/test_pcp_quantized_routing.py
5152
- tests/e2e/pull_request/one_card/test_hisparse_attention.py
5253
- tests/e2e/pull_request/one_card/test_hisparse_integration.py
5354
- tests/e2e/pull_request/one_card/test_hisparse_prefill_staging.py

‎csrc/attention/quant_lightning_indexer_v2/README.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ Key 和 scale 的 leading-axis stride 分别显式传入 native tiling,支持
174174
`candidate_mode=3`,每个 rank 输出完整本地 K 个候选,K 不超过 2048。
175175
可见长度的含义、因果前缀裁剪、无效行以及仅交换候选的契约与上述 A5 入口一致。
176176

177-
A3 直接输出其原有 Sort/MrgSort 使用的 FP32 比较值,分别覆盖普通输出和 LD
178-
分核归并输出;不将这些比较值转成 BF16。保留原有 Cube 的 INT32 QK、
177+
A3 在 `return_value=2` 本地候选模式直接输出其原有 Sort/MrgSort 使用的 FP32
178+
比较值,分别覆盖普通输出和 LD 分核归并输出;不将这些比较值转成 BF16。保留原有 Cube 的 INT32 QK、
179179
`1/1024` 归一化、FP16 ReLU/weight 中间值及 FP32 归约过程。
180180
A5 的 FP8 和 BF16 派生比较键路径保持原有行为。
181181

@@ -193,9 +193,8 @@ A3 硬件精度回归:`tests/e2e/nightly/single_node/ops/singlecard_ops/test_q
193193
## A3/A5 兼容边界与框架适配说明
194194

195195
- Host 注册沿用 `kv_quant_sparse_flash_attention_vllm` 的结构:默认签名用于
196-
Arch22,`aicore_config_95` 完整覆盖 Arch35 的输入输出类型。A3 的 score 输出
197-
在 return_value!=0 时统一为 FP32(DCP score 与本地候选共用),return_value=0 的
198-
空占位输出仍为 BF16。A5 的
196+
Arch22,`aicore_config_95` 完整覆盖 Arch35 的输入输出类型。A3 的 BF16
197+
score 输出用于普通和 DCP 路径,FP32 score 输出用于本地候选。A5 的
199198
dtype 列表和 `return_value` 约束保持原样,不依据 INT8 输入推断设备型号。
200199
`sparse_values` 的类型由调用方张量和产品注册确定,tiling 按架构和模式校验;
201200
不在共享 InferDataType 中覆盖它。A3 新增的本地长度和完整 score 形状校验

‎csrc/attention/quant_lightning_indexer_v2/docs/aclnnQuantLightningIndexerV2.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,10 @@ aclnnStatus aclnnQuantLightningIndexerV2(
493493
<td>公式中的Indices输出对应的value值。</td>
494494
<td>
495495
<ul>
496-
<li>returnValue为1时输出有效值,无效部分按输出 dtype 填负无穷;returnValue为0时输出shape为(0,)的空tensor。</li>
497-
<li>910B/910_93(arch22)在 returnValue为1时直接输出 FP32(跨 rank 归并不掉精度);950(arch35)为 BF16。</li>
496+
<li>returnValue为1时输出有效值,无效部分填bf16负无穷;returnValue为0时输出shape为(0,)的空tensor。</li>
498497
</ul>
499498
</td>
500-
<td>BFLOAT16(arch22 且 returnValue=1 时为 FLOAT32)</td>
499+
<td>BFLOAT16</td>
501500
<td>ND</td>
502501
<td>returnValue为1时shape与sparseIndicesOut保持一致;returnValue为0时shape为(0,)。</td>
503502
<td>x</td>

0 commit comments

Comments
 (0)