Introduction
Deploying modern Deep Neural Networks (DNNs) on specialized hardware is a significant challenge due to the rapidly evolving nature of AI architectures. Traditional hand-optimized libraries often fail to keep pace with new models. While automated compilers like TVM and AutoTVM optimize software parameters (e.g., tiling and threading) for fixed hardware, the most substantial performance gains are found in Hardware/Software Co-Optimization. This approach tunes the accelerator's architecture alongside the software mapping. However, the resulting search space is astronomical—often exceeding $O(2^{12})$ configurations—making traditional search methods computationally prohibitive.
The DCOC Framework
To address this, the authors propose the Dynamic Co-Optimization Compiler (DCOC). DCOC leverages Multi-Agent Reinforcement Learning (MARL) to navigate the complex design space efficiently. The framework breaks the optimization problem into a collaborative game played by specialized agents, integrated into a feedback-driven pipeline.
Multi-Agent Reinforcement Learning (MARL)
DCOC employs three specialized agents, each managing a distinct part of the optimization space:
- Hardware Agent: Adjusts physical parameters such as batch size and channel divisions to maximize resource utilization.
- Mapping Agent: Determines how data dimensions (height and width) are partitioned across hardware resources.
- Scheduling Agent: Manages task parallelization and threading strategies.
The agents utilize Centralized Training with Decentralized Execution (CTDE). They learn via a shared "critic" network that provides a global performance view, while maintaining decentralized decision-making during the optimization process.
Confidence Sampling (CS)
A key innovation in DCOC is Confidence Sampling. Rather than relying on uniform random sampling, DCOC uses its learned value network to identify high-confidence regions of the search space. It synthesizes promising new configurations based on patterns from successful trials, significantly reducing the number of expensive hardware measurements required for convergence.
Experimental Evaluation
The framework was evaluated using the TVM compiler and the VTA++ hardware simulator. Benchmarks included a variety of standard DNN models such as AlexNet, VGG (11, 13, 16, 19), and ResNet (18, 34). DCOC was compared against industry-standard AutoTVM and the RL-based adaptive compiler CHAMELEON.
Key Results
Experimental data demonstrates that DCOC consistently outperforms existing state-of-the-art frameworks in both throughput and optimization efficiency:
- Throughput Gains: DCOC achieved an average 1.17x improvement in throughput across all tested models compared to AutoTVM.
- Optimization Speed: For ResNet-34, DCOC reduced total compilation and optimization time by 42.2%.
- Inference Performance: For ResNet-18, mean inference time was reduced from 1.73s (AutoTVM) to 1.25s (DCOC).
Discussion and Future Work
DCOC demonstrates that assigning specific roles to agents makes massive search spaces manageable. The "learned intuition" provided by Confidence Sampling avoids wasting resources on poor hardware/software combinations. While the current focus is on the VTA++ platform, the authors suggest the MARL approach is generalizable to other architectures like GPUs and FPGAs. Future work includes scaling the framework to massive Transformer-based models and further reducing the computational overhead of training the policy networks themselves.
Summary updated