arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.07470cs.LGcs.AR
收藏

X-Former:Transformers的内存加速

X-Former: In-Memory Acceleration of Transformers

Purdue University(普渡大学)

Shrihari Sridharan, Jacob R. Stevens, Kaushik Roy, Anand Raghunathan

摘要:

由于注意力机制,Transformers在各种各样的自然语言处理(NLP)任务中取得了巨大的成功,该注意力机制为序列中的每个单词分配相对于其他单词的重要性分数。然而,这些模型非常大,往往达到数千亿个参数,因此需要大量的DRAM访问。因此,传统的深度神经网络(DNN)加速器(如GPU和TPU)在有效处理Transformers方面面临限制。基于非易失性存储器的存储器内加速器有望成为这一挑战的有效解决方案,因为它们提供高存储密度,同时在存储器阵列内执行大规模并行矩阵向量乘法。然而,注意力得分计算经常用于Transformers(与CNN和RNN不同),需要矩阵向量乘法(MVM),其中两个操作数针对每个输入动态变化。结果,传统的基于NVM的加速器在用于Transformers时招致高的写入延迟和写入能量,并且还遭受大多数NVM技术的低耐久性。为了解决这些挑战,我们提出了X-Former,一种混合内存硬件加速器,由NVM和CMOS处理元件组成,有效地执行Transformer工作负载。为了提高X-Former的硬件利用率,我们还提出了一种序列块并行算法,它重叠了两个处理单元的计算,减少了执行时间。在几个基准测试中,我们发现X-Former在延迟和能量方面比NVIDIA GeForce GTX 1060 GPU提高了85倍和7.5倍,在延迟和能量方面比最先进的内存中NVM加速器提高了10.7倍和4.6倍。

英文摘要:

Transformers have achieved great success in a wide variety of natural language processing (NLP) tasks due to the attention mechanism, which assigns an importance score for every word relative to other words in a sequence. However, these models are very large, often reaching hundreds of billions of parameters, and therefore require a large number of DRAM accesses. Hence, traditional deep neural network (DNN) accelerators such as GPUs and TPUs face limitations in processing Transformers efficiently. In-memory accelerators based on non-volatile memory promise to be an effective solution to this challenge, since they provide high storage density while performing massively parallel matrix vector multiplications within memory arrays. However, attention score computations, which are frequently used in Transformers (unlike CNNs and RNNs), require matrix vector multiplications (MVM) where both operands change dynamically for each input. As a result, conventional NVM-based accelerators incur high write latency and write energy when used for Transformers, and further suffer from the low endurance of most NVM technologies. To address these challenges, we present X-Former, a hybrid in-memory hardware accelerator that consists of both NVM and CMOS processing elements to execute transformer workloads efficiently. To improve the hardware utilization of X-Former, we also propose a sequence blocking dataflow, which overlaps the computations of the two processing elements and reduces execution time. Across several benchmarks, we show that X-Former achieves upto 85x and 7.5x improvements in latency and energy over a NVIDIA GeForce GTX 1060 GPU and upto 10.7x and 4.6x improvements in latency and energy over a state-of-the-art in-memory NVM accelerator.

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

↑