Ladder-residual:面向通信重叠的并行感知架构,用于加速大模型推理
Ladder-residual: parallelism-aware architecture for accelerating large model inference with communication overlapping
AI总结:
提出Ladder Residual架构修改,通过解耦通信与计算并重叠通信,在张量并行下实现70B模型推理29%端到端加速,且训练1B/3B模型性能与基线相当。
摘要:
大语言模型推理既消耗大量内存又耗时,通常需要分布式算法来高效扩展。在多GPU训练和推理中,使用了多种模型并行策略,将计算划分到多个设备上,以减少内存负载和计算时间。然而,使用模型并行需要在GPU之间通信信息,这已成为主要瓶颈,并限制了通过增加设备数量所获得的收益。我们引入了Ladder Residual,这是一种适用于所有基于残差的模型的简单架构修改,能够实现直接的重叠,从而有效隐藏通信延迟。我们的见解是,除了系统优化之外,还可以重新设计模型架构,将通信与计算解耦。虽然Ladder Residual可以在常规并行模式中实现通信-计算解耦,但本文重点研究张量并行,因为张量并行尤其受到其繁重通信的瓶颈限制。对于具有700亿参数的Transformer模型,将其所有层应用Ladder Residual,在8个设备上进行TP分片时,推理时可实现29%的端到端墙钟加速。我们将由此产生的Transformer模型称为Ladder Transformer。我们从零开始训练了10亿和30亿参数的Ladder Transformer,并观察到与标准密集Transformer基线相当的性能。我们还表明,可以将Llama-3.1 8B模型的部分层转换为我们的Ladder Residual架构,仅通过重新训练30亿个token,就能将精度下降降至最低。我们发布了用于训练和推理的代码,以便更容易地复现实验。
英文摘要:
Large language model inference is both memory-intensive and time-consuming, often requiring distributed algorithms to efficiently scale. Various model parallelism strategies are used in multi-gpu training and inference to partition computation across multiple devices, reducing memory load and computation time. However, using model parallelism necessitates communication of information between GPUs, which has been a major bottleneck and limits the gains obtained by scaling up the number of devices. We introduce Ladder Residual, a simple architectural modification applicable to all residual-based models that enables straightforward overlapping that effectively hides the latency of communication. Our insight is that in addition to systems optimization, one can also redesign the model architecture to decouple communication from computation. While Ladder Residual can allow communication-computation decoupling in conventional parallelism patterns, we focus on Tensor Parallelism in this paper, which is particularly bottlenecked by its heavy communication. For a Transformer model with 70B parameters, applying Ladder Residual to all its layers can achieve 29% end-to-end wall clock speed up at inference time with TP sharding over 8 devices. We refer the resulting Transformer model as the Ladder Transformer. We train a 1B and 3B Ladder Transformer from scratch and observe comparable performance to a standard dense transformer baseline. We also show that it is possible to convert parts of the Llama-3.1 8B model to our Ladder Residual architecture with minimal accuracy degradation by only retraining for 3B tokens. We release our code for training and inference for easier replication of experiments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。