TL;DR
This paper introduces DCOC, a novel compiler that uses multi-agent reinforcement learning (MARL) to simultaneously optimize both hardware and software configurations for Deep Neural Networks (DNNs). By treating hardware and software co-optimization as a cooperative game, DCOC significantly boosts DNN performance and reduces compilation time compared to existing methods.
What Problem Does This Paper Address?
Deep Neural Networks (DNNs) are becoming increasingly complex and are deployed across a wide range of applications, from autonomous driving to medical imaging. Optimizing these DNNs for efficient execution on diverse hardware platforms is crucial for achieving high performance and low latency. Traditional approaches rely on hand-optimized libraries or separate hardware and software optimization stages, which often fail to capture the intricate interplay between them. Existing automated tools, while improving, still struggle with the vast search space of possible configurations and can incur substantial compilation times. This paper addresses the challenge of efficiently and holistically co-optimizing DNNs for both hardware and software aspects to maximize performance.
Methods
The core innovation of DCOC lies in its use of a Multi-Agent Reinforcement Learning (MARL) framework for co-optimization. Specifically, it employs a Centralized Training with Decentralized Execution (CTDE) strategy, similar to Multi-Agent PPO (MAPPO).
Here's a breakdown of the key components:
- Three Specialized Agents: DCOC utilizes three distinct agents, each with a policy network:
- Scheduling Agent: Focuses on software-level task parallelization and distribution.
- Mapping Agent: Optimizes how data dimensions (like tensor height and width) are processed for computation.
- Hardware Agent: Adjusts parameters related to tensor component division (batches, channels) to optimize hardware utilization.
- Centralized Critic: A single value network (critic) provides global state feedback to all agents during training, enabling them to learn coordinated strategies.
- Design Space Exploration: The agents navigate a design space defined by various "knobs" (parameters) for both hardware and software.
- Cost Model: Instead of relying solely on expensive hardware measurements, DCOC uses a cost model (inverse of execution time) as a surrogate for performance feedback.
- Confidence Sampling (CS): A novel sampling method that prioritizes configurations with a higher probability of success. It uses a dynamic threshold to filter out low-confidence configurations and synthesizes new ones from high-confidence candidates, significantly reducing the search space and the number of required hardware evaluations.
Datasets
The paper does not explicitly mention specific datasets used for training or evaluation. Instead, it evaluates DCOC on a suite of established deep-learning models, including:
- AlexNet
- VGG-11, VGG-13, VGG-16, VGG-19
- ResNet-18, ResNet-34
These models are benchmarked on the VTA++ simulator, which is presented as a representative hardware platform comparable to GPUs and FPGAs.
Key Insights and Ideas
- Hardware-Software Co-optimization is Key: The paper strongly emphasizes that optimizing hardware and software independently is suboptimal. Their MARL approach effectively captures the interdependencies, leading to superior performance.
- MARL for Complex Search Spaces: The inherent complexity and high dimensionality of DNN optimization problems make MARL a natural fit. The cooperative nature of the agents allows for a more holistic exploration of the design space.
- Confidence Sampling Reduces Overhead: The novel Confidence Sampling method is a significant contribution, demonstrating that intelligently selecting configurations based on learned confidence levels can drastically reduce the number of costly hardware evaluations needed for optimization.
- Generalizability of VTA++: The use of the VTA++ simulator and the claim that its architecture is representative of other hardware platforms suggest that DCOC's findings could be broadly applicable.
Key Results
DCOC demonstrates significant improvements over existing frameworks like AutoTVM and CHAMELEON:
- Throughput Improvement: On average, DCOC achieves a 1.17x improvement in throughput (reduction in mean inference time) across various DNN models.
- Compilation Time Reduction: DCOC speeds up the optimization (compilation) time by up to 42.2% compared to AutoTVM.
- Efficient Convergence: Figure 6 shows that DCOC converges to high GFLOPS values with fewer hardware measurements and at a faster rate than other methods.
Limitations and Future Work
- Hardware Specificity: While VTA++ is presented as a generalizable platform, the paper could explore DCOC's performance on a wider range of actual hardware.
- Model Complexity: The evaluation focuses on specific DNN models. Future work could investigate DCOC's effectiveness on even larger and more complex modern architectures.
- Agent Specialization: While the current agent specialization is effective, exploring different agent roles or more dynamic agent allocation could be a future direction.
- Constraint Handling: The paper mentions incorporating hardware and software constraints via penalty terms. Further research could explore more sophisticated methods for handling complex constraints.
Summary updated