In modern deep learning accelerators, the "memory wall" is a primary bottleneck. Moving data between memory units (like DRAM, Cache, and SRAM) often consumes more energy and time than the actual mathematical computations. To maximize hardware performance, compilers must decide exactly where to store every weight and activation tensor for every layer of a model.
However, the search space for this "memory placement" problem is astronomically large. For a model like BERT, there are roughly $10^{358}$ possible mapping combinations—far exceeding the number of atoms in the observable universe. Traditional methods like dynamic programming cannot scale to this complexity. Standard Reinforcement Learning (RL) also struggles because the "reward" (the final latency of the model) is only available after every single placement decision is made, making the feedback extremely sparse and noisy.
To solve this, researchers have introduced Evolutionary Graph Reinforcement Learning (EGRL), a hybrid optimization framework that automates the mapping of neural network tensors to hardware memory hierarchies.
The EGRL Approach
EGRL tackles the massive search space by integrating three key components:
- Graph Neural Networks (GNNs): Instead of treating a neural network as a simple sequential list of layers, EGRL uses a Graph U-Net to process the model's actual computational topology. This allows the agent to understand the connectivity and data dependencies between operations.
- Hybrid Optimization: EGRL employs Collaborative Evolutionary Reinforcement Learning (CERL). This combines a stable Evolutionary Algorithm (EA), which maintains a population of diverse solutions, with a fast Policy Gradient (PG) learner. They share a common replay buffer, allowing the PG learner to benefit from the EA's broad exploration while helping the EA converge on superior strategies.
- Boltzmann Chromosomes: To handle the massive action space, the authors introduced "stateless" policies called Boltzmann chromosomes. These act as fast, partially optimized "anchors" that guide the evolutionary search, significantly improving sample efficiency.
Unlike many approaches that rely purely on software simulators, EGRL trains and validates directly on the Intel NNP-I (Neural Network Processor for Inference) hardware. It learns to handle invalid mapping constraints by receiving negative rewards for "illegal" moves flagged by the compiler.
Key Results and Performance
The researchers evaluated EGRL on the computational graphs of popular deep learning models, focusing on single-batch inference—a critical metric for real-time industrial applications. The workloads included ResNet-50, ResNet-101, and BERT.
EGRL consistently outperformed the Intel NNP-I native compiler and all other algorithmic baselines, including Greedy Dynamic Programming, pure EA, and pure RL.
Specifically, EGRL achieved the following speedups over the native compiler:
- ResNet-50: 1.28x speedup
- ResNet-101: 1.78x speedup
- BERT: 1.66x speedup
Emergent Strategies and Insights
By visualizing the results, the authors found that EGRL learned sophisticated, domain-invariant strategies. For instance, the agent demonstrated DRAM Avoidance, aggressively moving weight tensors out of the slow, high-capacity DRAM into faster on-chip memory. It also learned Contiguity, mapping neighboring layers to the same memory types to minimize data transfer overhead between operations.
Surprisingly, EGRL also exhibited Zero-Shot Generalization. A GNN policy trained on BERT could be transferred to ResNet-50 without any further training and still outperform the native compiler, suggesting the GNN successfully learned fundamental principles of memory movement.
Limitations and Future Work
While highly effective, training directly on hardware can be slow, and sample complexity remains a challenge for such large search spaces. Currently, the agent only decides memory placement. Future iterations could expand the action space to control other variables simultaneously, such as batch size, power efficiency settings, and data decomposition across multiple cores, further optimizing hardware utilization.
Summary updated