Hidet:深度学习张量程序的任务映射编程范式
Hidet: Task-Mapping Programming Paradigm for Deep Learning Tensor Programs
摘要:
随着深度学习模型如今被云服务和边缘设备广泛采用,减少深度学习模型推理的延迟对于提供高效的模型服务变得至关重要。然而,由于现代加速器的高度复杂性和运算符数量的快速增长,为深度学习运算符开发高效的张量程序具有挑战性。深度学习编译器,如Apache TVM,采用声明式调度原语来降低开发张量程序的标准。然而,我们表明,这种方法是不够的,以涵盖国家的最先进的张量程序优化。在本文中,我们建议将调度过程嵌入到张量程序中,并使用专用映射(称为任务映射)来定义计算分配和排序。这种新方法通过允许开发人员以更细的粒度操纵张量程序,极大地丰富了可表达的优化。我们称之为任务映射编程范式所提出的方法。此外,我们提出了一种新的调度后融合优化,允许开发人员专注于调度每个操作员,并在调度后自动进行融合。它大大减少了工程工作的运营商融合。我们提出的范例还构建了一个高效的硬件为中心的调度空间,这是不可知的程序输入大小,大大减少了调整时间。利用所提出的范例,我们实现了一个深度学习编译器Hidet。在现代卷积和Transformer模型上进行的大量实验表明,Hidet的性能比最先进的DNN推理框架、ONNX编译器和编译器、配备调度程序AutoTVM和Ansor的TVM高出1.48倍(平均1.22倍)。与AutoTVM和Ansor相比,它还将调优时间分别缩短了20倍和11倍。我们在https://www.github.com/hidet-org/hidet上开源了hidet。
英文摘要:
As deep learning models nowadays are widely adopted by both cloud services and edge devices, reducing the latency of deep learning model inferences becomes crucial to provide efficient model serving. However, it is challenging to develop efficient tensor programs for deep learning operators due to the high complexity of modern accelerators and the rapidly growing number of operators. Deep learning compilers, such as Apache TVM, adopt declarative scheduling primitives to lower the bar of developing tensor programs. However, we show that this approach is insufficient to cover state-of-the-art tensor program optimizations. In this paper, we propose to embed the scheduling process into tensor programs and use dedicated mappings, called task mappings, to define the computation assignment and ordering. This new approach greatly enriches the expressible optimizations by allowing developers to manipulate tensor programs at a much finer granularity. We call the proposed method the task-mapping programming paradigm. In addition, we propose a new post-scheduling fusion optimization that allows developers to focus on scheduling every single operator and automates the fusion after scheduling. It greatly reduces the engineering efforts for operator fusion. Our proposed paradigm also constructs an efficient hardware-centric schedule space, which is agnostic to the program input size and greatly reduces the tuning time. With the proposed paradigm, we implement a deep learning compiler Hidet. Extensive experiments on modern convolution and transformer models show that Hidet outperforms state-of-the-art DNN inference framework, ONNX Runtime, and compiler, TVM equipped with scheduler AutoTVM and Ansor, by up to 1.48x (1.22x on average). It also reduces the tuning time by 20x and 11x compared with AutoTVM and Ansor, respectively. We open-sourced hidet at https://www.github.com/hidet-org/hidet.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。