arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2405.02842cs.LG
收藏

IceFormer:在 CPU 上加速长序列 Transformer 推理

IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs

School of Computing Science, Simon Fraser University(西蒙菲莎大学计算科学学院)

Yuzhen Mao, Martin Ester, Ke Li

AI总结:

IceFormer 提出一种无需重训练即可在 CPU 上加速长序列 Transformer 自注意力推理的方法,在保持 98.6%-99.6% 准确率的同时实现 2.73-7.63 倍加速。

摘要:

现有基于 Transformer 的模型的一个局限是,它们无法处理非常长的输入序列,因为其自注意力操作具有二次方的时间和空间复杂度。当 Transformer 部署在仅配备 CPU 的硬件平台上时,这一问题尤为突出。为了解决这一问题,我们提出了一种在推理时加速自注意力的新方法,该方法可直接用于预训练 Transformer 模型,无需重新训练。我们使用该方法在各种基准上加速多种长序列 Transformer,包括基于领先的 LLaMA 2 的大语言模型,并证明在保持原始预训练模型 98.6% - 99.6% 准确率的同时,实现了 2.73 倍 - 7.63 倍的更高加速比。代码可在我们的项目网站 https://yuzhenmao.github.io/IceFormer/ 上获取。

英文摘要:

One limitation of existing Transformer-based models is that they cannot handle very long sequences as input since their self-attention operations exhibit quadratic time and space complexity. This problem becomes especially acute when Transformers are deployed on hardware platforms equipped only with CPUs. To address this issue, we propose a novel method for accelerating self-attention at inference time that works with pretrained Transformer models out-of-the-box without requiring retraining. We experiment using our method to accelerate various long-sequence Transformers, including a leading LLaMA 2-based LLM, on various benchmarks and demonstrate a greater speedup of 2.73x - 7.63x while retaining 98.6% - 99.6% of the accuracy of the original pretrained models. The code is available on our project website at https://yuzhenmao.github.io/IceFormer/.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑