Parallelism Strategies for Training Large-Scale Models Across Multiple GPUs
Training large neural language models poses significant computational challenges, primarily due to memory constraints of individual GPUs and the extended time required for model convergence. Modern models with tens of billions of parameters exceed the capacity of a single machine.
Several parallelism strategies address these limitations. Data parallelism replicates the complete model across multiple workers while distributing training data among them. When model size exceeds available memory, techniques like parameter offloading to CPU become necessary.
Model parallelism distributes model weights across multiple machines. Pipeline parallelism, implemented through frameworks such as GPipe and PipeDream, combines these approaches by partitioning the model into layers and processing multiple mini-batches in parallel to reduce computational idle periods. Tensor parallelism partitions individual tensor operations, as demonstrated by Megatron-LM, parallelizing computations within transformer blocks.
The Mixture of Experts approach has recently emerged as a prominent technique, particularly through implementations like GShard and Switch Transformer. Rather than always processing all parameters, these models employ a gating mechanism to activate only a subset of expert networks for each input, significantly reducing computation while scaling total parameters into the trillions.