AutoSync: Learning to Synchronize for Data-Parallel Distributed Deep Learning

Hao Zhang, Yuan Li, Zhijie Deng, Xiaodan Liang, Lawrence Carin, Eric P. Xing

Overview

AutoSync is an end-to-end framework designed to automatically optimize synchronization strategies for distributed deep learning. By combining analytical communication modeling with machine learning, AutoSync discovers custom synchronization patterns that outperform hand-tuned baselines—such as Horovod or Parameter Servers—by up to 1.6x, often requiring as few as 200 trial runs to find the optimal configuration.

The Synchronization Bottleneck

Training massive deep learning models requires distributing the computational workload across many GPUs and nodes, a paradigm known as data parallelism. A critical bottleneck in this process is synchronization: the method by which gradients are collected, aggregated, and redistributed across the network.

Currently, researchers typically default to a "one-size-fits-all" system. They either use a Parameter Server (PS) architecture or a Collective Communication (CC) approach like All-reduce. However, the optimal strategy depends heavily on the specific model architecture (e.g., sparse vs. dense layers) and the cluster's hardware characteristics (bandwidth, latency, topology). Manually tuning these factors—deciding how to partition variables, where to place them, and which communication primitives to use—is a complex "black art" that requires deep systems expertise and is prohibitively expensive to optimize by trial and error.

Methods: A Hybrid Optimization Approach

AutoSync treats synchronization strategy selection as a formal optimization problem. Its core components include:

  1. A Unified Search Space: The framework decomposes synchronization into four orthogonal factors:
  2. Variable Partitioning: Determining how to shard large tensors.
  3. Variable Placement: Assigning which device (CPU or GPU) handles which shard.
  4. Synchronization Architecture: Choosing between PS and CC primitives.
  5. Message Encoding: Utilizing compression or low-rank approximations.
  6. Domain Adaptive Simulator: To avoid running thousands of expensive experiments on a real cluster, AutoSync employs a hybrid simulator. It begins with Predefined Modeling (analytical formulas for network transfer and overhead) and refines this with Domain-specific Modeling (using RNNs or Graph Attention Networks) that learns from a small number of real-world trials.
AutoSync Framework Architecture
  1. Knowledge-Guided Search: Instead of conducting a blind search, AutoSync leverages system design principles—such as load balancing and adjacent merging constraints—to prune the search space, focusing computational effort only on promising regions.
  2. Transfer Learning: The framework can transfer a trained simulator from a "cheap" source (e.g., a small model or a small cluster) to a "costly" target (e.g., BERT-large on a massive AWS cluster), drastically reducing the optimization overhead.

Experimental Setup and Datasets

To evaluate the framework, the authors introduced a new dataset containing nearly 10,000 (strategy, runtime) pairs collected across 11 different models and 14 cluster specifications.

  • Models evaluated: NCF (Neural Collaborative Filtering), VGG16, ResNet, and various BERT/Transformer models.
  • Hardware: Two distinct clusters were used: an in-house cluster with Titan X GPUs and 40GbE networking, and an AWS cluster (g4dn.12xlarge) with T4 GPUs and 50GbE networking.

Key Insights

  • The Hybrid Advantage: Purely analytical models are often too simplistic to capture real-world noise, while pure ML models require too much data. By using analytical models to generate "domain-agnostic features" for an ML model, AutoSync achieves high accuracy with "low-shot" data (only ~200 trials).
  • Non-Obvious Strategies: AutoSync frequently discovers "hybrid" strategies that human engineers might overlook. For example, it might use different synchronization methods for different layers within the exact same model to perfectly balance the communication load.
  • Structural Transferability: Simulators trained on smaller versions of a model (like BERT-3L) transfer remarkably well to larger versions (BERT-base/large) because they share similar variable size distributions and communication patterns.

Key Results

AutoSync demonstrated significant improvements across multiple dimensions:

  • Speedups: AutoSync discovered strategies that were 1.2x to 1.6x faster than heavily optimized baselines like Horovod and manual Parameter Server setups.
  • Cost Savings: On AWS, using AutoSync for BERT-large reduced training time enough to save approximately $2,200 in AWS credits per training job.
  • Efficiency: When utilizing transfer learning, the system can find a strategy better than the baseline in as few as 30–50 trials.
  • Model Performance: The RNN-based simulator generally outperformed the GAT-based one, suggesting that the sequential order of operations in a model is a stronger signal for synchronization than the raw graph structure.
Performance Improvement vs. Number of Trials

Limitations and Future Work

While highly effective, AutoSync has a few limitations:

  • Synchronous Focus: The current work focuses strictly on synchronous data-parallel training. It does not explore asynchronous training or the effects of "staleness" on model convergence.
  • Data-Parallel Only: The framework is designed exclusively for data parallelism. It does not yet address model parallelism or pipeline parallelism, which are increasingly necessary for models that are too large to fit on a single GPU.
  • Search Budget: While 200 trials is considered "low-shot" compared to typical AutoML, it still represents a non-trivial cost for very large models, though the authors' transfer learning results suggest this can be effectively mitigated.

Summary updated

BibTeX
@inproceedings{zhang2020autosync,
  author = {Hao Zhang and Yuan Li and Zhijie Deng and Xiaodan Liang and Lawrence Carin and Eric P. Xing},
  title = {{AutoSync: Learning to Synchronize for Data-Parallel Distributed Deep Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure