FLAT: An Optimized Dataflow for Mitigating Attention Bottlenecks
Sheng-Chun Kao, Suvinay Subramanian, Gaurav Agrawal, Amir Yazdanbakhsh, Tushar Krishna
摘要
Attention mechanisms, primarily designed to capture pairwise correlations between words, have become the backbone of machine learning, expanding beyond natural language processing into other domains. This growth in adaptation comes at the cost of prohibitively large memory requirements and computational complexity, especially at higher number of input elements. This limitation is due to inherently limited data reuse opportunities and quadratic growth in memory footprints, leading to severe memory-boundedness and limited scalability of input elements. This work addresses these challenges by devising a tailored dataflow optimization, called FLAT, for attention mechanisms without altering their functionality. This dataflow processes costly attention operations through a unique fusion mechanism, transforming the memory footprint quadratic growth to merely a linear one. To realize the full potential of this bespoke mechanism, we propose a tiling approach to enhance the data reuse across attention operations. Our method both mitigates the off-chip bandwidth bottleneck as well as reduces the on-chip memory requirement. FLAT delivers 1.94× (1.76×) speedup and 49% and (42%) of energy savings compared to the state-of-the-art Edge (Cloud) accelerators with no customized dataflow optimization. When on-chip resources are scarce (20 KB-200 KB), FLAT yields, on average, 1.5× end-to-end latency reduction across a diverse range of conventional attention-based models with input sequence lengths ranging from 512-token to 64K-token. Our evaluations demonstrate that state-of-the-art DNN dataflows applied to attention operations reach the efficiency limit for inputs above 512 elements. In contrast, FLAT unblocks transformer models for inputs with up to 64K elements.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 22 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention 引用了 Reformer: The Efficient Transformer
- Accelerating attention through gradient-based learned runtime pruning 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Accelerating attention through gradient-based learned runtime pruning 引用了 Reformer: The Efficient Transformer
- Sparse Attention Acceleration with Synergistic In-Memory Pruning and On-Chip Recomputation 引用了 Accelerating attention through gradient-based learned runtime pruning
- Sparse Attention Acceleration with Synergistic In-Memory Pruning and On-Chip Recomputation 引用了 Reformer: The Efficient Transformer
- CvT: Introducing Convolutions to Vision Transformers 引用了 Deformable DETR: Deformable Transformers for End-to-End Object Detection
- Duplex: A Device for Large Language Models with Mixture of Experts, Grouped Query Attention, and Continuous Batching 引用了 Accelerating attention through gradient-based learned runtime pruning
- PAPI: Exploiting Dynamic Parallelism in Large Language Model Decoding with a Processing-In-Memory-Enabled Computing System 引用了 Sparse Attention Acceleration with Synergistic In-Memory Pruning and On-Chip Recomputation
- InfiniGen: Efficient Generative Inference of Large Language Models with Dynamic KV Cache Management 引用了 Reformer: The Efficient Transformer
- Deformable DETR: Deformable Transformers for End-to-End Object Detection 引用了 Reformer: The Efficient Transformer
引用它的顶会 Paper22
- InfiniGen: Efficient Generative Inference of Large Language Models with Dynamic KV Cache ManagementWonbeom Lee, Jungi Lee, Junghwan Seo, Jaewoong SimOSDI 2024 · 248 次引用
- Accelerating attention through gradient-based learned runtime pruningZheng Li, Soroush Ghodrati, Amir Yazdanbakhsh, Hadi Esmaeilzadeh 等ISCA 2022 · 48 次引用
- Sparse Attention Acceleration with Synergistic In-Memory Pruning and On-Chip RecomputationAmir Yazdanbakhsh, Ashkan Moradifirouzabadi, Zheng Li, Mingu KangMICRO 2022 · 47 次引用
- Duplex: A Device for Large Language Models with Mixture of Experts, Grouped Query Attention, and Continuous BatchingSungmin Yun, Kwanhee Kyung, Juhwan Cho, Jaewan Choi 等MICRO 2024 · 40 次引用
- PAPI: Exploiting Dynamic Parallelism in Large Language Model Decoding with a Processing-In-Memory-Enabled Computing SystemYintao He, Haiyu Mao, Christina Giannoula, Mohammad Sadrosadati 等ASPLOS 2025 · 37 次引用
它引用的 Paper33
- Deformable DETR: Deformable Transformers for End-to-End Object DetectionXizhou Zhu, Weijie Su, Lewei Lu, Bin Li 等ICLR 2021 · 7,353 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained TransformersWenhui Wang, Furu Wei, Li Dong, Hangbo Bao 等NeurIPS 2020 · 2,727 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
- CvT: Introducing Convolutions to Vision TransformersHaiping Wu, Bin Xiao, Noel Codella, Mengchen Liu 等ICCV 2021 · 2,397 次引用
相关 Paper
- Enabling Multiple Tensor-wise Operator Fusion for Transformer Models on Spatial AcceleratorsLei Xu, Zhiwen Mo, Qin Wang, Jianfei Jiang 等DAC 2024 · 4 次引用
- SWAT: Scalable and Efficient Window Attention-based Transformers Acceleration on FPGAsZhenyu Bai, Pranav Dangi, Huize Li, Tulika MitraDAC 2024 · 12 次引用
- FuseMax: Leveraging Extended Einsums to Optimize Attention Accelerator DesignNandeeka Nayak, Xinrui Wu, Toluwanimi O. Odemuyiwa, Michael Pellauer 等MICRO 2024 · 10 次引用
- ELFATT: Efficient Linear Fast Attention for Vision TransformersChong Wu, Maolin Che, Renjie Xu, Zhuoheng Ran 等ACM MM 2025 · 3 次引用
- MAT: Processing In-Memory Acceleration for Long-Sequence AttentionMinxuan Zhou, Yunhui Guo, Weihong Xu, Bin Li 等DAC 2021 · 10 次引用
