Data parallelism is a training method that places a replica of the same model on each of several GPUs, splits the minibatch so each computes its part separately, averages the resulting gradients, and then updates every replica in the same way. Among the methods for speeding up training with multiple GPUs or machines, it is the most basic and the most widely used.
In deep learning, the more data there is and the larger the batch size used per step, the longer training takes on a single GPU. With data parallelism, for example, 256 examples can be split into 64 per GPU across 4 GPUs and computed simultaneously, dividing the computation of one training step by the number of devices.
The idea is similar to splitting the grading of a test among four people. If the answer sheets are split into four piles, each person computes the average score of their pile, and the four averages are then averaged, the result equals the average obtained when one person grades every sheet. In data parallelism, this "average score" corresponds to the gradient.
Data parallelism averages the gradients using a collective communication called All-Reduce. In All-Reduce, every participant contributes data of the same size, and every participant receives the sum (or average). PyTorch's DistributedDataParallel (DDP) is a representative implementation of data parallelism based on this mechanism, and Li et al. described its design in a 2020 paper. This article mainly follows that paper.

