Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels

作者
Maximilian Beck,Korbinian Pöppel,Phillip Lippe,Sepp Hochreiter
出处
期刊: 卷期号:: 83630-83685 被引量:15
标识
DOI:10.52202/085713-2522
摘要

Linear RNNs with gating recently demonstrated competitive performance compared to Transformers in language modeling. Although their linear compute scaling in sequence length offers theoretical runtime advantages over Transformers, realizing these benefits in practice requires optimized custom kernels, as Transformers rely on the highly efficient Flash Attention kernels (Dao, 2024). Leveraging the chunkwise-parallel formulation of linear RNNs, Flash Linear Attention (FLA) (Yang & Zhang, 2024) shows that linear RNN kernels are faster than Flash Attention, by parallelizing over chunks of the input sequence. However, since the chunk size of FLA is limited, many intermediate states must be materialized in GPU memory. This leads to low arithmetic intensity and causes high memory consumption and IO cost, especially for long-context pre-training. In this work, we present Tiled Flash Linear Attention (TFLA), a novel kernel algorithm for linear RNNs, that enables arbitrary large chunk sizes and high arithmetic intensity by introducing an additional level of sequence parallelization within each chunk. First, we apply TFLA to the xLSTM with matrix memory, the mLSTM (Beck et al., 2024). Second, we propose an mLSTM variant with sigmoid input gate and reduced computation for even faster kernel runtimes at equal language modeling performance. In our speed benchmarks, we show that our new mLSTM kernels based on TFLA outperform highly optimized Flash Attention, Linear Attention and Mamba kernels, setting a new state of the art for efficient long-context sequence modeling primitives.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
科目三的应助被科研通管家采纳,获得10
刚刚
JamesPei的应助被科研通管家采纳,获得10
刚刚
我是老大的应助被科研通管家采纳,获得10
刚刚
lx的应助被科研通管家采纳,获得20
刚刚
刚刚
情怀的应助被科研通管家采纳,获得10
刚刚
www完成签到 ,获得积分10
刚刚
小蘑菇的应助被科研通管家采纳,获得30
刚刚
丘比特的应助被科研通管家采纳,获得10
1秒前
1秒前
Firsterchao的应助被科研通管家采纳,获得10
1秒前
英俊的铭的应助被科研通管家采纳,获得10
1秒前
1秒前
v0id的应助被科研通管家采纳,获得10
1秒前
1秒前
Youdge的应助被科研通管家采纳,获得30
1秒前
打打的应助被科研通管家采纳,获得10
1秒前
2秒前
Orange的应助被科研通管家采纳,获得10
2秒前
2秒前
英姑的应助被科研通管家采纳,获得10
2秒前
沙丁鹌鹑发布了新的文献求助10
2秒前
完美世界的应助被科研通管家采纳,获得10
2秒前
不吐葡萄皮完成签到 ,获得积分10
2秒前
2秒前
无极微光的应助被科研通管家采纳,获得20
3秒前
3秒前
斯文败类的应助被科研通管家采纳,获得10
3秒前
3秒前
小二郎的应助被科研通管家采纳,获得10
3秒前
田様的应助被科研通管家采纳,获得10
3秒前
无花果的应助被小琳采纳,获得10
3秒前
英姑的应助被科研通管家采纳,获得10
3秒前
科研通AI6.2的应助被feifeiaym采纳,获得10
4秒前
残酷月光完成签到,获得积分10
4秒前
5秒前
ffei19完成签到 ,获得积分10
5秒前
歪比巴布发布了新的文献求助10
6秒前
6秒前
SciGPT的应助被愉快的若云采纳,获得10
6秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Spec 401: Standards for Jet Fuel Facility and Equipment Commissioning and Flushing at Airports, 2026.1 (Original Issue) 1000
Spec 103: Standard for Jet Fuel Quality Control at Airports, Revision 2026.1 1000
Chinese Traditional Wisdom and Contemporary Education Values 600
AI Disclosure in Annual Reports: Evolution, Determinants, and Capital Market Participants’ Perceptions 500
5th World Conference on Detergents: Reinventing the Industry : Opportunities and Challenges 500
Erzählte Gnade 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 计算机科学 工程类 有机化学 化学工程 生物化学 物理 复合材料 内科学 催化作用 光电子学 人工智能 细胞生物学 无机化学 物理化学 数学
热门帖子
关注 科研通微信公众号,转发送积分 8104650
求助须知:如何正确求助?哪些是违规求助? 9513927
关于积分的说明 21489968
捐赠科研通 7681147
什么是DOI,文献DOI怎么找? 3409516
关于科研通互助平台的介绍 2537264
邀请新用户注册赠送积分活动 2449390