{"title":"A Reinforcement Learning Environment for Automatic Code Optimization in the MLIR Compiler","authors":"Nazim Bendib, Iheb Nassim Aouadj, Riyadh Baghdadi","doi":"arxiv-2409.11068","DOIUrl":null,"url":null,"abstract":"Code optimization is a crucial task aimed at enhancing code performance.\nHowever, this process is often tedious and complex, highlighting the necessity\nfor automatic code optimization techniques. Reinforcement Learning (RL), a\nmachine learning technique, has emerged as a promising approach for tackling\nsuch complex optimization problems. In this project, we introduce the first RL\nenvironment for the MLIR compiler, dedicated to facilitating MLIR compiler\nresearch, and enabling automatic code optimization using Multi-Action\nReinforcement Learning. We also propose a novel formulation of the action space\nas a Cartesian product of simpler action subspaces, enabling more efficient and\neffective optimizations. Experimental results demonstrate that our proposed\nenvironment allows for an effective optimization of MLIR operations, and yields\ncomparable performance to TensorFlow, surpassing it in multiple cases,\nhighlighting the potential of RL-based optimization in compiler frameworks.","PeriodicalId":501278,"journal":{"name":"arXiv - CS - Software Engineering","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-09-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Software Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.11068","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Code optimization is a crucial task aimed at enhancing code performance.
However, this process is often tedious and complex, highlighting the necessity
for automatic code optimization techniques. Reinforcement Learning (RL), a
machine learning technique, has emerged as a promising approach for tackling
such complex optimization problems. In this project, we introduce the first RL
environment for the MLIR compiler, dedicated to facilitating MLIR compiler
research, and enabling automatic code optimization using Multi-Action
Reinforcement Learning. We also propose a novel formulation of the action space
as a Cartesian product of simpler action subspaces, enabling more efficient and
effective optimizations. Experimental results demonstrate that our proposed
environment allows for an effective optimization of MLIR operations, and yields
comparable performance to TensorFlow, surpassing it in multiple cases,
highlighting the potential of RL-based optimization in compiler frameworks.