[Paper Review] Understanding the Potential of FPGA-Based Spatial Acceleration for Large Language Model Inference
This paper proposes a model-specific spatial FPGA accelerator for efficient large language model (LLM) inference, using dedicated hardware units for operators and a dataflow architecture to minimize off-chip memory access. It achieves up to 16.1× speedup over prior FPGA accelerators for BERT and 5.7× better energy efficiency than an A100 GPU in GPT2 decode inference.
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.
Motivation & Objective
- Address the high latency and energy overhead of temporal FPGA architectures in LLM inference due to frequent off-chip memory accesses.
- Explore the feasibility and performance potential of model-specific spatial acceleration on FPGAs using dedicated processing engines for operators.
- Develop an analytical model to estimate performance and guide optimal parallelization and buffering schemes for spatial accelerators.
- Create a composable, open-source HLS kernel library to accelerate deployment of quantized LLMs on FPGAs.
- Demonstrate that FPGA-based spatial accelerators can outperform GPUs in low-latency, small-batch inference scenarios.
Proposed method
- Design a spatial architecture with specialized processing engines (PEs) for specific operators or layers, enabling direct on-chip dataflow communication via streaming buffers.
- Develop a comprehensive analytical model to estimate performance based on on-chip compute and memory resources, supporting multi-FPGA distributed inference.
- Implement BERT and GPT2 on an AMD Alveo U280 FPGA using a library of high-level synthesis (HLS) kernels that are composable and reusable.
- Optimize for low-bitwidth quantization, custom numerical types, and sparsity to enhance efficiency and reduce memory bandwidth pressure.
- Use dataflow-style pipelining to enable concurrent processing across PEs and reduce reliance on off-chip memory.
- Apply the analytical model to identify optimal parallelization and buffering strategies for latency and resource efficiency.
Experimental results
Research questions
- RQ1In what scenarios does FPGA-based spatial acceleration outperform GPU-based inference for LLMs, especially in low-latency, small-batch settings?
- RQ2How can model-specific spatial architectures on FPGAs minimize off-chip memory access and improve latency and energy efficiency?
- RQ3What are the key bottlenecks in prefill and decode stages of LLM inference that can be mitigated through hardware specialization?
- RQ4How can a composable HLS kernel library enable rapid, high-performance deployment of diverse LLMs on FPGAs?
- RQ5What are the optimal parallelization and buffering schemes for spatial FPGA accelerators, and how can they be guided by analytical modeling?
Key findings
- The proposed FPGA-based spatial accelerator achieves up to 16.1× speedup over prior FPGA accelerators for BERT inference on the Alveo U280 FPGA.
- For GPT2 generative inference, the accelerator achieves a 2.2× speedup over DFX (an FPGA overlay) in the prefill stage.
- In the decode stage, the FPGA accelerator achieves a 1.9× speedup and a 5.7× improvement in energy efficiency compared to the NVIDIA A100 GPU.
- The analytical model successfully identifies optimal parallelization and buffering schemes, enabling efficient scaling across multiple FPGAs.
- The open-source HLS kernel library enables composable, high-performance implementation of Transformer kernels, accelerating deployment of quantized LLMs.
- Spatial acceleration on FPGAs can surpass GPUs in latency-sensitive, small-batch inference workloads due to reduced memory access overhead and efficient dataflow execution.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.