Profile Inference with Graph Neural Networks
Huiri Tan, Juyong Jiang, Jiasi Shen
The landscape of compiler optimization has evolved significantly with the advent of profile-guided optimization (PGO), a technique that leverages program runtime information to generate highly optimized binaries. While instrumentation-based profiling method provides accurate profile data, it often suffers from heavy runtime overhead.  A more efficient alternative is sampling-based profiling, which offers a rapid and scalable method for collecting profile data while incurring minimal runtime overhead and avoiding intrusive source code modifications. However, accurately collecting execution profiles via sampling remains challenging, especially when applied to fully optimized binaries. Such inaccurate profile data can diminish the potential benefits of PGO. This paper addresses the problem of profile inference, aiming to correct inaccuracies in the profiles collected by sampling. Our contributions include a novel Graph Neural Network (GNN)-based model to enhance profile accuracy. Extensive experiments on the SPEC 2017 benchmarks demonstrate that our GNN-based model achieves up to a 9.15\% performance improvement compared to the state-of-the-art traditional algorithm and an average 6.87\% improvement over the baseline machine learning models, showcasing the effectiveness of our approach in optimizing real-world application profiles.