liveBook · Manning

Tensor parallelism

As explained in Sutskever's List

Tensor parallelism is a distributed-training technique that partitions tensor computations and their associated parameters across devices.

A model’s weights, activations, and data are stored as tensors: containers ranging from single numbers to multidimensional arrays. Sharding splits tensor contents across devices, so one GPU need not store everything. AlexNet used hand-built sharding, an early response to limits in GPU memory and interconnect bandwidth. section 6.3 section 6.3

Tensor parallelism partitions tensor axes across devices. Mesh-TensorFlow made the choice explicit: splitting the vocabulary or feed-forward dimension is tensor parallelism, while splitting the batch is data parallelism. Pipeline parallelism instead divides computation into stages; it can be combined with tensor parallelism, with each pipeline stage distributed across devices. section 6.3.3 section 6.3.3

From hand-built slices to large-scale training

Megatron-LM’s tensor slicing was designed for a particular transformer layer. Mesh-TensorFlow generalized the approach by mapping tensor axes onto device-mesh axes. Megatron-LM later trained an 8.3-billion-parameter GPT-2-style transformer on 512 GPUs, demonstrating the scale these parallelism strategies could support. section 6.3.3 section 6.3.3

Distributing computation does not by itself eliminate memory redundancy: data-parallel GPUs still hold full model weights. Tensor parallelism addresses how tensor computations are distributed, while ZeRO targets duplicate storage of parameters, gradients, and optimizer states. section 6.3.3 section 6.3.3

How Sutskever's List covers it

How deep it goes
Defines sharding and gives tensor-axis examples, without detailing the mechanics of tensor slicing.
Examples
Uses AlexNet’s hand-built sharding, Mesh-TensorFlow’s axis choices, and Megatron-LM transformer training as examples.
What it assumes
Assumes no tensor notation, defining tensors through scalars, vectors, matrices, and higher-dimensional arrays.
What you can do after
Understand how tensor-axis partitioning differs from batch splitting and pipeline-stage partitioning.
How it connects
Connects tensor parallelism to data parallelism, pipeline parallelism, expert parallelism, and Mesh-TensorFlow.

Also explained in

Compare how 3 books explain tensor parallelism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Sutskever's List. The section links point to the parts of the book it draws on.