arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2002.02145cs.PLcs.LG
收藏

PolyScientist:自动循环变换结合微内核优化深度学习原语

PolyScientist: Automatic Loop Transformations Combined with Microkernels for Optimization of Deep Learning Primitives

Intel Labs(英特尔实验室);IIT Hyderabad(印度理工学院海得拉巴分校)

Sanket Tavarageri, Alexander Heinecke, Sasikanth Avancha, Gagandeep Goyal, Ramakrishna Upadrasta, Bharat Kaul

摘要:

深度学习训练和推理的核心是计算密集型原语,例如形成深度神经网络构建块的卷积。研究人员采取了两种不同的方法来创建深度学习内核的高性能实现,即1)以英特尔MKL-DNN为例的CPU库开发,2)以TensorFlow XLA编译器为代表的自动编译。这两种方法都有各自的缺点:即使定制的库可以提供非常好的性能,但库的开发成本和时间可能很高。内核的自动编译是有吸引力的,但在实践中,到目前为止,自动生成的实现在性能上落后于专家编码的内核几个数量级。在本文中,我们开发了一种混合解决方案来开发深度学习内核,实现了两全其美:专家编码的微内核用于内核的最内层循环,我们使用先进的多面体技术来自动调整外部循环的性能。我们设计了一种新的基于多面体模型的数据重用算法来优化内核的外循环。通过对一类重要的深度学习原语(即卷积)进行实验评估,我们证明了我们开发的方法可达到与英特尔MKL-DNN(一种手工编码的深度学习库)相同的性能水平。

英文摘要:

At the heart of deep learning training and inferencing are computationally intensive primitives such as convolutions which form the building blocks of deep neural networks. Researchers have taken two distinct approaches to creating high performance implementations of deep learning kernels, namely, 1) library development exemplified by Intel MKL-DNN for CPUs, 2) automatic compilation represented by the TensorFlow XLA compiler. The two approaches have their drawbacks: even though a custom built library can deliver very good performance, the cost and time of development of the library can be high. Automatic compilation of kernels is attractive but in practice, till date, automatically generated implementations lag expert coded kernels in performance by orders of magnitude. In this paper, we develop a hybrid solution to the development of deep learning kernels that achieves the best of both worlds: the expert coded microkernels are utilized for the innermost loops of kernels and we use the advanced polyhedral technology to automatically tune the outer loops for performance. We design a novel polyhedral model based data reuse algorithm to optimize the outer loops of the kernel. Through experimental evaluation on an important class of deep learning primitives namely convolutions, we demonstrate that the approach we develop attains the same levels of performance as Intel MKL-DNN, a hand coded deep learning library.

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

↑