一句话:Korch 用算子分裂暴露细粒度优化空间,并将内核编排形式化为二元线性规划问题求解最优策略。
深度神经网络中不同算子的计算需要映射为 GPU 内核执行,这一任务称为内核编排。已有方法主要依靠贪心的算子融合(把多个算子的计算合并进单个内核),因而错失了大量优化机会。Korch 提出一种新的张量程序优化器:它不直接融合算子,而是先用算子分裂将张量算子分解为一小组基本张量代数原语,从而暴露出多样化的细粒度跨算子优化空间;随后把内核编排形式化为约束优化问题,借助现成的二元线性规划求解器搜索最优编排策略,并生成可直接部署在现代 GPU 平台上的可执行程序。在多种 DNN 上的评测显示,Korch 在 V100 上最多比现有张量程序优化器快 1.7 倍,在 A100 上最多快 1.6 倍,且已开源。
Kernel orchestration is the task of mapping the computation defined in different operators of a deep neural network (DNN) to the execution of GPU kernels on modern hardware platforms. Prior approaches optimize kernel orchestration by greedily applying operator fusion, which fuses the computation of multiple operators into a single kernel, and miss a variety of optimization opportunities in kernel orchestration. This paper presents Korch, a tensor program optimizer that discovers optimal kernel orchestration strategies for tensor programs. Instead of directly fusing operators, Korch first applies operator fission to decompose tensor operators into a small set of basic tensor algebra primitives. This decomposition enables a diversity of fine-grained, inter-operator optimizations. Next, Korch optimizes kernel orchestration by formalizing it as a constrained optimization problem, leveraging an off-the-shelf binary linear programming solver to discover an optimal orchestration strategy, and generating an executable that can be directly deployed on modern GPU platforms. Evaluation on a variety of DNNs shows that Korch outperforms existing tensor program optimizers by up to 1.7× on V100 GPUs and up to 1.6× on A100 GPUs. Korch is publicly available at https://github.com/humuyan/Korch.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2406-09465,
title = {Optimal Kernel Orchestration for Tensor Programs with Korch},
author = {Muyan Hu and Ashwin Venkatram and Shreyashri Biswas and Balamurugan Marimuthu and Bohan Hou and Gabriele Oliaro and Haojie Wang and Liyan Zheng and Xupeng Miao and Jidong Zhai and Zhihao Jia},
booktitle = {ASPLOS},
year = {2024},
doi = {10.1145/3620666.3651383}
}