LightMamba: Efficient Mamba Acceleration on FPGA with Quantization and Hardware Co-design

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wei, Renjie, Xu, Songqiang, Zhong, Linfeng, Yang, Zebin, Guo, Qingyu, Wang, Yuan, Wang, Runsheng, Li, Meng
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866909834443489280
author Wei, Renjie
Xu, Songqiang
Zhong, Linfeng
Yang, Zebin
Guo, Qingyu
Wang, Yuan
Wang, Runsheng
Li, Meng
author_facet Wei, Renjie
Xu, Songqiang
Zhong, Linfeng
Yang, Zebin
Guo, Qingyu
Wang, Yuan
Wang, Runsheng
Li, Meng
contents State space models (SSMs) like Mamba have recently attracted much attention. Compared to Transformer-based large language models (LLMs), Mamba achieves linear computation complexity with the sequence length and demonstrates superior performance. However, Mamba is hard to accelerate due to the scattered activation outliers and the complex computation dependency, rendering existing LLM accelerators inefficient. In this paper, we propose LightMamba that co-designs the quantization algorithm and FPGA accelerator architecture for efficient Mamba inference. We first propose an FPGA-friendly post-training quantization algorithm that features rotation-assisted quantization and power-of-two SSM quantization to reduce the majority of computation to 4-bit. We further design an FPGA accelerator that partially unrolls the Mamba computation to balance the efficiency and hardware costs. Through computation reordering as well as fine-grained tiling and fusion, the hardware utilization and memory efficiency of the accelerator get drastically improved. We implement LightMamba on Xilinx Versal VCK190 FPGA and achieve 4.65x to 6.06x higher energy efficiency over the GPU baseline. When evaluated on Alveo U280 FPGA, LightMamba reaches 93 tokens/s, which is 1.43x that of the GPU baseline. Our code is available at https://github.com/PKU-SEC-Lab/LightMamba.
format Preprint
id arxiv_https___arxiv_org_abs_2502_15260
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LightMamba: Efficient Mamba Acceleration on FPGA with Quantization and Hardware Co-design
Wei, Renjie
Xu, Songqiang
Zhong, Linfeng
Yang, Zebin
Guo, Qingyu
Wang, Yuan
Wang, Runsheng
Li, Meng
Computation and Language
State space models (SSMs) like Mamba have recently attracted much attention. Compared to Transformer-based large language models (LLMs), Mamba achieves linear computation complexity with the sequence length and demonstrates superior performance. However, Mamba is hard to accelerate due to the scattered activation outliers and the complex computation dependency, rendering existing LLM accelerators inefficient. In this paper, we propose LightMamba that co-designs the quantization algorithm and FPGA accelerator architecture for efficient Mamba inference. We first propose an FPGA-friendly post-training quantization algorithm that features rotation-assisted quantization and power-of-two SSM quantization to reduce the majority of computation to 4-bit. We further design an FPGA accelerator that partially unrolls the Mamba computation to balance the efficiency and hardware costs. Through computation reordering as well as fine-grained tiling and fusion, the hardware utilization and memory efficiency of the accelerator get drastically improved. We implement LightMamba on Xilinx Versal VCK190 FPGA and achieve 4.65x to 6.06x higher energy efficiency over the GPU baseline. When evaluated on Alveo U280 FPGA, LightMamba reaches 93 tokens/s, which is 1.43x that of the GPU baseline. Our code is available at https://github.com/PKU-SEC-Lab/LightMamba.
title LightMamba: Efficient Mamba Acceleration on FPGA with Quantization and Hardware Co-design
topic Computation and Language
url https://arxiv.org/abs/2502.15260