[Paper Review] Reinforcement Learning and Adaptive Sampling for Optimized DNN Compilation
This paper proposes ReLeASE, a reinforcement learning (RL)-based optimizing compiler for deep neural networks that integrates adaptive sampling via clustering to reduce costly hardware measurements. By formulating DNN compilation as an RL problem and focusing samples on representative subspaces, ReLeASE achieves 4.45× faster optimization time and up to 5.6% better inference performance than AutoTVM, with significant reductions in search steps and measurement overhead.
Achieving faster execution with shorter compilation time can enable further diversity and innovation in neural networks. However, the current paradigm of executing neural networks either relies on hand-optimized libraries, traditional compilation heuristics, or very recently, simulated annealing and genetic algorithms. Our work takes a unique approach by formulating compiler optimizations for neural networks as a reinforcement learning problem, whose solution takes fewer steps to converge. This solution, dubbed ReLeASE, comes with a sampling algorithm that leverages clustering to focus the costly samples (real hardware measurements) on representative points, subsuming an entire subspace. Our adaptive sampling not only reduces the number of samples, but also improves the quality of samples for better exploration in shorter time. As such, experimentation with real hardware shows that reinforcement learning with adaptive sampling provides 4.45x speed up in optimization time over AutoTVM, while also improving inference time of the modern deep networks by 5.6%. Further experiments also confirm that our adaptive sampling can even improve AutoTVM's simulated annealing by 4.00x.
Motivation & Objective
- To reduce the time and cost of optimizing DNN compilation, which currently relies on heuristic or stochastic methods like simulated annealing and genetic algorithms.
- To address the high computational cost of real hardware measurements during search by minimizing the number of required samples.
- To improve search efficiency and solution quality in DNN compiler optimization by leveraging reinforcement learning instead of traditional search strategies.
- To develop a sampling strategy that maintains high representativeness and relevance while reducing the number of measurements through clustering-based subspace focus.
Proposed method
- Formulates DNN compilation as a reinforcement learning (RL) problem, where the agent learns to select optimal compiler parameters (knobs) to maximize performance.
- Introduces an adaptive sampling algorithm that clusters the search space to identify representative subspaces and prioritize hardware measurements on these points.
- Uses clustering to subsume entire subspaces, reducing the number of costly real hardware measurements while preserving exploration quality.
- Employs a reward function based on measured inference time to guide the RL agent toward faster, optimized code.
- Combines RL policy learning with a cost model that avoids redundant measurements by focusing on high-information regions of the search space.
- Implements the framework as ReLeASE, an open-source optimizing compiler compatible with TVM and other DNN frameworks.
Experimental results
Research questions
- RQ1Can reinforcement learning outperform traditional stochastic optimization methods like simulated annealing and genetic algorithms in DNN compiler optimization?
- RQ2Can adaptive sampling based on clustering reduce the number of required hardware measurements without sacrificing solution quality?
- RQ3Does combining RL with adaptive sampling lead to faster convergence and better-optimized code in real-world DNNs?
- RQ4To what extent can adaptive sampling improve existing frameworks like AutoTVM that already use cost models?
Key findings
- ReLeASE reduces optimization time by 4.45× compared to AutoTVM on ResNet-18, with 1.20 hours vs. 9.13 hours.
- The method improves inference performance by up to 5.6% across AlexNet, VGG-16, and ResNet-18, with end-to-end inference times reduced to 0.9673 ms (AlexNet) from 1.0277 ms.
- Adaptive sampling improves AutoTVM’s simulated annealing by 4.00× in optimization time, demonstrating its generalizability.
- The RL-based approach converges in fewer steps than simulated annealing, achieving better or comparable performance with less search effort.
- The adaptive sampling algorithm reduces the number of hardware measurements by focusing on clustered, representative subspaces, improving sample efficiency.
- ReLeASE is publicly available as open-source, enabling integration into existing DNN compilation pipelines.
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.