paper-with-me

Papers

Flex Attention: A Programming Model for Generating Optimized Attention Kernels

2024-12-07 · Juechu Dong, Boyuan Feng, Driss Guessous, Yanbo Liang, Horace He

Over the past 7 years, attention has become one of the most important primitives in deep learning. The primary approach to optimize attention is FlashAttention, which fuses the operation together, drastically improving both the runtime and the memory consumption. However, the importance of FlashAttention combined with its monolithic nature poses a problem for researchers aiming to try new attention variants -- a "software lottery". This problem is exacerbated by the difficulty of writing efficient fused attention kernels, resisting traditional compiler-based approaches. We introduce FlexAttention, a novel compiler-driven programming model that allows implementing the majority of attention variants in a few lines of idiomatic PyTorch code. We demonstrate that many existing attention variants (e.g. Alibi, Document Masking, PagedAttention, etc.) can be implemented via FlexAttention, and that we achieve competitive performance compared to these handwritten kernels. Finally, we demonstrate how FlexAttention allows for easy composition of attention variants, solving the combinatorial explosion of attention variants.

📄 PDF Abstract BibTeX arXiv:2412.05496

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

Flashlight: PyTorch Compiler Extensions to Accelerate Attention Variants

2025-11-03 · Bozhi You, Irene Wang, Zelal Su Mustafaoglu, Abhinav Jangda 외 arxiv

Attention is a fundamental building block of large language models (LLMs), so there have been many efforts to implement it efficiently. For example, FlashAttention leverages tiling and kernel fusion to optimize attention…

Evolving Algebraic Multigrid Methods Using Grammar-Guided Genetic Programming

2024-12-08 · Dinesh Parthasarathy, Wayne Bradford Mitchell, Harald Köstler

Multigrid methods despite being known to be asymptotically optimal algorithms, depend on the careful selection of their individual components for efficiency. Also, they are mostly restricted to standard cycle types like …

Evaluating Language Models for Generating and Judging Programming Feedback

2024-07-05 · Charles Koutcheme, Nicola Dainese, Arto Hellas, Sami Sarsa 외

The emergence of large language models (LLMs) has transformed research and practice across a wide range of domains. Within the computing education research (CER) domain, LLMs have garnered significant attention, particul…

You Need Better Attention Priors

2026-01-21 · Elon Litman, Gabe Guo arxiv

We generalize the attention mechanism by viewing it through the lens of Entropic Optimal Transport, revealing that standard attention corresponds to a transport problem regularized by an implicit uniform prior. We introd…

SeerAttention-R: Sparse Attention Adaptation for Long Reasoning

2025-06-10 · Yizhao Gao, Shuming Guo, Shijie Cao, Yuqing Xia 외

We introduce SeerAttention-R, a sparse attention framework specifically tailored for the long decoding of reasoning models. Extended from SeerAttention, SeerAttention-R retains the design of learning attention sparsity t…

4kGPU