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

Topkima-Former:利用top-k存内ADC实现Transformer的低能耗、低延迟推理

Topkima-Former: Low-energy, Low-Latency Inference for Transformers using top-k In-memory ADC

Shuai Dong, Junyi Yang, Xiaoqi Peng, Hongyang Shang, Ye Ke, Xiaofeng Yang, Hongjie Liu, Arindam Basu

AI总结:

本文提出Topkima-Former,通过top-k存内ADC实现低能耗低延迟softmax,并改进无尺度注意力,在Transformer推理中显著提升速度与能效,同时保持较高准确率。

摘要:

Transformer模型已成为神经语言处理和计算机视觉应用中广受欢迎的深度神经网络架构。然而,softmax等非线性运算的大量使用在Transformer推理过程中构成了性能瓶颈,并占总延迟高达40%。因此,我们在电路、架构和算法层面提出创新以加速Transformer。在电路层面,我们提出topkima——将top-k激活选择与存内ADC(IMA)相结合,实现低能耗、低延迟的softmax,且无需任何排序延迟。仅将k个最大激活值送入softmax计算模块,从而降低softmax的巨大计算成本。通过在前向传播中仅使用top-k的改进训练方案,实验结果表明,在k=5的条件下,于CIFAR-10、CIFAR-100和SQuAD数据集上评估ViT、distilBERT和BERT-base模型时,准确率仅下降0.4%至1.2%。在架构层面,引入一种改进的无尺度技术以降低注意力的计算成本。所提出的组合系统名为Topkima-Former,相较于先前的存内计算加速器,实现了1.8倍至84倍的加速和1.3倍至35倍的能效提升。与传统的softmax宏单元和数字top-k(Dtopk)softmax宏单元相比,我们提出的topkima softmax宏单元分别实现了约15倍和8倍的速度提升。

英文摘要:

Transformer model has gained prominence as a popular deep neural network architecture for neural language processing (NLP) and computer vision (CV) applications. However, the extensive use of nonlinear operations, like softmax, poses a performance bottleneck during transformer inference and comprises up to 40% of the total latency. Hence, we propose innovations at the circuit, architecture, and algorithm levels to accelerate the transformer. At the circuit level, we propose topkima-combining top-k activation selection with in-memory ADC (IMA) to implement a low-energy and low-latency softmax without any sorting latency. Only the k largest activations are sent to the softmax calculation block, reducing the huge computational cost of softmax. Using a modified training scheme with top-k only in the forward pass, experimental results demonstrate only a 0.4% to 1.2% reduction in accuracy across ViT, distilBERT, and BERT-base models when evaluated on CIFAR-10, CIFAR-100, and SQuAD datasets with k=5. At the architecture level, an improved scale-free technique is introduced to reduce the computational cost of attention. The combined system, dubbed Topkima-Former, enhances 1.8x-84x speedup and 1.3x-35x energy efficiency (EE) over prior In-memory computing (IMC) accelerators. Compared to a conventional softmax macro and a digital top-k (Dtopk) softmax macro, our proposed tokima softmax macro achieves about 15x and 8x faster speed respectively.

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

↑