Deep Learning-based Hybrid Graph-Coloring Algorithm for Register Allocation

12/08/2019
by   Dibyendu Das, et al.
0

Register allocation, which is a crucial phase of a good optimizing compiler, relies on graph coloring. Hence, an efficient graph coloring algorithm is of paramount importance. In this work we try to learn a good heuristic for coloring interference graphs that are used in the register allocation phase. We aim to handle moderate sized interference graphs which have 100 nodes or less. For such graphs we can get the optimal allocation of colors to the nodes. Such optimal coloring is then used to train our Deep Learning network which is based on several layers of LSTM that output a color for each node of the graph. However, the current network may allocate the same color to the nodes connected by an edge resulting in an invalid coloring of the interference graph. Since it is difficult to encode constraints in an LSTM to avoid invalid coloring, we augment our deep learning network with a color correction phase that runs after the colors have been allocated by the network. Thus, our algorithm is hybrid in nature consisting of a mix of a deep learning algorithm followed by a more traditional correction phase. We have trained our network using several thousand random graphs of varying sparsity. On application of our hybrid algorithm to various popular graphs found in literature we see that our algorithm does very well when compared to the optimal coloring of these graphs. We have also run our algorithm against LLVMs popular greedy register allocator for several SPEC CPU 2017 benchmarks and notice that the hybrid algorithm performs on par or better than such a well-tuned allocator for most of these benchmarks.

READ FULL TEXT

page 6

page 9

research
01/05/2013

Graph 3-coloring with a hybrid self-adaptive evolutionary algorithm

This paper proposes a hybrid self-adaptive evolutionary algorithm for gr...
research
11/11/2020

Efficient global register allocation

In a compiler, an essential component is the register allocator. Two mai...
research
08/14/2019

Equitable tree-O(d)-coloring of d-degenerate graphs

An equitable tree-k-coloring of a graph is a vertex coloring on k colors...
research
11/17/2021

Evolutionary Algorithm for Graph Coloring Problem

The graph coloring problem (GCP) is one of the most studied NP-HARD prob...
research
06/24/2019

Hierarchical Colorings of Cographs

Cographs are exactly hereditarily well-colored graphs, i.e., the graphs ...
research
08/15/2022

Rethinking Graph Neural Networks for the Graph Coloring Problem

Graph coloring, a classical and critical NP-hard problem, is the problem...
research
08/06/2019

An Index for Sequencing Reads Based on The Colored de Bruijn Graph

In this article, we show how to transform a colored de Bruijn graph (dBG...

Please sign up or login with your details

Forgot password? Click here to reset