Accelerating LLM Inference with Flexible N:M Sparsity via A Fully Digital Compute-in-Memory Accelerator

Akshat Ramachandran, Souvik Kundu, Arnab Raha, Shamik Kundu, Deepak K. Mathaikutty +1 more
4/19/2025
cs.LGcs.AIcs.AR

Official code: FLOW-open-project/FLOW (15 stars, MIT, last commit 2025-08-05).

Abstract

Large language model (LLM) pruning with fixed N:M structured sparsity significantly limits the expressivity of the sparse model, yielding sub-optimal performance. In contrast, supporting multiple N:M patterns to provide sparse representational freedom introduces costly overhead in hardware. To address these challenges for LLMs, we first present a flexible layer-wise outlier-density-aware N:M sparsity (FLOW) selection method. FLOW enables the identification of optimal layer-wise N and M values (from a given range) by simultaneously accounting for the presence and distribution of outliers, allowing a higher degree of representational freedom. To deploy sparse models with such N:M flexibility, we then introduce a flexible, low-overhead digital compute-in-memory architecture (FlexCiM). FlexCiM supports diverse sparsity patterns by partitioning a digital CiM (DCiM) macro into smaller sub-macros, which are adaptively aggregated and disaggregated through distribution and merging mechanisms for different N and M values. Extensive experiments on both transformer-based and recurrence-based state space foundation models (SSMs) demonstrate that FLOW outperforms existing alternatives with an accuracy improvement of up to 36%, while FlexCiM achieves up to 1.75x lower inference latency and 1.5x lower energy consumption compared to existing sparse accelerators. Code is available at: https://github.com/FLOW-open-project/FLOW

View on arXivView PDF

Code Implementations(1)

MIT

Codebase for layer wise N:M pruning pattern assignment for LLMs

153Shell, PythonApr 19, 20251 years agoMIT

Similar Papers

Cite this paper

@article{ramachandran2025accelerating,
  title  = {Accelerating LLM Inference with Flexible N:M Sparsity via A Fully Digital Compute-in-Memory Accelerator},
  author = {Akshat Ramachandran and Souvik Kundu and Arnab Raha and Shamik Kundu and Deepak K. Mathaikutty and Tushar Krishna},
  year   = {2025},
  eprint = {2504.14365},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.14365v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.14365.svg)](https://codeofpaper.com/paper/2504.14365)

Discussion