EasyScale: Accuracy-consistent Elastic Training for Deep Learning

Mingzhen Li, Wencong Xiao, Biao Sun, Hanyu Zhao, Hailong Yang, Shiru Ren, Zhongzhi Luan, Xianyan Jia, Yi Liu, Yong Li, Depei Qian, Wei LinarXiv 2022

Abstract

Distributed synchronized GPU training is commonly used for deep learning. The resource constraint of using a fixed number of GPUs makes large-scale training jobs suffer from long queuing time for resource allocation, and lowers the cluster utilization. Adapting to resource elasticity can alleviate this but often introduces inconsistent model accuracy, due to lacking of capability to decouple model training procedure from resource allocation. We propose EasyScale, an elastic training system that achieves consistent model accuracy under resource elasticity for both homogeneous and heterogeneous GPUs. EasyScale preserves the data-parallel training behaviors strictly, traces the consistency-relevant factors carefully, utilizes the deep learning characteristics for EasyScaleThread abstraction and fast context-switching. To utilize heterogeneous cluster, EasyScale dynamically assigns workers based on the intra-/inter-job schedulers, minimizing load imbalance and maximizing aggregated job throughput. Deployed in an online serving cluster, EasyScale powers the training jobs to utilize idle GPUs opportunistically, improving overall cluster utilization by 62.1%.

Introduction

In large-scale clusters, deep learning (DL) training is traditionally "rigid," requiring a fixed number of GPUs throughout the job's duration (gang-scheduling). This leads to significant inefficiencies: jobs wait in long queues for specific resource counts, and idle GPUs cannot be easily repurposed. While existing elastic frameworks like TorchElastic and Pollux allow scaling, they often sacrifice accuracy consistency. By changing hyperparameters like global batch size or learning rates to match new resource counts, they introduce non-determinism, making results difficult to reproduce.

Accuracy inconsistency in existing elastic frameworks (TorchElastic and Pollux) as GPU counts vary.

EasyScale addresses this by ensuring model accuracy remains consistent even as the number and type of GPUs fluctuate. It decouples logical training workers from physical hardware, allowing clusters to scale jobs dynamically and improve utilization without compromising the mathematical integrity of the training process.

The EasyScale Framework

The core of EasyScale is the EasyScaleThread (EST) abstraction. Instead of tying one training process to one physical GPU, EasyScale treats distributed training as a set of logical tasks.

EasyScale architecture showing the EST abstraction and resource reconfiguration.

Logical-Physical Decoupling

If a job is configured for 8 workers but only has 2 GPUs available, EasyScale runs 4 ESTs per GPU using time-slicing. This ensures the logical training behavior—such as batch size per worker and gradient aggregation—remains identical to the intended 8-GPU setup. This decoupling is the fundamental insight of the paper: the logical degree of parallelism should be independent of the physical degree of parallelism.

Lightweight Context Switching

To manage multiple ESTs on a single GPU without Out-of-Memory (OOM) errors, EasyScale performs context switching at mini-batch boundaries. It reuses model parameters and optimizer states across ESTs on the same GPU, only swapping unique data like gradients to the CPU. This mechanism is highly efficient, typically adding less than 2% overhead to training time.

Ensuring Determinism

EasyScale manages non-determinism at three levels:

  • Static (D0): Fixing random seeds across the software stack.
  • Elastic (D1): Ensuring the "gradient-to-bucket" mapping for communication is restored exactly after scaling, preventing floating-point summation shifts that can cause model divergence.
  • Heterogeneous (D2): Using hardware-agnostic operator implementations to ensure bitwise identical results across different GPU architectures (e.g., V100 vs. P100).

Evaluation and Results

EasyScale was evaluated using eight state-of-the-art models across Computer Vision (ResNet50, SwinTransformer, YOLOv3), Natural Language Processing (BERT, Electra), and Recommendation (NeuMF) domains.

Key Performance Metrics

  • Bitwise Consistency: EasyScale achieved bitwise identical loss curves compared to standard PyTorch Distributed Data Parallel (DDP) training, even under heavy resource scaling.
  • Cluster Efficiency: Deployed in a production cluster of over 3,000 GPUs, EasyScale improved overall cluster utilization by 62.1% and the GPU allocation ratio by 17.1%.
  • Job Completion Time: In trace-driven experiments, it reduced average Job Completion Time (JCT) by 13.2× and improved the makespan by 2.8× compared to traditional gang-scheduling.

Insights

A critical finding was that communication order matters; simply restarting a job on different hardware can change the order of gradient aggregation, causing model divergence over thousands of iterations. Furthermore, by making training elastic and accuracy-consistent, DL jobs can act as "filler" tasks, expanding to use idle GPUs from online serving clusters during low-traffic periods and shrinking instantly when traffic spikes.

Conclusion and Future Work

EasyScale demonstrates that decoupling logical parallelism from physical resources is essential for efficient, accurate elastic training. While it provides strong consistency, achieving this across heterogeneous hardware (D2 level) can introduce performance overhead by disabling certain vendor-optimized kernels. Future work will focus on extending these consistency guarantees to model-parallel and pipeline-parallel strategies for "Giant Models" and expanding the library of deterministic, hardware-agnostic operators.

Summary updated

BibTeX
@misc{li2022easyscale,
  author = {Mingzhen Li and Wencong Xiao and Biao Sun and Hanyu Zhao and Hailong Yang and Shiru Ren and Zhongzhi Luan and Xianyan Jia and Yi Liu and Yong Li and Depei Qian and Wei Lin},
  title = {{EasyScale: Accuracy-consistent Elastic Training for Deep Learning}},
  year = {2022},
  eprint = {2208.14228},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.14228},
}
Figure