arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.10241cs.DCcs.AIcs.LG
收藏

零气泡流水线并行

Zero Bubble Pipeline Parallelism

Sea AI Lab

Penghui Qi, Xinyi Wan, Guangxing Huang, Min Lin

AI总结:

本文提出零气泡流水线并行调度,通过拆分反向计算、自动搜索最优调度并绕过优化器同步,在同步训练下消除流水线气泡,最高较 1F1B 提升 31% 吞吐量。

摘要:

流水线并行是大规模分布式训练的关键组成部分之一,但其效率受到曾被认为不可避免的流水线气泡影响。在本工作中,我们提出一种调度策略;据我们所知,这是首个在同步训练语义下成功实现零流水线气泡的策略。这一改进背后的关键思想是将反向计算拆分为两部分:一部分计算输入的梯度,另一部分计算参数的梯度。基于该思想,我们手工设计了新颖的流水线调度,显著优于基线方法。我们进一步开发了一种算法,可根据特定模型配置和内存限制自动寻找最优调度。此外,为真正实现零气泡,我们引入了一项新技术,在优化器步骤期间绕过同步。实验评估表明,在相近内存限制下,我们的方法在吞吐量上比 1F1B 调度最高提升 23%。当放宽内存约束时,这一数字可进一步提升至 31%。我们相信,这些结果标志着在发挥流水线并行真正潜力方面迈出了重要一步。我们已基于流行的 Megatron-LM 仓库在 https://github.com/sail-sg/zero-bubble-pipeline-parism 上开源实现。

英文摘要:

Pipeline parallelism is one of the key components for large-scale distributed training, yet its efficiency suffers from pipeline bubbles which were deemed inevitable. In this work, we introduce a scheduling strategy that, to our knowledge, is the first to successfully achieve zero pipeline bubbles under synchronous training semantics. The key idea behind this improvement is to split the backward computation into two parts, one that computes gradient for the input and another that computes for the parameters. Based on this idea, we handcraft novel pipeline schedules that significantly outperform the baseline methods. We further develop an algorithm that automatically finds an optimal schedule based on specific model configuration and memory limit. Additionally, to truly achieve zero bubble, we introduce a novel technique to bypass synchronizations during the optimizer step. Experimental evaluations show that our method outperforms the 1F1B schedule up to 23% in throughput under a similar memory limit. This number can be further pushed to 31% when the memory constraint is relaxed. We believe our results mark a major step forward in harnessing the true potential of pipeline parallelism. We open sourced our implementation based on the popular Megatron-LM repository on https://github.com/sail-sg/zero-bubble-pipeline-parallelism.

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

↑