Quantization is commonly used in Deep Neural Networks (DNNs) to reduce the storage and computational complexity by decreasing the arithmetical precision of activations and weights, a.k.a. tensors. Efficient hardware architectures employ linear quantization to enable the deployment of recent DNNs onto embedded systems and mobile devices. However, linear uniform quantization cannot usually reduce the numerical precision to less than 8 bits without sacrificing high performance in terms of model accuracy. The performance loss is due to the fact that tensors do not follow uniform distributions. In this paper, we show that a significant amount of tensors fit into an exponential distribution. Then, we propose DNA-TEQ to exponentially quantize DNN tensors with an adaptive scheme that achieves the best trade-off between numerical precision and accuracy loss. The experimental results show that DNA-TEQ provides a much lower quantization bit-width compared to previous proposals, resulting in an average compression ratio of 40% over the linear INT8 baseline, with negligible accuracy loss and without retraining the DNNs. Besides, DNA-TEQ leads the way in performing dot-product operations in the exponential domain, which saves 66% of energy consumption on average for a set of widely used DNNs.
翻译:量化通常用于深度神经网络(DNN),通过降低激活值和权重(即张量)的算术精度来减少存储和计算复杂度。高效的硬件架构采用线性量化,以便将最新DNN部署到嵌入式系统和移动设备上。然而,线性均匀量化通常无法在不牺牲模型准确率的情况下将数值精度降至8位以下。性能损失源于张量并非服从均匀分布。本文表明,大量张量符合指数分布。由此,我们提出DNA-TEQ,通过自适应方案对DNN张量进行指数量化,实现了数值精度与准确率损失之间的最佳权衡。实验结果表明,与先前方案相比,DNA-TEQ提供了更低的量化位宽,在线性INT8基准上平均压缩比达40%,且无需重新训练DNN即可实现可忽略的准确率损失。此外,DNA-TEQ率先在指数域执行点积运算,在一组广泛使用的DNN上平均节省了66%的能耗。