Flash Inference:长卷积序列模型及其他模型的近线性时间推理
Flash Inference: Near Linear Time Inference for Long Convolution Sequence Models and Beyond
AI总结:
针对长卷积序列模型(如Hyena)推理时二次方复杂度的问题,提出基于分块策略的Flash Inference方法,将其精确推理加速至拟线性$O(L\rm{log}^2L)$时间,实现位置混合部分各层几乎完全并行化,Hyena概念验证实现端到端性能最多提升7.8倍。
摘要:
虽然Transformer一直是大多数最新序列生成模型进展的核心,但其计算成本在序列长度上仍呈二次方增长。为解决这一计算问题,已有多种亚二次方架构被提出。其中包括长卷积序列模型(LCSMs)(如Hyena)在内的一些架构在训练时解决了该问题,但推理时仍为二次方复杂度。我们提出一种方法,将LCSMs的精确推理加速至拟线性$O(L\rm{log}^2L)$时间,确定了实现这一加速的关键特性,并提出一个利用这些特性的通用框架。我们的方法受先前松弛多项式插值研究的启发,基于一种可减少内存移动并共享计算的分块策略,额外优势是允许架构中位置混合部分的各层几乎完全并行化。实验上,我们为Hyena提供了概念验证实现,通过将位置混合部分的速度提升110倍,端到端性能相比标准推理最多提升7.8倍。
英文摘要:
While transformers have been at the core of most recent advancements in sequence generative models, their computational cost remains quadratic in sequence length. Several subquadratic architectures have been proposed to address this computational issue. Some of them, including long convolution sequence models (LCSMs), such as Hyena, address this issue at training time but remain quadratic during inference. We propose a method for speeding up LCSMs' exact inference to quasilinear $O(L\log^2L)$ time, identify the key properties that make this possible, and propose a general framework that exploits these. Our approach, inspired by previous work on relaxed polynomial interpolation, is based on a tiling which helps decrease memory movement and share computation. It has the added benefit of allowing for almost complete parallelization across layers of the position-mixing part of the architecture. Empirically, we provide a proof of concept implementation for Hyena, which gets up to $7.8\times$ end-to-end improvement over standard inference by improving $110\times$ within the position-mixing part.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。