Introduction
Modern multi-core systems rely on Non-Uniform Memory Access (NUMA) architectures, where memory access latency depends on the physical distance between the processor and the memory bank. Optimizing performance in these environments requires fine-tuning complex parameters, including thread placement, page mapping, and hardware prefetchers. Traditionally, this optimization relies on expensive dynamic profiling, which is time-consuming and lacks portability across different CPU generations. This paper proposes a novel approach using Graph Neural Networks (GNNs) and static code analysis to predict optimal hardware configurations without the overhead of runtime profiling.
Methodology
The core of the proposed system is a pipeline that transforms source code into a structural graph representation, enabling a GNN to learn the relationship between code patterns and hardware performance.
Data Augmentation and Representation
To overcome the scarcity of high-performance computing (HPC) benchmarks, the authors employed data augmentation by compiling 57 parallel regions from suites like Rodinia and NAS with 1,000 different LLVM compiler flag sequences. This process created a diverse dataset of Intermediate Representations (IR). These IRs were then converted into graphs using ProGraML, capturing data flow, control flow, and function calls.
Model Architecture
The researchers utilized a Relational Graph Convolutional Network (RGCN) to process these program graphs. Unlike token-based models, the RGCN focuses on the structural logic of the code. Additionally, a hybrid model was developed featuring a "gatekeeper" classifier that determines whether a program can be optimized statically or requires a brief dynamic profile for higher confidence.
Results and Insights
The study demonstrates that static analysis can effectively capture the structural semantics necessary for hardware optimization. A key finding is the model's performance portability; a model trained on Intel Sandy Bridge architecture provided significant speedups when applied to the newer Skylake architecture, indicating it learns fundamental code-memory relationships.
As shown in the results, the purely static model achieved approximately 80% of the performance gains of state-of-the-art dynamic methods. The hybrid model matched full dynamic performance while reducing the profiling requirement by 70%, only resorting to dynamic execution for complex, "uncertain" code regions.
Conclusion and Future Work
By treating code as a graph and leveraging compiler transformations for data augmentation, this research provides a scalable path toward automated hardware tuning. While the current model is limited by its inability to see runtime input sizes and its focus on OpenMP regions, it significantly reduces the cost of optimization. Future work may involve multi-modal models that more tightly integrate static and dynamic features to further bridge the performance gap.
Summary updated