Neural networks have been successfully applied in various resource-constrained edge devices, where usually central processing units (CPUs) instead of graphics processing units exist due to limited power availability. State-of-the-art research still focuses on efficiently executing enormous numbers of multiply-accumulate (MAC) operations. However, CPUs themselves are not good at executing such mathematical operations on a large scale, since they are more suited to execute control flow logic, i.e., computer algorithms. To enhance the computation efficiency of neural networks on CPUs, in this paper, we propose to convert them into logic flows for execution. Specifically, neural networks are first converted into equivalent decision trees, from which decision paths with constant leaves are then selected and compressed into logic flows. Such logic flows consist of if and else structures and a reduced number of MAC operations. Experimental results demonstrate that the latency can be reduced by up to 14.9 % on a simulated RISC-V CPU without any accuracy degradation. The code is open source at https://github.com/TUDa-HWAI/NN2Logic
翻译:神经网络已成功应用于各类资源受限的边缘设备中,这些设备通常因供电有限而配备中央处理器(CPU)而非图形处理器。当前最先进的研究仍聚焦于高效执行海量乘积累加(MAC)运算。然而,CPU本身并不擅长大规模执行此类数学运算,因其更适用于执行控制流逻辑,即计算机算法。为提升神经网络在CPU上的计算效率,本文提出将其转换为逻辑流执行。具体而言,首先将神经网络转换为等效决策树,从中选取具有恒定叶节点的决策路径,并将其压缩为逻辑流。此类逻辑流由if-else结构及少量MAC运算构成。实验结果表明,在模拟RISC-V CPU上延迟最高可降低14.9%且无精度损失。代码已在https://github.com/TUDa-HWAI/NN2Logic开源。