Introduction
Large Language Models (LLMs) like LLaMA have revolutionized natural language processing but present immense challenges for deployment. The inference process typically occurs in two stages: prefill, which processes the initial prompt, and decode, which generates responses token-by-token. The decode stage is notoriously memory-bound; hardware often spends more time moving data from external memory to the processor than performing actual computations.
While compression techniques like sparsity and quantization are used to reduce model size, standard GPUs are optimized for dense, regular math. They struggle with the "unstructured" sparsity and mixed-precision requirements (e.g., 3-bit or 4-bit weights) common in compressed LLMs. FlightLLM is a specialized FPGA-based framework designed to bridge this gap, offering a complete mapping flow that optimizes both computation and memory access.
The FlightLLM Framework
FlightLLM introduces three primary innovations to transform FPGAs into high-efficiency LLM accelerators. These solutions target the heavy computation, memory access, and dynamic input length challenges inherent in modern transformer architectures.
1. Configurable Sparse DSP Chain (CSD-Chain)
To handle the irregular sparsity of compressed models, FlightLLM reconfigures the FPGA’s native Digital Signal Processing (DSP) slices. Unlike GPUs that may waste cycles on zero-value weights, the CSD-Chain allows the hardware to skip zeros dynamically. This architecture supports various sparsity patterns (such as N:M or block sparsity) with high efficiency, improving computational throughput by up to 1.6×.
2. Always-on-chip Decode Scheme
To mitigate the memory bottleneck, FlightLLM utilizes an "always-on-chip" dataflow. By fusing multiple operations—including Linear layers, Softmax, and LayerNorm—into a single pipeline, the system keeps intermediate activation data entirely within the FPGA's fast on-chip memory. This avoids the latency of writing back to external RAM, increasing effective bandwidth utilization from approximately 35% to 66%.
3. Length Adaptive Compilation
LLM inference involves varying sequence lengths, which traditionally requires generating unique instruction files for every possible length. This can lead to a "compilation explosion," requiring terabytes of storage. FlightLLM solves this by grouping similar sequence lengths into "bins" that share instructions. This adaptive approach reduces instruction storage overhead by 500×, shrinking a theoretical 1.67 TB file down to a manageable 3.25 GB.
Experimental Setup and Evaluation
The researchers evaluated FlightLLM using state-of-the-art open-source models, including LLaMA2-7B and OPT-6.7B. To ensure that compression did not degrade model quality, the team finetuned the models on a 56M token subset of the RedPajama dataset and measured perplexity using WikiText-103 and WikiText-2.
The hardware implementation was tested on the Xilinx Alveo U280 (16nm) and the newer Versal VHK158 FPGA, comparing performance against NVIDIA V100S and A100 GPUs.
Key Results and Performance Gains
FlightLLM demonstrates that FPGAs can outperform high-end GPUs in efficiency and cost for specific LLM workloads.
- Energy & Cost Efficiency: On the Alveo U280, FlightLLM achieved 6.0× higher energy efficiency and 1.8× better cost efficiency compared to an NVIDIA V100S running optimized vLLM and SmoothQuant software.
- Throughput: When deployed on the Versal VHK158, FlightLLM outperformed the NVIDIA A100 GPU with 1.2× higher throughput.
- Latency: For LLaMA2-7B, FlightLLM improved end-to-end latency by 1.2× to 1.6× over optimized GPU baselines at a batch size of one.
These gains are largely attributed to the FPGA's ability to act as a "bit-level sculptor," allowing for custom data paths that handle non-standard bit-widths (like 3-bit weights) far better than the fixed-width architectures of traditional GPUs.
Conclusion and Future Directions
FlightLLM establishes FPGAs as a viable, highly efficient alternative for LLM inference, particularly in real-time, low-latency applications where batch sizes are small. By intelligently fusing operations and utilizing configurable hardware chains, it overcomes the memory-wall and computation-wall that often limit GPU performance in compressed model scenarios.
Future work aims to automate the buffer scheduling process, which currently relies on manual templates, and to extend comparisons to the latest generation of GPUs, such as the NVIDIA H100, to further refine the framework's competitive positioning.
Summary updated