AutoChunk: Automated Activation Chunk for Memory-Efficient Long Sequence Inference

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Zhao, Xuanlei, Cheng, Shenggan, Lu, Guangyang, Fang, Jiarui, Zhou, Haotian, Jia, Bin, Liu, Ziming, You, Yang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866914862258454528
author Zhao, Xuanlei
Cheng, Shenggan
Lu, Guangyang
Fang, Jiarui
Zhou, Haotian
Jia, Bin
Liu, Ziming
You, Yang
author_facet Zhao, Xuanlei
Cheng, Shenggan
Lu, Guangyang
Fang, Jiarui
Zhou, Haotian
Jia, Bin
Liu, Ziming
You, Yang
contents Large deep learning models have achieved impressive performance across a range of applications. However, their large memory requirements, including parameter memory and activation memory, have become a significant challenge for their practical serving. While existing methods mainly address parameter memory, the importance of activation memory has been overlooked. Especially for long input sequences, activation memory is expected to experience a significant exponential growth as the length of sequences increases. In this approach, we propose AutoChunk, an automatic and adaptive compiler system that efficiently reduces activation memory for long sequence inference by chunk strategies. The proposed system generates chunk plans by optimizing through multiple stages. In each stage, the chunk search pass explores all possible chunk candidates and the chunk selection pass identifies the optimal one. At runtime, AutoChunk employs code generation to automatically apply chunk strategies. The experiments demonstrate that AutoChunk can reduce over 80\% of activation memory while maintaining speed loss within 10%, extend max sequence length by 3.2x to 11.7x, and outperform state-of-the-art methods by a large margin.
format Preprint
id arxiv_https___arxiv_org_abs_2401_10652
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle AutoChunk: Automated Activation Chunk for Memory-Efficient Long Sequence Inference
Zhao, Xuanlei
Cheng, Shenggan
Lu, Guangyang
Fang, Jiarui
Zhou, Haotian
Jia, Bin
Liu, Ziming
You, Yang
Performance
Distributed, Parallel, and Cluster Computing
Machine Learning
Large deep learning models have achieved impressive performance across a range of applications. However, their large memory requirements, including parameter memory and activation memory, have become a significant challenge for their practical serving. While existing methods mainly address parameter memory, the importance of activation memory has been overlooked. Especially for long input sequences, activation memory is expected to experience a significant exponential growth as the length of sequences increases. In this approach, we propose AutoChunk, an automatic and adaptive compiler system that efficiently reduces activation memory for long sequence inference by chunk strategies. The proposed system generates chunk plans by optimizing through multiple stages. In each stage, the chunk search pass explores all possible chunk candidates and the chunk selection pass identifies the optimal one. At runtime, AutoChunk employs code generation to automatically apply chunk strategies. The experiments demonstrate that AutoChunk can reduce over 80\% of activation memory while maintaining speed loss within 10%, extend max sequence length by 3.2x to 11.7x, and outperform state-of-the-art methods by a large margin.
title AutoChunk: Automated Activation Chunk for Memory-Efficient Long Sequence Inference
topic Performance
Distributed, Parallel, and Cluster Computing
Machine Learning
url https://arxiv.org/abs/2401.10652