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

优化二值神经网络中的数据流

Optimizing data-flow in Binary Neural Networks

Datalogic Labs(德逻捷实验室);University of Bologna(博洛尼亚大学)

L. Vorabbi, D. Maltoni, S. Santi

AI总结:

提出一种新颖的BNN训练方案,通过引入裁剪块、减小累加器大小、优化Batch Normalization层及实现Binary Direct Convolution,显著提升了推理速度且不损失精度。

摘要:

二值神经网络(BNNs)通过用按位运算替代昂贵的浮点运算,可以显著加快神经网络的推理时间。然而,大多数现有解决方案并未完全优化通过 BNN 层的数据流,且从 1 位到 16/32 位的中间转换通常会进一步阻碍效率。我们提出了一种新颖的训练方案,能够增加 BNN 流水线中的数据流和并行性;具体而言,我们引入了一个裁剪块,将数据宽度从 32 位减少到 8 位。此外,我们减小了二值层的内部累加器大小,通常使用 32 位以防止数据溢出且不损失精度。另外,我们提供了对 Batch Normalization 层的优化,既降低了延迟又简化了部署。最后,我们提出了针对 ARM 指令集的 Binary Direct Convolution 优化实现。我们的实验表明,推理速度持续提升(与两个最先进的 BNNs 框架相比分别高达 1.91 倍和 2.73 倍),且在至少一个全精度模型上精度无下降。

英文摘要:

Binary Neural Networks (BNNs) can significantly accelerate the inference time of a neural network by replacing its expensive floating-point arithmetic with bitwise operations. Most existing solutions, however, do not fully optimize data flow through the BNN layers, and intermediate conversions from 1 to 16/32 bits often further hinder efficiency. We propose a novel training scheme that can increase data flow and parallelism in the BNN pipeline; specifically, we introduce a clipping block that decreases the data-width from 32 bits to 8. Furthermore, we reduce the internal accumulator size of a binary layer, usually kept using 32-bit to prevent data overflow without losing accuracy. Additionally, we provide an optimization of the Batch Normalization layer that both reduces latency and simplifies deployment. Finally, we present an optimized implementation of the Binary Direct Convolution for ARM instruction sets. Our experiments show a consistent improvement of the inference speed (up to 1.91 and 2.73x compared to two state-of-the-art BNNs frameworks) with no drop in accuracy for at least one full-precision model.

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

↑