Skip to main content
QUICK REVIEW

[Paper Review] HyPar-Flow: Exploiting MPI and Keras for Scalable Hybrid-Parallel DNN Training using TensorFlow

Ammar Ahmad Awan, Arpan Jain|arXiv (Cornell University)|Nov 12, 2019
Advanced Neural Network ApplicationsComputer Science26 references5 citations
TL;DR

HyPar-Flow is a user-transparent, scalable framework that enables hybrid-parallel training of any Keras-based DNN using TensorFlow, MPI, and Eager Execution. It achieves up to 481× speedup over single-node training on 512 Frontera nodes for ResNet-1001 by dynamically orchestrating model/data parallelism with efficient MPI-based communication and pipelining.

ABSTRACT

To reduce training time of large-scale DNNs, scientists have started to explore parallelization strategies like data-parallelism, model-parallelism, and hybrid-parallelism. While data-parallelism has been extensively studied and developed, several problems exist in realizing model-parallelism and hybrid-parallelism efficiently. Four major problems we focus on are: 1) defining a notion of a distributed model across processes, 2) implementing forward/back-propagation across process boundaries that requires explicit communication, 3) obtaining parallel speedup on an inherently sequential task, and 4) achieving scalability without losing out on a model's accuracy. To address these problems, we create HyPar-Flow --- a model-size/-type agnostic, scalable, practical, and user-transparent system for hybrid-parallel training by exploiting MPI, Keras, and TensorFlow. HyPar-Flow provides a single API that can be used to perform data, model, and hybrid parallel training of any Keras model at scale. We create an internal distributed representation of the user-provided Keras model, utilize TF's Eager execution features for distributed forward/back-propagation across processes, exploit pipelining to improve performance and leverage efficient MPI primitives for scalable communication. Between model partitions, we use send and recv to exchange layer-data/partial-errors while allreduce is used to accumulate/average gradients across model replicas. Beyond the design and implementation of HyPar-Flow, we also provide comprehensive correctness and performance results on three state-of-the-art HPC systems including TACC Frontera (#5 on Top500.org). For ResNet-1001, an ultra-deep model, HyPar-Flow provides: 1) Up to 1.6x speedup over Horovod-based data-parallel training, 2) 110x speedup over single-node on 128 Stampede2 nodes, and 3) 481x speedup over single-node on 512 Frontera nodes.

Motivation & Objective

  • Address the challenge of training ultra-deep and large-scale DNNs that exceed GPU memory limits by enabling model-parallel and hybrid-parallel training.
  • Overcome the complexity of implementing distributed forward/backward propagation across multiple processes with explicit communication.
  • Provide a unified, user-transparent API that requires no model definition changes or manual partitioning, enabling seamless switching between data, model, and hybrid parallelism.
  • Achieve high scalability and performance without sacrificing model accuracy, even for models like ResNet-1001 and the experimental 5,000-layer ResNet-5000.
  • Enable training of out-of-core models on HPC systems by abstracting low-level communication and orchestration tasks from users.

Proposed method

  • Expose a single high-level API that accepts a Keras model, number of model partitions, number of replicas, and training strategy (data, model, or hybrid) without requiring model modification.
  • Internally construct a distributed model representation by partitioning the Keras model across processes and replicating partitions across nodes for data parallelism.
  • Leverage TensorFlow’s Eager Execution to enable dynamic, distributed forward and backward passes across process boundaries with explicit communication.
  • Use MPI primitives—send/recv for layer-data and partial-gradient exchange between partitions, and allreduce for gradient aggregation across replicas.
  • Implement pipelining over batch partitions with an optimized pipeline stage size (128) to hide communication latency and improve throughput.
  • Abstract system-level complexity (partitioning, placement, communication) within a Trainer and Communication Engine, ensuring user transparency.

Experimental results

Research questions

  • RQ1Can a unified, user-transparent framework efficiently support hybrid-parallel training of arbitrary Keras models across large-scale HPC systems?
  • RQ2How can model-parallelism be effectively combined with data-parallelism to achieve high scalability without compromising training accuracy?
  • RQ3What is the performance impact of using MPI primitives for inter-partition and inter-replica communication in deep learning training workloads?
  • RQ4To what extent can HyPar-Flow scale training of ultra-deep models like ResNet-1001 and ResNet-5000 beyond the memory limits of single-GPU systems?
  • RQ5How does HyPar-Flow’s hybrid-parallelism compare to traditional data-parallel approaches in terms of speedup and efficiency on modern HPC platforms?

Key findings

  • HyPar-Flow achieved up to 1.6× speedup over Horovod-based data-parallel training for ResNet-1001 on large-scale systems.
  • On 128 Stampede2 nodes, HyPar-Flow delivered 110× speedup over single-node training for ResNet-1001, demonstrating strong weak scaling.
  • On 512 Frontera nodes (28,762 cores), HyPar-Flow achieved 481× speedup over single-node training, highlighting exceptional strong scaling for hybrid-parallel training.
  • Model-parallel training with HyPar-Flow provided up to 3.2× speedup over sequential training and 1.6× over data-parallel training for ResNet-1001.
  • The framework successfully trained the experimental 5,000-layer ResNet-5000 model on just two nodes, demonstrating its ability to handle models that are infeasible on existing systems.
  • Pipelining with 128 stages was found to be optimal, significantly improving performance by overlapping computation and communication.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.