Choosing Data Parallel or Model Parallel Distributed Training
This lesson explains how distributed training spreads work across several GPUs or instances, shortening training on large datasets and making it possible to train models too large for one GPU.
Learning outcomes
After completing this lesson, you will be able to:
- Explain data parallel training.
- Explain model parallel training, including tensor and pipeline parallelism.
- Describe when SageMaker HyperPod suits very large training.
Data parallelism
In data parallel training, every GPU holds a full copy of the model and processes a different slice of each batch. After each step, gradients are averaged across GPUs (an all-reduce operation) so all copies stay identical. It is the right approach when the model fits in one GPU's memory but the dataset is large. SageMaker AI supports PyTorch DistributedDataParallel (DDP), Horovod and the SageMaker distributed data parallelism library, which optimises all-reduce on AWS networking. The effective batch size grows with the number of GPUs, so the learning rate often needs adjusting.
Data or model parallel?
Model parallelism
When a model is too large to fit in one GPU's memory, model parallel training splits the model itself across GPUs. Tensor parallelism splits individual layers, dividing their matrix operations across GPUs. Pipeline parallelism places groups of consecutive layers on different GPUs and streams micro-batches through them, so all GPUs work at once.
Sharded data parallelism, such as fully sharded data parallel (FSDP), splits the model's parameters, gradients and optimiser states across GPUs, gathering them only when needed, which greatly reduces memory per GPU. The SageMaker model parallelism library implements these techniques for PyTorch. Data parallelism, by contrast, copies the whole model to each GPU and splits the data, which speeds up training of models that already fit.
The following diagram compares how two training jobs, one with a 300-million-parameter model and one with a 70-billion-parameter model, use their GPUs.

SageMaker HyperPod
Training or fine-tuning very large models can take weeks on hundreds of accelerators, and at that scale hardware failures are routine. SageMaker HyperPod provides persistent clusters of accelerated instances, orchestrated with Slurm or Amazon EKS, for such long-running, large-scale training.
HyperPod monitors the health of each instance, replaces faulty nodes automatically and resumes jobs from their last checkpoints, so a failure costs minutes rather than days of training. HyperPod recipes provide tested training configurations for popular models. The following table summarises the distributed training options.
| Situation | Approach |
|---|---|
| Model fits on one GPU; large dataset | Data parallelism |
| Model too large for one GPU | Model parallelism (tensor, pipeline, sharded) |
| Weeks-long FM training with automatic recovery | SageMaker HyperPod |
| Encrypt traffic between nodes | Inter-container traffic encryption |
SageMaker HyperPod
Choosing a strategy
Two jobs need speeding up. Job 1 fine-tunes a 300-million-parameter vision model on 50 million images. Job 2 fine-tunes a 70-billion-parameter language model whose weights alone exceed one GPU's memory.
| Job | Strategy | Reason |
|---|---|---|
| Job 1 | Data parallel across 4 instances of 8 GPUs | Model fits; data is the bottleneck |
| Job 2 | Sharded data parallel plus tensor parallelism on HyperPod or training jobs, or LoRA to reduce memory | Model does not fit on one GPU |
Applying data parallelism to Job 2 would fail with out-of-memory errors, because each GPU must hold a full model copy.
Which strategy suits a model too large for one GPU?
Show answer
Model parallelism or sharded data parallelism. Data parallelism suits a model that fits on one GPU with large data.
Exam Tips
Remember for the exam
- Model fits on one GPU, large data: data parallelism.
- Model too large for one GPU: model parallelism or sharded data parallelism.
- Data parallelism increases effective batch size; adjust the learning rate.
- Long-running large-scale training with automatic node recovery: SageMaker HyperPod.
- Encrypt inter-node traffic when data is sensitive.