arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.01328cs.LGcs.AIcs.DC
收藏

PipeOffload:通过内存优化改进流水线并行的可扩展性

PipeOffload: Improving Scalability of Pipeline Parallelism with Memory Optimization

Sea AI Lab(海AI实验室);National University of Singapore(新加坡国立大学)

Xinyi Wan, Penghui Qi, Guangxing Huang, Min Lin, Jialin Li

AI总结:

本文提出PipeOffload,通过内存卸载策略和检查点技术优化流水线并行中的激活内存消耗,使其不随阶段数增加,在降低内存的同时实现19%加速。

摘要:

流水线并行(PP)被广泛用于训练大型语言模型(LLMs),但其可扩展性常常受到高激活内存消耗的限制,因为飞行中的微批次数量随着PP程度增加而增长。在本文中,我们通过利用PP中尚未充分探索的内存卸载策略来解决这一挑战。通过实证研究,我们发现,在大多数配置中,至少有一半且通常全部的激活可以被卸载,且开销可忽略不计。在无法完全卸载的情况下,我们引入了一种新颖的选择性卸载策略,以优于线性的方式减少峰值激活内存。此外,我们将内存卸载与检查点技术相结合,以共同考虑整体吞吐量和内存限制。我们的实验证明,每设备激活内存有效减少,且不随总阶段数增加,使PP成为比张量并行(TP)更强的替代方案,在提供高达19%加速的同时,内存消耗更低。该实现已在https://github.com/sail-sg/zero-bubble-pipeline-parallelism开源。

英文摘要:

Pipeline parallelism (PP) is widely used for training large language models (LLMs), yet its scalability is often constrained by high activation memory consumption as the number of in-flight microbatches grows with the degree of PP. In this paper, we focus on addressing this challenge by leveraging the under-explored memory offload strategy in PP. With empirical study, we discover that in the majority of standard configurations, at least half, and potentially all, of the activations can be offloaded with negligible overhead. In the cases where full overload is not possible, we introduce a novel selective offload strategy that decreases peak activation memory in a better-than-linear manner. Furthermore, we integrate memory offload with other techniques to jointly consider overall throughput and memory limitation. Our experiments proves that the per-device activation memory effectively reduces with the total number of stages, making PP a stronger alternative than TP, offering up to a 19\% acceleration with even lower memory consumption. The implementation is open-sourced at \href{https://github.com/sail-sg/zero-bubble-pipeline-parallelism}{this url}.

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

↑