Skip to main content

FlashAttention that just works. No compilation. Any GPU. AMD ROCm, NVIDIA CUDA, Intel, Apple via Vulkan.

Project description

aule-attention

FlashAttention that just works. No compilation. Any GPU.

Version: 0.3.3

What's New in 0.3.3

  • Windows Vulkan Support: Added Windows DLL - Vulkan backend now works on Windows!
  • Windows AMD Fix: Automatic fallback to Vulkan on Windows + AMD (Triton AMD doesn't support Windows)

What's New in 0.3.0

  • GQA/MQA Support: Full Grouped Query Attention and Multi-Query Attention for Vulkan backend
  • Cross-Attention: Different sequence lengths for Q and K/V tensors
  • ComfyUI Compatible: Works with Stable Diffusion, SDXL, Flux, SD3 (use causal=False)
  • 20% Faster: Phase 1 performance optimizations
  • Bug Fixes: Tensor cache fix for GQA, blocky noise fix for diffusion models

Installation

pip install aule-attention

Quick Start

from aule import flash_attention
import torch

q = torch.randn(1, 8, 512, 64, device='cuda')
k = torch.randn(1, 8, 512, 64, device='cuda')
v = torch.randn(1, 8, 512, 64, device='cuda')

output = flash_attention(q, k, v, causal=True)

ComfyUI / Diffusion Models

import aule
aule.install()  # Patches PyTorch SDPA globally

# Now all models using F.scaled_dot_product_attention use aule
# For diffusion models, causal=False is used automatically

GQA (Grouped Query Attention)

# 32 query heads, 8 key/value heads (4:1 ratio)
q = torch.randn(1, 32, 512, 64)
k = torch.randn(1, 8, 512, 64)
v = torch.randn(1, 8, 512, 64)

output = flash_attention(q, k, v, causal=True)

Features

  • No compilation at install time
  • Works on AMD, NVIDIA, Intel, and Apple GPUs
  • Training support with backward pass (Triton backend)
  • Grouped Query Attention (GQA) and Multi-Query Attention (MQA) support
  • Cross-attention with different Q/KV sequence lengths
  • O(N) memory complexity via FlashAttention-2 algorithm

Backends

Backend Hardware Features
Triton AMD ROCm (Linux), NVIDIA CUDA Training + Inference, head_dim up to 128
Vulkan Any Vulkan 1.2+ GPU (including Windows AMD) Inference, head_dim up to 64, GQA/MQA
CPU NumPy Fallback, any head_dim

Windows + AMD: Automatically uses Vulkan backend (Triton AMD only supports Linux).

API

from aule import flash_attention, get_available_backends, install

# Compute attention
output = flash_attention(query, key, value, causal=True, scale=None)

# Check available backends
backends = get_available_backends()  # ['vulkan', 'cpu'] or ['triton', 'vulkan', 'cpu']

# Install as PyTorch SDPA replacement (for ComfyUI, Transformers, etc.)
install()  # Auto-select best backend
install(backend='vulkan', verbose=True)  # Force backend + logging

Supported Hardware

Triton Backend (Training + Inference)

  • AMD Instinct: MI300X, MI300A, MI250X, MI250, MI210, MI100
  • NVIDIA Datacenter: H100, A100, A10, L40S
  • NVIDIA Consumer: RTX 4090, 4080, 3090, 3080

Vulkan Backend (Inference)

  • AMD RDNA3: RX 7900 XTX, 7900 XT, 7800 XT
  • AMD RDNA2: RX 6900 XT, 6800 XT, 6700 XT
  • Intel Arc: A770, A750, A580
  • Intel Integrated: 12th/13th/14th Gen
  • Apple Silicon: M1, M2, M3 (via MoltenVK)

License

MIT License - Aule Technologies

Links

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

aule_attention-0.3.3-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file aule_attention-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: aule_attention-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aule_attention-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b57421e6f9bc9691b414879dc4c04c020bda4cee270b8ad205a85a377cc6e132
MD5 cfd281825b74d7abdd4841187f4893eb
BLAKE2b-256 c41cac608892e41754650e2928f813a88cef24eb7c1124eadf6c8f181bbf7333

See more details on using hashes here.

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