Navigate:
xFormers
~$XFORM0.1%

xFormers: Optimized Transformer building blocks library

Memory-efficient PyTorch components for transformer architectures.

LIVE RANKINGS • 12:32 PM • STEADY
OVERALL
#332
56
AI & ML
#94
4
30 DAY RANKING TREND
ovr#332
·AI#94
STARS
10.4K
FORKS
770
7D STARS
+16
7D FORKS
+2
Tags:
See Repo:
Share:

Learn more about xFormers

import xformers.ops as xops\noutput = xops.memory_efficient_attention(query, key, value)

xFormers

1

Custom CUDA kernels

xFormers includes its own optimized CUDA implementations for attention mechanisms and fused operations rather than relying solely on PyTorch primitives. This allows for memory-efficient exact attention computation and other specialized operations not available in mainstream frameworks.

2

Composable architecture

Components are designed as independent, domain-agnostic building blocks that can be combined without boilerplate code. This modular approach enables researchers to construct custom transformer variants while maintaining clean, readable code.

3

Research-oriented components

The library prioritizes access to emerging techniques and experimental operations before they reach mainstream libraries. It provides implementations of sparse attention, block-sparse attention, and other attention variants alongside standard components.


import xformers.ops as xops

attention_out = xops.memory_efficient_attention(
    query, key, value
)

vv0.0.34

Stable wheels for PyTorch 2.10+

  • Migrated xFormers to the PyTorch stable API/ABI, which means that binary builds targeting PyTorch 2.10+ will be compatible with any later version
  • Removed optimized fast-path of SwiGLU (which was only available for A100 GPUs)
  • Removed most legacy components
vv0.0.33.post2

Wheels for PyTorch 2.9.1

vv0.0.33.post1

Fixed wheel upload to pypi

  • Fixed wheel upload to pypi


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers