提出新型路由策略,让专家分工更明确,降低通信开销,提升MoE模型效率。
Advancing MoE Efficiency: A Collaboration-Constrained Routing (C2R) Strategy for Better Expert Parallelism Design
- 引入协作约束路由,引导专家形成更专注的分组,减少冗余通信。
- 在多个NLP任务上提升0.33%-0.51%性能,通信开销显著下降。
- 适合追求高效部署的MoE模型研究者与工程团队。
Mixture-of-Experts (MoE) 在保持近似恒定计算成本的前提下实现了模型扩展。通过门控网络将输入令牌路由至部分专家网络处理,但实际应用中效率受限:一是专家激活不均衡导致模型或专家并行时出现大量空闲时间,二是专家并行中路由组合繁多引发巨大通信开销。以往工作多归因于负载不均或静态执行无法适应动态负载。本文从新视角——专家协作与专业化分析路由策略:部分专家倾向于广泛协同(协作型),另一些则仅与特定子集激活(专业化)。实验发现多数专家过度协作,导致频繁跨加速器传输令牌。为此,我们提出协作约束路由(C2R)策略,促进更专业的专家分组,提升利用率,并实现高效实现。在十项下游NLP基准测试中,对LLaMA-MoE和Qwen-MoE分别取得平均0.51%和0.33%性能提升,降低GPU间all2all通信成本,相较现有最优方案MegaBlocks额外节省20%-30%运行时间。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。