Skill 2.1.6

Manage distributed training for large and deep learning models

Key Concepts

A command job becomes distributed with a distribution setting and resources.instance_count. The PyTorch type launches process_count_per_instance processes on each node, normally one per GPU; MPI suits Horovod and DeepSpeed launched through MPI; TensorFlow sets TF_CONFIG for worker and parameter server roles. Azure Machine Learning sets MASTER_ADDR, MASTER_PORT, WORLD_SIZE, RANK and LOCAL_RANK for the processes.

Most jobs use data parallelism, in which every GPU holds a copy of the model and processes a different slice of each batch; DeepSpeed and fully sharded data parallelism split model state when a model does not fit in one GPU's memory. Multi-node jobs benefit from InfiniBand-capable VM sizes, whose names contain an r, and long jobs should save checkpoints to outputs so they can resume after a failure or Spot eviction.