AIWiki
Malaysia
Back to all articles
AI Foundationsdistributed trainingparallelismdeep learning

Distributed Training

3 min readUpdated November 2026
Distributed Training
Type
Machine-learning training technique
Key methods
Data, tensor and pipeline parallelism; ZeRO/FSDP sharding
Common frameworks
DeepSpeed, Megatron-LM, PyTorch FSDP, Ray
Emerged
Mid-2010s; scaled up from 2019
Related
GPU clusters, InfiniBand, MLOps, model parallelism
Distributed training is the practice of training a machine-learning model across multiple GPUs or machines rather than a single device, splitting either the data, the model's parameters, or the training pipeline between them. It is the technique that makes training of modern large language models possible: models with hundreds of billions of parameters and training corpora of trillions of tokens cannot fit in the memory of one accelerator, nor finish training in a reasonable time on one.[1]

Parallelism Strategies

Data parallelism replicates the model on every accelerator, feeds each a different mini-batch, and synchronises gradients after each step — typically with an all-reduce operation. It is simple and scales well but duplicates the full model and optimizer state on every device.

Sharded data parallelism attacks that memory cost. Microsoft's ZeRO (Zero Redundancy Optimizer) partitions optimizer states, gradients and parameters across devices, so each machine stores only a fraction of the redundant data while retaining data-parallel communication patterns; PyTorch's FSDP (Fully Sharded Data Parallel) implements the same idea.[2]

Tensor (model) parallelism splits individual weight matrices across devices so that a single layer's computation is shared — the approach popularised by NVIDIA's Megatron-LM — allowing a model too large for one GPU to be run layer-parallel across several.[3]

Pipeline parallelism cuts the model into sequential stages (embedding, transformer blocks, output head) assigned to different devices, streaming micro-batches through the "pipeline". Real systems combine all three, producing 3D parallelism configurations for frontier models.

The Communication Bottleneck

The limiting factor is not raw compute but interconnect bandwidth: gradients and activations must cross the network between steps, and slow links stall every GPU in the cluster. High-speed fabrics such as InfiniBand with RDMA, NVLink within a node, and topology-aware scheduling are what separate efficient clusters from expensive ones. Practical training also relies on mixed-precision arithmetic, gradient accumulation, activation checkpointing and frequent checkpointing to survive multi-week runs.[4]

Scale is staggering: BLOOM's 176B parameters were trained in 2022 on 384 A100 GPUs using Megatron-DeepSpeed, and Meta's Llama 3 405B model used a cluster of roughly 16,000 H100 GPUs.[5] Efficiency is measured as scaling efficiency — how much throughput a cluster retains as it grows — and diminishing returns from communication overhead are a major driver of hardware and software design in the AI infrastructure industry.

>See Also

🇲🇾Malaysian Context

🇲🇾 Relevance to Malaysia: Full-scale pre-training is not something Malaysian organisations currently do — the capital and power requirements put it out of reach — but distributed-training skills are directly relevant. Malaysia's rapidly expanding data-centre belt in Johor and the Klang Valley, the National AI Compute Exchange, and cloud regions in Kuala Lumpur are building the GPU capacity on which Malaysian institutions can run multi-GPU fine-tuning, continued pre-training of local models such as ILMU, and large-scale inference serving.

Malaysian enterprises fine-tuning domain models (banking, palm oil, manufacturing, public sector) increasingly hit single-GPU memory limits, making LoRA-based distributed fine-tuning and FSDP practical skills. Universities with HPC clusters (UM, USM, UTM, UTAR) use the same open-source tooling, and HRD Corp-funded and MDEC skills programmes feed the systems-engineering talent that the National AI Office's compute and talent agendas require. Because training data may contain personal data, keeping distributed workloads inside Malaysian infrastructure also simplifies PDPA compliance compared with sending datasets offshore for training.

References

  1. ↑Wikipedia. (2026). Parallel computing. https://en.wikipedia.org/wiki/Parallel_computing
  2. ↑Rajbhandari, T. et al. (2020). ZeRO: Memory Optimizations Toward Training Trillion Parameter Models. arXiv:1910.02054. https://arxiv.org/abs/1910.02054
  3. ↑Shoeybi, M. et al. (2019). Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism. arXiv:1909.08053. https://arxiv.org/abs/1909.08053
  4. ↑InfiniBand trade association. High-performance networking for AI training. https://www.infinibandta.org/
  5. ↑Grattafiori, A. et al. (2024). The Llama 3 Herd of Models. arXiv:2407.21783. https://arxiv.org/abs/2407.21783