#423423rd of 433 in ML frameworks and libraries

spargeattn

Training-free sparse attention CUDA kernels, a drop-in for PyTorch SDPA

Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.

Stars
1.3k
License
Apache-2.0
Last commit
Feb 2026
Language
Cuda
Stars, last 29 weeks+283
7 May 2026: 986 stars14 May 2026: 987 stars21 May 2026: 990 stars28 May 2026: 991 stars4 Jun 2026: 996 stars11 Jun 2026: 998 stars18 Jun 2026: 1,000 stars25 Jun 2026: 1,000 stars2 Jul 2026: 1,006 stars9 Jul 2026: 1,009 stars16 Jul 2026: 1,013 stars23 Jul 2026: 1,018 stars30 Jul 2026: 1,021 stars6 Aug 2026: 1,024 stars13 Aug 2026: 1,028 stars20 Aug 2026: 1,030 stars27 Aug 2026: 1,041 stars3 Sept 2026: 1,044 stars10 Sept 2026: 1,051 stars17 Sept 2026: 1,121 stars24 Sept 2026: 1,248 stars1 Oct 2026: 1,255 stars8 Oct 2026: 1,257 stars15 Oct 2026: 1,259 stars22 Oct 2026: 1,261 stars29 Oct 2026: 1,264 stars5 Nov 2026: 1,266 stars12 Nov 2026: 1,267 stars19 Nov 2026: 1,269 stars26 Nov 2026: 1,269 stars

986 on 7 May 20261,269 on 26 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

SpargeAttn is the official implementation of a training-free sparse attention method built on SageAttention quantized kernels. It provides a drop-in replacement for torch.nn.functional.scaled_dot_product_attention with a top-k sparsity parameter, plus a block-sparse API that takes a per-head 0/1 mask at 128x64 block size. It targets faster inference of language, image and video models on NVIDIA GPUs.

Who it is for: Engineers speeding up LLM or diffusion inference on NVIDIA GPUs

Strengths

  • Drop-in replacement for scaled_dot_product_attention with a single topk parameter
  • Block-sparse API accepts an arbitrary per-head mask
  • Recommended API needs no tuning or calibration
  • Variants based on SageAttention and SageAttention2; covers Ampere, Ada, Hopper, Blackwell

Weaknesses

  • Must be built from source with ninja; no prebuilt release
  • NVIDIA CUDA only; needs CUDA 12.0+ and torch 2.3+
  • Block size is fixed at 128x64
  • Model examples and tuned checkpoints are commented out of the README

What it needs

  • GPU required
  • Needs python>=3.9, torch>=2.3.0, CUDA>=12.0, ninja
  • Models: language models, image models, video models

Also in ML frameworks and libraries

See all 433
Also in ML frameworks and libraries
RankProjectScore
#421jeelizfacefilterWebGL face detection and head-pose tracking from webcam video, for AR filters Live demo ↗ (opens in a new tab)3k starsApache-2.0no commits in a year13 out of 100
#422metric-learnscikit-learn-compatible Python library of metric learning algorithms1.4k starsMIT13 out of 100
#424pyldavisInteractive visualization of fitted LDA topic models in Python notebooks Live demo ↗ (opens in a new tab)1.8k starsBSD-3-Clause12 out of 100
#425pfrlPyTorch library of deep RL algorithms such as DQN, PPO, SAC and TD31.3k starsMIT11 out of 100
#426pygamGeneralized Additive Models in Python with a scikit-learn-style API1k starsApache-2.010 out of 100