arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.12456cs.LGcs.OS
收藏

PowerInfer:使用消费级GPU的快速大语言模型服务

PowerInfer: Fast Large Language Model Serving with a Consumer-grade GPU

Shanghai Jiao Tong University(上海交通大学);Institute of Parallel and Distributed Systems(并行与分布式系统研究所)

Yixin Song, Zeyu Mi, Haotong Xie, Haibo Chen

AI总结:

本文提出PowerInfer推理引擎,利用LLM神经元激活的幂律分布特性,采用GPU-CPU混合架构与自适应优化技术,在消费级RTX 4090 GPU上实现了远超llama.cpp、接近A100的推理性能。

摘要:

本文介绍了PowerInfer,这是一款搭载单块消费级GPU的个人电脑(PC)上的高速大语言模型(LLM)推理引擎。PowerInfer设计的核心原理是利用LLM推理固有的高局部性,这种局部性以神经元激活的幂律分布为特征。该分布表明,一小部分被称为热神经元的神经元会在不同输入下持续激活,而大多数冷神经元则根据特定输入发生变化。\nPowerInfer利用这一洞见设计了GPU-CPU混合推理引擎:将热激活神经元预加载到GPU上以实现快速访问,而冷激活神经元则在CPU上计算,从而显著降低GPU内存需求和CPU-GPU间的数据传输量。PowerInfer还集成了自适应预测器和感知神经元的稀疏算子,优化了神经元激活效率和计算稀疏性。\n评估结果显示,在单块NVIDIA RTX 4090 GPU上,针对多种LLM(包括OPT-175B),PowerInfer的性能显著优于llama.cpp,最高可达11.69倍,同时保持了模型精度。对于OPT-30B模型,PowerInfer在单块消费级RTX 4090 GPU上实现了与高端服务器级A100 GPU相当的性能,达到了其令牌生成速率的82%。

英文摘要:

This paper introduces PowerInfer, a high-speed Large Language Model (LLM) inference engine on a personal computer (PC) equipped with a single consumer-grade GPU. The key principle underlying the design of PowerInfer is exploiting the high locality inherent in LLM inference, characterized by a power-law distribution in neuron activation. This distribution indicates that a small subset of neurons, termed hot neurons, are consistently activated across inputs, while the majority, cold neurons, vary based on specific inputs. PowerInfer exploits such an insight to design a GPU-CPU hybrid inference engine: hot-activated neurons are preloaded onto the GPU for fast access, while cold-activated neurons are computed on the CPU, thus significantly reducing GPU memory demands and CPU-GPU data transfers. PowerInfer further integrates adaptive predictors and neuron-aware sparse operators, optimizing the efficiency of neuron activation and computational sparsity. The evaluation shows that PowerInfer significantly outperforms llama.cpp by up to 11.69x while retaining model accuracy across various LLMs (including OPT-175B) on a single NVIDIA RTX 4090 GPU. For the OPT-30B model, PowerInfer achieves performance comparable to that of a high-end server-grade A100 GPU, reaching 82% of its token generation rate on a single consumer-grade RTX 4090 GPU.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑