使用Lina加速分布式MoE训练和推理
Accelerating Distributed MoE Training and Inference with Lina
AI总结:
本文针对分布式MoE训练和推理中all-to-all通信瓶颈,提出系统Lina,通过张量分区优先调度通信并动态调度推理资源,在A100上使训练步长最多减少1.73倍,95%ile推理时间平均减少1.63倍。
摘要:
扩大模型参数规模能提升模型质量,但代价是高昂的计算开销。稀疏激活模型通常以Mixture of Experts (MoE)架构的形式存在,其计算成本随模型大小呈次线性扩展,从而提供了以低于稠密模型的成本训练和部署更大模型的机会。然而,分布式MoE训练和推理效率低下,主要原因是模型计算过程中交织的all-to-all通信。本文做出了两项主要贡献。首先,我们系统地分析了分布式MoE中的all-to-all开销,并分别揭示了其成为训练和推理瓶颈的主要原因。其次,我们设计并构建了Lina以正面解决all-to-all瓶颈。Lina在可行时利用张量分区,机会主义地将all-to-all通信的优先级置于并发的allreduce之上,从而改善了all-to-all和训练步长时间。Lina进一步利用专家选择的固有模式,在推理过程中动态调度资源,使得在实际中高度倾斜的专家受欢迎程度下,跨设备的all-to-all传输大小和带宽得以平衡。在A100 GPU测试床上的实验表明,与最先进的系统相比,Lina将训练步长时间最多减少了1.73倍,并将95%ile推理时间平均减少了1.63倍。
英文摘要:
Scaling model parameters improves model quality at the price of high computation overhead. Sparsely activated models, usually in the form of Mixture of Experts (MoE) architecture, have sub-linear scaling of computation cost with model size, thus providing opportunities to train and serve a larger model at lower cost than their dense counterparts. However, distributed MoE training and inference is inefficient, mainly due to the interleaved all-to-all communication during model computation. This paper makes two main contributions. First, we systematically analyze all-to-all overhead in distributed MoE and present the main causes for it to be the bottleneck in training and inference, respectively. Second, we design and build Lina to address the all-to-all bottleneck head-on. Lina opportunistically prioritizes all-to-all over the concurrent allreduce whenever feasible using tensor partitioning, so all-to-all and training step time is improved. Lina further exploits the inherent pattern of expert selection to dynamically schedule resources during inference, so that the transfer size and bandwidth of all-to-all across devices are balanced amid the highly skewed expert popularity in practice. Experiments on an A100 GPU testbed show that Lina reduces the training step time by up to 1.73x and reduces the 95%ile inference time by an average of 1.63x over the state-of-the-art systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。