Because of the increasing demand for computation in DNN, researchers develope both hardware and software mechanisms to reduce the compute and memory burden. A widely adopted approach is to use mixed precision data types. However, it is hard to leverage mixed precision without hardware support because of the overhead of data casting. Hardware vendors offer tensorized instructions for mixed-precision tensor operations, like Intel VNNI, Tensor Core, and ARM-DOT. These instructions involve a computing idiom that reduces multiple low precision elements into one high precision element. The lack of compilation techniques for this makes it hard to utilize these instructions: Using vendor-provided libraries for computationally-intensive kernels is inflexible and prevents further optimizations, and manually writing hardware intrinsics is error-prone and difficult for programmers. Some prior works address this problem by creating compilers for each instruction. This requires excessive effort when it comes to many tensorized instructions. In this work, we develop a compiler framework to unify the compilation for these instructions -- a unified semantics abstraction eases the integration of new instructions, and reuses the analysis and transformations. Tensorized instructions from different platforms can be compiled via UNIT with moderate effort for favorable performance. Given a tensorized instruction and a tensor operation, UNIT automatically detects the applicability, transforms the loop organization of the operation,and rewrites the loop body to leverage the tensorized instruction. According to our evaluation, UNIT can target various mainstream hardware platforms. The generated end-to-end inference model achieves 1.3x speedup over Intel oneDNN on an x86 CPU, 1.75x speedup over Nvidia cuDNN on an NvidiaGPU, and 1.13x speedup over a carefully tuned TVM solution for ARM DOT on an ARM CPU.
翻译:由于DNN对计算的需求不断增加,研究人员开发硬件和软件机制以减少计算和记忆负担。广泛采用的方法是使用混合精密数据类型。然而,由于数据投放的权重,很难在不提供硬件支持的情况下利用混合精度。硬件供应商为混合精度高压操作提供加压指令,如Intel VNNI、Tensor Core和ARM-DOT。这些指令涉及一个计算音质,将多个低精度元素降低到一个高精度元素中。由于缺乏这方面的编译技术,因此很难使用这些指令:使用供应商提供的图书馆进行计算密集型的精度精密数据型数据型数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据化数据系统。