Skip to main content
QUICK REVIEW

[论文解读] Large Language Model Inference Acceleration: A Comprehensive Hardware Perspective

Jinhao Li, Jiaming Xu|arXiv (Cornell University)|Oct 6, 2024
Topic ModelingComputer Science被引用 3
一句话总结

本文全面综述了在 CPU、GPU、FPGA、ASIC 和 PIM/NDP 平台上,针对生成式大语言模型(LLMs)推理加速的硬件感知优化技术。评估了量化、稀疏性、算子优化及异构协同等技术,结果表明:在 ASIC 上通过算子优化可实现高达 1800 个 token/s 的速度与 18.557 个 token/J 的能效,而结合量化的 PIM/NDP 则达到 1998 个 token/s 与 46.66 个 token/J,凸显了在边缘部署中速度、功耗与能效之间的关键权衡。

ABSTRACT

Large Language Models (LLMs) have demonstrated remarkable capabilities across various fields, from natural language understanding to text generation. Compared to non-generative LLMs like BERT and DeBERTa, generative LLMs like GPT series and Llama series are currently the main focus due to their superior algorithmic performance. The advancements in generative LLMs are closely intertwined with the development of hardware capabilities. Various hardware platforms exhibit distinct hardware characteristics, which can help improve LLM inference performance. Therefore, this paper comprehensively surveys efficient generative LLM inference on different hardware platforms. First, we provide an overview of the algorithm architecture of mainstream generative LLMs and delve into the inference process. Then, we summarize different optimization methods for different platforms such as CPU, GPU, FPGA, ASIC, and PIM/NDP, and provide inference results for generative LLMs. Furthermore, we perform a qualitative and quantitative comparison of inference performance with batch sizes 1 and 8 on different hardware platforms by considering hardware power consumption, absolute inference speed (tokens/s), and energy efficiency (tokens/J). We compare the performance of the same optimization methods across different hardware platforms, the performance across different hardware platforms, and the performance of different methods on the same hardware platform. This provides a systematic and comprehensive summary of existing inference acceleration work by integrating software optimization methods and hardware platforms. We point out that three trends (multimodality, inference-time compute, and higher inference energy efficiency) are promising to redefine the capabilities of edge artificial intelligence systems. Our project is available at https://dai.sjtu.edu.cn/project.html.

研究动机与目标

  • 系统分析并比较生成式 LLM 在多样化硬件平台上的推理优化技术。
  • 评估在 CPU、GPU、FPGA、ASIC 和 PIM/NDP 上,绝对推理速度(tokens/s)、功耗与能效(tokens/J)之间的性能权衡。
  • 识别在不同批量大小(1 和 8)下,针对各类硬件平台最有效的优化方法,如量化、稀疏性与算子优化。
  • 评估在严格功耗与速度约束下,将 LLM 部署于边缘设备(包括 AI 智能手机与机器人)的可行性。
  • 通过识别趋势与潜在方向,为未来面向边缘场景的软硬件协同设计提供建议。

提出的方法

  • 本研究系统性地调研了主流生成式 LLM 架构及其推理流程,重点关注模型规模的演变与计算需求。
  • 评估了平台特定的优化技术:量化、稀疏性、算子优化、快速解码与异构协同,覆盖 CPU、GPU、FPGA、ASIC 与 PIM/NDP。
  • 采用三项关键指标进行性能基准测试:批量大小为 1 和 8 时的绝对推理速度(tokens/s)、功耗与能效(tokens/J)。
  • 在不同平台间进行定量比较,以评估方法的有效性、硬件适用性与效率权衡。
  • 分析涵盖真实边缘部署场景——AI 智能手机(≤10W,约 10 tokens/s)与机器人(20W,100–1000 tokens/s),以评估实际可行性。
  • 结果基于已发表的基准测试与仿真获得,重点关注新兴平台在预硅与后硅验证之间的差距。
Figure 1: Typical LLM model size in the past six years.
Figure 1: Typical LLM model size in the past six years.

实验结果

研究问题

  • RQ1在批量大小为 1 时,哪些硬件平台与优化技术能为生成式 LLM 提供最高的推理速度与能效?
  • RQ2同一优化方法(如量化、稀疏性)在不同硬件平台(CPU、GPU、FPGA、ASIC、PIM/NDP)上的表现如何?
  • RQ3在智能手机与机器人等边缘设备上,LLM 推理在速度、功耗与能效之间存在何种性能权衡?
  • RQ4在 ASIC 与 PIM/NDP 平台上,不同优化策略(如算子优化 vs. 量化)在绝对速度与能效方面的表现如何比较?
  • RQ5当前的预硅设计在多大程度上能够满足机器人应用的实时推理需求(100–1000 tokens/s,约 20W)?

主要发现

  • 在 ASIC 平台上,算子优化实现最高的绝对推理速度,约为 1800 个 token/s,能效达 18.557 个 token/J,优于稀疏性(42.664 个 token/s,1.421 个 token/J)与量化(161.086 个 token/s,7.434 个 token/J)。
  • 在 PIM/NDP 平台上,量化实现最高的吞吐量(1998 个 token/s)与能效(46.66 个 token/J),显著优于快速解码(174.018 个 token/s,9.94 个 token/J)与异构协同(330 个 token/s,4.34 个 token/J)。
  • 在批量大小为 8 时,PIM/NDP 上的异构协同实现 3000 个 token/s 与 40 个 token/J 的能效,为所有配置中的最高值,表明其在高吞吐量工作负载下具备强大可扩展性。
  • 在 GPU 平台上,算子优化实现约 1033 个 token/s 与 2.3275 个 token/J 的能效,优于稀疏性(290 个 token/s,0.725 个 token/J)与量化(1000 个 token/s,3.155 个 token/J)。
  • 对于边缘 AI 智能手机(≤10W),基于量化的优化在 CPU 与 ASIC 上可实现约 10 个 token/s 的推理速度,满足典型用户阅读速度,同时保持在功耗预算内。
  • 机器人应用(100–1000 个 token/s,约 20W)仍具挑战性:尽管预硅设计如 Guo et al. [127] 与 SpecPIM [168] 在仿真中表现良好,但后硅验证尚未完成,表明仿真与真实部署之间仍存在差距。
Figure 2: LLM inference includes prefill and decode stages. During inference in daily scenarios (input tokens: 128 $\leq$ I $\leq$ 256, output tokens: O $\geq$ 32), the time of decode stage is dominant.
Figure 2: LLM inference includes prefill and decode stages. During inference in daily scenarios (input tokens: 128 $\leq$ I $\leq$ 256, output tokens: O $\geq$ 32), the time of decode stage is dominant.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。