SlimPipe:面向长上下文大语言模型训练的内存节约型高效流水线并行方法
SlimPipe: Memory-Thrifty and Efficient Pipeline Parallelism for Long-Context LLM Training
AI总结:
提出SlimPipe,一种细粒度流水线并行方法,通过均匀序列切分和1F1B调度减少激活内存并最小化气泡,在长上下文LLM训练中显著提升MFU。
摘要:
流水线并行(PP)是训练大语言模型(LLMs)的关键技术,因其能以相对较低的通信开销缓解模型状态带来的内存压力。然而,在长上下文场景中,现有流水线并行方法无法解决显著的激活内存压力,这主要是由于多个微批次(microbatches)上激活值累积导致的峰值内存消耗。此外,这些方法不可避免地引入大量流水线气泡(pipeline bubbles),进一步阻碍了效率。为应对这些挑战,我们提出了SlimPipe,一种新颖的细粒度流水线并行方法,采用均匀序列切分结合一次前向-一次后向(1F1B)调度。它将多个微批次的累积激活值减少到仅一个,并将其分割为多个切片。尽管切片均匀划分,但由于因果注意力(causal attention),各切片间的计算成本并不相等。我们开发了一种精细的工作负载重分配技术来解决这种负载不平衡问题。SlimPipe同时实现了(1)近乎零的内存开销和(2)最小的流水线气泡。通过在不同模型架构、上下文窗口大小和SlimPipe特定配置下的全面测试,SlimPipe的有效性得到了验证。例如,在Llama 70B模型上,与最先进的方法相比,SlimPipe在512K上下文长度下将模型浮点运算利用率(MFU)显著提升至高达1.57倍。更值得注意的是,在2048K上下文长度下,它在256块NVIDIA Hopper 80GB GPU上保持了超过45%的利用率,而其他方法要么遭受显著性能下降,要么因内存限制完全失败。
英文摘要:
Pipeline Parallelism (PP) serves as a crucial technique for training Large Language Models (LLMs), owing to its capability to alleviate memory pressure from model states with relatively low communication overhead. However, in long-context scenarios, existing pipeline parallelism methods fail to address the substantial activation memory pressure, primarily due to the peak memory consumption resulting from the accumulation of activations across multiple microbatches. Moreover, these approaches inevitably introduce considerable pipeline bubbles, further hindering efficiency. To tackle these challenges, we propose SlimPipe, a novel approach to fine-grained pipeline parallelism that employs uniform sequence slicing coupled with one-forward-one-backward (1F1B) schedule. It reduces the accumulated activations from several microbatches to just one, which is split into several slices. Although the slices are evenly partitioned, the computation cost is not equal across slices due to causal attention. We develop a sophisticated workload redistribution technique to address this load imbalance. SlimPipe achieves (1) near-zero memory overhead and (2) minimal pipeline bubbles simultaneously. The effectiveness of SlimPipe has been proven by thorough testing with diverse model architectures, context window sizes, and SlimPipe-specific configurations. For example, on the Llama 70B model, compared to state-of-the-art methods, SlimPipe significantly boosts the Model FLOPs Utilization (MFU) to up to $1.57\times$ for a context length of 512K. More notably, for a context length of 2048K, it maintains over 45% utilization on 256 NVIDIA Hopper 80GB GPUs, while other approaches either suffer significant performance drops or fail entirely due to memory constraints.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。