Distributed training

Distributed training is training one AI model across many chips or machines at once, splitting the data, the model or both so that work too large for a single processor can be done.

A modern large language model is far too big and takes far too much computation to train on one chip. Distributed training spreads the job across hundreds or thousands of GPUs or other accelerators working in step. The challenge is not just dividing the arithmetic but keeping every chip busy while they constantly exchange results over a network.

There are three main ways to divide the work. Data parallelism gives each chip a copy of the model and a different slice of the data, then averages the results. Tensor parallelism splits the individual calculations inside each layer across several chips; NVIDIA's Megatron-LM paper of September 2019 used this intra-layer approach, splitting each layer eight ways and combining it with data parallelism, to train a transformer of 8.3 billion parameters on 512 GPUs with 76% scaling efficiency. Pipeline parallelism places different layers on different chips and streams small slices of each batch through them like an assembly line; Google's GPipe paper of November 2018 split each batch into smaller micro-batches to keep every stage busy, and trained a 6 billion parameter, 128-layer translation model.

Memory is often the binding constraint. Microsoft's 2019 ZeRO paper attacked the duplication of model state across data-parallel chips and reported training models of over 100 billion parameters on 400 GPUs; it was used to build the 17 billion parameter Turing-NLG. The largest training runs combine several of these methods at once.

The hardware matters as much as the software. In March 2024 Meta described two clusters of 24,576 NVIDIA H100 GPUs each, used for training Llama 3: one networked with Ethernet-based RoCE, the other with InfiniBand, both at 400 gigabits per second per endpoint. Meta's design includes storage built for checkpointing, saving snapshots of the training state so a job can resume after a fault.

For readers, distributed training explains why AI progress is tied to chip supply, network design and data centre power. A lab's ability to train a frontier model depends on whether it can make tens of thousands of chips behave like one machine, and efficiency gains in this plumbing can be worth as much as new chips.

Common questions

What is distributed training in machine learning?

It is training a single model across many processors or machines at the same time. The work is split by data, by model, or both, and the processors exchange results over a network. It is how every large modern model is trained.

What is the difference between tensor and pipeline parallelism?

Tensor parallelism splits the calculations within each layer across several chips, which needs very fast links because they communicate constantly. Pipeline parallelism puts whole layers on different chips and passes data from one stage to the next. They are often used together, along with data parallelism.

Why is distributed training hard?

Chips must constantly exchange data, so a slow network leaves expensive processors idle. Memory limits force careful decisions about how to split the model. With thousands of components, jobs also need regular checkpoints so they can resume after hardware faults.

What software is used for distributed training?

Common tools include PyTorch's distributed features such as DistributedDataParallel and Fully Sharded Data Parallel, Microsoft's DeepSpeed, NVIDIA's Megatron-LM and Google's JAX. Large labs often build their own systems on top of these.

Finding more

Search for "tensor parallelism", "pipeline parallelism", "Megatron-LM" or "ZeRO DeepSpeed" to find the foundational papers. Research papers on arXiv, framework documentation and engineering blogs from labs that run large clusters give the most reliable detail. Scaling-efficiency numbers depend on model size, cluster and network, so compare them only under similar conditions.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.