arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.07304cs.AI
收藏

CPU上大语言模型的推理性能优化

Inference Performance Optimization for Large Language Models on CPUs

Intel Corporation(英特尔公司)

Pujiang He, Shan Zhou, Wenhuan Huang, Changqing Li, Duyi Wang, Bin Guo, Chen Meng, Sheng Gui, Weifei Yu, Yi Xie

AI总结:

针对GPU资源有限时CPU上LLM推理部署的硬件与成本约束问题,本文提出含KV缓存优化、基于oneAPI CCL的分布式推理及常用模型定制优化的易部署方案,代码已开源。

摘要:

大语言模型(LLM)已在各类任务中展现出卓越性能与巨大潜力。然而,在低资源环境下高性能部署LLM已成为行业内的重点关注方向。当GPU硬件资源有限时,我们可以探索CPU上的替代方案。为减轻经济负担、缓解硬件资源带来的限制,有必要对推理性能进行优化。本文提出一种易于部署的推理性能优化方案,旨在加速CPU上的LLM推理。该方案中,我们实现了一种在保证精度的同时减小KV缓存大小的有效方法。我们提出了一种分布式推理优化方法,并基于oneAPI Collective Communications Library(oneAPI集合通信库)实现了该方法。此外,我们还提出了针对CPU上LLM的优化方法,并对最常用的模型进行了定制化优化。相关代码已开源至https://github.com/intel/xFasterTransformer。

英文摘要:

Large language models (LLMs) have shown exceptional performance and vast potential across diverse tasks. However, the deployment of LLMs with high performance in low-resource environments has garnered significant attention in the industry. When GPU hardware resources are limited, we can explore alternative options on CPUs. To mitigate the financial burden and alleviate constraints imposed by hardware resources, optimizing inference performance is necessary. In this paper, we introduce an easily deployable inference performance optimization solution aimed at accelerating LLMs on CPUs. In this solution, we implement an effective way to reduce the KV cache size while ensuring precision. We propose a distributed inference optimization approach and implement it based on oneAPI Collective Communications Library. Furthermore, we propose optimization approaches for LLMs on CPU, and conduct tailored optimizations for the most commonly used models. The code is open-sourced at https://github.com/intel/xFasterTransformer.

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

↑