Auto-MAP: A DQN Framework for Exploring Distributed Execution Plans for DNN Workloads

Siyu Wang, Yi Rong, Shiqing Fan, Zhen Zheng, Lansong Diao, Guoping Long, Jun Yang, Xiaoyong Liu, Wei Lin · DOI

Abstract

The last decade has witnessed growth in the computational requirements for training deep neural networks. Current approaches (e.g., data/model parallelism, pipeline parallelism) parallelize training tasks onto multiple devices. However, these approaches always rely on specific deep learning frameworks and require elaborate manual design, which makes it difficult to maintain and share between different types of models. In this paper, we propose Auto-MAP, a framework for exploring distributed execution plans for DNN workloads, which can automatically discover fast parallelization strategies through reinforcement learning on the intermediate representation (IR) level of deep learning models. Efficient exploration remains a major challenge for reinforcement learning. We leverage DQN with task-specific pruning strategies to help efficiently explore the search space, including optimized strategies. Our evaluation shows that Auto-MAP can find the optimal solution in two hours while achieving better throughput on several NLP and convolution models.

Introduction

As deep learning models scale to billions of parameters—exemplified by architectures like BERT and the T5 family—they quickly exceed the memory capacity of individual hardware accelerators. To train these massive models, engineers must distribute the workload across multiple GPUs or TPUs. Traditionally, this involves three primary strategies: Data Parallelism (DP), Model Parallelism (MP), and Pipeline Parallelism (PP).

Common parallelization strategies for deep learning workloads, including data, pipeline, and model parallelism.

Despite the availability of these techniques, determining the optimal combination for a specific model and hardware topology remains a "black art." It typically requires significant manual effort, framework-specific modifications, and deep expertise in both the model architecture and the underlying hardware interconnects (e.g., NVLink, PCIe). Existing automated solutions often suffer from limited scope—supporting only one type of parallelism—or operate at a coarse, layer-by-layer granularity that misses fine-grained optimization opportunities. Auto-MAP addresses these challenges by providing a unified, framework-agnostic framework that automatically explores the massive search space of parallelization strategies.

Methodology: The Auto-MAP Framework

Auto-MAP is built upon two core innovations: operating at the Intermediate Representation (IR) level and utilizing an optimized reinforcement learning agent.

HLO IR Integration

Unlike tools that analyze high-level Python code or coarse operator graphs, Auto-MAP operates on the High-Level Optimizer Intermediate Representation (HLO IR) generated by the XLA compiler. This approach offers two distinct advantages. First, it is "code-intrusion free," meaning users do not need to modify their original model code. Second, HLO IR provides a granular view of data flow between low-level instructions, enabling the discovery of optimizations that are invisible at the higher layers.

The Auto-MAP system architecture, showing the transition from user input to HLO IR and the subsequent exploration of parallelization strategies.

Optimized DQN with Pruning

To navigate the astronomical search space (e.g., $2^{1116}$ for a T5-11B model), Auto-MAP employs a Rainbow Deep Q-Network (DQN). To make this exploration feasible, the researchers introduced Linkage Groups. These groups identify variables and operations that must be partitioned identically due to mathematical constraints, effectively pruning the search tree and making RL training computationally viable.

The framework explores three specific domains through its "Plans Explorer":

  1. Auto Data Parallelism (ADP): Focuses on minimizing communication overhead during gradient synchronization.
  2. Operation Partitioning Parallelism (OPP): Aims to maximize device utilization by splitting individual operators across devices.
  3. Pipeline Parallelism (PP): Partitions the model into sequential stages to minimize "pipeline bubbles" and cross-stage communication. For PP, the DQN is trained on thousands of synthetic model graphs, allowing it to learn general "physics" of pipelining that generalize to real-world models without retraining.

Experimental Evaluation

The researchers evaluated Auto-MAP using a suite of large-scale models, including BERT-48 (640M parameters), various T5 configurations (up to 11B parameters), and VGG-19 (137M parameters). These were tested on simulated clusters of 2 to 4 servers, each containing 8 NVIDIA V100 GPUs connected via NVLink.

Key Results

  • Search Efficiency: Auto-MAP demonstrated remarkable speed, finding optimal strategies for the 11-billion-parameter T5 model in under two hours. Smaller models like T5-base were optimized in just 30 minutes.
  • Expert-Level Performance: The strategies discovered by the DQN matched or outperformed manual designs by human experts. For instance, in VGG-19, Auto-MAP correctly identified that partitioning the final two fully connected layers (which account for 86% of the parameters) was the optimal move to reduce synchronization overhead.
  • Scalability: The framework successfully enabled the training of the T5-11B model on standard 4-server clusters, avoiding "Out of Memory" (OOM) errors by discovering efficient pipeline cuts that human designers might overlook.

Conclusion and Future Work

Auto-MAP represents a significant step toward automating the complex task of distributed DNN training. By operating at the HLO IR level and leveraging RL with intelligent pruning, it provides a framework-agnostic solution that matches expert performance. Future work will focus on moving from discrete to continuous state representations for faster convergence on even larger graphs and developing a "fully hybrid" search that explores all parallelism strategies simultaneously in a single pass.

Summary updated

BibTeX
@misc{wang2020auto,
  author = {Siyu Wang and Yi Rong and Shiqing Fan and Zhen Zheng and Lansong Diao and Guoping Long and Jun Yang and Xiaoyong Liu and Wei Lin},
  title = {{Auto-MAP: A DQN Framework for Exploring Distributed Execution Plans for DNN Workloads}},
  year = {2020},
  eprint = {2007.04069},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.04069},
}
Figure