facebookresearch/xformers

Hackable and optimized Transformers building blocks, supporting a composable construction.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 47 minutes ago
Added to GitGenius on September 5th, 2026
Created on October 13th, 2021
Open Issues & Pull Requests: 376 (+0)
GitHub issues: Enabled
Number of forks: 787
Total Stargazers: 10,545 (+0)
Total Subscribers: 76 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 14.8 hours
Mean response time: 14.9 days
90th percentile: 33.5 days
Tracked items: 217

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 7% of issues opened in the past year have been closed. Three people close 57% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 141
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 605 days
Stale 30+ days: 139
Stale 90+ days: 137

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (2)
  • ongoing (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

xFormers is a toolbox for building and accelerating Transformer models through optimized, composable components.

The project addresses the need for fast iteration on Transformer research by providing customizable building blocks that researchers can assemble without boilerplate code. Rather than requiring researchers to implement components from scratch or rely on generic PyTorch primitives, xFormers offers domain-agnostic modules that work across vision, NLP, and other fields. The tool achieves efficiency through custom CUDA kernels and selective dispatch to other libraries where appropriate, with particular emphasis on memory-efficient exact attention that can deliver up to 10x speedup compared to standard implementations. Beyond attention optimization, the project includes fused operations for softmax, linear layers, layer normalization, and composite operations like dropout-activation-bias fusion and SwiGLU.

Researchers working on Transformer architectures should consider xFormers when speed of iteration and memory efficiency matter for their experiments. The project suits teams building custom models in research settings rather than those seeking a complete end-to-end framework. It is particularly valuable for those exploring sparse attention, block-sparse attention, or other attention variants, as well as for practitioners who need the memory savings that exact attention optimization provides. The tool contains bleeding-edge components not yet available in mainstream libraries like PyTorch, making it most relevant for researchers at the frontier of Transformer development rather than those building production systems with stable, widely-adopted architectures.

The project maintains active development with regular updates to its CUDA kernel implementations and component library. Installation and build processes receive ongoing refinement, with documented solutions for common environment configuration issues across Linux and Windows platforms. The codebase incorporates kernels and techniques from multiple upstream sources, indicating sustained engagement with the broader research community's advances in efficient Transformer computation.