Pangu Ultra MoE: How to Train Your Big MoE on Ascend NPUs

📄 arXiv: 2505.04519v1 📥 PDF

作者: Yehui Tang, Yichun Yin, Yaoyuan Wang, Hang Zhou, Yu Pan, Wei Guo, Ziyang Zhang, Miao Rang, Fangcheng Liu, Naifu Zhang, Binghan Li, Yonghan Dong, Xiaojun Meng, Yasheng Wang, Dong Li, Yin Li, Dandan Tu, Can Chen, Youliang Yan, Fisher Yu, Ruiming Tang, Yunhe Wang, Botian Huang, Bo Wang, Boxiao Liu, Changzheng Zhang, Da Kuang, Fei Liu, Gang Huang, Jiansheng Wei, Jiarui Qin, Jie Ran, Jinpeng Li, Jun Zhao, Liang Dai, Lin Li, Liqun Deng, Peifeng Qin, Pengyuan Zeng, Qiang Gu, Shaohua Tang, Shengjun Cheng, Tao Gao, Tao Yu, Tianshu Li, Tianyu Bi, Wei He, Weikai Mao, Wenyong Huang, Wulong Liu, Xiabing Li, Xianzhi Yu, Xueyu Wu, Xu He, Yangkai Du, Yan Xu, Ye Tian, Yimeng Wu, Yongbing Huang, Yong Tian, Yong Zhu, Yue Li, Yufei Wang, Yuhang Gai, Yujun Li, Yu Luo, Yunsheng Ni, Yusen Sun, Zelin Chen, Zhe Liu, Zhicheng Liu, Zhipeng Tu, Zilin Ding, Zongyuan Zhan

分类: cs.CL

发布日期: 2025-05-07


💡 一句话要点

提出盘古 Ultra MoE 模型,探索在昇腾 NPU 上训练千亿级稀疏 MoE 大模型的有效方法。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: MoE 大语言模型 昇腾NPU 专家并行 模型训练 系统优化 稀疏模型

📋 核心要点

  1. 现有 MoE 大模型训练面临软硬件系统挑战,尤其是在动态稀疏结构下如何高效利用计算资源。
  2. 通过仿真优化模型配置,并结合专家并行和内存优化等系统级改进,提升训练效率。
  3. 在 6K 昇腾 NPU 上,盘古 Ultra MoE 实现了 30.0% 的 MFU,性能媲美 DeepSeek R1。

📝 摘要(中文)

本文旨在探索在昇腾 NPU 上训练大规模稀疏语言模型(LLM)的方法,特别是参数接近万亿的混合专家模型(MoE)。由于模型规模巨大,对底层软硬件系统提出了严峻挑战。本文的目标是在动态稀疏模型结构下,更好地利用计算资源,并在实际硬件上实现预期的性能提升。通过仿真比较各种模型超参数的权衡,选择适合昇腾 NPU 的模型配置,避免昂贵的重复实验。基于此,构建了拥有 7180 亿参数的盘古 Ultra MoE 模型,并通过实验验证了仿真结果。在系统层面,深入研究专家并行性,优化 NPU 设备间的通信,以减少同步开销。同时,优化设备内的内存效率,进一步减少参数和激活管理的开销。最终,在 6K 昇腾 NPU 上训练盘古 Ultra MoE 模型时,实现了 30.0% 的 MFU,性能与 DeepSeek R1 相当,证明了昇腾系统能够驾驭最先进语言模型的各个训练阶段。大量实验表明,本文提出的方法可以有效训练大规模稀疏 MoE 语言模型。此外,还研究了此类模型的行为,以供未来参考。

🔬 方法详解

问题定义:论文旨在解决在昇腾 NPU 上高效训练超大规模稀疏 MoE 模型的问题。现有方法在面对千亿级参数和动态稀疏结构时,难以充分利用硬件资源,导致训练效率低下,同步开销大,内存管理复杂。

核心思路:论文的核心思路是通过软硬件协同优化,充分挖掘昇腾 NPU 的潜力。首先,利用仿真技术选择合适的模型配置,避免盲目实验。然后,通过优化专家并行策略和内存管理,减少通信开销和资源浪费。

技术框架:整体框架包括模型选择、系统优化和实验验证三个阶段。模型选择阶段,通过仿真比较不同超参数组合的性能。系统优化阶段,重点优化专家并行通信和设备内内存管理。实验验证阶段,在昇腾 NPU 集群上训练盘古 Ultra MoE 模型,并评估其性能。

关键创新:论文的关键创新在于将模型层面的仿真优化与系统层面的并行优化相结合,形成一套完整的训练方案。这种协同优化方法能够更好地适应昇腾 NPU 的硬件特性,从而实现更高的训练效率。

关键设计:在模型层面,论文基于仿真结果选择了合适的 MoE 模型结构和超参数。在系统层面,论文优化了专家并行通信策略,减少了 NPU 设备间的同步开销。此外,论文还优化了设备内的内存管理,减少了参数和激活的存储开销。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

论文在 6K 昇腾 NPU 上训练了 7180 亿参数的盘古 Ultra MoE 模型,实现了 30.0% 的 MFU。该性能与在其他硬件平台上训练的 DeepSeek R1 模型相当,证明了昇腾 NPU 在训练大规模语言模型方面的潜力。此外,论文还通过实验验证了仿真结果的有效性,为未来的模型选择提供了参考。

🎯 应用场景

该研究成果可应用于各种需要大规模语言模型的场景,例如智能客服、机器翻译、文本生成等。通过在国产硬件平台上高效训练超大规模模型,可以降低 AI 应用的成本,并促进相关产业的发展。未来,该研究方法可以推广到其他类型的 AI 模型和硬件平台。

📄 摘要(原文)

Sparse large language models (LLMs) with Mixture of Experts (MoE) and close to a trillion parameters are dominating the realm of most capable language models. However, the massive model scale poses significant challenges for the underlying software and hardware systems. In this paper, we aim to uncover a recipe to harness such scale on Ascend NPUs. The key goals are better usage of the computing resources under the dynamic sparse model structures and materializing the expected performance gain on the actual hardware. To select model configurations suitable for Ascend NPUs without repeatedly running the expensive experiments, we leverage simulation to compare the trade-off of various model hyperparameters. This study led to Pangu Ultra MoE, a sparse LLM with 718 billion parameters, and we conducted experiments on the model to verify the simulation results. On the system side, we dig into Expert Parallelism to optimize the communication between NPU devices to reduce the synchronization overhead. We also optimize the memory efficiency within the devices to further reduce the parameter and activation management overhead. In the end, we achieve an MFU of 30.0% when training Pangu Ultra MoE, with performance comparable to that of DeepSeek R1, on 6K Ascend NPUs, and demonstrate that the Ascend system is capable of harnessing all the training stages of the state-of-the-art language models. Extensive experiments indicate that our recipe can lead to efficient training of large-scale sparse language models with MoE. We also study the behaviors of such models for future reference.