arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2604.05091cs.CLcs.DCcs.OS
收藏

MegaTrain:在单块GPU上以全精度训练1000亿参数以上的大型语言模型

MegaTrain: Full Precision Training of 100B+ Parameter Large Language Models on a Single GPU

University of Notre Dame(圣母大学);Lehigh University(里海大学)

Zhengqing Yuan, Hanchi Sun, Lichao Sun, Yanfang Ye

AI总结:

MegaTrain通过在主机内存中存储参数和优化器状态,利用GPU作为临时计算引擎,实现了在单块GPU上以全精度训练超大规模语言模型,并在120B参数模型训练中表现出色。

摘要:

MegaTrain是一种以内存为中心的系统,能够高效地在单块GPU上以全精度训练超过1000亿参数的大型语言模型。与传统的GPU为中心的系统不同,MegaTrain将参数和优化器状态存储在主机内存(CPU内存)中,并将GPU视为临时计算引擎。对于每一层,我们流式传输参数并计算梯度,从而最小化持久化的设备状态。为了克服CPU和GPU带宽瓶颈,我们采用了两种关键优化。1)我们引入了一个流水线双缓冲执行引擎,通过多个CUDA流重叠参数预取、计算和梯度卸载,实现了连续的GPU执行。2)我们用无状态的层模板取代了持久化的autograd图,动态绑定权重,当参数流式传输时,消除了持久化的图元数据,同时提供了灵活的调度能力。在单块H200 GPU配备1.5TB主机内存的情况下,MegaTrain能够可靠地训练高达1200亿参数的模型。它在训练14B模型时,实现了比DeepSpeed ZeRO-3带CPU卸载的训练吞吐量高1.84倍。MegaTrain还能够在单块GH200上实现7B模型训练,支持512k token的上下文长度。

英文摘要:

We present MegaTrain, a memory-centric system that efficiently trains 100B+ parameter large language models at full precision on a single GPU. Unlike traditional GPU-centric systems, MegaTrain stores parameters and optimizer states in host memory (CPU memory) and treats GPUs as transient compute engines. For each layer, we stream parameters in and compute gradients out, minimizing persistent device state. To battle the CPU-GPU bandwidth bottleneck, we adopt two key optimizations. 1) We introduce a pipelined double-buffered execution engine that overlaps parameter prefetching, computation, and gradient offloading across multiple CUDA streams, enabling continuous GPU execution. 2) We replace persistent autograd graphs with stateless layer templates, binding weights dynamically as they stream in, eliminating persistent graph metadata while providing flexibility in scheduling. On a single H200 GPU with 1.5TB host memory, MegaTrain reliably trains models up to 120B parameters. It also achieves 1.84$\times$ the training throughput of DeepSpeed ZeRO-3 with CPU offloading when training 14B models. MegaTrain also enables 7B model training with 512k token context on a single GH200.

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

↑