FlashAttention is a high-performance deep learning optimization library that reimplements the attention mechanism used in transformer models to be significantly faster and more memory-efficient than standard implementations. It achieves this by using IO-aware algorithms that minimize memory reads and writes, reducing the quadratic memory overhead typically associated with attention operations. The project provides implementations of FlashAttention, FlashAttention-2, and newer iterations optimized for modern GPU architectures such as NVIDIA Hopper and AMD accelerators. By improving both forward and backward pass efficiency, it enables training and inference of large language models with longer sequence lengths and higher throughput. The library integrates with PyTorch and supports various attention configurations, including causal masking, multi-query attention, and rotary embeddings.

Features

  • Memory-efficient attention with linear scaling instead of quadratic overhead
  • High-performance GPU kernels optimized for CUDA and ROCm
  • Support for FlashAttention-2 and newer optimized implementations
  • Integration with PyTorch and modern transformer architectures
  • Support for causal masking, rotary embeddings, and advanced attention types
  • Enables faster training and inference for large-scale AI models

Project Samples

Project Activity

See All Activity >

Categories

Machine Learning

License

BSD License

Follow FlashAttention

FlashAttention Web Site

Other Useful Business Software
Try Google Cloud Risk-Free With $300 in Credit Icon
Try Google Cloud Risk-Free With $300 in Credit

No hidden charges. No surprise bills. Cancel anytime.

Use your credit across every product. Compute, storage, AI, analytics. When it runs out, 20+ products stay free. You only pay when you choose to.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of FlashAttention!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Python

Related Categories

Python Machine Learning Software

Registered

6 days ago