返回资讯中心
外部精选
软件工程
#开发者实时流

DeepEP-Ascend 发布:面向昇腾 NPU 的 DeepEP 通信库

来源标题:Training and Inference on Huawei Ascend NPUs

DeepEP-Ascend 是面向华为昇腾 NPU 的 DeepEP 移植版通信库,其公开 buffer API 与 NVIDIA 版 DeepEP 对齐。该库提供 MoE dispatch/combine 的专家并行 all-to-all 操作(含 FP8 dispatch 和延迟 epilogue),以及 PP、CP/DP 的 Bucket 集合通信和 Engram 远端内存访问(开发中)。Ascend C 内核使用 HCCL/HCOMM、UBMEM 和 URMA 通信,并通过 DeepJIT 在运行时编译。

Hacker News 最新Bluestein2026/11/14 · 3 天前30 分钟阅读

以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。

DeepEP-Ascend 是面向华为昇腾 NPU 的高性能机器学习训练与推理通信库,提供 MoE dispatch/combine 的专家并行(EP)all-to-all 操作,支持 FP8 dispatch 和延迟 epilogue。此外还提供流水线并行(PP)、面向上下文并行和数据并行(CP/DP)的 Bucket 集合通信,以及 Engram 远端内存访问等通信原语(开发中)。其公开 buffer API 与 NVIDIA 版 DeepEP 对齐。Ascend C 内核使用 HCCL/HCOMM、UBMEM 和 URMA 完成通信,并通过 DeepJIT 在运行时编译。

DeepEP-Ascend is a high-performance communication library for machine learning training and inference on Huawei Ascend NPUs. It provides expert-parallel (EP) all-to-all operations for MoE dispatch and combine, including FP8 dispatch and deferred epilogues. It also offers communication primitives (work in progress) for pipeline parallelism (PP), context and data parallelism through Bucket collectives (CP/DP), and remote memory access through Engram. Its public buffer APIs are aligned with the NVIDIA version of DeepEP. Ascend C kernels use HCCL/HCOMM, UBMEM and URMA, and are compiled at runtime through DeepJIT.

以下测量基于 Ascend 950DT NPU,使用 CANN 9.2.0,以及“Recommended HDK and firmware”一节中所述的手动配置 PoC HDK。所有测量均使用 netlayer 1,即超级节点的外部 Clos 网络。

以下运行采用每 rank 16,384 token 容量、hidden size 7168、256 个专家上的 top-6 路由、32 个 AI core / 64 个 AIV、专家对齐 128,且无 bias。Dispatch 使用 FP8 和行主序 scale;combine 使用 BF16。每个 rank 进行 10 次预热和 50 次采样,并刷新 cache。

带宽范围覆盖所有 rank,计时包含 issue 和 drain,但不包含最终 epilogue。在 EP size 不超过 32 时,持续 dispatch 可达到物理 payload 带宽上限的约 90–95%。更大的 EP size 和 combine 仍在优化中;combine 存在额外的本地 reduction 开销以及与 URMA 的 HBM 争用。华为还计划通过固件改进来降低这一争用。

Requirements Linux on an Ascend host with supported NPU drivers and firmware. Ascend 950 (A5) with UBMEM connectivity and UBC_CTP/URMA channels between the participating ranks. An even number of ranks for multi-rank communication. CANN with Ascend C, the Bisheng compiler, HCCL and HCOMM headers/libraries. Python 3.10 or newer, a matching PyTorch/torch_npu installation, and NumPy for the tests. A C++20 compiler and standard library supporting std::format.

经验证的软件栈为 Ascend 950DT、CANN 9.2.0、Python 3.12、PyTorch 2.13.0+cpu 和 torch_npu 2.13.0rc1,并采用下文所述的 PoC HDK 配置。这些测量尚未确认其他昇腾代际或 CANN 版本上的内核支持。

安装过程会构建 host 扩展;device kernel 在首次使用时编译。请确保运行时 CANN toolkit 和 Bisheng 可用。将 ASCEND_HOME_PATH 设置为当前使用的 CANN 安装路径,或使用 ASCEND_TOOLKIT_HOME。

Atlas 850E 的华为 Q3 商用 HDK 版本公开发布后,请使用该版本。华为已告知,该版本包含实现全带宽运行所需的配置。公开发布目前计划在 2026 年 10 月中旬、约 10 月 15 日,通过华为 Atlas 850E 软件下载页面提供;版本可用后,用户可在该页面申请访问权限。该日期为厂商发布计划;实际可用性取决于华为的发布安排。

本 README 中的性能结果使用提供给 DeepSeek 的 PoC HDK 并经过额外手动配置后采集。该配置并非公开发布的版本。使用较早 PoC 版本的用户可能会观察到较低带宽,应首先检查其 HDK 版本和配置。Q3 商用版本发布后,请将其作为推荐的公开部署基线;这些测量结果并非来自该尚未发布的商用版本。

先激活 CANN 环境并安装匹配的 PyTorch/torch_npu 包,然后执行: git clone https://github.com/deepseek-ai/DeepEP-Ascend.git cd DeepEP-Ascend

Fetch the required DeepJIT submodule over HTTPS.

git submodule update --init --recursive third-party/deep_jit python -m pip install --no-build-isolation .

开发时,使用 bash develop.sh 构建扩展并链接到源码树中。clangd-ascend 子模块和 CMake 配置用于 IDE/调试支持。

训练、推理 prefill 和解码共用相同的 EPBuffer 接口和 deep_ep Python 包名。实现遵循 DeepEP 基于 EPBuffer 的 V2.5 API;支持的模式和 stream 行为为昇腾特有。

PP、Engram 和 Bucket 为实验性功能;剩余工作列在 Ongoing 下。EP 要求 do_expand=True 和 allow_multiple_reduction=True;do_handle_copy 必须保持为 False。

路由索引使用 deep_ep.topk_idx_t,目前固定为 torch.int64。不支持显式指定 RDMA service level 和 QP 数量;请将 sl_idx=None,并让 QP 参数保持默认值。兼容 NV 的 num_sms 参数在昇腾 EP 上用于选择 AI core,0 表示选择默认值;缓存 dispatch 和 combine 会复用 handle 中保存的计数。

Ascend 后端仍在积极开发中: Hybrid communication, CPU-backed Engram storage and graph capture remain unsupported.

Buffer initialization Create one long-lived buffer per EP group and reuse it across layers or microbatches. All ranks must agree on the token capacity. Complete outstanding operations before resizing, reusing or destroying a buffer. import torch import torch.distributed as dist import torch_npu from deep_ep import EPBuffer

First select the local NPU and initialize torch.distributed with backend='hccl'.

ep_group = dist.group.WORLD max_tokens_per_rank = 4096 hidden = 7168 num_topk = 6 num_experts = 256 buffer = EPBuffer( ep_group, num_max_tokens_per_rank=max_tokens_per_rank, hidden=hidden, num_topk=num_topk, use_fp8_dispatch=False, # Reserve enough storage for BF16 and FP8 dispatch. explicitly_destroy=True, )

(原文较长,此处译出前 6000 字,完整内容请点「打开原文」。)

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →