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

具有细粒度Quantization的三值神经网络

Ternary Neural Networks with Fine-Grained Quantization

Intel Labs(英特尔实验室)

Naveen Mellempudi, Abhisek Kundu, Dheevatsa Mudigere, Dipankar Das, Bharat Kaul, Pradeep Dubey

摘要:

我们提出了一种新的细粒度量化(FGQ)方法来三进制化预训练的全精度模型,同时还将激活限制为8位和4位。使用这种方法,我们证明了一个最小的损失,在最先进的拓扑结构的分类精度,而无需额外的训练。我们提供了一个改进的理论公式,形成了一个更高质量的解决方案,使用FGQ的基础。我们的方法涉及将原始权重张量三值化为$N$权重组。使用$N=4$,我们分别在Resnet-101和Resnet-50的基线全精度结果的$3.7\%$和$4.2\%$范围内实现Top-1精度,同时消除了所有乘法的$75\%$。这些结果实现了完整的8/4位推理管道,在ImageNet数据集上使用三进制权重具有最佳报告的准确性,并具有$9\times$性能改进的潜力。此外,对于像AlexNet这样的小型网络,FGQ可以实现最先进的结果。我们进一步研究了组大小对性能和准确性的影响。使用$N=64$的组大小,我们消除了乘法的$\approx99\%$;然而,这引入了精度的明显下降,这需要在较低精度下微调参数。我们通过在$N=64$上使用8位激活和三进制权重微调Resnet-50来解决这个问题,通过$<30\%$额外的训练开销将Top-1精度提高到全精度结果的$4\%$范围内。我们的最终量化模型可以使用2位权重在完整的8位计算流水线上运行,并且与基线全精度模型相比,具有高达$15\times$的性能改进潜力。

英文摘要:

We propose a novel fine-grained quantization (FGQ) method to ternarize pre-trained full precision models, while also constraining activations to 8 and 4-bits. Using this method, we demonstrate a minimal loss in classification accuracy on state-of-the-art topologies without additional training. We provide an improved theoretical formulation that forms the basis for a higher quality solution using FGQ. Our method involves ternarizing the original weight tensor in groups of $N$ weights. Using $N=4$, we achieve Top-1 accuracy within $3.7\%$ and $4.2\%$ of the baseline full precision result for Resnet-101 and Resnet-50 respectively, while eliminating $75\%$ of all multiplications. These results enable a full 8/4-bit inference pipeline, with best-reported accuracy using ternary weights on ImageNet dataset, with a potential of $9\times$ improvement in performance. Also, for smaller networks like AlexNet, FGQ achieves state-of-the-art results. We further study the impact of group size on both performance and accuracy. With a group size of $N=64$, we eliminate $\approx99\%$ of the multiplications; however, this introduces a noticeable drop in accuracy, which necessitates fine tuning the parameters at lower precision. We address this by fine-tuning Resnet-50 with 8-bit activations and ternary weights at $N=64$, improving the Top-1 accuracy to within $4\%$ of the full precision result with $<30\%$ additional training overhead. Our final quantized model can run on a full 8-bit compute pipeline using 2-bit weights and has the potential of up to $15\times$ improvement in performance compared to baseline full-precision models.

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

↑