Prhub

#27049 docs: add DeepSeek-V4 EPLB Waterfill tips

原始 PR 作者 xutizhou 合并时间 2026-06-03 15:37 文件变更 1 提交数 3 评论 7 代码增减 +41 / -0

执行摘要

新增 DeepSeek-V4 EPLB Waterfill 配置文档

为使用 DeepEP 的 Expert Parallel 部署提供 EPLB(Expert Parallel Load Balancing)和 Waterfill 功能的配置指导,帮助用户在专家路由不均衡时启用均衡策略,并说明录制与回放的使用流程。

值得精读:该文档总结了 DeepEP Waterfill 的关键参数和约束,对使用 DeepSeek-V4 进行 EP 部署的团队有直接指导意义。设计上明确了实验性特征与兼容性边界,体现了良好的文档实践。

讨论亮点

review 中主要围绕措辞精确性和兼容性展开:

  • gemini-code-assist[bot] 建议将 "add EPLB" 改为 "enable EPLB",并澄清 --deepep-mode normal 与 CUDA graph 不兼容。
  • Fridge003 建议将小节标题标注为 Experimental,并强调需要基于 main 分支的最新代码。
  • Fridge003 询问 MegaMoE 是否兼容;xutizhou 通过实测确认不兼容并补充了说明。
  • Fridge003 要求链接指向 /docs_new 下的文档(而非 /docs),作者已修正。

实现拆解

  1. 新增独立小节:在 DeepSeek-V4.mdx 文档的现有内容后插入名为 EPLB + DeepEP Waterfill (Experimental) 的章节。
  2. 录制指南:引用已有文档链接,指导用户如何生成 expert_distribution_recorder_*.pt 文件。
  3. 命令行示例:分别给出非 PD 场景和 PD 分离场景(prefill + decode)的启动参数,明确 --moe-a2a-backend deepep--deepep-mode--init-expert-location--enable-deepep-waterfill 等关键标志。
  4. 约束说明:标注 Waterfill 依赖 --moe-a2a-backend deepep--deepep-mode normal 与 CUDA graph 不兼容、以及 MegaMoE 当前不支持该特性。
文件 模块 状态 重要度
docs_new/cookbook/autoregressive/DeepSeek/DeepSeek-V4.mdx 文档 modified 3.86

关键源码片段

docs_new/cookbook/autoregressive/DeepSeek/DeepSeek-V4.mdx documentation

唯一变更文件,新增 EPLB + DeepEP Waterfill 配置小节,包含录制方法、命令行示例和兼容性约束。

<!-- docs_new/cookbook/autoregressive/DeepSeek/DeepSeek-V4.mdx -->

**EPLB + DeepEP Waterfill (Experimental)**

For EP deployments that use DeepEP, enable EPLB when routed experts become imbalanced
under high concurrency. Use `--enable-deepep-waterfill` to route shared expert routing
through DeepEP for load balancing.

For recorded/static EPLB reproduction, first record an expert-distribution file by following
[Capture expert selection distribution in MoE models](../../../docs/basic_usage/native_api.mdx#capture-expert-selection-distribution-in-moe-models).
**Please checkout to latest main branch for this feature.**

For non-PD reproduction, use:
```bash Command
--moe-a2a-backend deepep \
--deepep-mode auto \
--init-expert-location /path/to/expert_distribution_recorder_*.pt \
--enable-deepep-waterfill

For PD-Disagg reproduction, use normal mode on the prefill server and
low_latency mode on the decode server. Add the same --init-expert-location
flag to both commands:
```bash Command

prefill

--moe-a2a-backend deepep \
--deepep-mode normal \
--init-expert-location /path/to/expert_distribution_recorder_*.pt \
--enable-deepep-waterfill

decode

--moe-a2a-backend deepep \
--deepep-mode low_latency \
--init-expert-location /path/to/expert_distribution_recorder_*.pt \
--enable-deepep-waterfill


You can also add `--ep-num-redundant-experts` and `--eplb-algorithm` to customize
EPLB placement.

MegaMoE is not supported with this DeepEP Waterfill recipe yet. Waterfill routes
the shared expert through DeepEP for load balancing, so `--enable-deepep-waterfill`
requires `--moe-a2a-backend deepep`.

评论区精华

措辞精确性:"add EPLB" → "enable EPLB" documentation

gemini-code-assist[bot] 建议将 "add EPLB" 改为 "enable EPLB",因为 EPLB 是一个软件特性 / 标志,启用比添加更准确。

结论:建议被采纳,文档已修改。 · 已解决

CUDA graph 兼容性澄清 documentation

gemini-code-assist[bot] 指出 `--deepep-mode normal` 与 CUDA graph 不兼容,建议明确说明。

结论:文档已添加此约束。 · 已解决

MegaMoE 兼容性确认 question

Fridge003 询问 MegaMoE 是否支持该特性;xutizhou 通过实测确认不兼容,并补充说明 Waterfill 通过 DeepEP 路由 shared expert,因此需要 `--moe-a2a-backend deepep`。

结论:文档新增一行明确标注 MegaMoE 暂不支持。 · 已解决

文档链接指向 /docs_new vs /docs documentation

Fridge003 要求链接指向 `/docs_new` 下的文档,因为 `/docs` 已停止维护。

结论:作者已将链接修正为指向 `/docs_new` 源文件。 · 已解决

风险与影响

纯文档变更,无代码逻辑修改,技术风险极低。但若用户误将文档中的实验性参数直接用于生产环境,可能因 CUDA graph 兼容性问题导致推理失败,文档中已明确标注。

影响范围限于查阅 DeepSeek-V4 文档的用户,为其提供更完整的 EPLB 和 Waterfill 配置指南,降低使用门槛。无运行时行为变更。

文档变更无技术风险

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论