Skip to main content
QUICK REVIEW

[Paper Review] An MPI-Based Python Framework for Distributed Training with Keras

Dustin Anderson, Jean-Roch Vlimant|arXiv (Cornell University)|Dec 16, 2017
Computational Physics and Python ApplicationsComputer Science9 references16 citations
TL;DR

This paper presents mpi_learn, a lightweight MPI-based Python framework that enables distributed training of Keras models across multiple GPUs or CPUs using Downpour SGD and Elastic Averaging SGD. It achieves near-linear speedup on up to 60 GPUs, demonstrating efficient scaling on both single-node and large-scale supercomputing clusters with minimal overhead.

ABSTRACT

We present a lightweight Python framework for distributed training of neural networks on multiple GPUs or CPUs. The framework is built on the popular Keras machine learning library. The Message Passing Interface (MPI) protocol is used to coordinate the training process, and the system is well suited for job submission at supercomputing sites. We detail the software's features, describe its use, and demonstrate its performance on systems of varying sizes on a benchmark problem drawn from high-energy physics research.

Motivation & Objective

  • To address the lack of user-friendly tools for integrating Keras with distributed training on HPC systems.
  • To enable efficient, scalable training of deep neural networks using MPI across multi-GPU servers and large-scale clusters.
  • To provide a lightweight, configurable framework that minimizes overhead while supporting both synchronous and asynchronous training.
  • To facilitate rapid prototyping and deployment of large-scale deep learning models in scientific computing environments.
  • To support flexible model and data distribution across workers, including model parallelism via device-specific layer assignment.

Proposed method

  • The framework uses MPI for coordination between master and worker processes, with one master and multiple workers handling model updates.
  • It implements two distributed training algorithms: Downpour SGD (asynchronous gradient updates) and Elastic Averaging SGD (with periodic weight synchronization).
  • The user defines training via an Algo class (batch size, optimizer, loss function), a ModelBuilder class (Keras model architecture), and a Data class (data generator and file distribution).
  • Data is split evenly among worker processes, and model weights are synchronized via the master process after each gradient update.
  • The framework supports both CPU and GPU training, with device-specific layer assignment enabled through the TensorFlow backend.
  • Validation is performed serially by the master, and its frequency can be tuned to reduce performance bottlenecks.

Experimental results

Research questions

  • RQ1Can a lightweight, MPI-based framework enable efficient distributed training of Keras models on diverse HPC systems?
  • RQ2How does the training speedup scale with the number of workers across different hardware configurations?
  • RQ3What is the impact of batch size and validation frequency on training performance and scalability?
  • RQ4To what extent can the framework fully utilize multi-GPU nodes and large-scale GPU clusters?
  • RQ5How does the overhead of the framework compare to native Keras training on a single process?

Key findings

  • The framework achieves near-linear speedup on a Supermicro server with 8 GPUs, up to 10 workers, indicating full utilization of multi-GPU resources.
  • On the ALCF Cooley cluster with 60 GPUs, the framework achieved a speedup of 30x compared to single-worker training, despite deviations from linearity at scale.
  • Increasing the batch size from 100 to 1000 improved speedup from 1.0x to 4.1x with 20 workers, reducing the impact of master update bottlenecks.
  • The overhead of the mpi_learn framework itself is minimal, as single-worker training times are nearly identical to native Keras training.
  • The performance bottleneck from serial validation becomes more pronounced with higher validation frequency, limiting scalability.
  • Hierarchical configurations with multiple masters are supported, enabling flexible scaling across large clusters.

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.