Skip to content

Commit 019d3e9

Browse files
authored
[Doc] Add docs for mega moe (vllm-project#12926)
### What this PR does / why we need it? Update docs for fused mc2. Now mega_moe is already supported in vllm-ascend for A2/A3. To let users know about this change, the docs should also be updated. This PR adds the description of the mega_moe operator to the original dispatch_ffn_combine document and comments. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - vLLM version: v0.25.1 - vLLM main: vllm-project/vllm@fe784ff Signed-off-by: nanshen3000 <2693653227@qq.com>
1 parent 7573ea0 commit 019d3e9

11 files changed

Lines changed: 20 additions & 19 deletions

File tree

docs/source/locale/zh_CN/LC_MESSAGES/tutorials/models/GLM5.2.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ msgstr "以下是一些用于优化的配置:"
220220

221221
msgid ""
222222
"- `VLLM_ASCEND_ENABLE_FLASHCOMM1`: Enable FlashComm optimization to reduce communication and computation overhead on prefill node. With FlashComm enabled, layer_sharding list cannot include o_proj as an element.\n"
223-
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine fused operator."
223+
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine/mega_moe fused operator."
224224
msgstr ""
225225
"- `VLLM_ASCEND_ENABLE_FLASHCOMM1`:启用 FlashComm 优化,以减少预填充节点上的通信和计算开销。启用 FlashComm 后,layer_sharding 列表不能包含 o_proj 作为元素。\n"
226-
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`:启用 dispatch_ffn_combine 融合算子。"
226+
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`:启用 dispatch_ffn_combine/mega_moe 融合算子。"
227227

228228
msgid ""
229229
"Please refer to the following python file for further explanation and "

docs/source/locale/zh_CN/LC_MESSAGES/tutorials/models/GLM5.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ msgstr "以下是一些用于优化的配置:"
259259

260260
msgid ""
261261
"- `VLLM_ASCEND_ENABLE_FLASHCOMM1`: Enable FlashComm optimization to reduce communication and computation overhead on prefill node. With FlashComm enabled, layer_sharding list cannot include o_proj as an element.\n"
262-
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine fused operator.\n"
262+
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine/mega_moe fused operator.\n"
263263
"- `VLLM_ASCEND_ENABLE_MLAPO`: Enable fused operator MlaPreprocessOperation."
264264
msgstr ""
265265
"- `VLLM_ASCEND_ENABLE_FLASHCOMM1`:启用 FlashComm 优化,以减少预填充节点上的通信和计算开销。启用 FlashComm 后,layer_sharding 列表不能包含 o_proj 作为元素。\n"
266-
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`:启用 dispatch_ffn_combine 融合算子。\n"
266+
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`:启用 dispatch_ffn_combine/mega_moe 融合算子。\n"
267267
"- `VLLM_ASCEND_ENABLE_MLAPO`:启用融合算子 MlaPreprocessOperation。"
268268

269269
msgid ""

docs/source/locale/zh_CN/LC_MESSAGES/tutorials/models/InternVL3.5.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ msgstr "一些用于优化的配置如下所示:"
142142

143143
msgid ""
144144
"- `VLLM_ASCEND_ENABLE_FLASHCOMM1`: Enable FlashComm optimization to reduce communication and computation overhead on prefill node. With FlashComm enabled, layer_sharding list cannot include o_proj as an element.\n"
145-
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine fused operator."
145+
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine/mega_moe fused operator."
146146
msgstr ""
147147
"- `VLLM_ASCEND_ENABLE_FLASHCOMM1`:启用 FlashComm 优化以减少 prefill 节点上的通信和计算开销。启用 FlashComm 后,layer_sharding 列表不能包含 o_proj 作为元素。\n"
148-
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`:启用 dispatch_ffn_combine 融合算子。"
148+
"- `VLLM_ASCEND_ENABLE_FUSED_MC2`:启用 dispatch_ffn_combine/mega_moe 融合算子。"
149149

150150
msgid ""
151151
"Please refer to the following python file for further explanation and "

docs/source/locale/zh_CN/LC_MESSAGES/user_guide/configuration/additional_config.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ msgstr ""
342342

343343
msgid ""
344344
"| `mega_moe_max_tokens` | int | `65536` | Per-rank token "
345-
"capacity after dispatch in the mega moe (dispatch_ffn_combine) fused "
345+
"capacity after dispatch in the mega moe (dispatch_ffn_combine/mega_moe) fused "
346346
"operator. When load imbalance causes a rank to receive more tokens than this"
347347
" limit, the excess tokens are dropped and skipped from computation, "
348348
"degrading accuracy. Do not set this too large: workspace memory scales "
349349
"linearly with this value. |"
350350
msgstr ""
351351
"| `mega_moe_max_tokens` | int | `65536` | 在 mega "
352-
"moe(dispatch_ffn_combine)融合算子中,每个 rank 在分发后的 token 容量。当负载不均衡导致某个 rank 接收的 "
352+
"moe(dispatch_ffn_combine/mega_moe)融合算子中,每个 rank 在分发后的 token 容量。当负载不均衡导致某个 rank 接收的 "
353353
"token 超过此限制时,多余的 token 将被丢弃并跳过计算,从而降低精度。请勿将此值设置过大:工作空间内存与此值呈线性增长。 |"
354354

355355
msgid ""

docs/source/tutorials/models/GLM5.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ python load_balance_proxy_server_example.py \
11221122
Some configurations for optimization are shown below:
11231123
11241124
- `VLLM_ASCEND_ENABLE_FLASHCOMM1`: Enable FlashComm optimization to reduce communication and computation overhead on prefill node. With FlashComm enabled, layer_sharding list cannot include o_proj as an element.
1125-
- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine fused operator.
1125+
- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine/mega_moe fused operator.
11261126
11271127
Please refer to the following python file for further explanation and restrictions of the environment variables above: [envs.py](https://github.com/vllm-project/vllm-ascend/blob/main/vllm_ascend/envs.py)
11281128

docs/source/tutorials/models/GLM5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ python load_balance_proxy_server_example.py \
12911291
Some configurations for optimization are shown below:
12921292

12931293
- `VLLM_ASCEND_ENABLE_FLASHCOMM1`: Enable FlashComm optimization to reduce communication and computation overhead on prefill node. With FlashComm enabled, layer_sharding list cannot include o_proj as an element.
1294-
- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine fused operator.
1294+
- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine/mega_moe fused operator.
12951295
- `VLLM_ASCEND_ENABLE_MLAPO`: Enable fused operator MlaPreprocessOperation.
12961296

12971297
Please refer to the following python file for further explanation and restrictions of the environment variables above: [envs.py](https://github.com/vllm-project/vllm-ascend/blob/main/vllm_ascend/envs.py)

docs/source/tutorials/models/InternVL3.5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ If you want to deploy multi-node environment, you need to set up environment on
178178
Some configurations for optimization are shown below:
179179

180180
- `VLLM_ASCEND_ENABLE_FLASHCOMM1`: Enable FlashComm optimization to reduce communication and computation overhead on prefill node. With FlashComm enabled, layer_sharding list cannot include o_proj as an element.
181-
- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine fused operator.
181+
- `VLLM_ASCEND_ENABLE_FUSED_MC2`: Enable the dispatch_ffn_combine/mega_moe fused operator.
182182

183183
Please refer to the following python file for further explanation and restrictions of the environment variables above: [envs.py](https://github.com/vllm-project/vllm-ascend/blob/main/vllm_ascend/envs.py)
184184

vllm_ascend/ascend_forward_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def select_moe_comm_method(num_tokens: int, vllm_config: VllmConfig) -> MoECommT
374374
moe_comm_type = MoECommType.ALLGATHER
375375
elif lora_config is not None and vllm_config.parallel_config.enable_expert_parallel:
376376
# LoRA + EP requires AlltoAll because the MC2/FusedMC2 paths
377-
# Ascend MoE LoRA cannot patch FusedMC2 path for dispatch_ffn_combine
377+
# Ascend MoE LoRA cannot patch FusedMC2 path for dispatch_ffn_combine/mega_moe
378378
# is a single fused C++ op. This covers both normal model
379379
# forward and _dummy_run during profile_run.
380380
moe_comm_type = MoECommType.ALLTOALL

vllm_ascend/envs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@
8484
"VLLM_ASCEND_ENABLE_NZ": lambda: int(os.getenv("VLLM_ASCEND_ENABLE_NZ", 1)),
8585
# Whether to anbale dynamic EPLB
8686
"DYNAMIC_EPLB": lambda: os.getenv("DYNAMIC_EPLB", "false").lower(),
87-
# Whether to enable fused MC2 (`dispatch_ffn_combine`).
87+
# Whether to enable fused MC2 (`dispatch_ffn_combine/mega_moe`).
8888
# 0, or not set: default ALLTOALL and MC2 will be used.
89-
# 1: ALLTOALL and MC2 might be replaced by `dispatch_ffn_combine` operator.
89+
# 1: ALLTOALL and MC2 might be replaced by `dispatch_ffn_combine/mega_moe` operator.
9090
# `dispatch_ffn_combine` can be used only for moe layer with W8A8, EP<=32, non-mtp, non-dynamic-eplb.
91+
# `mega_moe` can be used only for moe layer with W8A8/W4A8/bf16(none quant), EP<=64, non-dynamic-eplb.
9192
"VLLM_ASCEND_ENABLE_FUSED_MC2": lambda: int(os.getenv("VLLM_ASCEND_ENABLE_FUSED_MC2", "0")),
9293
# DEPRECATED: VLLM_ASCEND_BALANCE_SCHEDULING env var will be removed in a future release.
9394
# Use --additional-config '{"enable_balance_scheduling": true}' instead.

vllm_ascend/lora/fused_moe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _assert_ascend_moe_lora_supported(base_layer: nn.Module) -> None:
181181
if int(envs_ascend.VLLM_ASCEND_ENABLE_FUSED_MC2) != 0:
182182
raise AssertionError(
183183
"Ascend MoE LoRA cannot patch FusedMC2 path "
184-
"(dispatch_ffn_combine is a single fused C++ op). "
184+
"(dispatch_ffn_combine/mega_moe is a single fused C++ op). "
185185
"Set VLLM_ASCEND_ENABLE_FUSED_MC2=0."
186186
)
187187
if getattr(base_layer, "_shared_experts", None) is not None:

0 commit comments

Comments
 (0)