paper-with-me

홈 › Papers

MEMO: Fine-grained Tensor Management For Ultra-long Context LLM Training

2024-07-16 · Pinxue Zhao, Hailin Zhang, Fangcheng Fu, Xiaonan Nie, Qibin Liu, Fang Yang, Yuanbo Peng, Dian Jiao, Shuaipeng Li, Jinbao Xue, Yangyu Tao, Bin Cui

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%.

📄 PDF Abstract BibTeX arXiv:2407.12117

Code (0)

등록된 구현이 없습니다.

Tasks

CPUGPUManagement

Methods 이 논문이 사용한 방법론

Fragmentation Given a pattern $P,$ that is more complicated than the patterns, we fragment $P$ into simpler patterns such that their exact count is known. In the subgraph GNN proposed earlier,…

Similar Papers 제목 키워드 기반

vMCU: Coordinated Memory Management and Kernel Optimization for DNN Inference on MCUs

2024-05-01 · Size Zheng, Renze Chen, Meng Li, Zihao Ye 외

IoT devices based on microcontroller units (MCU) provide ultra-low power consumption and ubiquitous computation for near-sensor deep learning models (DNN). However, the memory of MCU is usually 2-3 orders of magnitude sm…

Management

Efficient Arbitrary Precision Acceleration for Large Language Models on GPU Tensor Cores

2024-09-26 · Shaobo Ma, Chao Fang, Haikuo Shao, Zhongfeng Wang

Large language models (LLMs) have been widely applied but face challenges in efficient inference. While quantization methods reduce computational demands, ultra-low bit quantization with arbitrary precision is hindered b…

GPUManagementQuantization

Salus: Fine-Grained GPU Sharing Primitives for Deep Learning Applications

2019-02-12 · Peifeng Yu, Mosharaf Chowdhury

GPU computing is becoming increasingly more popular with the proliferation of deep learning (DL) applications. However, unlike traditional resources such as CPU or the network, modern GPUs do not natively support fine-gr…

CPUDeep LearningFairnessGPU+2

APT-LLM: Exploiting Arbitrary-Precision Tensor Core Computing for LLM Acceleration

2025-08-26 · Shaobo Ma, Chao Fang, Haikuo Shao, Zhongfeng Wang arxiv

Large language models (LLMs) have revolutionized AI applications, yet their enormous computational demands severely limit deployment and real-time performance. Quantization methods can help reduce computational costs, ho…

3U-EdgeAI: Ultra-Low Memory Training, Ultra-Low BitwidthQuantization, and Ultra-Low Latency Acceleration

2021-05-11 · Yao Chen, Cole Hawkins, Kaiqi Zhang, Zheng Zhang 외

The deep neural network (DNN) based AI applications on the edge require both low-cost computing platforms and high-quality services. However, the limited memory, computing resources, and power budget of the edge devices …

Model CompressionQuantization