arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.09690cs.LGcs.PF
收藏

CDMPP:一种设备-模型无关的张量程序延迟预测框架

CDMPP: A Device-Model Agnostic Framework for Latency Prediction of Tensor Programs

University of Hong Kong(香港大学);ByteDance Inc.(字节跳动公司)

Hanpeng Hu, Junwei Su, Juntao Zhao, Yanghua Peng, Yibo Zhu, Haibin Lin, Chuan Wu

AI总结:

CDMPP提出了一种设备-模型无关的张量程序延迟预测框架,利用紧凑AST表示和领域自适应方法,在跨模型和跨设备预测中分别达到14.03%和10.85%的误差,显著优于现有基线。

摘要:

深度神经网络(DNN)在广泛的机器学习应用中表现出优异的性能。在特定设备上运行DNN模型或张量程序的延迟信息,对于DNN图级或张量级优化以及设备选择等任务非常有用。考虑到DNN模型和设备的巨大空间阻碍了对所有组合的直接分析,近期的研究致力于构建预测器来建模DNN模型在不同设备上的性能。然而,现有的尝试均未实现一个能够准确预测各种张量程序性能,同时支持训练和推理加速器的成本模型。我们提出了CDMPP,一种高效的张量程序延迟预测框架,支持跨模型和跨设备预测。我们设计了一种信息丰富且高效的张量程序表示,称为紧凑抽象语法树(compact ASTs),并采用基于前序的位置编码方法来捕获张量程序的内部结构。我们开发了一种受领域自适应启发的方法来学习领域不变表示,并设计了一种基于KMeans的采样算法,使预测器能够从不同领域(即不同的DNN算子和设备)中学习。我们在多种DNN模型和设备上的大量实验表明,CDMPP显著优于最先进的基线,跨模型和跨设备预测的误差分别为14.03%和10.85%,训练效率提高了一个数量级。实现和扩展数据集可在https://github.com/joapolarbear/cdmpp获取。

英文摘要:

Deep Neural Networks (DNNs) have shown excellent performance in a wide range of machine learning applications. Knowing the latency of running a DNN model or tensor program on a specific device is useful in various tasks, such as DNN graph- or tensor-level optimization and device selection. Considering the large space of DNN models and devices that impede direct profiling of all combinations, recent efforts focus on building a predictor to model the performance of DNN models on different devices. However, none of the existing attempts have achieved a cost model that can accurately predict the performance of various tensor programs while supporting both training and inference accelerators. We propose CDMPP, an efficient tensor program latency prediction framework for both cross-model and cross-device prediction. We design an informative but efficient representation of tensor programs, called compact ASTs, and a pre-order-based positional encoding method, to capture the internal structure of tensor programs. We develop a domain-adaption-inspired method to learn domain-invariant representations and devise a KMeans-based sampling algorithm, for the predictor to learn from different domains (i.e., different DNN operators and devices). Our extensive experiments on a diverse range of DNN models and devices demonstrate that CDMPP significantly outperforms state-of-the-art baselines with 14.03% and 10.85% prediction error for cross-model and cross-device prediction, respectively, and one order of magnitude higher training efficiency. The implementation and the expanded dataset are available at https://github.com/joapolarbear/cdmpp.

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

↑