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

打破内存墙:面向混合 CPU-GPU 卸载优化器的 I/O 模式与 GPU 内存利用率研究

Breaking the Memory Wall: A Study of I/O Patterns and GPU Memory Utilization for Hybrid CPU-GPU Offloaded Optimizers

Avinash Maurya, Jie Ye, M. Mustafa Rafique, Franck Cappello, Bogdan Nicolae

AI总结:

本文利用 DeepSpeed 分析混合 CPU-GPU 卸载训练的 GPU 内存利用、PCIe 传输及迭代步骤关系,揭示其瓶颈与优化空间。

摘要:

Transformer 和 LLM 已在所有领域得到快速采用。它们的规模已激增至数千亿个参数,并且仍在持续增长。在这种情况下,Transformer 的训练速度很慢,通常需要数周或数月时间。得益于 3D 模型并行(数据并行、流水线并行和张量级并行),训练可以扩展到大量 GPU,从而缩短训练持续时间,但也显著增加了成本。即使有大量 GPU 可用,聚合后的 GPU 内存往往仍不足以容纳完整的训练状态(优化器状态、模型参数和梯度)。为弥补这一不足,最先进的方法至少会将部分优化器状态卸载到主机内存,并执行混合 CPU-GPU 计算。这类灵活方案大幅降低了 GPU 内存利用率,使在更少 GPU 上运行训练成为可能,但代价是性能损失。遗憾的是,现有研究尚未充分分析采用该策略所面临的挑战和瓶颈,导致主机与 GPU 组合内存管理不佳,数据移动与计算之间的重叠也较差。本文旨在通过刻画使用 DeepSpeed 运行时进行卸载训练的行为来填补这一空白。具体而言,我们研究每次迭代过程中随时间变化的 GPU 内存利用率、与主机内存和 GPU 内存之间传输相关的 PCIe 活动,以及资源利用率与每次迭代所涉及步骤之间的关系。通过该研究,我们揭示了未来改进卸载方案的机会,从而在 Transformer 和 LLM 训练场景中为优化成本与性能权衡提供更大灵活性。

英文摘要:

Transformers and LLMs have seen rapid adoption in all domains. Their sizes have exploded to hundreds of billions of parameters and keep increasing. Under these circumstances, the training of transformers is slow and often takes in the order of weeks or months. Thanks to 3D model parallelism (data, pipeline, and tensor-level parallelism), the training can scale to a large number of GPUs, which reduces the duration of the training but dramatically increases the cost. Even when a large number of GPUs are available, the aggregated GPU memory is often not enough to hold the full training state (optimizer state, model parameters, and gradients). To compensate, state-of-the-art approaches offload the optimizer state at least partially to the host memory and perform hybrid CPU-GPU computations. Such flexible solutions dramatically reduce the GPU memory utilization, which makes it feasible to run the training on a smaller number of GPUs at the cost of performance penalty. Unfortunately, the challenges and bottlenecks of adopting this strategy are not sufficiently studied by state-of-the-art, which results in poor management of the combined host-GPU memory and poor overlapping between data movements and computations. In this paper, we aim to fill this gap by characterizing the behavior of offloaded training using the DeepSpeed runtime. Specifically, we study the GPU memory utilization over time during each iteration, the activity on the PCIe related to transfers between the host memory and the GPU memory, and the relationship between resource utilization and the steps involved in each iteration. Thanks to this study, we reveal opportunities for future improvements of offloading solutions, which enable greater flexibility to optimize the cost-performance trade-off in the context of transformer and LLM training.

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

↑