#6464th of 75 in ML frameworks and libraries

xformers

PyTorch library of memory-efficient attention and fused transformer kernels

Stars
10.6k
License
custom license
Last commit
Oct 2026
Last release
Feb 2026
Language
Python
Stars, last 29 weeks+248
31 Mar 2026: 10,321 stars7 Apr 2026: 10,338 stars14 Apr 2026: 10,346 stars21 Apr 2026: 10,356 stars28 Apr 2026: 10,369 stars5 May 2026: 10,377 stars12 May 2026: 10,388 stars19 May 2026: 10,398 stars26 May 2026: 10,415 stars2 Jun 2026: 10,427 stars9 Jun 2026: 10,433 stars16 Jun 2026: 10,445 stars23 Jun 2026: 10,459 stars30 Jun 2026: 10,469 stars7 Jul 2026: 10,477 stars14 Jul 2026: 10,479 stars21 Jul 2026: 10,491 stars28 Jul 2026: 10,501 stars4 Aug 2026: 10,510 stars11 Aug 2026: 10,516 stars18 Aug 2026: 10,523 stars25 Aug 2026: 10,526 stars1 Sept 2026: 10,529 stars8 Sept 2026: 10,533 stars15 Sept 2026: 10,538 stars22 Sept 2026: 10,544 stars29 Sept 2026: 10,550 stars6 Oct 2026: 10,554 stars13 Oct 2026: 10,564 stars20 Oct 2026: 10,569 stars

10,321 on 31 Mar 202610,569 on 20 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

xFormers is a PyTorch library of transformer building blocks for research, including exact memory-efficient attention (xformers.ops.memory_efficient_attention), sparse and block-sparse attention, and fused softmax, linear, layer norm, dropout and SwiGLU ops. It ships its own CUDA kernels and dispatches to other libraries such as Flash-Attention where relevant. Wheels are published for CUDA 12.6, 12.8 and 13.0, with an experimental ROCm 7.1 build on Linux.

Who it is for: Researchers and ML engineers optimizing PyTorch transformers

Strengths

  • Exact (not approximate) memory-efficient attention via a single function call
  • Fused ops include softmax, layer norm, dropout(activation(x+bias)) and SwiGLU
  • Prebuilt pip wheels for CUDA 12.6, 12.8 and 13.0 on Linux and Windows
  • Includes python -m xformers.info to list which kernels are built

Weaknesses

  • Tied to a specific PyTorch version (2.10.0 for the current stable wheels)
  • Source builds can take dozens of minutes and may run out of memory
  • ROCm support is marked experimental and Linux only
  • License is BSD-style but detected as NOASSERTION; includes code from triton-lang/kernels

What it needs

  • GPU required
  • Needs PyTorch 2.10.0, CUDA 12.6/12.8/13.0 or ROCm 7.1, ninja (source builds)
  • Models: PyTorch transformer models

Also in ML frameworks and libraries

See all 75
Also in ML frameworks and libraries
RankProjectScore
1transformersPython library defining open models for text, vision, audio and multimodal tasks167.9k starsApache-2.094 out of 100
2pytorchPython tensor library with GPU support and tape-based autograd for deep learning104.9k starscustom license94 out of 100
3ultralyticsPython library and CLI for training and running YOLO vision models62.7k starsAGPL-3.092 out of 100
#4pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts37.2k starsApache-2.091 out of 100
#5supervisionPython toolkit for loading, annotating and counting computer vision detections Live demo ↗ (opens in a new tab)51.3k starsMIT90 out of 100