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

使用强化学习实现的目标无关XLA优化

Target-independent XLA optimization using Reinforcement Learning

University of California San Diego(加州大学圣地亚哥分校);Amazon(亚马逊)

Milan Ganai, Haichen Li, Theodore Enns, Yida Wang, Randy Huang

AI总结:

针对XLA HLO目标无关遍次排序优化研究不足的问题,提出基于深度强化学习的搜索方法并改进算法,搭建XLA Gym框架训练智能体,在多个基准上实现操作数减少效果的显著提升。

摘要:

XLA这类机器学习编译器面临的一项重要挑战是多遍优化与分析。近期研究主要关注图级、子图级和内核级阶段的XLA目标相关优化。我们专门聚焦于目标无关的XLA HLO遍次排序优化:该方法旨在找到最优的编译器优化遍次序列,且与目标相关优化解耦。但目前针对XLA HLO的遍次排序的领域特定研究较少。为此,我们提出引入基于深度强化学习(RL)的搜索方法来寻找最优XLA HLO遍次排序。我们还对深度RL算法提出了改进,以进一步提升最优搜索性能,并为RL的领域特定指导开辟了研究方向。我们构建了XLA Gym实验框架,作为使RL算法能够与编译器交互以执行优化、从而训练智能体的工具。总体而言,在实验中我们观察到,相较于编译器的默认阶段排序,使用所提出的方法在GPT-2训练图基准上的操作数减少量平均提升13.3%,在包含GPT-2、BERT和ResNet图的多样化基准上提升10.4%。

英文摘要:

An important challenge in Machine Learning compilers like XLA is multi-pass optimization and analysis. There has been recent interest chiefly in XLA target-dependent optimization on the graph-level, subgraph-level, and kernel-level phases. We specifically focus on target-independent optimization XLA HLO pass ordering: our approach aims at finding the optimal sequence of compiler optimization passes, which is decoupled from target-dependent optimization. However, there is little domain specific study in pass ordering for XLA HLO. To this end, we propose introducing deep Reinforcement Learning (RL) based search for optimal XLA HLO pass ordering. We also propose enhancements to the deep RL algorithms to further improve optimal search performance and open the research direction for domain-specific guidance for RL. We create an XLA Gym experimentation framework as a tool to enable RL algorithms to interact with the compiler for passing optimizations and thereby train agents. Overall, in our experimentation we observe an average of $13.3\%$ improvement in operation count reduction on a benchmark of GPT-2 training graphs and $10.4\%$ improvement on a diverse benchmark including GPT-2, BERT, and ResNet graphs using the proposed approach over the compiler's default phase ordering.

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

↑