Target-independent XLA optimization using Reinforcement Learning

Milan Ganai, Haichen Li, Theodore Enns, Yida Wang, Randy Huang
8/28/2023
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ganai2023targetindependent,
  title  = {Target-independent XLA optimization using Reinforcement Learning},
  author = {Milan Ganai and Haichen Li and Theodore Enns and Yida Wang and Randy Huang},
  year   = {2023},
  eprint = {2308.14364},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.14364v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.14364.svg)](https://codeofpaper.com/paper/2308.14364)

Discussion