GRANITE: A Graph Neural Network Model for Basic Block Throughput Estimation

Ondrej Sykora, Phitchaya Mangpo Phothilimthana, Charith Mendis, Amir Yazdanbakhsh
10/8/2022
cs.LGcs.ARcs.PF
gnn

Official code: google/gematria (95 stars, Python, Apache-2.0, last commit 2026-02-13).

Abstract

Analytical hardware performance models yield swift estimation of desired hardware performance metrics. However, developing these analytical models for modern processors with sophisticated microarchitectures is an extremely laborious task and requires a firm understanding of target microarchitecture's internal structure.

Show full abstract

In this paper, we introduce GRANITE, a new machine learning model that estimates the throughput of basic blocks across different microarchitectures. GRANITE uses a graph representation of basic blocks that captures both structural and data dependencies between instructions. This representation is processed using a graph neural network that takes advantage of the relational information captured in the graph and learns a rich neural representation of the basic block that allows more precise throughput estimation. Our results establish a new state-of-the-art for basic block performance estimation with an average test error of 6.9% across a wide range of basic blocks and microarchitectures for the x86-64 target. Compared to recent work, this reduced the error by 1.7% while improving training and inference throughput by approximately 3.0x. In addition, we propose the use of multi-task learning with independent multi-layer feed forward decoder networks. Our results show that this technique further improves precision of all learned models while significantly reducing per-microarchitecture training costs. We perform an extensive set of ablation studies and comparisons with prior work, concluding a set of methods to achieve high accuracy for basic block performance estimation.

View on arXivView PDF

Code Implementations(1)

google/gematriaOfficial100%
Apache-2.0

Machine learning for machine code.

9519Python, C++Oct 3, 20229 months agoApache-2.0
compilermachine-codemachine-learningperformance-analysis

Similar Papers

Cite this paper

@article{sykora2022granite,
  title  = {GRANITE: A Graph Neural Network Model for Basic Block Throughput Estimation},
  author = {Ondrej Sykora and Phitchaya Mangpo Phothilimthana and Charith Mendis and Amir Yazdanbakhsh},
  year   = {2022},
  eprint = {2210.03894},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.03894}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.03894.svg)](https://codeofpaper.com/paper/2210.03894)

Discussion