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

Mokey:为开箱即用的浮点Transformer模型启用窄定点推断

Mokey: Enabling Narrow Fixed-Point Inference for Out-of-the-Box Floating-Point Transformer Models

University of Toronto(多伦多大学);Vector Institute(向量研究所)

Ali Hadi Zadeh, Mostafa Mahmoud, Ameer Abdelhadi, Andreas Moshovos

摘要:

越来越大和更好的Transformer模型不断提高自然语言处理应用程序的最新精度和功能。这些模型需要更多的计算能力、存储和能源。Mokey通过将所有值量化为4位索引并放入代表性16位定点质心的字典中,减少了最先进的32位或16位浮点Transformer模型的占用空间。Mokey不需要微调,这是一个基本功能,因为许多人通常无法获得训练资源或数据集。利用Transformer模型中自然出现的值范围,Mokey选择质心值来拟合指数曲线。这一独特的功能使Mokey能够用窄3b定点加法取代大量原始乘法-累加运算,从而实现面积和能效的硬件加速器设计。在一组最先进的Transformer模型上,Mokey加速器的能效比基于Tensor Core的加速器提高了一个数量级,同时根据模型和片上缓冲容量,将性能提高了至少$4\times$和$15\times$。可选地,Mokey可以用作任何其他加速器的内存压缩辅助,透明地将宽浮点或定点激活或权重存储到窄的4位索引中。Mokey证明优于现有技术的Transformers的量化方法。

英文摘要:

Increasingly larger and better Transformer models keep advancing state-of-the-art accuracy and capability for Natural Language Processing applications. These models demand more computational power, storage, and energy. Mokey reduces the footprint of state-of-the-art 32-bit or 16-bit floating-point transformer models by quantizing all values to 4-bit indexes into dictionaries of representative 16-bit fixed-point centroids. Mokey does not need fine-tuning, an essential feature as often the training resources or datasets are not available to many. Exploiting the range of values that naturally occur in transformer models, Mokey selects centroid values to also fit an exponential curve. This unique feature enables Mokey to replace the bulk of the original multiply-accumulate operations with narrow 3b fixed-point additions resulting in an area- and energy-efficient hardware accelerator design. Over a set of state-of-the-art transformer models, the Mokey accelerator delivers an order of magnitude improvements in energy efficiency over a Tensor Cores-based accelerator while improving performance by at least $4\times$ and as much as $15\times$ depending on the model and on-chip buffering capacity. Optionally, Mokey can be used as a memory compression assist for any other accelerator, transparently stashing wide floating-point or fixed-point activations or weights into narrow 4-bit indexes. Mokey proves superior to prior state-of-the-art quantization methods for Transformers.

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

↑