arXiv:2501.06589cs.LGcs.CL2025-01ICML被引 8

通过重构模型结构,让大模型推理通信与计算重叠,提速近30%。

Ladder-residual: parallelism-aware architecture for accelerating large model inference with communication overlapping

论文配图:Ladder-residual: parallelism-aware architecture for accelerating large model inference with communication overlapping
图 1 · 摘自论文原文
  • 在残差模型中引入阶梯残差结构,实现通信与计算解耦。
  • 70B模型在8卡张量并行下推理速度提升29%。
  • 可无损转换Llama-3.1 8B部分层,适合追求高效推理的开发者。

大语言模型推理既耗内存又耗时,常需分布式算法扩展。现有模型并行策略虽能分摊计算负载,但设备间通信成为主要瓶颈,限制了设备规模扩展带来的性能提升。本文提出Ladder Residual——一种适用于所有残差结构模型的简单架构改进,可直接实现通信与计算的重叠,有效隐藏通信延迟。该方法在张量并行场景中尤为有效,因该模式通信开销大。对700亿参数的Transformer模型,全层应用该结构后,在8个设备上使用张量并行可实现29%的端到端时钟加速。由此构建的Ladder Transformer经训练,10亿和30亿参数版本表现与标准密集模型相当。此外,仅用30亿词元微调即可将Llama-3.1 8B模型的部分层转换为该结构,精度下降极小。代码已开源,便于复现。

原文摘要 · Abstract (English)

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.

大模型推理通信重叠张量并行架构优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。