Improving Vectorization Heuristics in a Dynamic Compiler with Machine Learning Models
Optimizing compilers rely on many hand-crafted heuristics to guide the optimization process. However, the interactions between different optimizations makes their design a difficult task. We propose using machine learning models to either replace such heuristics or to support their development process, for example, by identifying important code features. Especially in static compilation, machine learning has been shown to outperform hand-crafted heuristics. We applied our approach in a state-of-the-art dynamic compiler, the GraalVM compiler. Our models predict an unroll factor for vectorized loops for which the GraalVM compiler developers have not been able to design satisfactory heuristics. Thereby, we identified features to describe vectorized loops and empirically evaluated the impact of different training data, features or model parameters on the accuracy of the learned models. When deployed in the GraalVM dynamic compiler, our models produce significant speedups of 8-11%, on average. Furthermore, large speedups unveiled a performance bug in the compiler which was fixed after our report. Our work shows that machine learning can be used to improve a dynamic compiler directly by replacing existing vectorization heuristics or indirectly by helping compiler developers to design better hand-crafted heuristics.
Mon 5 DecDisplayed time zone: Auckland, Wellington change
13:30 - 15:00 | |||
13:30 60mKeynote | Virgil as a Systems Programming Language VMIL Ben L. Titzer Carnegie Mellon University | ||
14:30 30mTalk | Improving Vectorization Heuristics in a Dynamic Compiler with Machine Learning Models VMIL Raphael Mosaner JKU Linz, Gergö Barany Oracle Labs, David Leopoldseder Oracle Labs, Hanspeter Mössenböck JKU Linz DOI |