TL;DR
This paper introduces DOSA, a novel one-loop approach for optimizing both hardware configurations and algorithm mappings for DNN accelerators. By using differentiable performance models and gradient descent, DOSA significantly speeds up design space exploration, achieving better energy-delay products than previous methods.
What Problem Does This Paper Address?
Designing efficient hardware accelerators for Deep Neural Networks (DNNs) is a complex challenge. It involves exploring a vast "design space" that includes both the hardware's architecture (like array sizes and memory configurations) and how the DNN algorithm is mapped onto that hardware (e.g., loop tiling and dataflow). Traditionally, these two aspects have been optimized separately, leading to a "combinatorial explosion" of possibilities and making the overall optimization process extremely slow and computationally expensive. Existing methods often resort to time-consuming simulations or rely on heuristics that might miss optimal solutions.
Methods
DOSA tackles this challenge with a "mapping-first, one-loop" approach. The core innovation lies in creating differentiable analytical models for DNN accelerator performance (latency and energy). This means that instead of relying on slow simulations, the system can use gradient descent – a powerful optimization technique – to directly adjust parameters and find better designs.
Here's a breakdown of the key techniques:
- Differentiable Performance Models: DOSA builds models that predict latency and energy based on hardware parameters and mapping decisions. Crucially, these models are differentiable, allowing gradient descent to guide the optimization.
- Gradient Descent Optimization: The system uses gradient descent to iteratively update mapping parameters (like tiling factors) to minimize the Energy-Delay Product (EDP), a common metric for performance and efficiency.
- Hardware Parameter Inference: As mappings are optimized, DOSA infers the minimal hardware resources required to support those mappings. This avoids a separate, slow hardware search loop.
- Augmented Models: To bridge the gap between analytical models and real hardware performance, DOSA also trains a differentiable DNN model that learns the discrepancies. This "learned" model is then combined with the analytical model for more accurate predictions on actual hardware.
- Iterative Refinement: The process involves initializing with a random hardware configuration and mapping, then iteratively refining the mappings using gradient descent, and re-calculating hardware requirements.
Datasets
The paper evaluates DOSA on the Gemmini accelerator [4], an open-source DNN accelerator. They use both a Timeloop-based architectural model (Gemmini-TL) and a cycle-accurate RTL simulation (Gemmini-RTL) for evaluation. The workloads used include BERT, ResNet-50, U-Net, and RetinaNet. No new datasets were introduced; rather, existing DNN models were used as benchmarks.
Key Insights and Ideas
- One-Loop is Better: By unifying hardware and mapping optimization into a single loop using differentiable models, DOSA dramatically reduces the search complexity and time compared to traditional two-loop approaches.
- Differentiability is Key: Making performance models differentiable unlocks the power of gradient descent for hardware design, enabling faster convergence to optimal solutions.
- Analytical + Learned Models = Power: Combining interpretable analytical models with data-driven DNN models for performance prediction offers the best of both worlds: accuracy and efficiency. This hybrid approach is crucial for bridging the gap between simulation and real hardware.
- Modularity Matters: The modular design of DOSA allows for easy integration of different performance models and even real hardware feedback, making it adaptable to various accelerators and objectives.
Key Results
- Significant EDP Improvement: DOSA outperforms random search by 2.80x and Bayesian optimization by 12.59x in terms of Energy-Delay Product (EDP) improvement on the Gemmini-TL model, using a similar number of samples.
- Real Hardware Gains: When applied to the Gemmini-RTL (real hardware simulation), DOSA achieved a 2.07x improvement in EDP by augmenting its analytical model with a learned DNN model.
- Faster Convergence: DOSA converges at least 40% faster than state-of-the-art DSE approaches.
Limitations and Future Work
- Differentiability of Loop Ordering: The paper notes that loop ordering, a part of the mapping problem, is not directly differentiated. While they use a heuristic to select the best loop ordering, future work could explore ways to make this aspect differentiable or use surrogate models.
- Model Accuracy: While DOSA's analytical model is accurate, it doesn't perfectly capture all real hardware nuances. The paper addresses this by augmenting with a learned DNN model, but further improvements in model accuracy could lead to even better results.
- Generalizability: While DOSA shows promise across different DNN models and on a real accelerator, further validation on a wider range of hardware architectures and workloads would be beneficial.
- Future Work: The authors suggest that this modular approach to building and combining performance models opens avenues for optimizing expensive simulations and bridging the gap between architectural models and real silicon.
Summary updated