#1212th of 433 in ML frameworks and libraries

flash-attention

Fused GPU kernels for exact attention in PyTorch, FlashAttention 2 through 4

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

Stars
25.4k
License
BSD-3-Clause
Last commit
Nov 2026
Last release
Oct 2026
Language
Python
Stars, last 35 weeks+2,624
25 Mar 2026: 22,733 stars1 Apr 2026: 22,857 stars8 Apr 2026: 23,000 stars15 Apr 2026: 23,147 stars22 Apr 2026: 23,259 stars29 Apr 2026: 23,377 stars6 May 2026: 23,443 stars13 May 2026: 23,551 stars20 May 2026: 23,660 stars27 May 2026: 23,758 stars3 Jun 2026: 23,849 stars10 Jun 2026: 23,932 stars17 Jun 2026: 24,007 stars24 Jun 2026: 24,088 stars1 Jul 2026: 24,172 stars8 Jul 2026: 24,251 stars15 Jul 2026: 24,318 stars22 Jul 2026: 24,377 stars29 Jul 2026: 24,440 stars5 Aug 2026: 24,509 stars12 Aug 2026: 24,575 stars19 Aug 2026: 24,629 stars26 Aug 2026: 24,683 stars2 Sept 2026: 24,738 stars9 Sept 2026: 24,788 stars16 Sept 2026: 24,851 stars23 Sept 2026: 24,929 stars30 Sept 2026: 24,979 stars7 Oct 2026: 25,045 stars14 Oct 2026: 25,088 stars21 Oct 2026: 25,147 stars28 Oct 2026: 25,188 stars4 Nov 2026: 25,229 stars11 Nov 2026: 25,274 stars18 Nov 2026: 25,323 stars25 Nov 2026: 25,357 stars

22,733 on 25 Mar 202625,357 on 25 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Official implementation of FlashAttention and FlashAttention-2 as CUDA and ROCm kernels exposed through a PyTorch Python API (flash_attn_func, varlen, and KV-cache variants). The repo also ships FlashAttention-3 (beta, Hopper) and FlashAttention-4 (CuTeDSL, Hopper and Blackwell). Supports causal masks, sliding window, ALiBi, MQA/GQA, and paged KV cache.

Who it is for: ML engineers writing or optimizing transformer training and inference code

Strengths

  • Official reference implementation with papers for FA1, FA2 and FA3
  • Covers NVIDIA (Ampere, Ada, Hopper, Blackwell via FA4) and AMD ROCm (CK and Triton backends)
  • Decoding-oriented API: in-place KV cache update, rotary, paged cache, GQA/MQA
  • Head dimensions up to 256 with fp16 and bf16; FP8 forward in FA3

Weaknesses

  • Source build is slow without ninja: about 2h versus 3-5 minutes on 64 cores
  • FA3 is a beta, requires H100/H800 and CUDA 12.3 or newer
  • Linux only; Windows support is untested and unconfirmed
  • flash_attn_with_kvcache has no backward pass; Turing GPUs need a separate repo

What it needs

  • GPU required
  • Needs PyTorch 2.2+, CUDA 12.0+ or ROCm 6.0+, ninja, packaging, psutil
  • Models: fp16, bf16, fp8 (FA3 forward), fp32 (ROCm Triton)

What changed

  1. CVE-2026-31253, GHSA-7G5W-PQ96-8C5W, CVE-2026-62239, GHSA-W9R7-4GWR-J959. “Backport #2622: torch.load(..., weightsonly=True) in flashattn/utils/distributed.py and flashattn/models (CVE-2026-31253 / GHSA-7g5w-pq96-8c5w). #2974”

From the release notes. No flag means the note does not say so, not that the upgrade is safe. Releases and problems by RSS

Also in ML frameworks and libraries

See all 433
Also in ML frameworks and libraries
RankProjectScore
#10onnxOpen model format and operator spec for exchanging ML models between frameworks21.8k starsApache-2.089 out of 100
#11diffusersPyTorch library of diffusion pipelines and schedulers for image generation35k starsApache-2.088 out of 100
#13mediapipeOn-device ML task APIs and a C++ pipeline framework for mobile, web and desktop Live demo ↗ (opens in a new tab)37.9k starsApache-2.087 out of 100
#14netronViewer for neural network and machine learning model graphs Live demo ↗ (opens in a new tab)33.7k stars+139 (+0.4%) in 30 daysMIT87 out of 100
#15deepfacePython library for face verification, search and age/gender/emotion analysis23.7k starsMIT87 out of 100