用廉价固态盘扩展GPU显存,让大模型训练快1.5倍
Cost-Efficient LLM Training with Lifetime-Aware Tensor Offloading via GPUDirect Storage
- 通过分析张量生命周期,智能决定何时搬移数据
- 实测平均提速1.47倍,接近理论最优性能的80.7%
- 支持多卡多盘,用GPUDirect直接传数据,不堵CPU
我们提出一种基于低成本PCIe SSD的新型寿命感知张量卸载框架TERAIO,专为多GPU、多SSD的大语言模型(LLM)训练设计。观察发现,每个训练迭代中活跃张量仅占分配显存的1.7%(平均),大量非活跃张量长时间不会被使用,为在不影响训练的前提下将张量移入/移出慢速SSD提供了充足空间。TERAIO通过前几轮训练的性能分析,精准估算每个张量的生命周期,并据此生成优化的卸载/预取计划,集成到经编译的LLM程序中。其运行时张量迁移引擎利用GPUDirect Storage技术,实现GPU与SSD间的直接数据迁移,缓解CPU瓶颈并最大化SSD带宽利用率。相比ZeRO-Offload和ZeRO-Infinity等先进方案,TERAIO平均提升各类LLM训练性能1.47倍,达到理想无限显存下性能的80.7%。
原文摘要 · Abstract (English)
We present the design and implementation of a new lifetime-aware tensor offloading framework for GPU memory expansion using low-cost PCIe-based solid-state drives (SSDs). Our framework, TERAIO, is developed explicitly for large language model (LLM) training with multiple GPUs and multiple SSDs. Its design is driven by our observation that the active tensors take only a small fraction (1.7% on average) of allocated GPU memory in each LLM training iteration, the inactive tensors are usually large and will not be used for a long period of time, creating ample opportunities for offloading/prefetching tensors to/from slow SSDs without stalling the GPU training process. TERAIO accurately estimates the lifetime (active period of time in GPU memory) of each tensor with the profiling of the first few iterations in the training process. With the tensor lifetime analysis, TERAIO will generate an optimized tensor offloading/prefetching plan and integrate it into the compiled LLM program via PyTorch. TERAIO has a runtime tensor migration engine to execute the offloading/prefetching plan via GPUDirect storage, which allows direct tensor migration between GPUs and SSDs for alleviating the CPU bottleneck and maximizing the SSD bandwidth utilization. In comparison with state-of-the-art studies such as ZeRO-Offload and ZeRO-Infinity, we show that TERAIO improves the training performance of various LLMs by 1.47x on average, and achieves 80.7% of the ideal performance assuming unlimited GPU memory.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。