PowerInfer-2: Fast Large Language Model Inference on a Smartphone

Zhenliang Xue, Yixin Song, Zeyu Mi, Xinrui Zheng, Yubin Xia +1 more
6/10/2024
cs.LG

No official code found. Best implementation: Tiiny-AI/PowerInfer (9,768 stars, MIT, last commit 2026-01-24).

Abstract

Large language models (LLMs) on smartphones enable real-time AI assistance and privacy-preserving, offline operation. However, resource constraints of smartphones limit current deployments to small language models (SLMs), significantly compromising their capabilities. This paper introduces PowerInfer-2, a smartphone-based framework that enables fast inference for LLMs exceeding the memory capacity. The key insight is decomposing matrix operations into neuron clusters as the basic processing unit, which enables flexible scheduling and efficient I/O-computation pipelining. PowerInfer-2 leverages this neuron-cluster-based design in both computation and storage. For computation, neuron clusters with dense activations are processed on NPU, while sparse clusters use CPU. The storage engine provides a fine-grained pipeline mechanism that coordinates cluster-level computation and I/O operations, enhanced by a segmented neuron cache to reduce I/O activities. PowerInfer-2 achieves up to a 27.8x speed increase compared to state-of-the-art frameworks. PowerInfer-2 is the first system to serve a 47B LLM on a smartphone, achieving 11.68 tokens/s. Notably, these performance improvements preserve model quality with negligible accuracy degradation.

View on arXivView PDF

Code Implementations(1)

MIT

High-speed Large Language Model Serving for Local Deployment

9,768598C, C++Dec 15, 20239 months agoMIT
large-language-modelsllamallmllm-inferencelocal-inference

Similar Papers

Cite this paper

@article{xue2024powerinfer,
  title  = {PowerInfer-2: Fast Large Language Model Inference on a Smartphone},
  author = {Zhenliang Xue and Yixin Song and Zeyu Mi and Xinrui Zheng and Yubin Xia and Haibo Chen},
  year   = {2024},
  eprint = {2406.06282},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.06282v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.06282.svg)](https://codeofpaper.com/paper/2406.06282)

Discussion