Skip to main content

Flash Attention CUTE (CUDA Template Engine) implementation

Project description

FlashAttention-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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flash_attn_4-4.0.0b22.tar.gz (357.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flash_attn_4-4.0.0b22-py3-none-any.whl (382.3 kB view details)

Uploaded Python 3

File details

Details for the file flash_attn_4-4.0.0b22.tar.gz.

File metadata

  • Download URL: flash_attn_4-4.0.0b22.tar.gz
  • Upload date:
  • Size: 357.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flash_attn_4-4.0.0b22.tar.gz
Algorithm Hash digest
SHA256 29641ac02e4cf50657def59e5931d4ba7f45bc4a86e0d286e1a599850cd81908
MD5 944c120ed418c1da9d37f1b382e8dd02
BLAKE2b-256 d7581c64b1f423ab5be09a65b75ce5fa28adfc1eead6e6d57f795ed7051976f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for flash_attn_4-4.0.0b22.tar.gz:

Publisher: publish-fa4.yml on Dao-AILab/flash-attention

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flash_attn_4-4.0.0b22-py3-none-any.whl.

File metadata

  • Download URL: flash_attn_4-4.0.0b22-py3-none-any.whl
  • Upload date:
  • Size: 382.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flash_attn_4-4.0.0b22-py3-none-any.whl
Algorithm Hash digest
SHA256 7f5085c05cad7fbc43f6b3968d5739f019a3a0c1d9cc358e3c02b5c6c0b41ee4
MD5 c1dfbaafbc7617b60284fde234da8d13
BLAKE2b-256 f6fdbc5255048b7418566ab200877f6ece34ccbd15bc2eeb7e463650494f7eb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for flash_attn_4-4.0.0b22-py3-none-any.whl:

Publisher: publish-fa4.yml on Dao-AILab/flash-attention

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page