PowerInfer-2:在智能手机上实现大语言模型快速推理
PowerInfer-2: Fast Large Language Model Inference on a Smartphone
AI总结:
针对智能手机资源受限难以部署大语言模型的问题,提出基于神经元簇分解设计的PowerInfer-2框架,通过异构计算调度与细粒度I/O流水线等优化,首次在手机上实现47B参数LLM的高速推理且精度损失极小。
摘要:
部署在智能手机上的大语言模型(LLM)可提供实时AI辅助,同时支持隐私保护的离线运行。然而,智能手机的资源限制使得当前部署仅能使用小语言模型(SLM),能力大幅受限。本文提出PowerInfer-2,这是一款基于智能手机的框架,可对超出内存容量的LLM实现快速推理。其核心思路是将矩阵运算分解为以神经元簇为基本处理单元,从而支持灵活调度与高效的I/O-计算流水线。PowerInfer-2在计算和存储两方面均采用了这种基于神经元簇的设计:计算层面,激活密集的神经元簇在NPU上处理,稀疏簇则使用CPU;存储引擎提供细粒度流水线机制以协调簇级计算与I/O操作,并通过分段神经元缓存减少I/O开销。与当前最优框架相比,PowerInfer-2的速度提升最高可达27.8倍。它是首个能在智能手机上运行47B参数LLM的系统,推理速度达11.68 tokens/s。值得注意的是,这些性能提升保留了模型质量,准确率下降可忽略不计。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。