In theory, Attention is All You Need. In practice, however, we also need optimized attention implementations like FlashAttention. Although these fused attention implementations have substantially improved performance and enabled long contexts, this efficiency has come with a loss of flexibility. You can no longer try out a new attention variant by writing a few PyTorch operators - you often need t
![FlexAttention: The Flexibility of PyTorch with the Performance of FlashAttention](https://cdn-ak-scissors.b.st-hatena.com/image/square/620891c997fbe414d1c946e00299739ac874f11e/height=288;version=1;width=512/https%3A%2F%2Fpytorch.org%2Fassets%2Fimages%2Fsocial-share.jpg)