Lune

NeurIPS2023顶会

Fast Attention Over Long Sequences With Dynamic Sparse Flash Attention

Matteo Pagliardini, Daniele Paliotta, Martin Jaggi, François Fleuret

2023年份
26被引次数
14顶会引用

摘要

Transformer-based language models have found many diverse applications requiring them to process sequences of increasing length. For these applications, the causal self-attention-which is the only component scaling quadratically w.r.t. the sequence length-becomes a central concern. While many works have proposed schemes to sparsify the attention patterns and reduce the computational overhead of self-attention, those are often limited by implementation concerns and end up imposing a simple and static structure over the attention matrix. Conversely, implementing more dynamic sparse attention often results in runtimes significantly slower than computing the full attention using the Flash implementation from Dao et al. (2022) . We extend FlashAttention to accommodate a large class of attention sparsity patterns that, in particular, encompass key/query dropping and hashing-based attention. This leads to implementations with no computational complexity overhead and a multi-fold runtime speedup on top of FlashAttention. Even with relatively low degrees of sparsity, our method improves visibly upon FlashAttention as the sequence length increases. Without sacrificing perplexity, we increase the training speed of a transformer language model by 2.0× and 3.3× for sequences of respectively 8k and 16k tokens. * Equal contribution. 37th Conference on Neural Information Processing Systems (NeurIPS 2023).

问问这篇 Paper

智能体会读完全文。

Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。

可以从这些问题问起

智能体调用

Luneget_paper_fulltext

在 Lune 里问

免费开始,无需绑卡

lune papers fulltext 1b2db129-3a98-4a26-afa0-0a7f91903dd7

引用它的顶会 Paper14

问问它们各自怎么用它

它引用的顶会 Paper16

相关 Paper

黄昏的海面,两侧是细线勾勒的悬崖