A Reinforcement Learning Environment for Automatic Code Optimization in the MLIR Compiler

Nazim Bendib, Iheb Nassim Aouadj, Riyadh Baghdadi
{"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":"27 1","pages":""},"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.
在 MLIR 编译器中自动优化代码的强化学习环境
代码优化是一项旨在提高代码性能的重要任务。然而,这一过程往往繁琐而复杂,这凸显了自动代码优化技术的必要性。强化学习(RL)作为一种机器学习技术,已成为解决此类复杂优化问题的一种有前途的方法。在本项目中,我们为 MLIR 编译器引入了第一个 RL 环境,致力于促进 MLIR 编译器的研究,并使用多动作强化学习实现自动代码优化。我们还提出了一种新颖的方法,将行动空间表述为更简单的行动子空间的笛卡尔乘积,从而实现更高效、更有效的优化。实验结果表明,我们提出的环境可以有效优化多动作强化学习(MLIR)操作,其性能可与 TensorFlow 相媲美,并在多种情况下超过了 TensorFlow,这凸显了基于 RL 的优化在编译器框架中的潜力。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信