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

迈向编译器世界模型:学习潜在动态以实现高效张量程序搜索

Toward Compiler World Models: Learning Latent Dynamics for Efficient Tensor Program Search

Hangzhou Institute for Advanced Study, University of Chinese Academy of Sciences(中国科学院大学杭州高等研究院);Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学)

Haolin Pan, Lianghong Huang, Xvlin Zhou, Mingjie Xing, Yanjun Wu

AI总结:

提出一种受世界模型启发的评估器,通过轻量级过渡模型在连续潜在空间中展开调度动作,避免昂贵AST变异和重复编码,在TVM AutoScheduler中实现比Ansor更优的延迟和测量效率。

摘要:

张量程序优化对现代机器学习系统至关重要,但其搜索空间巨大。现有的自动调度器通过学习成本模型来降低测量成本,但它们通常将每个候选视为静态代码快照,忽略了产生它的调度轨迹。这使得它们对动作依赖不敏感,且易受表面代码变化影响。我们提出一种受世界模型启发的评估器,将调度评估建模为程序状态上的动作条件潜在动态。从初始程序开始,它使用轻量级过渡模型在连续潜在空间中展开调度动作,避免了昂贵的AST变异和重复代码编码。最终的动态表示与动作和硬件特征结合以对候选进行排序。在TVM AutoScheduler中实现后,我们的方法在相同64次试验预算下,GPU上代表性子图延迟比Ansor提升1.37倍,CPU上提升1.54倍。它还在使用10倍更少测量次数的情况下,在2.2%几何平均内匹配Ansor-10K,并将完整模型推理速度提升至PyTorch/PyTorch-opt(cuDNN)的4.61倍/3.67倍几何平均。

英文摘要:

Tensor program optimization is essential for modern machine learning systems, but its search space is enormous. Existing auto-schedulers reduce measurement cost with learned cost models, yet they usually evaluate each candidate as a static code snapshot, ignoring the schedule trajectory that produced it. This makes them insensitive to action dependencies and vulnerable to superficial code variations. We propose a \emph{world-model-inspired} evaluator that models schedule evaluation as action-conditioned latent dynamics over program states. Starting from the initial program, it rolls out scheduling actions in a continuous latent space with a lightweight transition model, avoiding expensive AST mutation and repeated code encoding. The final dynamic representation is combined with action and hardware features to rank candidates. Implemented in TVM AutoScheduler, our method improves representative-subgraph latency over Ansor by 1.37$\times$ on GPU and 1.54$\times$ on CPU under the same 64-trial budget. It also matches Ansor-10K within 2.2% geometric mean using 10$\times$ fewer measurements, and accelerates full-model inference over PyTorch/PyTorch-opt(cuDNN) by 4.61$\times$/3.67$\times$ geometric mean.

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

↑