Large Language Model Inference Acceleration: A Comprehensive Hardware Perspective

Jinhao Li, Jiaming Xu, Shan Huang, Yonghua Chen, Wen Li, Jun Liu, Yaoxiu Lian, Jiayi Pan, Li Ding, Hao Zhou, Yu Wang, Guohao DaiarXiv 2024 · DOI

Introduction: The Generative LLM Era and the Inference Bottleneck

The transition from discriminative models (like BERT) to generative Large Language Models (LLMs) such as Llama and GPT has fundamentally shifted the landscape of AI infrastructure. While these models offer unprecedented capabilities, their deployment is hindered by significant computational and energy costs. The primary challenge lies in the autoregressive decoding process, where tokens are generated sequentially. This creates a severe memory bottleneck; hardware often spends more time fetching model weights from memory than performing actual computations.

Methodology: Six Pillars of LLM Acceleration

To address these challenges, researchers have developed a diverse array of acceleration techniques, categorized into six major pillars:

  1. Quantization: Reducing numerical precision (e.g., from FP16 to INT4) to decrease memory footprint and increase throughput.
  2. Sparsity: Identifying and skipping "zero" or insignificant values to reduce the total number of operations.
  3. Fast Decoding: Techniques such as Speculative Decoding break the sequential bottleneck by using a smaller "draft" model to predict multiple future tokens, which are then verified in parallel by the larger target model.
  4. Operator Optimization: Fusing multiple mathematical operations into a single kernel to minimize redundant memory accesses.
  5. Heterogeneous Cooperation: Leveraging the strengths of different hardware types (e.g., CPU + GPU) to balance the workload.
  6. Homogeneous Cooperation: Scaling inference across multiple identical units, such as multi-GPU or multi-FPGA clusters.
Quantization techniques: (a) basic quantization, (b) weight-only, and (c) weight-activation quantization.

Key Insights: The Dominance of the Decode Stage

A critical finding in LLM profiling is the disparity between the prefill stage (processing the input prompt) and the decode stage (generating the response).

Comparison of the prefill and decode stages, highlighting that the decode stage often accounts for over 80% of total inference time.

As shown in the figure above, the decode stage is the primary target for optimization. In typical usage scenarios, it accounts for the vast majority of total inference time. This stage is fundamentally memory-bound, leading to the "Memory Wall" problem. To overcome this, emerging architectures like Processing-in-Memory (PIM) and Near-Data Processing (NDP) are gaining traction, as they perform calculations directly where the data resides, significantly reducing energy-intensive data movement.

Hardware Landscape and Performance Results

The survey provides a quantitative mapping of current hardware capabilities using metrics like tokens per second (tokens/s) for throughput and tokens per Joule (tokens/J) for energy efficiency.

  • GPUs: High-end GPUs (e.g., NVIDIA H100) lead in raw throughput but suffer from high power consumption, making them less ideal for edge applications.
  • ASICs and PIM: Custom accelerators and PIM designs offer the highest energy efficiency, with some PIM implementations reaching over 40 tokens/J—a massive improvement over standard GPU efficiencies (<1 token/J).
  • CPUs: With modern vector extensions (like Intel AMX), CPUs are becoming viable for smaller 7B parameter models, achieving 10-50 tokens/s.
  • Quantization Gains: Moving from FP16 to INT4 precision typically results in a 3x-4x speedup by alleviating memory pressure.

Future Outlook and Limitations

Despite rapid progress, several "frontier" challenges remain. Unstructured sparsity is difficult for current hardware to exploit efficiently, requiring tighter hardware-software co-design. Furthermore, the rise of multimodal models (video/audio) and inference-time compute (where models "think" longer, similar to OpenAI's o1) will require new scheduling and memory management strategies. The ultimate goal remains reaching the efficiency of the human brain (~20W), which likely necessitates a shift toward 3D-stacked memory and wafer-scale integration to achieve a target of 10 tokens/J for ubiquitous edge AI.

Summary updated

BibTeX
@misc{li2024large,
  author = {Jinhao Li and Jiaming Xu and Shan Huang and Yonghua Chen and Wen Li and Jun Liu and Yaoxiu Lian and Jiayi Pan and Li Ding and Hao Zhou and Yu Wang and Guohao Dai},
  title = {{Large Language Model Inference Acceleration: A Comprehensive Hardware Perspective}},
  year = {2024},
  eprint = {2410.04466},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.04466},
}
Figure