arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.01337cs.LGcs.AIcs.CLcs.DC
收藏

推进 MoE 效率:一种协作约束路由(C2R)策略以优化专家并行设计

Advancing MoE Efficiency: A Collaboration-Constrained Routing (C2R) Strategy for Better Expert Parallelism Design

University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校)

Mohan Zhang, Pingzhi Li, Jie Peng, Mufan Qiu, Tianlong Chen

AI总结:

针对MoE模型因专家过度协作导致的通信开销和利用率不足问题,提出协作约束路由(C2R)策略,鼓励专家专业化,在多个基准上提升性能并节省20%-30%运行时间。

摘要:

混合专家(Mixture-of-Experts, MoE)模型在保持近乎恒定计算成本的同时,成功实现了模型规模的扩展。通过使用门控网络对输入令牌进行路由,它选择性地激活一部分专家网络来处理对应的令牌嵌入。然而,在实践中,MoE 的效率难以实现,原因主要有两个:专家激活不均衡,导致在模型或专家并行期间出现大量空闲时间,以及容量利用率不足;大量通信开销,由系统层面专家并行中众多专家路由组合引起。以往的研究通常将其表述为负载不均衡问题,表现为门控网络偏向某些专家而非其他专家,或将其归因于静态执行,无法在运行时适应动态的专家工作负载。在本文中,我们从一个全新的视角,即对 MoE 路由策略进行高阶视图和分析:专家协作与专业化,其中一些专家倾向于与其他专家广泛激活(协作型),而另一些专家则更可能仅与特定专家子集激活(专业化型)。我们的实验表明,大多数专家倾向于过度协作,导致因重复将令牌发送到不同加速器而增加通信开销。为此,我们提出了一种新颖的协作约束路由(Collaboration-Constrained Routing, C2R)策略,以鼓励更专业化的专家群体,并提高专家利用率,同时提出了一种高效的 MoE 实现,进一步利用专家专业化。我们在十个下游 NLP 基准上,分别在 LLaMA-MoE 和 Qwen-MoE 上实现了平均性能提升 0.51% 和 0.33%,并减少了 GPU 之间的 all2all 通信成本,在现有最先进方法(即 MegaBlocks)的基础上,额外节省了 20%-30% 的总运行时间。

英文摘要:

Mixture-of-Experts (MoE) has successfully scaled up models while maintaining nearly constant computing costs. By employing a gating network to route input tokens, it selectively activates a subset of expert networks to process the corresponding token embeddings. However, in practice, the efficiency of MoE is challenging to achieve due to two key reasons: imbalanced expert activation, which leads to substantial idle time during model or expert parallelism, and insufficient capacity utilization; massive communication overhead, induced by numerous expert routing combinations in expert parallelism at the system level. Previous works typically formulate it as the load imbalance issue characterized by the gating network favoring certain experts over others or attribute it to static execution which fails to adapt to the dynamic expert workload at runtime. In this paper, we exploit it from a brand new perspective, a higher-order view and analysis of MoE routing policies: expert collaboration and specialization where some experts tend to activate broadly with others (collaborative), while others are more likely to activate only with a specific subset of experts (specialized). Our experiments reveal that most experts tend to be overly collaborative, leading to increased communication overhead from repeatedly sending tokens to different accelerators. To this end, we propose a novel collaboration-constrained routing (C2R) strategy to encourage more specialized expert groups, as well as to improve expert utilization, and present an efficient implementation of MoE that further leverages expert specialization. We achieve an average performance improvement of 0.51% and 0.33% on LLaMA-MoE and Qwen-MoE respectively across ten downstream NLP benchmarks, and reduce the all2all communication costs between GPUs, bringing an extra 20%-30% total running time savings on top of the existing SoTA, i.e. MegaBlocks.

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

↑