HiRE:用于高效LLM推理的高召回率近似Top-$k$估计
HiRE: High Recall Approximate Top-$k$ Estimation for Efficient LLM Inference
AI总结:
本文提出HiRE,一种用于高效LLM推理的高召回率近似Top-$k$估计方法,通过压缩方案和高效多设备算子减少内存传输,在保持准确率的同时显著提升推理速度。
摘要:
在加速器(GPU/TPU)上使用生成式大型语言模型(LLM)进行自回归解码通常是内存受限的,大部分时间花在将模型参数从高带宽内存(HBM)传输到缓存上。另一方面,最近的研究表明,通过适当训练模型在top-$k$比例的行/列上运行(其中$k \approx 0.05$),LLM在前馈(FFN)层中具有显著的稀疏性/冗余度时仍能保持质量,从而提出了一种减少模型参数传输进而降低延迟的方法。然而,利用这种稀疏性来改善延迟受到以下事实的阻碍:识别top行/列是数据相关的,通常使用完整的矩阵操作来执行,严重限制了潜在的增益。为了解决这些问题,我们引入了HiRE(高召回率近似Top-$k$估计)。HiRE包含两个新颖的组件:(i)一种压缩方案,用于以高召回率廉价地预测top-$k$行/列,随后将完整计算限制在预测的子集上,以及(ii)DA-TOP-$k$:一种高效的多设备近似top-$k$算子。我们证明,在一个十亿参数的模型上,应用于softmax层和前馈层的HiRE实现了几乎匹配的预训练和下游准确率,并在单个TPUv5e设备上将推理延迟提高了$1.47\times$。
英文摘要:
Autoregressive decoding with generative Large Language Models (LLMs) on accelerators (GPUs/TPUs) is often memory-bound where most of the time is spent on transferring model parameters from high bandwidth memory (HBM) to cache. On the other hand, recent works show that LLMs can maintain quality with significant sparsity/redundancy in the feedforward (FFN) layers by appropriately training the model to operate on a top-$k$ fraction of rows/columns (where $k \approx 0.05$), there by suggesting a way to reduce the transfer of model parameters, and hence latency. However, exploiting this sparsity for improving latency is hindered by the fact that identifying top rows/columns is data-dependent and is usually performed using full matrix operations, severely limiting potential gains. To address these issues, we introduce HiRE (High Recall Approximate Top-k Estimation). HiRE comprises of two novel components: (i) a compression scheme to cheaply predict top-$k$ rows/columns with high recall, followed by full computation restricted to the predicted subset, and (ii) DA-TOP-$k$: an efficient multi-device approximate top-$k$ operator. We demonstrate that on a one billion parameter model, HiRE applied to both the softmax as well as feedforward layers, achieves almost matching pretraining and downstream accuracy, and speeds up inference latency by $1.47\times$ on a single TPUv5e device.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。