arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.16927cs.LGcs.AI
收藏

BigMac:一种面向快速训练与推理的高通信效率专家混合模型结构

BigMac: A Communication-Efficient Mixture-of-Experts Model Structure for Fast Training and Inference

University of Science and Technology of China(中国科学技术大学);Huawei Technologies(华为技术有限公司);Institute of Artificial Intelligence, Hefei Comprehensive National Science Center(合肥综合性国家科学中心人工智能研究院)

Zewen Jin, Shengnan Wang, Jiaan Zhu, Hongrui Zhan, Youhui Bai, Lin Zhang, Zhenyu Ming, Cheng Li

AI总结:

本文提出细粒度MoE结构BigMac,通过用低维通信的DCCA方式替代高维All-to-All通信的CDAC方式,在保持模型质量的同时显著降低训练延迟并提升推理吞吐量。

摘要:

专家混合(Mixture-of-Experts, MoE)结构能够扩展基于Transformer的大语言模型(LLMs),并仅以计算资源的次线性增长提升其性能。最近,一种细粒度的DeepSeekMoE结构被提出,它可以在不降低性能的情况下进一步提高MoE的计算效率。然而,MoE引入的All-to-All通信已成为瓶颈,尤其是对于细粒度结构而言,其通常涉及并激活更多专家,从而导致更重的通信开销。在本文中,我们提出了一种名为BigMac的新型MoE结构,该结构同样具有细粒度特性,但具备高通信效率。BigMac的创新主要在于我们放弃了细粒度MoE所使用的“通信-降维-升维-通信”(communicate-descend-ascend-communicate, CDAC)方式,该方式导致All-to-All通信始终发生在最高维度。相反,BigMac设计了一种高效的“降维-通信-通信-升维”(descend-communicate-communicate-ascend, DCCA)方式。具体而言,我们分别在专家的入口和出口处添加降维投影和升维投影,从而使通信能够在非常低的维度上进行。此外,为了适应DCCA,我们重新设计了小型专家的结构,确保BigMac中的专家具有足够的复杂度来处理token。实验结果表明,在专家数量相同且总参数量相近的情况下,BigMac达到了与细粒度MoE相当甚至更好的模型质量。同样重要的是,在包括Megatron、Tutel和DeepSpeed-Inference在内的最先进AI计算框架上,BigMac将训练的端到端延迟降低了最高3.09倍,并将推理的吞吐量提高了最高3.11倍。

英文摘要:

The Mixture-of-Experts (MoE) structure scales the Transformer-based large language models (LLMs) and improves their performance with only the sub-linear increase in computation resources. Recently, a fine-grained DeepSeekMoE structure is proposed, which can further improve the computing efficiency of MoE without performance degradation. However, the All-to-All communication introduced by MoE has become a bottleneck, especially for the fine-grained structure, which typically involves and activates more experts, hence contributing to heavier communication overhead. In this paper, we propose a novel MoE structure named BigMac, which is also fine-grained but with high communication efficiency. The innovation of BigMac is mainly due to that we abandon the \textbf{c}ommunicate-\textbf{d}escend-\textbf{a}scend-\textbf{c}ommunicate (CDAC) manner used by fine-grained MoE, which leads to the All-to-All communication always taking place at the highest dimension. Instead, BigMac designs an efficient \textbf{d}escend-\textbf{c}ommunicate-\textbf{c}ommunicate-\textbf{a}scend (DCCA) manner. Specifically, we add a descending and ascending projection at the entrance and exit of the expert, respectively, which enables the communication to perform at a very low dimension. Furthermore, to adapt to DCCA, we re-design the structure of small experts, ensuring that the expert in BigMac has enough complexity to address tokens. Experimental results show that BigMac achieves comparable or even better model quality than fine-grained MoEs with the same number of experts and a similar number of total parameters. Equally importantly, BigMac reduces the end-to-end latency by up to 3.09$\times$ for training and increases the throughput by up to 3.11$\times$ for inference on state-of-the-art AI computing frameworks including Megatron, Tutel, and DeepSpeed-Inference.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑