[Paper Review] FlexLLM: Composable HLS Library for Flexible Hybrid LLM Accelerator Design
FlexLLM presents a composable high-level synthesis library enabling stage-customized hybrid LLM accelerators with comprehensive quantization and a Hierarchical Memory Transformer plug-in, achieving notable FPGA-to-GPU speedups and energy efficiency for Llama-3.2 1B.
We present FlexLLM, a composable High-Level Synthesis (HLS) library for rapid development of domain-specific LLM accelerators. FlexLLM exposes key architectural degrees of freedom for stage-customized inference, enabling hybrid designs that tailor temporal reuse and spatial dataflow differently for prefill and decode, and provides a comprehensive quantization suite to support accurate low-bit deployment. Using FlexLLM, we build a complete inference system for the Llama-3.2 1B model in under two months with only 1K lines of code. The system includes: (1) a stage-customized accelerator with hardware-efficient quantization (12.68 WikiText-2 PPL) surpassing SpinQuant baseline, and (2) a Hierarchical Memory Transformer (HMT) plug-in for efficient long-context processing. On the AMD U280 FPGA at 16nm, the accelerator achieves 1.29$ imes$ end-to-end speedup, 1.64$ imes$ higher decode throughput, and 3.14$ imes$ better energy efficiency than an NVIDIA A100 GPU (7nm) running BF16 inference; projected results on the V80 FPGA at 7nm reach 4.71$ imes$, 6.55$ imes$, and 4.13$ imes$, respectively. In long-context scenarios, integrating the HMT plug-in reduces prefill latency by 23.23$ imes$ and extends the context window by 64$ imes$, delivering 1.10$ imes$/4.86$ imes$ lower end-to-end latency and 5.21$ imes$/6.27$ imes$ higher energy efficiency on the U280/V80 compared to the A100 baseline. FlexLLM thus bridges algorithmic innovation in LLM inference and high-performance accelerators with minimal manual effort.
Motivation & Objective
- Address the divergent compute and memory needs of prefill vs decode in LLM inference.
- Provide a programmable, composable HLS framework to enable stage-customized hybrid architectures.
- Integrate a comprehensive quantization stack to enable accurate low-bit deployment on FPGA/ASICs.
- Demonstrate rapid model-to-silicon turnaround with minimal code (≤1K lines) for LLM accelerators.
Proposed method
- Introduce stage-customized module templates for prefill (token_parallelism and weight_parallelism) and decode (block_parallelism and WP) within a 2D/1D systolic-architecture framework.
- Incorporate a comprehensive quantization library supporting static/dynamic, symmetric/asymmetric, per-tensor/token/channel granularity, and outlier-handling (rotation, FHT).
- Provide a library of templated kernel modules (linear, non-linear, quant/dequant) and a composable flow built on the TAPA HLS framework.
- Demonstrate hybrid accelerator construction by composing temporal reuse and spatial dataflow modules, with an ILP-driven optimization under hardware constraints.
- Integrate a Hierarchical Memory Transformer (HMT) plug-in to compress long-context processing and enable scalable context windows.
Experimental results
Research questions
- RQ1Can stage-customized, hybrid architectures outperform unified designs for prefill and decode in LLM inference?
- RQ2What quantization strategies yield accurate, hardware-efficient LLM inference on FPGA while preserving model quality?
- RQ3How quickly can a model-specific accelerator be implemented with FlexLLM (in terms of lines of code and turnaround time)?
- RQ4What is the impact of adding an HMT plug-in on latency, context length, and energy efficiency for long-context LLM workloads?
Key findings
- On Llama-3.2 1B, FPGA implementations show 1.29× end-to-end speedup over A100 BF16 baseline on U280 and 4.71× on Versal V80.
- Decode throughput is 1.64× higher on U280 and 6.55× higher on V80 versus the GPU baseline.
- Energy efficiency improves by 3.14× (U280) and 4.13× (V80) relative to the A100 baseline.
- Long-context processing with HMT reduces prefill latency by 23.23× and extends context window by 64×, with end-to-end latency reduced by 1.10× (U280) and 4.86× (V80) and energy efficiency increased by 5.21× (U280) and 6.27× (V80).
- With long decode, HMT adds minimal resource and latency overhead (<7.5% resources, <0.6% latency) but enables scalable context for long-context workloads.
- Stage-customized architectures combined with quantization achieve competitive performance against GPU baselines while maintaining lower energy per token.
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.