ClipFormer:忆阻交叉阵列上Transformer的键值裁剪以缓解写入噪声
ClipFormer: Key-Value Clipping of Transformers on Memristive Crossbars for Write Noise Mitigation
AI总结:
针对忆阻交叉阵列中写入噪声影响预训练ViT注意力层键值矩阵精度的问题,提出无额外开销的推理时变换方法ClipFormer,使非理想精度提升10-40%。
摘要:
Transformer已彻底改变了从自然语言处理到计算机视觉的各种现实应用。然而,传统的冯·诺依曼计算范式由于其庞大的模型规模,在加速Transformer时面临内存和带宽限制。为此,基于非易失性存储器(NVMs)的内存计算(IMC)交叉阵列,因其能够以高能效执行高度并行的矩阵-向量乘法(MVMs),已成为加速Transformer的一种极具前景的解决方案。然而,交叉阵列中的模拟MVM操作会引入非理想特性,如随机的读取和写入噪声,这会影响已部署Transformer的推理精度。具体而言,我们发现预训练的视觉Transformer(ViTs)在交叉阵列上容易受到攻击,原因是写入噪声对注意力层中动态生成的键(K)和值(V)矩阵产生影响,而这一效应在先前的研究中未被考虑。因此,我们提出ClipFormer,一种在推理期间对K和V矩阵进行的变换,以提升预训练ViT模型的非理想精度。ClipFormer不需要额外的硬件和训练开销,并且适用于部署在任何忆阻交叉阵列平台上的Transformer。我们在Imagenet-1k数据集上使用预训练的DeiT-S Transformer进行了实验,在标准训练和变化感知训练下,通过应用ClipFormer,在高写入噪声环境下获得了高出10-40%的非理想精度。
英文摘要:
Transformers have revolutionized various real-world applications from natural language processing to computer vision. However, traditional von-Neumann computing paradigm faces memory and bandwidth limitations in accelerating transformers owing to their massive model sizes. To this end, In-memory Computing (IMC) crossbars based on Non-volatile Memories (NVMs), due to their ability to perform highly parallelized Matrix-Vector-Multiplications (MVMs) with high energy-efficiencies, have emerged as a promising solution for accelerating transformers. However, analog MVM operations in crossbars introduce non-idealities, such as stochastic read & write noise, which affect the inference accuracy of the deployed transformers. Specifically, we find pre-trained Vision Transformers (ViTs) to be vulnerable on crossbars due to the impact of write noise on the dynamically-generated Key (K) and Value (V) matrices in the attention layers, an effect not accounted for in prior studies. We, thus, propose ClipFormer, a transformation on the K and V matrices during inference, to boost the non-ideal accuracies of pre-trained ViT models. ClipFormer requires no additional hardware and training overhead and is amenable to transformers deployed on any memristive crossbar platform. Our experiments on Imagenet-1k dataset using pre-trained DeiT-S transformers, subjected to standard training and variation-aware-training, show >10-40% higher non-ideal accuracies at the high write noise regime by applying ClipFormer.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。