arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2401.08383cs.LGcs.AIcs.DC
收藏

利用层间专家亲和性加速混合专家模型推理

Exploiting Inter-Layer Expert Affinity for Accelerating Mixture-of-Experts Model Inference

The Ohio State University(俄亥俄州立大学)

Jinghan Yao, Quentin Anthony, Aamir Shafi, Hari Subramoni, Dhabaleswar K., Panda

AI总结:

本文提出ExFlow方法,利用预训练GPT MoE模型中层间专家亲和性,通过整数规划优化专家放置,将两次Alltoall通信减少为一次,无需微调即可降低最高67%跨GPU路由延迟,推理吞吐量提升最高达2.2倍。

摘要:

在生成式预训练Transformer等大语言模型中,混合专家范式已成为增强模型表达能力和准确性的强大技术。然而,在分布式系统上部署GPT MoE模型进行并行推理面临重大挑战,主要原因是专家路由和聚合所需的大量Alltoall通信。这一通信瓶颈加剧了本就复杂的计算格局,阻碍了高性能计算资源的高效利用。本文提出一种轻量级优化技术ExFlow,以大幅加速这些MoE模型的推理。我们从利用层间专家亲和性的新视角来缓解通信开销。与以往方法不同,我们的解决方案可以直接应用于预训练MoE模型,无需任何微调,也不会造成精度下降。通过在分布式系统上提出上下文一致的专家并行,我们的设计仅使用一次Alltoall通信即可实现相同功能,而以往方法都需要两次Alltoall。通过仔细考察token跨多层路由中的条件概率,我们证明了预训练GPT MoE模型隐式地表现出很强的层间专家亲和性。随后,我们设计了一个高效的整数规划模型来捕捉这些特征,并表明通过将专家适当地放置到相应GPU上,我们可以减少高达67%的跨GPU路由延迟。我们的解决方案在专家数量从8到64的范围内超越了最先进的MoE实现,推理吞吐量提升最高达2.2倍。我们进一步详细研究了模型如何在训练早期隐式获得这种专家亲和性,以及这种亲和性在训练过程中如何演化和趋于稳定。

英文摘要:

In large language models like the Generative Pre-trained Transformer, the Mixture of Experts paradigm has emerged as a powerful technique for enhancing model expressiveness and accuracy. However, deploying GPT MoE models for parallel inference on distributed systems presents significant challenges, primarily due to the extensive Alltoall communication required for expert routing and aggregation. This communication bottleneck exacerbates the already complex computational landscape, hindering the efficient utilization of high-performance computing resources. In this paper, we propose a lightweight optimization technique called ExFlow, to largely accelerate the inference of these MoE models. We take a new perspective on alleviating the communication overhead by exploiting the inter-layer expert affinity. Unlike previous methods, our solution can be directly applied to pre-trained MoE models without any fine-tuning or accuracy degradation. By proposing a context-coherent expert parallelism on distributed systems, our design only uses one Alltoall communication to deliver the same functionality while previous methods all require two Alltoalls. By carefully examining the conditional probability in tokens' routing across multiple layers, we proved that pre-trained GPT MoE models implicitly exhibit a strong inter-layer expert affinity. We then design an efficient integer programming model to capture such features and show that by properly placing the experts on corresponding GPUs, we can reduce up to 67% cross-GPU routing latency. Our solution beats the cutting-edge MoE implementations with experts from 8 to 64, with up to 2.2x improvement in inference throughput. We further provide a detailed study of how the model implicitly acquires this expert affinity at the very early training stage and how this affinity evolves and stabilizes during training.

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

↑