平衡流水线并行与词表并行
Balancing Pipeline Parallelism with Vocabulary Parallelism
AI总结:
针对大型语言模型训练中词表层导致的流水线计算与内存不均衡问题,提出词表并行方法均匀划分词表层并优化通信,实现计算与内存的完美均衡,提升5%至51%的吞吐量。
摘要:
流水线并行被广泛用于扩展基于transformer的大型语言模型的训练,已有诸多工作致力于提升其吞吐量和内存占用。本文解决了一个常被忽视的问题:词表层会导致跨流水线阶段的计算和内存使用不均衡,加剧流水线气泡和内存瓶颈。为此,我们将词表层均匀划分到流水线设备上,并将计算分组为流水线传递。为降低激活内存开销,我们提出了多种算法以减少词表层内的通信屏障。此外,我们采用一种可推广的方法将Vocabulary Parallelism与现有流水线调度相集成。结合这些技术,我们的方法有效平衡了计算和参数内存,仅带来极小的常量激活内存开销。值得注意的是,当与V-Half等激活内存均衡调度结合时,我们的方法在内存和计算上均实现了完美均衡。广泛评估表明,无论词表大小如何,我们的方法均能实现计算与内存均衡,相较于朴素方法实现了5%至51%的吞吐量提升,同时显著降低了峰值内存使用,尤其适用于大词表场景。我们的实现已在 https://github.com/sail-sg/VocabularyParallelism 开源。
英文摘要:
Pipeline parallelism is widely used to scale the training of transformer-based large language models, various works have been done to improve its throughput and memory footprint. In this paper, we address a frequently overlooked issue: the vocabulary layers can cause imbalanced computation and memory usage across pipeline stages, worsening pipeline bubbles and the memory bottleneck. To tackle this, we partition the vocabulary layers evenly across pipeline devices and group the computation into pipeline passes. To reduce the activation memory overhead, we propose several algorithms to reduce communication barriers within vocabulary layers. Additionally, we utilize a generalizable method to integrate Vocabulary Parallelism with existing pipeline schedules. By combining these techniques, our methods effectively balance the computation and parameter memory, with only a small constant activation memory overhead. Notably, when combined with activation memory-balanced schedules like V-Half, our approach achieves perfect balance in both memory and computation. Extensive evaluations demonstrate that our method achieves computation and memory balance regardless of the vocabulary size, resulting in a 5% to 51% improvement in throughput compared to naive approaches, meanwhile significantly reducing peak memory usage especially for large vocabulary scenarios. Our implementation is open-sourced at https://github.com/sail-sg/VocabularyParallelism .
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。