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

TLP:基于深度学习的张量程序优化代价模型

TLP: A Deep Learning-based Cost Model for Tensor Program Tuning

University of Science and Technology of China(中国科学技术大学)

Yi Zhai, Yu Zhang, Shuo Liu, Xiaomeng Chu, Jie Peng, Jianmin Ji, Yanyong Zhang

摘要:

张量规划调整是一个非凸目标优化问题,基于搜索的方法已被证明是有效的。基于搜索的方法的核心在于成本模型的设计。尽管基于深度学习的成本模型的性能明显优于其他方法,但它们仍然存在不足,并存在以下问题。首先,它们的特征提取严重依赖于硬件架构中的专家级领域知识。即便如此,提取的特征往往不能令人满意,需要分别考虑CPU和GPU。其次,在一个硬件平台上训练的成本模型通常在另一个硬件平台上表现不佳,我们称之为跨硬件不可用性问题。为了解决这些问题,我们提出了TLP和MTLTLP。TLP是一种基于深度学习的成本模型,有助于张量程序调优。TLP不是从张量程序本身提取特征,而是从调度原语中提取特征。我们将调度原语视为张量语言。因此,TLP是一个张量语言处理任务。通过这种方式,通过成本模型预测张量程序延迟的任务被转换为自然语言处理(NLP)回归任务。MTL-TLP结合了多任务学习和TLP来解决跨硬件不可用问题。我们将这些技术纳入到Ansor框架,并进行详细的实验。结果表明,与最先进的实现相比,TLP可以在CPU和GPU工作负载上分别将平均搜索时间加快9.1倍和3.0倍。MTL-TLP可以在CPU和GPU工作负载上分别实现4.7倍和2.9倍的速度提升,仅使用7%的目标硬件数据。

英文摘要:

Tensor program tuning is a non-convex objective optimization problem, to which search-based approaches have proven to be effective. At the core of the search-based approaches lies the design of the cost model. Though deep learning-based cost models perform significantly better than other methods, they still fall short and suffer from the following problems. First, their feature extraction heavily relies on expert-level domain knowledge in hardware architectures. Even so, the extracted features are often unsatisfactory and require separate considerations for CPUs and GPUs. Second, a cost model trained on one hardware platform usually performs poorly on another, a problem we call cross-hardware unavailability. In order to address these problems, we propose TLP and MTLTLP. TLP is a deep learning-based cost model that facilitates tensor program tuning. Instead of extracting features from the tensor program itself, TLP extracts features from the schedule primitives. We treat schedule primitives as tensor languages. TLP is thus a Tensor Language Processing task. In this way, the task of predicting the tensor program latency through the cost model is transformed into a natural language processing (NLP) regression task. MTL-TLP combines Multi-Task Learning and TLP to cope with the cross-hardware unavailability problem. We incorporate these techniques into the Ansor framework and conduct detailed experiments. Results show that TLP can speed up the average search time by 9.1X and 3.0X on CPU and GPU workloads, respectively, compared to the state-of-the-art implementation. MTL-TLP can achieve a speed-up of 4.7X and 2.9X on CPU and GPU workloads, respectively, using only 7% of the target hardware data.

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

↑