liveBook · Manning

Tensor parallelism

As explained in LLMs in Production

Tensor parallelism is a distributed-computing technique that partitions tensor computations across multiple processors and combines their results.

Tensor parallelism splits tensor computations across processors, runs the pieces concurrently, and combines their results. It helps when a matrix or tensor cannot fit on one processor or its calculations become a throughput bottleneck. section 3.3.2

A practical tensor-parallel workflow follows these decisions:

  • Choose a tensor dimension to partition, commonly by rows or columns. section 3.3.2
  • Prefer a dimension with more elements than the number of processors so the available resources are fully used. section 3.3.2
  • Run the partial calculations concurrently, then communicate and combine the results. section 3.3.2
  • Treat the partition choice as a trade-off: different dimensions impose different data-movement costs. section 3.3.2

Splitting a large matrix

Suppose Y is too large for one processor. Split Y by columns or rows, perform the corresponding matrix calculations on separate processors, and combine the partial outputs to obtain the same result. The same principle extends from matrices to tensors with more than two dimensions. section 3.3.2

How LLMs in Production covers it

How deep it goes
Explains row and column partitioning, recombination, dimension selection, and data-movement costs without detailing a complete implementation.
Examples
Uses a large matrix split by rows or columns and a visual comparison of equivalent tensor-parallel decompositions.
What it assumes
Assumes matrix multiplication and processor-based distributed computation, then generalizes the reasoning to higher-dimensional tensors.
What you can do after
Apply tensor parallelism by partitioning activations across processors and combining their partial results.
How it connects
Connects tensor parallelism with distributed computing, sequence parallelism, data parallelism, pipeline parallelism, and 3D parallelism.

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 LLMs in Production. The section links point to the parts of the book it draws on.