atlas

Research map / Architectures and efficiency / Attention and transformers

FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning

ICLR 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse efficient transformers for long context · 143 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes FlashAttention-2, an IO-aware exact attention kernel with better work partitioning (fewer non-matmul FLOPs, sequence-length parallelism, warp-level partitioning) that speeds up attention on A100 GPUs.

Problem

Attention runtime and memory scale quadratically with sequence length, and the original FlashAttention still reaches only a fraction of peak GPU FLOPs/s due to suboptimal work partitioning across thread blocks and warps.

Approach

Reduces non-matmul FLOPs in the forward and backward passes, parallelizes over the sequence length dimension in addition to batch and heads, and partitions work between warps to cut shared-memory communication.

Key results

Limitations

Experimental setup

Metrics: runtime FLOPs/s memory

Baselines: FlashAttention PyTorch standard attention Megatron-LM xFormers

Builds on: FlashAttention

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy