flash-attn-4
v4.0.0b30Flash Attention CUTE (CUDA Template Engine) implementation
397 KB Python 3.10+ py3-none-anyBSD License7 deps
$ uv add flash-attn-4FlashAttention-4 (CuTeDSL)
FlashAttention-4 is a CuTeDSL-based implementation of FlashAttention for Hopper and Blackwell GPUs.
Installation
pip install flash-attn-4
If you're on CUDA 13, install with the cu13 extra for best performance:
pip install "flash-attn-4[cu13]"
Usage
from flash_attn.cute import flash_attn_func, flash_attn_varlen_func
out = flash_attn_func(q, k, v, causal=True)
Development
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention
pip install -e "flash_attn/cute[dev]" # CUDA 12.x
pip install -e "flash_attn/cute[dev,cu13]" # CUDA 13.x (e.g. B200)
pytest tests/cute/
Details
- Version
- 4.0.0b30
- License
- BSD License
- Python
- >=3.10
- Maintainer
- Tri Dao
Links
Release Cadence
28
releases in the past year
avg 8 days between releases
Maintainers
- Tri Dao