传输调优:重用自动调度实现高效的张量程序代码生成
Transfer-Tuning: Reusing Auto-Schedules for Efficient Tensor Program Code Generation
摘要:
张量程序的自动调度是一个搜索算法自动探索目标硬件平台上给定程序的候选调度(程序转换)以提高其性能的过程。然而,这可能是一个非常耗时的过程,这取决于张量程序的复杂性和目标设备的容量,通常需要探索数千个程序变体。为了解决这个问题,在本文中,我们介绍了转移调整的想法,一种新的方法来识别和重用张量程序之间的自动调度。我们使用深度神经网络(DNN)来证明这一概念,从预先调整的DNN中获取自动调度集,并使用它们来减少新DNN的推理时间。我们将传输调优与最先进的Ansor自动调度器进行比较,将给定DNN模型的最大可能加速定义为Ansor使用其推荐的完整调优时间实现的加速。在服务器级CPU和11个广泛使用的DNN模型上,我们观察到传输调优达到了$88.41\%$(平均$49.13\%$),而Ansor平均需要$6.5\times$更多的搜索时间来匹配它。我们还评估了受限边缘CPU上的传输调整,并观察到搜索时间的差异加剧,Ansor平均需要$10.8\times$更多的时间来匹配transfer-tuning的加速,这进一步证明了它的价值。我们的代码可在www.example.com上获得
英文摘要:
Auto-scheduling for tensor programs is a process where a search algorithm automatically explores candidate schedules (program transformations) for a given program on a target hardware platform to improve its performance. However this can be a very time consuming process depending on the complexity of the tensor program and the capacity of the target device, with often many thousands of program variants being explored. To address this, in this paper we introduce the idea of transfer-tuning, a novel approach to identify and reuse auto-schedules between tensor programs. We demonstrate this concept using Deep Neural Networks (DNNs), taking sets of auto-schedules from pre-tuned DNNs and using them to reduce the inference time of a new DNN. We compare transfer-tuning against the state-of-the-art Ansor auto-scheduler, defining the maximum possible speedup for a given DNN model as what Ansor achieves using its recommended full tuning time. On a server-class CPU and across 11 widely used DNN models, we observe that transfer-tuning achieves up to $88.41\%$ ($49.13\%$ on average) of this maximum speedup, while Ansor requires $6.5\times$ more search time on average to match it. We also evaluate transfer-tuning on a constrained edge CPU and observe that the differences in search time are exacerbated, with Ansor requiring $10.8\times$ more time on average to match transfer-tuning's speedup, which further demonstrates its value. Our code is available at https://www.github.com/gicLAB/transfer-tuning
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。