English

FlashFormer: Whole-Model Kernels for Efficient Low-Batch Inference

Machine Learning 2025-12-05 v2 Computation and Language

Abstract

The size and compute characteristics of modern large language models have led to an increased interest in developing specialized kernels tailored for particular training and inference workloads. Existing kernels primarily optimize for compute utilization, targeting the large-batch training and inference settings. However, low-batch inference, where memory bandwidth and kernel launch overheads are significant factors, remains important for many applications of interest such as in edge deployment and latency-sensitive applications. This paper describes FlashFormer, which fuses the entire transformer forward pass into a single kernel for accelerating low-batch inference of large language models. Across various model sizes and quantizations settings, FlashFormer achieves nontrivial speedups compared to existing inference kernels.

Keywords

Cite

@article{arxiv.2505.22758,
  title  = {FlashFormer: Whole-Model Kernels for Efficient Low-Batch Inference},
  author = {Aniruddha Nrusimha and William Brandon and Mayank Mishra and Yikang Shen and Rameswar Panda and Jonathan Ragan-Kelley and Yoon Kim},
  journal= {arXiv preprint arXiv:2505.22758},
  year   = {2025}
}
R2 v1 2026-07-01T02:47:11.437Z