LLM in a flash: Efficient Large Language Model Inference with Limited Memory
Authors: Keivan Alizadeh, Iman Mirzadeh, Dmitry Belenko, Karen Khatamifard, Minsik Cho, Carlo C Del Mundo, Mohammad Rastegari, Mehrdad Farajtabar
AI-generated Key Points
- Large language models (LLMs) are crucial for natural language processing and perform well in various tasks.
- LLMs have high computational and memory requirements, which pose challenges for devices with limited DRAM capacity.
- The authors propose a method to efficiently run LLMs exceeding the available DRAM capacity by storing model parameters on flash memory and bringing them on demand to DRAM.
- Their approach involves constructing an inference cost model that aligns with the behavior of flash memory.
- They introduce two techniques: "windowing" reduces data transfer by reusing previously activated neurons, while "row-column bundling" increases the size of data chunks read from flash memory.
- By combining these methods, they can run models up to twice the size of available DRAM, achieving significant improvements in inference speed on both CPU and GPU platforms.
- Additional features include integrating sparsity awareness and context-adaptive loading techniques into their design.
- Overall, this work presents an effective solution for running large language models on devices with limited memory resources.
Abstract: Large language models (LLMs) are central to modern natural language processing, delivering exceptional performance in various tasks. However, their intensive 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 on flash memory but bringing them on demand to DRAM. Our method involves constructing an inference cost model that harmonizes with the flash memory behavior, 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 flash memory-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.
Tools for this paper
Ask questions about this paper to our AI assistant
You can also chat with multiple papers at once here.
The previous summary was created more than a year ago and can be re-run (if necessary) by clicking on the Run button below.
Similar papers summarized with our AI tools
Navigate through even more similar papers through a
tree representationLook for similar papers (in beta version)
We compare the title and abstract with papers indexed in our database. For arXiv papers, we search within the same category; for DOI and other sources, we search across sources and subjects. You can rerun the search as our database grows.
Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.