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

FTuner:面向深度学习编译器的快速动态形状张量程序自动调优器

FTuner: A Fast Dynamic Shape Tensors Program Auto-Tuner for Deep Learning Compilers

School of Computer Science and Engineering(计算机科学与工程学院);Beihang University(北京航空航天大学)

Pengyu Mu, Linquan Wei, Yi Liu, Rui Wang

AI总结:

FTuner通过uKernel抽象计算单元拼接小张量以匹配动态输入形状,结合解析硬件信息模型,在保持与厂商库相当性能的同时将调优时间降低两个数量级。

摘要:

许多人工智能模型处理不同长度和分辨率的输入数据,使得张量的形状具有动态性。这些模型的性能依赖于张量的形状,这使得在模型运行之前对张量进行优化变得困难。针对这一问题有两种常见的解决方案。第一种是向输入添加无用数据,以匹配预先优化好的张量库。第二种是使用小型基础张量创建一个在尺寸上最接近输入数据的张量,然后对其进行调优以最小化填充。然而,第二种方案可能非常耗时。本文提出了一种用于深度学习编译器的新技术,称为FTuner。我们没有使用庞大的设计空间或训练代价模型,而是使用一种称为uKernel的抽象计算单元,将各种尺寸的小型张量拼接在一起,以匹配输入张量的形状。我们利用解析硬件信息模型来确定uKernel的形状。实验表明,FTuner能够实现与厂商库相当的算子性能和端到端性能,并且在带有模型训练编译器的现有自动调优器上实现了3%的加速,同时将调优时间降低了两个数量级。

英文摘要:

Many artificial intelligence models process input data of different lengths and resolutions, making the shape of the tensors dynamic. The performance of these models depends on the shape of the tensors, which makes it difficult to optimize the tensors before the model runs. There are two common solutions to this problem. The first is to add useless data to the input to match a pre-optimized tensor library. The second is to use small basic tensors to create a tensor that is closest in size to the input data and then tune it to minimize padding. However, this second solution can be time-consuming. This paper proposes a new technique for deep learning compilers called FTuner. Instead of using a large design space or training a cost model, we use an abstract computational unit called the uKernel to patch together small, various-sized tensors to match the shape of the input tensor. We determine the shape of the uKernel using an analytic hardware information model. Experiments show that the FTuner can achieve comparable operators and end-to-end performance to vendor libraries and achieves 3\% speedup on existing auto-tuner with the model-training compiler while reducing tuning time by two orders of magnitude.

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

↑