Saved in:
Bibliographic Details
Main Authors: Alizadeh, Keivan, Mirzadeh, Iman, Belenko, Dmitry, Khatamifard, Karen, Cho, Minsik, Del Mundo, Carlo C, Rastegari, Mohammad, Farajtabar, Mehrdad
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2312.11514
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929443513040896
author Alizadeh, Keivan
Mirzadeh, Iman
Belenko, Dmitry
Khatamifard, Karen
Cho, Minsik
Del Mundo, Carlo C
Rastegari, Mohammad
Farajtabar, Mehrdad
author_facet Alizadeh, Keivan
Mirzadeh, Iman
Belenko, Dmitry
Khatamifard, Karen
Cho, Minsik
Del Mundo, Carlo C
Rastegari, Mohammad
Farajtabar, Mehrdad
contents Large language models (LLMs) are central to modern natural language processing, delivering exceptional performance in various tasks. However, their substantial computational and memory requirements present challenges, especially for devices with limited DRAM capacity. This paper tackles the challenge of efficiently running LLMs that exceed the available DRAM capacity by storing the model parameters in flash memory, but bringing them on demand to DRAM. Our method involves constructing an inference cost model that takes into account the characteristics of flash memory, guiding us to optimize in two critical areas: reducing the volume of data transferred from flash and reading data in larger, more contiguous chunks. Within this hardware-informed framework, we introduce two principal techniques. First, "windowing" strategically reduces data transfer by reusing previously activated neurons, and second, "row-column bundling", tailored to the sequential data access strengths of flash memory, increases the size of data chunks read from flash memory. These methods collectively enable running models up to twice the size of the available DRAM, with a 4-5x and 20-25x increase in inference speed compared to naive loading approaches in CPU and GPU, respectively. Our integration of sparsity awareness, context-adaptive loading, and a hardware-oriented design paves the way for effective inference of LLMs on devices with limited memory.
format Preprint
id arxiv_https___arxiv_org_abs_2312_11514
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle LLM in a flash: Efficient Large Language Model Inference with Limited Memory
Alizadeh, Keivan
Mirzadeh, Iman
Belenko, Dmitry
Khatamifard, Karen
Cho, Minsik
Del Mundo, Carlo C
Rastegari, Mohammad
Farajtabar, Mehrdad
Computation and Language
Artificial Intelligence
Machine Learning
Large language models (LLMs) are central to modern natural language processing, delivering exceptional performance in various tasks. However, their substantial computational and memory requirements present challenges, especially for devices with limited DRAM capacity. This paper tackles the challenge of efficiently running LLMs that exceed the available DRAM capacity by storing the model parameters in flash memory, but bringing them on demand to DRAM. Our method involves constructing an inference cost model that takes into account the characteristics of flash memory, guiding us to optimize in two critical areas: reducing the volume of data transferred from flash and reading data in larger, more contiguous chunks. Within this hardware-informed framework, we introduce two principal techniques. First, "windowing" strategically reduces data transfer by reusing previously activated neurons, and second, "row-column bundling", tailored to the sequential data access strengths of flash memory, increases the size of data chunks read from flash memory. These methods collectively enable running models up to twice the size of the available DRAM, with a 4-5x and 20-25x increase in inference speed compared to naive loading approaches in CPU and GPU, respectively. Our integration of sparsity awareness, context-adaptive loading, and a hardware-oriented design paves the way for effective inference of LLMs on devices with limited memory.
title LLM in a flash: Efficient Large Language Model Inference with Limited Memory
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2312.11514