FLInt:利用浮点运算实现高效随机森林推理
FLInt: Exploiting Floating Point Enabled Integer Arithmetic for Efficient Random Forest Inference
摘要:
在许多机器学习应用中,例如,基于树的集合、浮点数由于它们的表达性而被广泛使用。如今,在嵌入式设备上从动态数据量执行数据分析变得可用,但是这样的系统通常缺乏处理浮点数的硬件能力,从而为它们的处理引入了大量开销。即使这样的硬件存在于一般的计算系统中,使用整数运算而不是浮点运算也有望减少运算开销并提高性能。在本文中,我们提供了\mdname,一个全精度浮点比较的随机森林,仅使用整数和逻辑运算。为了确保相同的功能保留,我们正式证明了这种比较的正确性。由于随机森林在推理过程中只需要比较浮点数,因此我们在低级实现中实现了\mdname ~,从而通过保持模型精度不变,完全消除了对浮点硬件的需求。\mdname ~的用法基本上归结为一个接一个的条件替换:例如,C中的比较语句:if(pX[3]<=(float)10.074347)变成了if((*((int*)(pX))+3))<=((int)(0x 41213087)。在X86和ARMv 8桌面和服务器类系统上的实验结果表明,该方法可以将执行时间减少到$\approx 30\%$.
英文摘要:
In many machine learning applications, e.g., tree-based ensembles, floating point numbers are extensively utilized due to their expressiveness. Nowadays performing data analysis on embedded devices from dynamic data masses becomes available, but such systems often lack hardware capabilities to process floating point numbers, introducing large overheads for their processing. Even if such hardware is present in general computing systems, using integer operations instead of floating point operations promises to reduce operation overheads and improve the performance. In this paper, we provide \mdname, a full precision floating point comparison for random forests, by only using integer and logic operations. To ensure the same functionality preserves, we formally prove the correctness of this comparison. Since random forests only require comparison of floating point numbers during inference, we implement \mdname~in low level realizations and therefore eliminate the need for floating point hardware entirely, by keeping the model accuracy unchanged. The usage of \mdname~basically boils down to a one-by-one replacement of conditions: For instance, a comparison statement in C: if(pX[3]<=(float)10.074347) becomes if((*(((int*)(pX))+3))<=((int)(0x41213087))). Experimental evaluation on X86 and ARMv8 desktop and server class systems shows that the execution time can be reduced by up to $\approx 30\%$ with our novel approach.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。