Machine-Learning-Based Compiler-Parameter and Profile Inference
Project
Machine-Learning-Based Compiler-Parameter and Profile Inference
Principal Investigator
Faculty of Mathematics, University of Belgrade
Oracle Fellowship Recipient
Ivan Ristovic, Marjana Solajic, Milan Cugurovic, Nevena Vilotic, Strahinja Stanojevic
Summary
This project aims to address two problems:
1. The GraalVM compiler uses the same parameters for all methods. This leads to: a) lower performance as the compiler misses optimization opportunities in the frequently executed methods and b) unnecessary code duplication in methods that are rarely or never executed.
2. The branch profiles in GraalVM Native Image without PGO are mainly set to the default probability (0.5). The default probabilities cause the compiler to waste the code-duplication budget on parts of the code that are never executed.
These two problems amount to lower peak performance in both Native Image and JIT and result in larger than necessary native images.
This project will parse the Graal IR to produce a set of representative features that can be used for both compiler-parameter and branch-profile inference. Based on the feature set this project will evaluate the success of different ML-models such as support-vector machines, feed-forward deep neural networks, and decision trees in predicting compiler parameters and branch profiles. The best ML model will be used to drive the compiler-parameter and the branch-profile inference.
After implementing the best ML model in GraalVM, the aim of the project is to tune it extensively across a range of benchmarks, and to then merge it into the GraalVM codebase, first as an experimental flag, and ultimately as a default option. As such, the results of this project will become a crucial part of GraalVM, making it more competitive in terms of program-execution performance and image size.
This project thus aims to both push the state-of-the-art of ahead-of-time compilation and to contribute the improvements to the GraalVM codebase.