Tensor parallelism is a form of model parallelism that splits a layer’s parameters or tensors across multiple devices. Unlike pipeline parallelism, which divides a model between modules, it divides computation inside the modules themselves. section 16.5.2
Each device works on its segment of a layer, such as part of a linear layer’s weights and biases. Devices then exchange intermediate results so the combined computation produces the correct output shape. section 16.5.2
Tensor parallelism is especially useful when:
- A model is wide and shallow, with relatively few layers but many parameters in each layer. section 16.5.3
- A single layer is too large to fit in one device’s memory. section 16.5.3
- Fast communication is available between devices, since splitting tensors requires exchanging intermediate results. section 16.5.2 section 16.6
Splitting a linear layer
A linear layer can divide its weights row-wise or column-wise across two devices. Each device performs matrix multiplication with the input using its weight segment, then communication combines the partial results into the layer’s expected output. section 16.5.2
Figure 16.8 Pipeline parallelism (top) compared to tensor parallelism (bottom). Pipeline parallelism splits at the module granularity, while tensor parallelism splits at the module parameter (tensor) granularity.
Compare pipeline parallelism’s module-level split with tensor parallelism’s parameter-level split. section 16.5.2
Tensor parallelism can also combine with data, pipeline, and other parallelism strategies. DeviceMesh helps define the device groups and communication patterns needed for these multidimensional arrangements. section 16.6


