Use activation entropy + channel shuffling to get one-shot N:M sparsity for LLMs with big memory and latency wins

October 24, 20237 min

Overview

Decision SnapshotReady For Pilot

Implemented in FasterTransformer and measured on A100; results are strong for Ampere hardware but rely on cuSPARSE/cuSPARSELt support and were tested on public NLP datasets only.

Citations4

Evidence Strength0.80

Confidence0.80

Risk Signals9

Trust Signals

Findings with numeric evidence: 5/5

Findings with evidence refs: 5/5

Results with explicit delta: 4/4

Reproducibility

Status: Partial assets available

Open source: Partial

At A Glance

Cost impact: 80%

Production readiness: 70%

Novelty: 60%

Authors

Yun Li, Lin Niu, Xipeng Zhang, Kai Liu, Jianchen Zhu, Zhanhui Kang

Links

Abstract / PDF

Why It Matters For Business

E-Sparse cuts LLM GPU memory by ~43% and speeds matrix work 1.24–1.53× on Ampere hardware, letting teams host larger models or reduce instance costs with small accuracy trade-offs.

Who Should Care

Summary TLDR

E-Sparse is a one-shot, post-training pruning method for LLMs that adds channel-wise information entropy to standard magnitude metrics and reorders channels (global + local shuffle) to reduce information loss from N:M sparsity. Implemented as a Sparse-GEMM in FasterTransformer, it achieves ~1.24–1.53× end-to-end GEMM speedups and ~42.6–43.5% model memory savings on LLaMA/OPT with small accuracy costs on WikiText and zero-shot tasks.

Problem Statement

N:M sparsity can speed up LLM inference on modern GPUs but damages accuracy because informative activation channels are concentrated and standard magnitude metrics miss this. Existing good-accuracy methods either need expensive weight updates or use only feature norms. We need a cheap, one-shot pruning metric and a practical channel reordering to get N:M sparsity on LLMs with low accuracy loss.

Main Contribution

Introduce an entropy-based channel importance metric that augments weight magnitude and activation norm to rank elements for N:M pruning.

Design a two-stage channel shuffle (global naive + local block greedy) that spreads information to reduce N:M pruning damage.

Key Findings

E-Sparse reduces LLaMA-13B WikiText perplexity under 2:4 sparsity to 8.26.

NumbersLLaMA-13B 2:4 perplexity = 8.26 (FP16 = 5.09)

Practical UseYou can apply E-Sparse one-shot 2:4 pruning on LLaMA-13B with moderate perplexity increase vs FP16 while avoiding expensive weight updates.

Evidence RefTable 1 (perplexity on WikiText)

E-Sparse outperforms Wanda and SparseGPT on average zero-shot accuracy for small LLaMA (7B) under 2:4 sparsity.

NumbersLLaMA-7B avg accuracy: E-Sparse 49.00% vs Wanda 47.68% vs SparseGPT 48.37%

Practical UseFor downstream zero-shot tasks, E-Sparse conservatively improves end-task accuracy versus popular no-update baselines.

Evidence RefTable 2 (zero-shot task averages)

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
WikiText perplexity (LLaMA-13B, 2:4)8.26FP16 = 5.09+3.17WikiText validationTable 1 reports LLaMA-13B 2:4 E-Sparse perplexity = 8.26Table 1
Accuracy49.00%Wanda = 47.68%, SparseGPT = 48.37%+1.32% vs WandaHellaSwag, PiQA, OpenBookQA, SciQ, LogiQA (avg)Table 2 zero-shot averagesTable 2

What To Try In 7 Days

Run E-Sparse one-shot pruning (2:4) on one LLaMA variant using 128 calibration sequences from C4 and measure WikiText perplexity.

Integrate the saved sparse kernels into FasterTransformer and benchmark GEMM latency on your Ampere/A100 hardware.

Enable global naive + local block shuffle and compare accuracy vs using only activation norms (ablation).

Optimization Features

Infra Optimization
Optimized for NVIDIA Ampere (A100) sparse tensor cores
Model Optimization
N:M structured sparsity (2:4 and 4:8 patterns)one-shot post-training pruning (no weight updates)
System Optimization
Algorithm search and caching for optimal sparse matmul per tensor shape
Inference Optimization
Entropy-augmented importance metric (weights + activation norm + entropy)Channel shuffle (global naive + local block greedy)Sparse-GEMM kernels selected via cuSPARSE / cuSPARSELt

Reproducibility

Code AvailableNo
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Risks & Boundaries

Limitations

Tested only on NLP LLMs (LLaMA/OPT/BLOOM); applicability to vision or speech tasks is untested.

Experiments use public datasets with limited sentence lengths; longer contexts not fully evaluated.

When Not To Use

When your deployment GPUs do not support N:M sparse tensor cores (older hardware).

When any small perplexity increase is unacceptable for your task.

Failure Modes

Accuracy degradation increases if sparsity pattern is too aggressive for a given model.

Speed/memory wins depend on GPU and cuSPARSE/cuSPARSELt kernel availability and shapes.

Core Entities

Models

LLaMA-7BLLaMA-13BLLaMA-30BLLaMA-65BOPT-6.7BOPT-30BBLOOM-176B (mentioned)

Metrics

PerplexityAccuracyGEMM / layer latency reductionMemory saving (%)

Datasets

WikiText (validation)C4 (128 calibration sequences)EleutherAI LM Harness (zero-shot benchmark)

Benchmarks

EleutherAI LM HarnessWikiText perplexity