[Paper Review] Reinforced Genetic Algorithm Learning for Optimizing Computation Graphs
This paper proposes REGAL, a reinforcement learning-enhanced genetic algorithm that trains a graph neural network to guide a Biased Random-Key Genetic Algorithm (BRKGA) in optimizing neural network computation graphs for minimal running time and peak memory usage. By learning input-specific proposal distributions for BRKGA, REGAL achieves high-quality solutions in seconds on unseen real-world TensorFlow graphs, outperforming classical and learning-based baselines without retraining.
We present a deep reinforcement learning approach to minimizing the execution cost of neural network computation graphs in an optimizing compiler. Unlike earlier learning-based works that require training the optimizer on the same graph to be optimized, we propose a learning approach that trains an optimizer offline and then generalizes to previously unseen graphs without further training. This allows our approach to produce high-quality execution decisions on real-world TensorFlow graphs in seconds instead of hours. We consider two optimization tasks for computation graphs: minimizing running time and peak memory usage. In comparison to an extensive set of baselines, our approach achieves significant improvements over classical and other learning-based methods on these two tasks.
Motivation & Objective
- To develop a fast, generalizable optimizer for neural network computation graphs that works across diverse real-world models without retraining.
- To jointly optimize placement and scheduling decisions in static compilers to minimize execution cost (running time or peak memory).
- To overcome the limitations of prior learning-based optimizers that require hours of training per graph or lack generalization to unseen architectures.
- To enable production deployment of optimizing compilers by achieving high solution quality within seconds on large graphs.
Proposed method
- A graph neural network (GNN) is trained via a contextual bandit setup with REINFORCE to predict non-uniform beta distribution parameters for each node in BRKGA’s mutant generation step.
- The BRKGA algorithm uses these learned, input-dependent proposal distributions instead of uniform defaults to guide search toward higher-quality solutions.
- The GNN processes the computation graph’s structure, node features (e.g., op type, tensor size), and edge dependencies to produce node-specific action probabilities for placement and scheduling.
- The policy is trained using the objective value (e.g., running time or memory) as a sparse reward signal, with no explicit supervision.
- A coarse static cost model estimates execution cost for candidate solutions during BRKGA evaluation, enabling fast feedback during training.
- The approach generalizes across diverse graph topologies, including real-world TensorFlow models, by learning transferable decision patterns.
Experimental results
Research questions
- RQ1Can a learned policy guide a genetic algorithm to find better solutions on unseen computation graphs without retraining?
- RQ2Does GNN-based policy learning improve solution quality for joint placement and scheduling optimization in static compilers?
- RQ3Can the approach achieve high-quality results in seconds rather than hours, enabling real-time use in production compilers?
- RQ4How does the model generalize across diverse neural network architectures and workloads?
Key findings
- REGAL achieves significant improvements over classical and learning-based baselines in minimizing both running time and peak memory usage on real-world TensorFlow graphs.
- The method produces high-quality solutions in seconds, compared to hours required by prior learning-based approaches like Mirhoseini et al. (2017, 2018).
- The GNN policy generalizes effectively to unseen graph topologies, including those generated via data augmentation, with low variance in performance across different architectures.
- The policy learns non-trivial, data-dependent strategies—e.g., assigning lower scheduling priority to high-memory nodes and avoiding device bias for heavy nodes—beyond simple heuristics.
- On the TF Runtime test set, REGAL outperforms BRKGA baseline in 95% of cases, with rewards greater than -1 indicating better solutions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.