liveBook · Manning

Distributed training

As explained in Distributed Machine Learning Patterns

The process of fitting a machine learning model by coordinating computation across multiple machines or execution units.

Distributed training fits a machine learning model across multiple nodes after data ingestion. Workers concurrently consume processed data and calculate updates, allowing training to use clustered compute when datasets, models, or runtime demands exceed a single machine. section 3.1 section 3.0

Table 3.1 Comparison of traditional (nondistributed) training and distributed training for machine learning models (view table figure)

 

Traditional model training

Distributed model training

Computational resources

Laptop or single remote server

Cluster of machines

Dataset location

Local disk on a single laptop or machine

Remote distributed database or partitions on disks of multiple machines

Network infrastructure

Local hosts

InfiniBand or RDMA

Model size

Small enough to fit on a single machine

Medium to large

Compare single-machine and distributed training by compute location, dataset placement, network infrastructure, and model size. section 3.1

Choose the coordination pattern by model size and communication cost:

  • Use parameter servers for large, complex models that cannot fit on one machine; partition model parameters across servers while workers send gradients for updates. section 3.9 section 7.3.2
  • Use collective communication for smaller models when parameter-server traffic becomes a bottleneck. Each worker holds a full parameter copy, computes gradients on a data partition, and synchronizes updates through collective operations such as all-reduce. section 3.9 section 7.3.2
  • Plan for failures as part of training: skip unusable corrupted batches, checkpoint model parameters during network instability, and resume after connectivity returns. Synchronous collective communication can block the whole job when the network is slow. section 3.4.2

Multi-worker TensorFlow job

For synchronous multi-worker training, create a tf.distribute.MultiWorkerMirroredStrategy, define the distributed input pipeline and model inside its strategy scope, then call fit(). The strategy copies layer variables across workers and uses collective communication. Save the completed model only from the chief worker, identified through TF_CONFIG, to avoid incorrect or redundant output. section 9.2.2

Operational deployment can package the training script in a container and run a two-worker Kubeflow TFJob on Kubernetes with persistent storage for checkpoints and saved models. An Argo workflow can place data ingestion before parallel distributed runs for CNN, dropout, and batch-normalization variants, then select a top model and create model serving. section 9.2.2 section 9.4.1

How Distributed Machine Learning Patterns covers it

How deep it goes
Explains coordination patterns, bottlenecks, failures, and a TensorFlow multi-worker implementation through deployment and workflow execution.
Examples
Uses YouTube-8M corruption and network failures, Fashion-MNIST models, TensorFlow strategies, TFJobs, and parallel CNN variants.
What it assumes
Assumes processed, properly sharded input data while contrasting distributed execution with single-machine model training.
What you can do after
Apply it via TensorFlow and Kubeflow to run synchronous multi-worker training, persist outputs, and orchestrate model-selection workflows.
How it connects
Connects data ingestion, parameter servers, collective communication, all-reduce, Kubernetes, Kubeflow, Argo Workflows, and model serving.

Also explained in

Compare how 6 books explain distributed training →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.