Skip to main content
QUICK REVIEW

[论文解读] Understanding the Potential of FPGA-Based Spatial Acceleration for Large Language Model Inference

Hongzheng Chen, Jiahao Zhang|arXiv (Cornell University)|Dec 23, 2023
Topic Modeling参考文献 76被引用 4
一句话总结

本文提出一种面向大语言模型(LLM)高效推理的模型专用空间FPGA加速器,采用专用硬件单元处理算子,并通过数据流架构最小化片外内存访问。在Alveo U280 FPGA上,该加速器相较以往FPGA加速器实现高达16.1倍的BERT推理速度提升,且在GPT2解码推理中相比A100 GPU实现5.7倍的能效增益。

ABSTRACT

Recent advancements in large language models (LLMs) boasting billions of parameters have generated a significant demand for efficient deployment in inference workloads. The majority of existing approaches rely on temporal architectures that reuse hardware units for different network layers and operators. However, these methods often encounter challenges in achieving low latency due to considerable memory access overhead. This paper investigates the feasibility and potential of model-specific spatial acceleration for LLM inference on FPGAs. Our approach involves the specialization of distinct hardware units for specific operators or layers, facilitating direct communication between them through a dataflow architecture while minimizing off-chip memory accesses. We introduce a comprehensive analytical model for estimating the performance of a spatial LLM accelerator, taking into account the on-chip compute and memory resources available on an FPGA. Through our analysis, we can determine the scenarios in which FPGA-based spatial acceleration can outperform its GPU-based counterpart. To enable more productive implementations of an LLM model on FPGAs, we further provide a library of high-level synthesis (HLS) kernels that are composable and reusable. This library will be made available as open-source. To validate the effectiveness of both our analytical model and HLS library, we have implemented BERT and GPT2 on an AMD Alveo U280 FPGA device. Experimental results demonstrate our approach can achieve up to 13.4x speedup when compared to previous FPGA-based accelerators for the BERT model. For GPT generative inference, we attain a 2.2x speedup compared to DFX, an FPGA overlay, in the prefill stage, while achieving a 1.9x speedup and a 5.7x improvement in energy efficiency compared to the NVIDIA A100 GPU in the decode stage.

研究动机与目标

  • 解决传统时间性FPGA架构在LLM推理中因频繁访问片外内存而导致的高延迟与高能耗问题。
  • 探索在FPGA上使用专用处理引擎实现算子级模型专用空间加速的可行性与性能潜力。
  • 构建一个分析模型以估算性能,并指导空间加速器的最优并行化与缓冲策略。
  • 开发一个可组合的开源HLS内核库,以加速量化LLM在FPGA上的部署。
  • 证明基于FPGA的空间加速器在低延迟、小批量推理场景下可超越GPU性能。

提出的方法

  • 设计一种空间架构,为特定算子或层配备专用处理单元(PE),通过流式缓冲器实现片上数据流通信。
  • 开发一个全面的分析模型,基于片上计算与内存资源估算性能,支持多FPGA分布式推理。
  • 在AMD Alveo U280 FPGA上使用可组合且可复用的高层次综合(HLS)内核库实现BERT与GPT2。
  • 针对低比特宽量化、自定义数值类型及稀疏性进行优化,以提升效率并减轻内存带宽压力。
  • 采用数据流风格流水线,实现PE之间的并行处理,降低对片外内存的依赖。
  • 应用分析模型识别最优并行化与缓冲策略,以兼顾延迟与资源效率。

实验结果

研究问题

  • RQ1在何种场景下,基于FPGA的空间加速相比GPU推理在LLM上表现更优,特别是在低延迟、小批量设置下?
  • RQ2如何通过FPGA上的模型专用空间架构最小化片外内存访问,从而提升延迟与能效?
  • RQ3LLM推理的预填充与解码阶段中,哪些关键瓶颈可通过硬件专用化加以缓解?
  • RQ4如何通过可组合的HLS内核库实现FPGA上多样化LLM的快速、高性能部署?
  • RQ5空间FPGA加速器的最优并行化与缓冲策略是什么?这些策略如何通过分析建模进行指导?

主要发现

  • 所提出的基于FPGA的空间加速器在Alveo U280 FPGA上相较以往FPGA加速器,实现高达16.1倍的BERT推理速度提升。
  • 在GPT2生成式推理的预填充阶段,该加速器相较DFX(一种FPGA叠加层)实现2.2倍的速度提升。
  • 在解码阶段,该FPGA加速器相较NVIDIA A100 GPU实现1.9倍的速度提升与5.7倍的能效增益。
  • 分析模型成功识别出最优并行化与缓冲策略,支持在多FPGA间高效扩展。
  • 开源HLS内核库实现了可组合的高性能Transformer内核实现,显著加速了量化LLM的部署。
  • 由于减少了内存访问开销并实现了高效的数据流执行,FPGA上的空间加速可在延迟敏感、小批量推理工作负载中超越GPU。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。