Tensor parallelism puts several GPUs to work on the same layer. Take a Transformer's linear layer: forward propagation computes βoutput = input Γ weights + bias.β During training, both this multiplication and the multiplications that compute gradients during backpropagation can be distributed. Inference uses only the forward pass when generating text, but can use the same partition.12
Reading Colossal-AI's training documentation, I kept returning to the 2D, 2.5D, and 3D pages. A matrix only has rows and columns, so where does a third dimension come from? Why stop short of 4D or 5D? Readers familiar with linear layers can skip to the two-GPU 1D example.345
Prerequisites: how a linear layer computes its output
How many rows and columns do the input and output have?
Consider one text, tokenized into three tokens with integer IDs . The token embedding layer looks up rows of its embedding table. With four numbers in each row, each token gains a vector of length 4. Arrange the three vectors in sequence order to obtain a matrix with one row per position in the text.
The embedding layer performs lookups; subsequent linear layers combine existing token features into new ones. For a batch of texts padded to positions each, token IDs have shape , and the lookup output has shape , where is the vector length. Consider just one sequence below. At an intermediate linear layer, stacking the incoming feature vectors by position gives the input matrix . The layer multiplies by its weight matrix , sharing the same across positions.
Suppose there are tokens with input features each, and this layer produces output features per token. and the optional bias vector are trainable parameters; comes from this input. The forward formula is:
The length of is . Add the same to every output row. For three tokens going from four features each to two, multiply a input by weights to get a output. The number of tokens stays at three; the number of features per token changes. Retaining the batch dimension gives input shape and output shape .
For output of input row , dot row of with column of and add bias :
As runs from 1 to , each input feature is multiplied by its weight for output . Here is the linear layer's output. An activation function such as ReLU subsequently maps negative values to zero, yielding activations . In training memory discussions, activations more broadly means intermediate forward-pass data that the backward pass may need. The incoming can be called input activations; consists of model parameters.
How does a column of weights combine input features?
Gilbert Strang's Introduction to Linear Algebra gives a difference matrix example. The inputs are three squares , transformed into successive differences starting from zero. The book uses column vectors. In this article's row-vector notation the same calculation is:6
Look at the second weight column, . It subtracts the first number from the second and ignores the third. If the inputs are cumulative mileage readings starting from zero, the second output, , is the distance traveled on the second leg. Add other trips as rows of , and the same matrix gives each trip's distances row by row. Each column of a linear layer's likewise defines a combination of input features yielding one new feature, though its coefficients are usually learned.
Suppose we have three tokens. The first output neuron has four weights . Set the bias to zero to see the relationship clearly. The neuron dots its four weights with the four input features of each token, yielding one number per token. Sharing the same weight column across all three positions gives a column of three values:
Generally, with input features per token, one neuron has weights. For a sequence of tokens, it produces scalars arranged as . Increasing to neurons expands the output to , with weights in the layer. Bias adds one parameter per neuron.
Letters help show that splitting does not drop connections. One token is [a,b,c,d], and the first output neuron's weights are [pβ,pβ,pβ,pβ]. The first two inputs contribute aΒ·pβ + bΒ·pβ, the last two contribute cΒ·pβ + dΒ·pβ, and only their sum gives the token's first output. The second output uses the same four inputs with the four weights of the second column. A dot product produces one number: multiplying 1Γ2 by 2Γ2 computes two dot products to obtain 1Γ2. A vector cross product produces a vector, whereas the neuron needs a sum of corresponding products.
How does PyTorch store the weights and output?
Keep the three tokens and add an output neuron with weights . The weights of nn.Linear(4, 2) have shape [2, 4], each row holding one neuron's four weights. The output has shape [3, 2], each row holding one token's two outputs. Fill in the example weights to compare indices directly:7
import torch
from torch import nn
x = torch.tensor([[1., 2., 3., 4.], [0., 1., 0., 1.], [2., 0., 1., 0.]])
layer = nn.Linear(4, 2, bias=False)
with torch.no_grad():
layer.weight.copy_(torch.tensor([[1., 0., 1., 0.], [0., 1., 1., 0.]]))
y = layer(x)
# y.tolist() β [[4., 5.], [0., 1.], [3., 1.]]
# y[0].tolist() β [4., 5.] 第δΈδΈͺθ―ε
ηδΈ€δΈͺθΎεΊ
# y[:, 0].tolist() β [4., 0., 3.] 第δΈδΈͺη₯η»ε
ε―ΉδΈδΈͺθ―ε
ηθΎεΊ
layer.weight[0] corresponds to the first column of this article's . We write , and the layer(x) call above is mathematically equivalent to x @ layer.weight.T. Thus splitting by columns across two GPUs corresponds in PyTorch to splitting rows of layer.weight.7
π NoteγTo group results by neuron in each inner list,
y.T.tolist()gives[[4., 0., 3.], [5., 1., 1.]]. To feed the next layer, pass the[3, 2]-shapedydirectly to a linear layer with two input features. Herey.Tswaps the indices of a two-dimensional output, whereaslayer.weight.Taligns weights for multiplication. For ordinary dense tensors, transposition shares the original storage. If later operations require contiguous memory, calling.contiguous()on a noncontiguous transpose makes a contiguous copy.8
What does backpropagation send to the preceding layer?
Suppose this layer receives three tokens with four input features each. Its two output neurons have weights and and zero bias. Put each token in a row of and each neuron's weights in a column of . The forward calculation yields:
The and in the first row are the two neurons' outputs for the first token. Suppose ReLU follows, giving , then is compared with a target to compute loss . Backpropagation walks this path in reverse, using the chain rule at each step to calculate how the loss depends on the previous result:
- The loss function provides the starting gradient. For every position of , calculate the sensitivity of the loss to a small change, giving . The loss is a scalar, but its gradient has three rows and two columns like .
- ReLU passes gradients position by position. At row one, column two, in the forward pass and remains after ReLU, so the incoming gradient passes straight back. At a negative input, ReLU produces zero and zeroes that position's gradient. Applying this across positions yields the loss gradient with respect to the linear output, .
- The linear layer computes gradients by matrix multiplication. It uses the forward input and incoming to calculate weight gradients for the optimizer. It uses and weights to calculate the input gradient for the preceding layer. For trainable bias, sum the rows of along the token dimension. Here are the three results:
| Gradient | Calculation | Shape in this example | Destination |
|---|---|---|---|
| Weight gradient | , like | Optimizer, to update weights | |
| Input gradient | , like | Previous layer, to continue backpropagation | |
| Bias gradient (when used) | Length 2, like | Optimizer, to update bias |
Here denotes transposition, swapping a matrix's rows and columns.2
What occupies GPU memory during training?
Keep the same three tokens, four features per token, two output neurons, and the bias-free setting from the code. Start on one GPU, assuming FP32 weights, activations, gradients, and both Adam statistics, at 4 bytes per number. Dense tensor data occupies element count Γ bytes per element. Input , for instance, has numbers and takes 48 bytes.9
| When used | Tensor on GPU | Shape | Size here | Why retain it? |
|---|---|---|---|---|
| Forward, backward, update | Weights | 32 bytes | All tokens share eight weights, reused after updating for the next batch. | |
| Forward, kept for backward | Input activations | 48 bytes | Used for in forward and for weight gradients in backward. | |
| Forward | Linear output and ReLU output | each | 24 bytes each | goes to ReLU, goes to the next step, and indicates where gradients pass during backward. |
| Backward | Incoming ReLU gradient and linear gradient | each | 24 bytes each | Carries the loss gradient backward for each output position. |
| Backward | Input gradient | 48 bytes | Passed back to the previous layer. | |
| Backward, retained for update | Weight gradient | 32 bytes | One gradient per weight for the optimizer. | |
| Parameter update, retained across steps | Adam's first and second moments | each | 32 bytes each, 64 total | Moving averages of each weight's gradient and squared gradient. |
At update time, weights, weight gradients, and Adam's two statistics total 128 bytes. Two trainable biases add 8 bytes each for bias, bias gradient, and the two statistics, bringing that subtotal to 160 bytes. At the model input, three int64 token IDs occupy 24 bytes. At the end, a single FP32 loss value occupies 4 bytes. Count each at its own location.
π NoteγEach row gives tensor data size. Peak memory depends on simultaneous lifetimes. For example, keep until computing the weight gradient. ReLU can save for backward, allowing to be released after use. Count an activation shared between adjacent layers once. Operator workspaces and allocation behavior also affect peaks. Ordinary forward-only inference can release intermediates after use and dispenses with weight gradients and Adam state.10
Now assign one output neuron to each GPU. Resident weights per GPU fall from 32 to 16 bytes and local linear outputs from 24 to 12 bytes, but both neurons still need the complete 48-byte input. Which other data shrinks with the weights depends on the split direction.
1D: when two GPUs each do half, do we concatenate or add?
Compute on two GPUs with zero bias. Three quantities are distinct: three tokens, four input features, and two output features. However we split, each token needs two outputs.
Column split: each GPU finishes some output features
Divide the two output features between GPUs. GPU A gets the first column of , B the second. Each column has four weights, so both read the complete . Each performs a multiplication, yielding its neuron's output for all three tokens:
Teal represents GPU A, orange GPU B. Each finishes one column. Diagram drawn for this example.111
To obtain the full output, concatenate the two results by column. For the first token, A has completed output and B has completed output . More generally, splitting evenly by column leaves weights on each GPU, with rows and columns of output.
GeLU acts elementwise. A can calculate while B calculates , without concatenating their columns before activation.111
Row split: each GPU contributes partial sums to every output
Split the four input features between GPUs. A gets the first two rows of and first two columns of . B gets the remaining two rows and the last two columns of . Each GPU performs a multiplication and produces numbers, but each number includes contributions from only two input features:
Multiply inputs and weights of the same color. The first rows of the two products are and . Drawn for this example.111
This time the full result requires elementwise addition. For the first token, A computes and B computes . If both need the complete output after local multiplication, use an all-reduce: corresponding positions are added across the group and both receive . With an even row split of , the GPUs each perform half the multiply-adds for each neuron, and each partial result has rows and columns.
If GeLU follows, the first neuron needs . A's and B's are only partial sums. Activating each separately and then adding gives a different result. Finish the sum before GeLU.111
Column split followed by row split: no activation communication between layers
Follow the first token, . Both GPUs hold this input. The first layer is split by column: A uses the first weight column to compute , B uses the second to compute . Write and . Choose as the second layer's weights, split by row. A holds row and already has the input it needs. B holds row and already has . This is the Megatron 1D tensor-parallel layout used for the feedforward network (MLP) in BLOOM training: first layer by column, second by row.112
Both upper dot products use the entire input row. A sums its local products to 4, applies GeLU to get , then multiplies by the teal weight row below. Only the plus sign between the two lower vectors requires inter-GPU communication. Diagram based on Megatron's layout.1
Follow only the first output of the second layer to locate the communication. A calculates , B calculates , and only after the second multiplication do they need to add these to get . The second output, , completes in the same all-reduce. If the second layer were column-split too, the GPU with weight column would need to compute itself, requiring the missing activation from its peer before multiplication.
The table counts only communication within the tensor-parallel group for these two layers. With Megatron's layout both GPUs have the full input at the start of forward and the complete output gradient at the start of backward. Read forward from layer one to two and backward from two to one.12
| Weight split | Forward | Backward |
|---|---|---|
| First layer by column | Each GPU finishes its output columns, applies GeLU locally, and passes them directly to the second layer. | Each computes local weight gradients from its column's gradients. Both outputs used the same input, so before returning to the preceding layer an all-reduce sums both GPUs' gradient contributions for each input position. |
| Second layer by row | Each multiplies local activations by local weight rows. Afterward an all-reduce combines partial sums before supplying the complete output to the next operator. | Each uses the full output gradient and its local weight rows to compute the gradient for its assigned input features. These pass locally back through GeLU, and each GPU can compute its own weight gradients. |
Thus this pair needs one forward all-reduce after the second multiplication, and one backward all-reduce before the first layer returns its input gradient.1
π NoteγWhy is column then row still 1D? The first layer splits by output neuron and the second by input feature. Each splits its weights in just one direction. The next section's 2D SUMMA splits a single layer simultaneously by token and output neuron, assigning each GPU an output block.23
How much memory does 1D tensor parallelism save per GPU?
Suppose a forward microbatch has equal-length sequences of length , giving the linear layer tokens. For a dense padded batch, include the padding positions actually computed. The model sets input width and output width . Thus has shape , has shape , and has shape . The size of this multiplication depends jointly on . For a fixed model, doubling the tokens doubles input and output while all tokens still share the same weights.
Suppose there are GPUs, and each input, weight, and output element takes bytes. All dimensions divide evenly, and input is already laid out as this layer requires. Counting only the three local multiplication tensors gives the following per GPU.2
| Bytes per GPU | Input | Weights | Local product |
|---|---|---|---|
| Full layer on one GPU | |||
| Column-split weights | , output shard | ||
| Row-split weights | , partial output sums |
Both splits reduce resident weights per GPU to of the full layer. If each updates its own shard, its weight gradients and optimizer states are divided in the same proportion.
π NoteγThe Colossal-AI 2D tutorial says β1DεΌ ιεΉΆθ‘沑ζε―Ή activations θΏθ‘εεβ (β1D tensor parallelism does not partition activationsβ). In the column-split layer above, input still takes , but output has fallen to , and GeLU can operate on that shard. The tutorial summarizes activation memory as because each GPU still holds a full input growing with and as GPU count increases.32
2D: why does a square of four GPUs need two rounds?
To work equal-sized blocks by hand on four GPUs, add a token row below from the 1D example and two output weight columns to the right of . Now and are both , while the first two outputs for the first three tokens remain as before.
Arrange four GPUs in two rows and two columns. Split and horizontally and vertically into four submatrices each. Indices start at zero. Each GPU begins with one input and one weight block and is responsible for the output block in the corresponding position. To calculate , walk block row of and block column of , multiplying two block pairs in turn and adding the products locally:
Follow only the first number in . Each round multiplies a block pair. The upper-left GPU records 1, then adds 3. Diagram drawn for the SUMMA example.3
| GPU and output block | First-round product | Second-round product | Locally summed output |
|---|---|---|---|
| Upper left | |||
| Upper right | |||
| Lower left | |||
| Lower right |
In round one, is needed by both upper GPUs because it affects both upper outputs. Similarly, goes to both left GPUs because both input groups multiply it. Broadcast input blocks along rows and weight blocks down columns. In round two switch blocks: the upper-left GPU receives from the right and from below, then adds this round's product to its result. Check the numbers: the upper-left output block's first row starts at and adds , giving the 1D example's .
The lower-right GPU also participates in round one, using from its row and from its column. This algorithm broadcasts along device rows and columns and accumulates local products over rounds. It is called SUMMA and applies to dense multiplications that permit this blocking.3
Follow GPU A at upper left. In round one it sends blocks it already holds to neighbors and obtains the first upper-left contribution, 1, using . In round two it receives from the right and from below and adds 3. The four boxes remain the same GPUs. Open the animation for step-by-step playback. Drawn for this four-GPU SUMMA example.3
π NoteγHow many blocks are transmitted in two rounds? Each round broadcasts one input in each of two rows and one weight in each of two columns. With only two GPUs in each group, each broadcast sends exactly one block to its peer. The four GPUs send four blocks per round, totaling four input and four weight blocks. A remote activation block participates in the local multiplication; its temporary copy can be freed after the round.
Now count computation: four GPUs each perform one block multiplication per round, eight in total. Both products for an output block are computed on the same GPU, so each GPU needs one local block addition. All four can add concurrently, with zero extra cross-GPU communication.3
π Note Take one token, eight input features, and four outputs.
xis1Γ8, so in the mathematical expressionxWthe weight matrix must be8Γ4. PyTorch storesLinear.weightas4Γ8and transposes it for the multiplication. Split the input evenly intoa,band split the weight matrix along both axes into four4Γ2blocks. The two outputs on the left areaWββ + bWββ, and the two on the right areaWββ + bWββ. Each addition supplies the four missing terms for the same output. Concatenate the left and right results only if the next operation needs all four values. Partitioning and communication play different roles here. Alternating column and row splits across adjacent layers determines which GPU holds the data. Ring communication determines which neighbors it passes through.72
Different layers may have shapes such as 8Γ4 and 4Γ7. In an ordinary dense layer each column has a weight for every input feature, so its columns have equal length. Different layers need not be padded to a common width. With seven outputs on two GPUs, an implementation supporting uneven shards can take four columns and three. Evenly split linear layers such as Megatron Core's first check divisibility. You could choose another axis or adjust the parallel group. If padding one extra column, ensure downstream computation ignores it, especially during normalization over output classes.713
Communication glossary: shards or partial sums, and who gets the result?
In SUMMA, sending along rows or columns is a broadcast. GPUs participating in an operation form a communication group. A broadcast along the first row involves only the upper-left and upper-right GPUs, so βthe whole groupβ can mean just two GPUs. Each member's number in the group is its rank. Some operations designate one sender or receiver of results called the root.
Here are common collectives on two GPUs, A and B. Each row is an independent operation, with A as root where one is required. Reduction combines corresponding positions across GPUs using a specified operation. The examples use summation; maximum is another possibility.14
| Term | Operation | Two-GPU example |
|---|---|---|
| broadcast | Root sends the same data to the whole group. | A has [4,5] β A and B both get [4,5] |
| scatter | Root partitions its data, giving each member one shard. | A has [4,5] β A gets [4], B gets [5] |
| gather | Root collects every shard in rank order. | A has [4], B has [5] β A gets the complete [4,5] |
| all-gather | Each member collects every shard in rank order. | A has [4], B has [5] β both get [4,5] |
| reduce | Sum elementwise and deliver the result to root. | A has [1,2], B has [3,3] β A gets [4,5] |
| all-reduce | Sum elementwise and deliver the full result to every member. | Same two inputs β both get [4,5] |
| reduce-scatter | Sum elementwise, giving each member one shard of the result. | Same two inputs β A gets [4], B gets [5] |
| all-to-all | Each member partitions data by destination and receives one shard from each source. | A has [1,2], B has [3,4] β A gets [1,3], B gets [2,4] |
Another common term is send / recv, a form of point-to-point (P2P) communication. For instance, one pipeline stage sends its activations to the next, which calls recv.15
π NoteγReturn to the first token. If A holds the first neuron's output
[4]and B holds the second's output[5], use all-gather for both to see the complete output. If each GPU computed only half the input features, they hold partial sums[1,2]and[3,3]instead. Use all-reduce if both need both outputs next, or reduce-scatter if each needs one. A subsequent all-gather after reduce-scatter gives both[4,5]too.14
Still using four GPUs, when must we sum across devices?
Track just the first entry of the upper-left output block. Input is , weights . The first two features contribute and the last two . Both 2D implementations obtain . The difference is: which GPU holds and which holds when they are computed?316
| Forward stage | 2D SUMMA in Colossal-AI's tutorial | 2D MatMul in the MindSpore 2.4 tutorial |
|---|---|---|
| Before local multiplication | Round one broadcasts inputs along rows and weights along columns, giving the upper-left GPU everything for the first two features. | First all-gather within group y. Each GPU gets the input required for this multiplication, while weights stay blocked. |
| While calculating partial sums | The upper-left GPU computes and keeps . Round two supplies data for the remaining features. The same upper-left GPU computes and adds it to its stored . | Different GPUs compute the two contributions to the same output. One holds , another . Their local multiplication is complete. |
| Handing off to the next step | The upper-left GPU already has and can pass it on as part of its output block. This multiplication is complete. | Perform reduce-scatter in group x, summing contributions at each position and distributing finished positions among GPUs. The GPU responsible for this position receives . |
Here reduce means reduction across GPUs, specifically addition. SUMMA communicates every round, sending inputs and weights needed for the next multiplication; its two products accumulate locally. MindSpore moves some communication after multiplication and transmits partial sums. Before applying GeLU to complete outputs, reduce those sums. In contrast, with 1D column splitting, each GPU has finished its assigned outputs, so it can apply GeLU locally even without assembling both sets of columns.1316
π NoteγGroup size, direct peers, bytes per multiply, and rounds of waiting are different quantities. In a ring all-reduce across ten thousand GPUs, each GPU can pass chunks to its next neighbor over successive rounds. In a square each GPU has 99 other members in its row and 99 in its column. These counts describe grouping; the broadcast algorithm determines actual routes.23
How many bytes does each 2D layout transmit for the same forward multiplication?
Notation for communication volume
| Symbol | Meaning in this multiplication | Units |
|---|---|---|
| Tokens processed together in this forward pass, or input rows | Tokens | |
| Features entering this layer per token, or input width | Input features/token | |
| Features produced per token, or output width | Output features/token | |
| Bytes per communicated tensor element, assuming identical precision | Bytes/element | |
| GPUs per row of the square device mesh, also GPUs per column | GPUs | |
| Total GPUs participating in tensor parallelism; for the square, | GPUs |
One forward pass computes . Input has elements (tokens Γ input width), weights have elements (input width Γ output width), and output has elements (tokens Γ output width).
Count only bytes each GPU receives from other GPUs. Consider SUMMA's input. Each evenly divided block has elements. Each GPU uses blocks of the same block row, already has one, and must receive blocks. The incoming volume is bytes. The analogous weight broadcast runs down device columns. MindSpore's square first gathers input within each group, then combines output partial sums with a ring reduce-scatter.316
| Incoming bytes per GPU | SUMMA | MindSpore 2D |
|---|---|---|
| Input | ||
| Weights or partial output sums | , weight blocks | , output partial sums |
Both transmit the same input volume. If , sending weight blocks costs less than sending output partial sums. If , the opposite holds. This threshold assumes the square mesh and precision above. Runtime also depends on whether SUMMA's staged broadcasts overlap multiplication and how effectively the local matrix shapes use the hardware.316
Does 2D always use less forward memory than a 1D row split?
With in-place reduction in the output buffer, a 1D row split simultaneously holds bytes of input, weights, and partial sums. For 2D SUMMA suppose each GPU holds input blocks and weight blocks at a given time, including original shards and live broadcast/prefetch copies. Each GPU accumulates in one output block. The three categories total bytes. Prefetching and buffer reuse affect .2317
Subtract the expressions to see the tradeoff. If , the space saved on 2D's smaller output exceeds the extra input and weight blocks. Keep the token count in this comparison: with fixed layer widths, increasing sequence length or microbatch size changes activation memory, while weight block size stays fixed.
For two large feedforward layers, what else contributes to peak memory?
Consider two layers of shape , ignoring bias. Suppose the weight, gradient, master weight, and optimizer state together occupy bytes per parameter. The layers have parameters. If weights and update state are divided evenly among GPUs, each GPU needs bytes for model state in either 1D or 2D. varies with precision and optimizer configuration. If ZeRO also shards states across the data-parallel group, calculate each component for the relevant stage. Mixed-precision Adam breakdown in the earlier article
In a classic column-then-row 1D layout, the first layer's complete input and local output total bytes. The second layer's local input and partial output sums also occupy bytes. If the first input is saved for backward, add while processing the second layer. If 2D retains only evenly split original inputs, this term is per GPU, saving bytes. To find training peak memory, follow execution order, sum simultaneously live tensors, and take the maximum. Include activations kept by other layers, GeLU's backward inputs, and communication buffers. Recomputation changes which activations need retaining.1310
For the same layer pair, MindSpore's model of the two forward multiplications gives bytes per GPU for classic 1D and bytes for 2D on GPUs. With fixed widths and layouts, increasing scales both communication volumes proportionately. Which transmits less depends on layer widths and layout together.16
2.5D and 3D: with the same eight GPUs, what does the third direction do?
The 3D tensor parallelism here splits along three natural directions of a matrix product: which tokens, which output neurons, and which input-feature segment of each dot product. The first two identify an output block. The third assigns segments of its dot products to different GPUs, which compute contributions and add them elementwise. 2D SUMMA also segments the dot products, but the GPU responsible for an output block computes every segment over successive rounds.35

The four layouts side by side in HPC-AI Tech's Colossal-AI overview. Both 2.5D and 3D have depth. To understand how two GPUs along that direction cooperate, check what each computes.18
Arrange eight GPUs in two square planes, four per plane. Both Colossal-AI layouts can be drawn this way. To tell them apart, ask whether the planes compute outputs for different tokens or different contributions to the same output.45
| Still computing | Eight-GPU 2.5D example | Eight-GPU 3D example |
|---|---|---|
| What do the planes store? | The upper plane gets the first two rows of X, the lower the remaining two. Each plane splits its own input further and stores a copy of all four weight blocks. | Inputs and weights are split more finely among eight GPUs. Data for one output block is distributed across groups in different directions. |
| How is the output obtained? | Each plane runs independent 2D multiplication on its four-GPU square. The upper plane produces the first two rows of Y, the lower produces the rest. | Gather necessary input and weight blocks along two directions, multiply locally, then sum partial outputs along the third direction, leaving each GPU a final output shard. |
| What does the extra direction do? | Replicas of a weight block at different depths can process different input rows close to the data. Extra weight storage trades for less communication. | It also combines results. Weights can be divided among more GPUs, but one multiplication requires coordinating three communication directions. |
Track the first output in row one. In 2.5D the plane holding that input row completes itself. The other plane handles different tokens. In 3D, two GPUs compute and separately. If GeLU follows, they must first add across GPUs because activation requires .45
Watch the front and rear GPUs at the upper right. Moving packets indicate transfers and gold halos indicate local computation. Track two positions during reduction: the front GPU keeps the first token's first output, 4, and the rear keeps the second token's second output, 1. Open the image to pause or step through. Drawn for Colossal-AI's 3D forward layout.5
During training, distinguish reducing outputs from reducing gradients. In the 2.5D forward example, the two device planes run SUMMA on different input rows. Their outputs can be assembled by row. During backward, both used the same weight blocks, so each obtains only its rows' contributions to the weight gradients. Combine the two gradients across planes before updating the block. The 3D example needs reduction sooner: while computing one forward multiplication, different depths produce partial sums for the same output position. Reduce-scatter along depth yields the correct output shards.4519
β2.5β denotes an adjustable layered scheme. Write the device count as q Γ q Γ d, with a q Γ q square per plane and d planes in depth. Setting d = 1 returns to a single 2D plane. Increasing depth can change each plane's size, the number of weight replicas, and per-GPU communication. Even at q = d = 2, if each plane independently performs 2D multiplication with a weight copy, it is still the left-hand scheme in the table.4
Deriving an algorithm and enabling it in a particular software release are separate questions. Colossal-AI's 2.5D tutorial, for instance, distinguishes the legacy example from a Shardformer interface still awaiting integration in its βUsageβ section. Check installed versions and APIs for support in a training environment. Production adoption requires deployment data.4
With 16 GPUs, how different are one 4Γ4 square and four 2Γ2 squares?
Give input, weights, and output shape 16Γ16, with two bytes per element. Consider only one forward SUMMA multiplication, with each GPU accumulating its output in place. The four smaller squares each own four different tokens and need all weights. As before, count only useful data a GPU receives from its peers.34
| What each GPU holds or receives | 2D, one 4Γ4 square | 2.5D, four 2Γ2 squares |
|---|---|---|
| Resident input block / final output block | 4Γ4 each, 32 bytes each | 2Γ8 each, 32 bytes each |
| Resident weight block | 4Γ4, 32 bytes | 8Γ8, 128 bytes |
| Missing input for this multiplication | 3 more blocks, 96 bytes | 1 more block, 32 bytes |
| Missing weights for this multiplication | 3 more blocks, 96 bytes | 1 more block, 128 bytes |
| Total received per GPU in forward | 192 bytes | 160 bytes |
For fixed GPU count, resident input per GPU is the same. The tutorial's intuition of βsame parameters, fewer activationsβ uses a different comparison: hold the side length of each square fixed and add device planes. Each plane retains the same weights and each GPU gets fewer input rows. Here we rearrange the same 16 GPUs into four planes. Each GPU stores 96 extra weight bytes and receives 32 fewer bytes per forward. The planes compute different tokens, so no cross-plane addition is required in forward. If a caller needs the full output, both layouts must deliver their shards. Training requires adding gradients for the same weight block across the four planes.419
3D moves reductions onto different coordinate axes. To track numbers on a specific GPU, see how eight GPUs calculate and redistribute input and weight gradients.
Does the extra 3D reduction before activation increase total forward traffic?
After a 3D reduction, each GPU keeps its own output shard, avoiding a full-result broadcast to everyone. Whether the entire forward pass transmits more than 2D SUMMA depends on whether input and weight savings before multiplication offset the additional reduction.
First look between multiplication and GeLU. In 2D SUMMA one GPU computes and in two rounds and adds locally. In Colossal-AI's 3D scheme the contributions reside on different GPUs, so multiplication is followed by reduce-scatter. MindSpore's 2D MatMul already uses reduce-scatter afterward, so both have this step in that comparison.3516
Reduce-scatter completes each output position's sum. The GPU responsible receives and can calculate locally, while its peers handle their own positions. All-reduce would give everyone the results for every position. Standard ring all-reduce follows reduce-scatter with all-gather. For elementwise GeLU that final gathering can be omitted.14
Now consider the inputs and weights delivered to multiplication. Fix matrix shapes and total GPU count and compare two evenly divisible layouts. 2D SUMMA has GPUs per side of its square, while 3D has per side of its cube; take . Both initially partition inputs and weights into blocks each. For a given tensor, initial blocks have equal element counts across plans. What changes is how many GPUs need each block.35
| Where one initial block goes | 2D SUMMA | Colossal-AI 3D |
|---|---|---|
| Input block | Broadcast to the other GPUs in its row | Delivered to the other GPUs in its input gather group |
| Weight block | Broadcast to the other GPUs in its column | Delivered to the other GPUs in its weight gather group |
Since , both operands move less in 3D. Let denote tokens, the input and output widths respectively, and bytes per transmitted element. Counting only useful payload received per GPU in one forward pass, 3D saves bytes on operands. However, its ring reduce-scatter requires each GPU to receive another output shard equivalents, totaling bytes. If the former exceeds the latter, 3D moves less overall; if equal, they tie. The same dependency can be met by sending operands to the output owner or by multiplying locally first and sending partial sums.3514
Does the conclusion hold for another 2D layout?
Introducing 2.5D and 3D, Zhou Boyang wrote, βζ―εδΈδΈͺη»΄εΊ¦οΌι俑代εΏι½δΌεΎε°θΏδΈζ₯ηδΈιβ (βeach added dimension further reduces the communication overheadβ). βEachβ is too categorical. In MindSpore's implementation, moving from 2D to 3D can transmit fewer activations but more weights. The larger term depends on how many tokens in the batch share those weights.1116
Fix the GPU count and consider a pair of feedforward layers. Replace MindSpore's 2D layout with 3D layout , where . From the documented two-layer forward formulas, 2D communicates bytes per GPU, 3D bytes. Subtracting activation savings from extra weight traffic, the change per GPU is
For these layouts, 3D saves communication when , and 2D saves it when . More tokens in one forward pass amortize the weight gather. With fixed , widening the intermediate layer can cross the threshold again. Increasing only the training corpus's token count while keeping the microbatch shape fixed repeats the original cost per forward. Redistributing GPUs among different axes can change elements transmitted per token, requiring a new comparison.16
Why are there only three natural directions in ordinary matrix multiplication? What can 4D and 5D mean?
Consider one output of the linear layer . There are tokens, input features, and output neurons. To compute output neuron for token , dot row of with column of :
Choosing uniquely determines which two values are multiplied and which output receives their product. For this ordinary dense multiplication there is no fourth or fifth independent computation index. Here are the three directions:
| Index divided | Where the matrix is cut | Result computed by each group |
|---|---|---|
| : which of tokens | Group rows of | Different rows of |
| : which of output neurons | Group columns of | Different columns of |
| : which segment of a dot product with terms | Group columns of with corresponding rows of | Partial sums for the same output position, which must be combined |
A 1D row split already uses : every GPU has every token, but only a segment of each row's features. 2D SUMMA uses device rows and columns for and respectively. In a square each GPU handles tokens and output neurons. is usually a whole block containing many output values.23
If output blocks can be split further, why split the dot product?
Suppose two GPUs share an output block previously assigned to one. Cut along and each takes some tokens, both needing the original weights. Cut along and each takes some neurons, both needing the original inputs. Cut along and each takes a segment of inputs and matching weights, combining partial sums only after multiplication. Even before is down to a single output, changing the division may be worthwhile: for long dot products and small output blocks, transmitting partial sums may cost less than transmitting inputs or weights.
Revisit . In 2D SUMMA, one GPU computes and over two rounds and adds them locally. Colossal-AI's 3D approach gives two GPUs different segments of . One contributes , the other , and adding across GPUs gives the same output for the same token and neuron.35
Can four or five coordinates describe the same work?
Any axis in can be subdivided. Write token index as βtoken group, position within groupβ and a product has four coordinates. Also split into βneuron group, position within groupβ to get five. The first pair still selects a row of , the second pair selects a column of , and the last index identifies the input feature used in the product. Device communication can be organized hierarchically the same way. HSUMMA adds inter-group and intra-group broadcasts within a 2D device square.20
Fix a token and output neuron , focusing on the GPUs that compute . Four GPUs arranged in a plane have two within-group axes: horizontal pairs in rows and vertical pairs in columns. Arrange four such planes for two tokens and two neurons, and the mesh has four axes , totaling 16 GPUs. For a third within-group axis, expand each group into a cube of eight GPUs. The full mesh now has five dimensions and 32 GPUs. These are the smallest examples with two positions per axis.
Both animations compute the same output matrix. The upper-left circular group A and upper-right square group B handle the first token. Lower-left hexagonal C and lower-right diamond-shaped D handle the second. Moving horizontally between groups changes the output neuron.
Start from the preceding layer's output. Suppose an intermediate layer computes . The previous layer has produced 16 features each for two tokens, so has shape and the current layer's weights have shape . Divide the 16 features into eight dot-product segments of two terms. Choose an even layout: the two input values for a token are split between groups in one row, and the two weight values for a neuron between groups in one column. For each segment, each group already has one input and one weight. Each GPU covers two segments in the 4D diagram and one in 5D. Inputs come from the preceding layer, while weights are the current layer's own parameters.
For segment one, the four corresponding GPUs hold the numbers below. The two GPUs in each row together have the two input values for one token, and the two GPUs in each column have the two weights for one neuron.
| Output neuron 0 | Output neuron 1 | |
|---|---|---|
| Token 0 | A: input 1, weight 3 | B: input 2, weight 6 |
| Token 1 | C: input 3, weight β1 | D: input 6, weight β2 |
Follow D, which must compute . It already has both numbers for the second term and could begin with , but lacks input 3 and weight 6 for the first term. The animation gathers first. D exchanges inputs horizontally with C, sending its 6 and receiving 3. It exchanges weights vertically with B, sending β2 and receiving 6. D can now compute the local sum . The other seven segments use the same layout. Segment scales the first segment's inputs by with unchanged weights, giving D eight contributions .
If two GPUs need one value, how many transfers are required? Both C and D need input 3. If inputs start in external storage and each GPU can read just its required shard, C and D can each read it once, for two storage reads. Alternatively, C can read it once and send it to D, for one storage read and one inter-GPU transfer. Both routes deliver 3 to both GPUs. Compare costs by identifying the links traversed and bytes sent on each.
This diagram counts from an intermediate layer: the previous layer already produced 3 on C, so it shows only C sending it to D. If the previous activations and this layer's weights are already aligned for each GPU's features, local multiplication can begin immediately. Whether communication follows depends on which GPUs hold partial sums for the same output.
4D diagram: each output group uses a four-GPU plane. The horizontal coordinate is and the vertical is . Of eight dot-product segments, each GPU handles two. Group A's upper-left GPU, for example, takes segments 1 and 5 and locally obtains . Upper-right, lower-left, and lower-right obtain 8, 10, and 12. Now follow the two plane axes.
In A, simultaneously compute and along , then combine along . Open the animation to step through. Intergroup exchange tracks only segment one. Diagram designed for this article.
5D diagram: each output group uses an eight-GPU cube. With the same eight segments, each GPU computes one. Left/right , up/down , and front/back provide three within-group axes, giving full coordinates .
In A again, the rear four GPUs compute and along , then combine to 26 along . Finally send forward along and combine with 10 from the front plane to obtain 36. Diagram designed for this article.
How many GPUs does a mesh with independent axes need? In a regular full mesh each axis has at least two positions, so dimensions need at least GPUs. The minima for 1D through 5D are 2, 4, 8, 16, and 32. To add depth to a four-GPU plane, each front position needs a corresponding GPU behind it, giving a cube of eight. Re-pairing the original four creates new communication groups but leaves only the original four device positions.
Conversely, how many dimensions can GPUs occupy? For axis lengths , we have and hence . To use every GPU exactly once, the exact maximum is the number of prime factors of , counting multiplicity, since each can supply one axis length. Broadcasting and reducing repeatedly in the same group doesn't change mesh dimensionality.
Whether grouping saves communication depends on ownership and routes. Suppose a token's activations are evenly split over GPUs. If every GPU needs the complete input for the next layer, each lacks values. Hierarchical gathering doesn't eliminate that deficit. If the next weight rows already align with local activations, multiply locally and reduce outputs afterward. With a β4Dβ or β5Dβ description, ask what a new coordinate indexes: subdivisions of an existing index, a hierarchy of device communication, or a different division of labor in training.141
π NoteγWhat does D count in β2Dβ or β3Dβ? Zhou Boyang's fourth lesson on distributed LLM training gives βTP+PPοΌζθ TP+DDPβ (βTP+PP, or TP+DDPβ). Here 2D counts two training strategies: tensor parallelism paired with pipeline parallelism, or with distributed data parallelism that synchronizes training across replicas.11
HPC-AI Tech's 2021 Colossal-AI introduction called DeepSpeed and Megatron's 3D hybrid parallelism βdata parallelism, pipeline parallelism, and 1D tensor parallelism.β Immediately afterward, it listed 2D, 2.5D, and 3D tensor-parallel strategies in Colossal-AI. The first counts strategies for an entire training run. The second counts how within-layer computation is split.18
BLOOM splits examples using data parallelism and successive layers using pipeline parallelism, while employing Megatron-style 1D tensor parallelism inside layers. Its first feedforward layer is column-split, its second row-split, both across the same group of devices. This article's 3D tensor parallelism divides tokens , output neurons , and dot-product sum positions across GPUs within one layer multiplication.125 Revisit the roles of BLOOM's 384 GPUs
Redrawn from DeepSpeed's 32-GPU example. Each block is a GPU with its number on the front face. Four blocks of one color extend front to back, computing a single stage for one replica. The original labels depth Model Parallel; in this example it uses Megatron's tensor partitioning.21
Start at GPU 0. Behind it is 1: they process the same layer, stage, and sample batch, handling different shards. Below it is 4, which handles the same layers and shards but reads another sample batch. ZeRO can share optimizer states between these data-parallel partners. To the right is 8, the next network stage for the same replica. Now take a step along depth in the earlier 3D tensor-parallel cube: both GPUs still compute the same layer and output block, but handle different dot-product segments and must sum their contributions.215
Can algorithms automatically find the best combination of network partitions?
An algorithm can select partitions. For the two-layer feedforward network, column then row splitting lets activations stay local. Optimizing both layers independently may select each layer's fastest multiplication yet introduce an all-gather between them. Compare time to complete the same training step, including forward, backward, and parameter updates.122
How does automatic scheduling relate to partition selection? HPC-AI Tech's 2021 overview calls one feature Adaptive task scheduling: a scheduler can scale using factors such as batch size and migrate jobs through NCCL communication.18 If a job expands from eight GPUs to sixteen, what next? Add data-parallel replicas to process more samples simultaneously or spread the matrices in one layer over more GPUs? Scaling changes available resources; partitioning decides how they participate. Resource changes can trigger a new search. The choice requires comparing memory, communication, and full step time.
To follow code into an execution plan, see drawing a computation graph from two multiplications and costing two layouts operation by operation.
What does βfastest within budgetβ mean?
Fix the model, input shape and tokens per step, GPU count, and interconnect. Suppose there are two hard budgets: no GPU may exceed peak memory during the step, and total bytes sent across nodes cluster-wide must remain below a per-step limit, counted once at the sender. Exclude candidates exceeding either budget, then choose the remaining plan that finishes the step soonest.
π NoteγBandwidth and communication volume have different units. Assume both layouts fit in memory. A sends 120 GB across nodes per step and takes 0.8 seconds. B sends 80 GB and takes 1 second. With a 100 GB cap, choose B. If only link bandwidth (GB/s) is specified and the step times already include communication waits, choose A. Extra data movement may overlap other computation.
Can the matrix shape alone determine the partition?
Start with . Let denote the numbers of groups along token, output neuron, and dot-product length. A regular mesh of GPUs with one per coordinate requires . For evenly divisible dimensions, enumerate compatible integer combinations, specify broadcasts, reductions, and inter-layer handoffs for each, and compare costs. This is grid search. The axes with more than one group are the ones actually split; you needn't guess a best dimension count in advance.
The earlier formulas directly compare communication bytes for a forward pass in two specified layouts. To derive a blocking scheme for one product, COSMA starts from shape, processor count, and available memory, derives a lower bound on data movement, and constructs a parallel algorithm close to it. Optimizing a whole network's step time also requires each local multiplication's performance on the target GPUs and where the next layer needs its data.23
How can we estimate the cost of a training step?
Calculon models hardware costs. Its A100 configuration describes matrix throughput, memory capacity and bandwidth, and interconnects, with compute efficiency varying by operation size. Halving a matrix halves each GPU's work, but the smaller multiplication may achieve a lower fraction of peak throughput. Given a model and parallel configuration, Calculon estimates batch execution time, throughput, and memory, and compares multiple configurations.24
Proteus simulates dependencies and overlap. It expands a plan into per-GPU compute and transfer tasks, simulating dependencies and competing transfers on shared links. In the 3D reduce-scatter, GeLU waits for its local sums to complete, but another microbatch may already have multiplication ready. Step time depends on how far the reduction delays completion of the whole step. Proteus's authors tested three hardware configurations and reported 3.0% average error in training throughput prediction for the tested plans.25
How does the search handle network-wide combinations?
With a few candidates, a cost model can estimate each layout. As layer count rises, exhaustive tests of all combinations quickly become expensive. Automatic parallelization systems use dependencies between neighboring layers or pipeline structure to narrow the search.
| System | What the algorithm decides | How the paper handles budgets and time |
|---|---|---|
| Alpa | Uses integer linear programming for operator partitions, including resharding between neighbors. Dynamic programming then chooses pipeline stages and assigns devices to them. | Checks whether each stage fits per-GPU memory and compares candidate execution times including cross-device communication.22 |
| Galvatron | Prunes candidates, then uses dynamic programming to combine data, sharded data, and tensor parallelism per layer and compares pipeline stage counts. | At a fixed batch size, seeks a fast plan under the device-memory budget, including communication time. The paper also searches batch size to optimize samples per second.26 |
Neither system separately budgets maximum cross-node bytes per step. If that limit exists, track sent bytes per candidate and reject even the estimated fastest plan if it exceeds the cap. With a finite candidate set and exact costs, a complete solver can find the fastest feasible plan, possibly with ties. Real systems prune and can only estimate GPU efficiency and communication overlap. Benchmark full steps with identical inputs on the target cluster to determine which top candidates are actually fastest.222625
How do Alpa's automatic plans compare with hand-tuned plans?
Start with the user's code. Alpa's quickstart uses JAX to write one training step: accept a batch, calculate prediction error, and update the weights. Add @alpa.parallelize to allow the same computation to run on multiple GPUs. The tutorial first compares updated weights with a single-GPU result, then compares step time and per-GPU memory. The tuning guide recommends trying plain data parallelism with a small model, splitting samples among GPUs. Its pipeline tutorial then demonstrates two ways to use one network: manually mark where the next GPU group takes over, or let Alpa choose stage boundaries and device assignments.2728
π NoteγJAX is a Python library for array computation. Here
jax.gradautomatically differentiates the error function to obtain each weight's gradient, telling us how the error changes with a small weight change. Alpa takes the training step containing these operations and schedules it across GPUs.27
Figure 7 of Alpa's paper reports hardware measurements. For both comparison systems the authors tried multiple parallel settings and kept each system's best. On the GPT-3 family, Alpa's automatically found plans matched tuned Megatron-LM v2 throughput. For mixture-of-experts models (MoE, where each token uses only some experts), they compared against DeepSpeed. Each machine had eight V100s connected by fast local links. The network between machines was much slower. Alpa kept frequently communicating computations together on a host where possible and placed groups of consecutive layers on different machines. For the GShard MoE models in the paper, Alpa achieved 3.5Γ the throughput of the contemporary DeepSpeed configuration on two hosts and 9.7Γ on four. Each ratio compares the same training task within that scale; the four-host model was larger than the two-host one.22
Once a partition is chosen, how do processes on different machines run their assigned stages? See how Ray distributes work during multi-GPU training.
Footnotes
-
Shoeybi, M., et al. (2019). Megatron-LM: Training multi-billion parameter language models using model parallelism. arXiv. Section 3, figure 3, column and row partitions of consecutive layers β© β©2 β©3 β©4 β©5 β©6 β©7 β©8 β©9 β©10 β©11 β©12 β©13
-
Bian, Z., & Li, Y. (n.d.). 1D tensor parallelism. Colossal-AI. Two-layer partition in βIntroduction,β ring communication and activation memory estimate in βEfficiencyβ β© β©2 β©3 β©4 β©5 β©6 β©7 β©8 β©9 β©10
-
Bian, Z., & Li, Y. (n.d.). 2D tensor parallelism. Colossal-AI. Four-GPU blocking and two broadcast rounds in βIntroductionβ β© β©2 β©3 β©4 β©5 β©6 β©7 β©8 β©9 β©10 β©11 β©12 β©13 β©14 β©15 β©16 β©17 β©18 β©19 β©20 β©21
-
Bian, Z., & Li, Y. (n.d.). 2.5D tensor parallelism. Colossal-AI. Layering and weight partition example in βIntroductionβ β© β©2 β©3 β©4 β©5 β©6 β©7 β©8
-
Bian, Z., & Li, Y. (n.d.). 3D tensor parallelism. Colossal-AI. Three-axis partitioning and reduction in βIntroductionβ β© β©2 β©3 β©4 β©5 β©6 β©7 β©8 β©9 β©10 β©11 β©12
-
Strang, G. (2016). Introduction to linear algebra (5th ed.). Wellesley-Cambridge Press. Section 1.3, βMatrices,β p. 23, equations (3)β(4) β©
-
PyTorch. (n.d.). Linear. PyTorch documentation. Forward formula, input/output shapes, and weight layout β© β©2 β©3 β©4
-
PyTorch. (n.d.). Tensor views. PyTorch documentation. Transposed views and contiguous storage β©
-
Kingma, D. P., & Ba, J. (2015). Adam: A method for stochastic optimization. ICLR. Section 2, first and second moments in Algorithm 1 β©
-
PyTorch. (n.d.). Autograd mechanics. PyTorch documentation. Saved tensors β© β©2
-
Zhou Boyang. (2024, March 23). Distributed LLM Training, Lesson Four: Tensor Model Parallelism. Zhihu. Discussion of GeLU after βColumn Parallelism,β opening of β2D/2.5D and 3D Parallelism,β and paragraph after the 3D block matrix formula. Original article β© β©2 β©3 β©4 β©5 β©6
-
Bekman, S. (2022, July 14). The technology behind BLOOM training. Hugging Face. Tensor Parallelism β© β©2
-
NVIDIA. (2025). Megatron Core tensor-parallel layers (core_v0.12.0). GitHub. Implementation dividing input width equally by GPU count. β©
-
NVIDIA. (n.d.). Collective operations. NCCL User Guide. Definitions and diagrams of the collectives β© β©2 β©3 β©4 β©5
-
NVIDIA. (n.d.). Point-to-point communication. NCCL User Guide. Two-sided communication β©
-
MindSpore. (n.d.). Higher-dimensional tensor parallelism. MindSpore 2.4.0 documentation. Communication behavior in 2D tensor-parallel computation β© β©2 β©3 β©4 β©5 β©6 β©7 β©8
-
Xu, Q., Li, S., Gong, C., & You, Y. (2021). An efficient 2D method for training super-large deep learning models. arXiv. Page 7, communication workspace and table 1 communication and computation costs β©
-
HPC-AI Tech. (2021, November 18). Colossal-AI: A unified deep learning system for large-scale parallel training. Medium. βMultiple parallelisms,β opening paragraph, sentences 1β2 Β· βMulti-dimensional model parallelβ diagram Β· βAdaptive task schedulingβ β© β©2 β©3
-
Wang, B., Xu, Q., Bian, Z., & You, Y. (2021). Tesseract: Parallelize the tensor parallelism efficiently. arXiv. Figure 3 and synchronization between device planes β© β©2
-
Quintin, J.-N., Hasanov, K., & Lastovetsky, A. (2013). Hierarchical parallel matrix multiplication on large-scale distributed memory platforms. arXiv. Device grouping and two-level communication in hierarchical SUMMA β©
-
DeepSpeed Team, Majumder, R., & Wang, J. (2020, September 10). DeepSpeed: Extreme-scale model training for everyone. Microsoft Research. β3D parallelism,β figures 1 and 2, grouping and device mapping for 32 GPUs β© β©2
-
Zheng, L., et al. (2022). Alpa: Automating inter- and intra-operator parallelism for distributed deep learning. OSDI 2022. Sections 4β5, operator layouts, pipeline search, and memory constraint in equation 5; section 8.1, experiment configuration, figure 7, and comparisons; appendix B, table 7, MoE model sizes for each GPU count. β© β©2 β©3 β©4
-
Kwasniewski, G., et al. (2019). Red-blue pebbling revisited: Near optimal parallel matrix-matrix multiplication. SC19. Communication lower bound and COSMA algorithm β©
-
Isaev, M., McDonald, N., Dennison, L., & Vuduc, R. (2023). Calculon: A methodology and tool for high-level codesign of systems and large language models. SC23. Hardware cost model, batch time and memory breakdown Β· A100 efficiency and bandwidth settings Β· Single estimates and configuration search examples β©
-
Duan, J., et al. (2023). Proteus: Simulating the performance of distributed DNN training. arXiv. Execution graphs, shared bandwidth, and throughput prediction experiments β© β©2
-
Miao, X., et al. (2022). Galvatron: Efficient Transformer training over multiple GPUs using automatic parallelism. arXiv. Algorithm 1 and section 3.4, strategy search under memory budgets and communication time estimates β© β©2
-
Alpa contributors. (n.d.). Alpa quickstart. Alpa 0.2.3.dev17. Official training step, automatic parallelization, and numerical validation. β© β©2
-
Alpa contributors. (n.d.). Performance tuning guide and Distributed training with both shard and pipeline parallelism. Alpa 0.2.3.dev17. Tuning sequence starting from data parallelism; manual and automatic stage examples. β©