arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.02573cs.LGcs.CLcs.MS
收藏

LeetDecoding:一个用于指数衰减因果线性注意力且具有 CUDA 实现的 PyTorch 库

LeetDecoding: A PyTorch Library for Exponentially Decaying Causal Linear Attention with CUDA Implementations

Hong Kong Baptist University(香港浸会大学);East China Normal University(华东师范大学);Southern University of Science and Technology(南方科技大学)

Jiaping Wang, Simiao Zhang, Qiao-Chu He, Yifan Chen

AI总结:

针对指数衰减因果线性注意力缺乏统一复杂度认识、方法汇集与 GPU 实现的问题,本文提出 PyTorch 库 LeetDecoding,提供可便捷集成、基准测试与评估的计算例程和 CUDA 推理支持。

摘要:

机器学习与数据科学社区在加速基于 transformer 的大型语言模型(LLM)方面已经取得了显著但分散的进展,其中一种颇具前景的方法是用“指数衰减因果线性注意力”替换生成式预训练 transformer(GPT)中的原始因果注意力。本文提出 LeetDecoding,这是首个为这一基础算子提供大量计算例程的 Python 软件包。LeetDecoding 的推出源于当前缺乏:(1)对该算子复杂度的清晰理解;(2)对现有计算方法的全面汇集(这些方法通常分散在看似不相关的领域中);以及(3)用于在 GPU 上快速推理的 CUDA 实现。LeetDecoding 的设计易于与现有线性注意力 LLM 集成,并允许研究人员对指数衰减因果线性注意力的新型计算方法进行基准测试和评估。使用 LeetDecoding 不需要任何 GPU 编程和底层复杂度分析知识,这是有意让 LLM 从业者能够方便地使用它。LeetDecoding 的源代码发布在该 GitHub 仓库(https://github.com/Computational-Machine-Intelligence/LeetDecoding)中,用户只需运行命令 pip install leet-decoding 即可安装 LeetDecoding。

英文摘要:

The machine learning and data science community has made significant while dispersive progress in accelerating transformer-based large language models (LLMs), and one promising approach is to replace the original causal attention in a generative pre-trained transformer (GPT) with \emph{exponentially decaying causal linear attention}. In this paper, we present LeetDecoding, which is the first Python package that provides a large set of computation routines for this fundamental operator. The launch of LeetDecoding was motivated by the current lack of (1) clear understanding of the complexity regarding this operator, (2) a comprehensive collection of existing computation methods (usually spread in seemingly unrelated fields), and (3) CUDA implementations for fast inference on GPU. LeetDecoding's design is easy to integrate with existing linear-attention LLMs, and allows for researchers to benchmark and evaluate new computation methods for exponentially decaying causal linear attention. The usage of LeetDecoding does not require any knowledge of GPU programming and the underlying complexity analysis, intentionally making LeetDecoding accessible to LLM practitioners. The source code of LeetDecoding is provided at \href{https://github.com/Computational-Machine-Intelligence/LeetDecoding}{this GitHub repository}, and users can simply install LeetDecoding by the command \texttt{pip install leet-decoding}.

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

↑