Manish Kumar Jha,
Shambhu Kumar Mishra,
- Research Scholar, Department of Mathematics, Patliputra University, Patna, Bihar, India
- Professor, Department of Mathematics, Patliputra University, Patna, Bihar, India
Abstract
This study reports on an ML-based approach to compiler optimization, complementing traditional optimization methods that rely strongly on hand-tuned settings. Compiler optimization plays a key role in performance-speedup and energy optimization of complex contemporary software systems. However, the traditional approach to optimizer settings involves laborious, error-prone, and scale-insensitive human-in-the-loop intervention, especially in the complex and high-demand environments in which today’s computing application thrives. By integrating RL and GA, we can automatically find the optimal compiler configuration, reduce human effort, and improve performance efficiency to overcome these bottlenecks. Reinforcement learning dynamically adjusts compiler settings based on real-time performance feedback, refining configurations iteratively through reward-driven mechanisms. In parallel, genetic algorithms use evolutionary principles to systematically explore vast configuration spaces, ensuring diverse solutions and avoiding convergence to local optima. Together, these techniques create a hybrid system capable of self-optimization, offering significant adaptability across a range of software architectures. The performance benchmarks conducted on various applications report significant execution time and memory size reduction along with the scalability on various hardware platforms, including GPUs and multi-core processors. The proposed system delivers performance comparable to manually optimized configurations while significantly reducing time and effort. This automation capability is especially valuable for large-scale and resource-intensive applications where it has an immediate impact on productivity as well as cost. This ultimately underlines the promise of ML-driven compiler optimization towards being an adaptive, scalable, and intelligent solution for next-generation compilers in computing environments that are highly diverse.
Keywords: Compiler automation, machine learning, reinforcement learning, genetic algorithms, adaptive optimization.
[This article belongs to Journal of Artificial Intelligence Research & Advances ]
Manish Kumar Jha, Shambhu Kumar Mishra. Automating Compiler Optimization: A Machine Learning Approach. Journal of Artificial Intelligence Research & Advances. 2024; 12(01):12-16.
Manish Kumar Jha, Shambhu Kumar Mishra. Automating Compiler Optimization: A Machine Learning Approach. Journal of Artificial Intelligence Research & Advances. 2024; 12(01):12-16. Available from: https://journals.stmjournals.com/joaira/article=2024/view=190015
References
- Wang Z, O’Boyle M. Machine learning in compiler optimization. Proc IEEE. 2018 May 10; 106(11): 1879–901.
- Bhattacharyya A, Kwasniewski G, Hoefler T. Using compiler techniques to improve automatic performance modeling. In 2015 IEEE International Conference on Parallel Architecture and Compilation (PACT). 2015 Oct 18; 468–479.
- Chen Z, Yu CH, Morris T, Tuyls J, Lai YH, Roesch J, Delaye E, Sharma V, Wang Y. Bring your own codegen to deep learning compiler. arXiv preprint arXiv:2105.03215. 2021 May 3.
- Ballal PA, Sarojadevi H, Harsha PS. Compiler optimization: A genetic algorithm approach. Int J Comput Appl. 2015 Jan 1; 112(10): 9–13.
- Mammadli R, Jannesari A, Wolf F. Static neural compiler optimization via deep reinforcement learning. In 2020 IEEE/ACM 6th Workshop on the LLVM Compiler Infrastructure in HPC (LLVM-HPC) and Workshop on Hierarchical Parallelism for Exascale Computing (HiPar). 2020 Nov 12; 1–11.
- Fister I, Iglesias A, Galvez A, Fister D, Fister Jr I. Design and implementation of parallel self-adaptive differential evolution for global optimization. Log J IGPL. 2023 Aug; 31(4): 701–21.
- Yang T, Zhao L, Li W, Zomaya AY. Reinforcement learning in sustainable energy and electric systems: A survey. Annu Rev Control. 2020 Jan 1; 49: 145–63.
- Siddiqi UF, Shiraishi Y, Sait SM. Memory-efficient genetic algorithm for path optimization in embedded systems. IPSJ Online Transactions. 2013; 6(6): 28–36.
- Shukla A, Hudemann KN, Hecker A, Schmid S. Runtime verification of P4 switches with reinforcement learning. In Proceedings of the 2019 Workshop on Network Meets AI & ML. 2019 Aug 14; 1–7.
- Maier HR, Razavi S, Kapelan Z, Matott LS, Kasprzyk J, Tolson BA. Introductory overview: Optimization using evolutionary algorithms and other metaheuristics. Environ Model Softw. 2019 Apr 1; 114: 195–213.
- Chang K, et al. Mutation and diversity in genetic algorithms for compiler configurations. IEEE Comput Archit Lett. 2021; 20(3): 123–127.
- Li M, Liu Y, Liu X, Sun Q, You X, Yang H, Luan Z, Gan L, Yang G, Qian D. The deep learning compiler: A comprehensive survey. IEEE Trans Parallel Distrib Syst. 2020 Oct 13; 32(3): 708–27.
- Ashouri AH, Killian W, Cavazos J, Palermo G, Silvano C. A survey on compiler autotuning using machine learning. ACM Comput Surv (CSUR). 2018 Sep 18; 51(5): 1–42.
- Ryu J, Sung H. Metatune: Meta-learning based cost model for fast and efficient auto-tuning frameworks. arXiv preprint arXiv:2102.04199. 2021 Feb 8.
- Ramesh S, Sukanth BN, Jaswanth SS, Sharma V, Belwal M. ThriveJIT: Dynamic Just-In-Time Compilation for Efficient Execution of Arithmetic Expressions. In 2024 IEEE 15th International Conference on Computing Communication and Networking Technologies (ICCCNT). 2024 Jun 24; 1–9.
- Zhang H, Xing M, Wu Y, Zhao C. Compiler Technologies in Deep Learning Co-Design: A Survey. Intelligent Computing. 2023 Jun 19; 2: 0040.
- Ottoni AL, Nepomuceno EG, De Oliveira MS, De Oliveira DC. Tuning of reinforcement learning parameters applied to SOP using the Scott–Knott method. Soft Comput. 2020 Mar; 24(6): 4441–53.
- Guo S, Zhou Q. Machine Learning on Commodity Tiny Devices: Theory and Practice. CRC Press; United States. 2022 Dec 13.
- White DR, Arcuri A, Clark JA. Evolutionary improvement of programs. IEEE Trans Evol Comput. 2011 Jan 17; 15(4): 515–38.
- Silver D, Hubert T, Schrittwieser J, Antonoglou I, Lai M, Guez A, Lanctot M, Sifre L, Kumaran D, Graepel T, Lillicrap T. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815. 2017 Dec 5.
- Goldberg DE, Kuo CH. Genetic algorithms in pipeline optimization. J Comput Civ Eng. 1987 Apr; 1(2): 128–41.

Journal of Artificial Intelligence Research & Advances
| Volume | 12 |
| Issue | 01 |
| Received | 14/11/2024 |
| Accepted | 02/12/2024 |
| Published | 18/12/2024 |
Login
PlumX Metrics