Nowadays, Large Language Models (LLMs) have been trained using extended context lengths to foster more creative applications. However, long context training poses great challenges considering the constraint of GPU memory. It not only leads to substantial activation memory consumption during training, but also incurs considerable memory fragmentation. To facilitate long context training, existing frameworks have adopted strategies such as recomputation and various forms of parallelisms. Nevertheless, these techniques rely on redundant computation or extensive communication, resulting in low Model FLOPS Utilization (MFU). In this paper, we propose MEMO, a novel LLM training framework designed for fine-grained activation memory management. Given the quadratic scaling of computation and linear scaling of memory with sequence lengths when using FlashAttention, we offload memory-consuming activations to CPU memory after each layer's forward pass and fetch them during the backward pass. To maximize the swapping of activations without hindering computation, and to avoid exhausting limited CPU memory, we implement a token-wise activation recomputation and swapping mechanism. Furthermore, we tackle the memory fragmentation issue by employing a bi-level Mixed Integer Programming (MIP) approach, optimizing memory reuse across transformer layers. Empirical results demonstrate that MEMO achieves an average of 1.97x and 1.80x MFU compared to Megatron-LM and DeepSpeed, respectively. This improvement is attributed to MEMO's ability to minimize memory fragmentation, reduce recomputation and intensive communication, and circumvent the delays associated with the memory reorganization process due to fragmentation. By leveraging fine-grained activation memory management, MEMO facilitates efficient training of 7B LLM with 1 million sequence length on just 8 A800 GPUs, achieving an MFU of 52.30%.
EBRL: Asynchronous Embodied RL by Multi-Grained Resource Management
Nanjing University(南京大学);Institute for AI Industry Research (AIR), Tsinghua University(清华大学智能产业研究院(AIR));Nanjing University of Posts and Telecommunications(南京邮电大学);University of Science and Technology of China(中国科学技术大学)
PatrickStar: Parallel Training of Pre-trained Models via Chunk-based Memory Management
Tencent Inc(腾讯公司);National University of Singapore(新加坡国立大学)
预训练模型(PTM)正在彻底改变人工智能(AI)技术。然而,PTM训练的硬件要求非常高,使其成为一小部分人的游戏。因此,我们提出了PatrickStar系统,以降低PTM的硬件要求,并使其可供任何人使用。PatrickStar使用CPU-GPU异构内存空间存储模型数据。与现有的工作不同,我们组织的模型数据在内存块和动态分布在异构内存。在预热迭代中收集的运行时内存统计数据的指导下,在异构内存中高效地编排块,并产生更低的CPU-GPU数据传输量和更高的带宽利用率。PatrickStar与零冗余优化器共生,可扩展到多个节点上的多个GPU。%使用数据并行。该系统可以在更大的模型和更大的批量上进行训练任务,这是现有工作无法完成的。实验结果表明,PatrickStar将模型规模扩展到DeepSpeed的2.27和2.5倍,并始终表现出显着更高的执行速度。PatricStar还在32 GPU集群上成功运行了175 B GPT 3训练任务。我们的代码可在https://github.com/Tencent/PatrickStar上公开获取。
SuperNeurons: Dynamic GPU Memory Management for Training Deep Neural Networks
Brown University(布朗大学);Univ. of Electr. Sci. & Tech. of China(电子科技大学);Los Alamos National Laboratory(洛斯阿拉莫斯国家实验室);Pacific Northwest National Laboratory(太平洋西北国家实验室);Massachusetts Institute of Technology(麻省理工学院)
vMCU: Coordinated Memory Management and Kernel Optimization for DNN Inference on MCUs
School of Computer Science, Peking University(北京大学计算机学院);School of Computer Science & Engineering, University of Washington(华盛顿大学计算机科学与工程学院);OctoAI(OctoAI公司)