Elamur Research

Demystifying the Communication Characteristics for Distributed Transformer Models

Paper · 2024 · Quentin Anthony, Benjamin Michalowicz, Jacob Hatef et al.

Summary

Adding GPUs to a training job gives it more computing power, but it also creates more places where one worker needs a result from another. For a Transformer, that result might be a contribution to a weight update, an intermediate calculation from an earlier layer, or the missing portion of a calculation shared across devices. The authors use GPT-NeoX training runs on Frontier to find out what each arrangement asks of the communication system. They derive the amount of data that should move, then use traces from the running jobs to examine the operations, payload sizes, and frequency of those exchanges.

Ordinary distributed data parallelism, ZeRO-1, and ZeRO-2 have equal predicted traffic per iteration. They differ in how workers hold training state and in how they combine gradients and distribute updated weights. ZeRO-3 splits the weights themselves across workers, adding a gather to the traffic account and making its predicted volume 50% higher than the ordinary data-parallel baseline. The logs generally follow the data-parallel predictions. They also reveal a range that a traffic total obscures. In the 1.3B ZeRO-3 case, many exchanges that supply weights to workers have kilobyte-scale payloads, while the messages associated with combining gradients run from 10s to 100s of megabytes.

The authors also vary the number of tokens per sequence in the 1.3B configuration. Where the runs use Allgather, an operation that assembles pieces held by different workers, its volume stays effectively flat across the reported range from 512 to 4096 or higher. Sending intermediate results and their gradients across pipeline stages has a different cost. Those transfers grow with sequence length, as the exchanged arrays contain values associated with token positions. Achieved floating-point throughput per GPU rises with longer sequences in the tested runs. In the settings displayed for the direct comparison, sharing calculations within layers through tensor parallelism reaches up to almost 2x the throughput per GPU of dividing the layers into pipeline stages.

Timing exposes a further feature of the workload. Some small pipeline receives take unusually long during the opening iteration, even though the traces contain much larger transfers elsewhere. The result matters alongside the message counts and total volumes. Those measurements answer how often the communication system is called and how much data it handles. The receive trace shows where an individual exchange can take a long time. The paper uses all of these observations to identify demands that a single measure of training performance would leave hidden.

Deep dive: Demystifying the Communication Characteristics for Distributed Transformer Models

Frontier training traces and traffic equations show how data, pipeline, and tensor parallelism change the messages exchanged between GPUs. · about 34 minutes to read

The problem and its context

Why a training rate leaves an engineering question open

Training a large Transformer requires space for its learned weights, the information needed to update them, and the intermediate results used to work out those updates. It also requires enough time on the accelerators to repeat that computation across the training data. Distributing the job can provide both memory and computing capacity. As soon as the job places related calculations or pieces of training state on separate devices, however, the devices have to bring those pieces together at the appropriate points. A faster local calculation can leave a worker waiting if the next calculation depends on a message that has yet to arrive. That is the aspect of the training workload the authors investigate through GPU and parallel computing.

The paper motivates the study with a result from MegaScale. That work reports 55.2% utilization of the available floating-point capacity for training a 175-billion parameter configuration on 12,288 GPUs. The utilization measure describes how much of the available arithmetic capacity the training work uses. It gives a view of the efficiency problem at large scale. To decide which communication routines deserve attention, an engineer would still need to identify the exchanges involved, how often they occur, and at what sizes. MegaScale is an example of a broader effort that develops the training framework together with the system it runs on, with efficiency and stability as goals. MegaScale

The useful level of detail depends on who is asking. A training framework developer may want to see where a new placement of weights creates additional requests for them. A developer working on the communication library may need to know which operations recur with small payloads. A system designer may be interested in whether the workers participating in those operations can be kept within a node or must exchange data across nodes. All of those questions concern the same training iteration, but they concern different properties of it. The paper sets out to identify the payloads and operations before interpreting the rate at which the whole job runs.

There are many ways to assemble the software and hardware for a distributed run. The authors discuss choices spanning the training framework, the communication library beneath it, the division of work, and the machine. The choice of framework can affect which operations appear in a trace. The choice of device placement affects which links can carry them. The architectural dimensions govern the size of the data that workers need. An observation about elapsed time alone bundles those effects together. The study aims to give the exchanges a description that begins with the training computation and can then be checked against a particular implementation.

How the division of work creates dependencies

The original Transformer in the paper's account has an encoder and a decoder for translation. Later architectures use different parts of that design, with BERT and GPT-2 illustrating encoder and decoder use respectively. The piece of the architecture that matters here is a stack of layers that repeatedly transforms a representation of the input. Attention uses information from different positions. A feed-forward block then transforms the features at each position before the representation advances through the stack. Normalization and residual connections are also part of the layer structure the authors describe. Attention Is All You Need · BERT

A training step uses this stack in both directions. The forward calculation produces a prediction and a loss. The backward calculation works from the loss through the earlier calculations, producing gradients that the training procedure uses to update the learned values. A gradient gives the sensitivity of the loss to a change in a value. Different divisions of work create different reasons to exchange one of these quantities. That distinction is important because the dimensions of an intermediate result follow the current input, whereas the size of a set of weights follows the architecture.

Data parallelism assigns different examples to different workers. In its ordinary replicated form, each worker can run the full computation on the examples assigned to it. To move all replicas through the same update, the workers need to combine the gradients derived from their separate examples. The authors describe earlier data-parallel work as showing that increasing the number of workers can raise the rate at which training data is processed, with a corresponding increase in the batch. They also describe two constraints that make the choice consequential. Replicated training state must fit on each worker, and training with a larger batch across the whole job can require tuning to achieve convergence.

Pipeline parallelism puts different layers on different workers. A portion of the input can begin at an early stage while a different portion has progressed to a later one. The division puts an exchange wherever consecutive stages meet. In forward computation the later stage needs the earlier one's output, called an activation. In backward computation the earlier stage needs gradients that come from the later one. At some points the schedule leaves a worker with no ready work. The paper calls these periods pipeline bubbles and describes earlier pipeline research as trying to reduce them. Where the stage boundary falls affects both the computation assigned to each stage and where the waiting can occur.

Tensor parallelism divides calculations within a layer. The paper uses large matrix operations as its example. A worker can carry out the calculation for one portion of a matrix, such as a set of rows or columns, while other workers handle other portions. The arrangement needs a way to combine or assemble the results so the next part of the layer receives what it requires. The authors describe existing implementations that split both attention and the feed-forward block this way. They also explain the practice of keeping a tensor-parallel group within a node when possible. Those workers communicate repeatedly, and the links inside a node typically offer higher bandwidth than the links between nodes.

The three approaches can be combined. Separate groups can process different examples, a group's layers can be split into stages, and a stage can divide a layer's arithmetic among its workers. The paper calls this arrangement 3D parallelism. It gives a job ways to add workers without increasing the number of separate data replicas in step with the total device count. It also creates distinct sets of participants. The workers sharing a gradient update across copies need not be the workers that exchange pieces of a calculation inside a layer. Communication traced on a given device can thus include calls made for several different purposes.

Where earlier measurements put the emphasis

The authors place their work in a line of systems studies that profiled distributed neural-network training. Earlier studies assessed CPU and GPU training, compared runs using PyTorch and TensorFlow, or investigated communication through CUDA-aware MPI. The paper also describes a comparison of different language architectures on Frontier. A study that varies architecture can reveal what changes in whole-job performance as the computational workload changes. Here the authors are interested in identifying the traffic caused by different placements of the same kinds of training work.

The paper describes an investigation of language-system development in datacenters that identified communication as one source of performance variation alongside other hardware and system constraints. It also discusses work on NVIDIA DGX that emphasized use of a 200Gb/s network as training scaled. In the authors' comparison, that work leaves open how the traffic mix changes when a job uses different ways of partitioning layers or calculations, or when the number of input positions changes. This paper makes the operation and its payload the unit of analysis, so it can examine those changes in terms of what the workers exchange.

That focus calls for both a description of the work the training algorithm requires and a record of the work the system performs. An equation can identify how much data a pipeline boundary ought to carry. A trace can show the boundary transfer alongside calls that arise during setup or from decisions inside the framework. The authors use the equation to give the traffic a specific interpretation and the trace to test how much of the observed communication that interpretation covers.

The method, step by step

Identify the payload before counting the calls

The starting point is the shape of the information used during training. Each input token is mapped to a vector, a list of values that represents it. Position embeddings supply values associated with its place in the sequence. The resulting array has an axis for token positions, an axis for the examples processed together, and an axis for the features used to represent each position. The paper uses the microbatch for the group of examples in this calculation. A larger microbatch makes the array wider along the examples axis. A longer sequence extends the positions axis.

The same outer shape is maintained through the layer stack. The feed-forward block temporarily projects into a wider feature space, then returns to the layer's original hidden width. At the end of the stack, a separate projection into vocabulary space produces the quantities used to calculate cross-entropy loss. For the traffic calculation, the important point is that the array crossing a boundary inside the stack has a size that can be described without counting all the parameters in the layers on either side.

Once a layout is specified, the authors identify which data must leave a worker. A replicated training run needs to reconcile the gradients from separate pieces of the batch. A pipeline needs to get the array of intermediate values to the worker responsible for its next layers and return the corresponding gradients. Workers sharing a layer need to communicate whenever the calculation requires a result that spans the pieces assigned to them. With weight sharding, in which each worker holds a portion of the weights, a worker can also need values that it did not store when the step began.

These needs map onto different operations. A send and its corresponding receive are point-to-point operations involving particular endpoints. A collective involves a group of participating processes, known as ranks. Allreduce combines rank contributions and supplies the combined result throughout the group. Reduce scatter also combines contributions, then gives each rank the part of the result assigned to it. Allgather assembles portions contributed by the different ranks and supplies the combined collection to all of them. Reduce directs a combined result to a designated rank. Broadcast starts with data at a designated rank and distributes it.

The name of the operation tells a reader something about the participants and the disposition of the result. It takes a further step to tell whether the payload is a weight, a gradient, or an activation. For example, an Allgather can make an updated set of weights available at the end of a step, or it can get weights into place for a layer that is about to compute. The calculations represent the role an operation plays in the training procedure. The logs provide the calls made during execution, with size and frequency information for the comparison.

From the training layout to measured traffic

The steps in order.

From the training layout to measured trafficStep 1: Choose the architecture, input shape, and worker layout1. Choose the architecture, input shape, and worker layoutStep 2: Identify which data must cross worker boundaries2. Identify which data must cross worker boundariesStep 3: Count payload elements and required exchanges3. Count payload elements and required exchangesStep 4: Estimate traffic for the chosen parallel arrangement4. Estimate traffic for the chosen parallel arrangementStep 5: Profile GPT-NeoX training runs on Frontier5. Profile GPT-NeoX training runs on FrontierStep 6: Group logged calls by operation and size6. Group logged calls by operation and sizeStep 7: Compare the observed and expected traffic7. Compare the observed and expected traffic

Calculate the size of the parameter collection

The authors divide the learned values into the input embedding, the projection back to the vocabulary, the position embeddings, and the parts of the layer stack. The input table and output projection each have a vocabulary dimension and a hidden dimension. In all the configurations used here their weights are untied, which means the tables have separate learned values. The position table contributes a vector of hidden width for each position counted by the formula. The remaining terms come from the repeated layers and their final normalization.

P = 2Vh + sh + L(12h² + 8h) + 2h

P is the count of learned parameters. V denotes vocabulary size, h is the hidden dimension or feature width, s is sequence length, and L is the layer count. Juxtaposed quantities are multiplied, ² indicates a square, and the plus signs add the groups of parameters. The first 2 represents the separate vocabulary-sized tables. The sh term gives the position table size. Within the parentheses, 12h² counts the attention and feed-forward matrices for each layer and 8h accounts for the per-layer gains and biases in the paper's tally. The final 2h represents the last normalization's learned scale and offset. The equality expresses the sum for the full architecture.

The attention term comes from four projections with hidden width along each axis. The feed-forward term involves a projection from hidden width to an expanded width, then another projection back. The paper writes the feed-forward count using the expansion factor and gives the resulting expression for the GPT-NeoX convention.

2xh² = 8h²

x is the expansion factor and h is the hidden width. Juxtaposition means multiplication and ² indicates the square of the width. The 2 counts the linear projections into and out of the expanded space. The equality gives the 8h² contribution at the paper's expansion factor of 4, with 8 the resulting coefficient for that architecture.

The notation also identifies a as the number of attention heads, the separate parts into which the attention computation is organized. The parameter formula counts the complete attention matrices, so it has no independent head-count term. The head count still matters when placing the computation on devices. The selected tensor partition has to be compatible with the allocation of heads. The experiment matrix includes a case where that requirement prevents a run.

The parameter expression helps establish what changes when an architecture grows. Increasing width increases the size of the vocabulary tables as well as the dimensions of the projections in every layer. Adding layers repeats the per-layer contribution. By comparison, the intermediate array that crosses a single stage boundary has one hidden-width axis. The authors can use the appropriate size for each exchange instead of describing all traffic in terms of the number of learned values.

Apply the collective costs to replicated and sharded training

The collective cost uses a logical payload size and a factor for the number of participating devices. In the data-parallel setting, the factor reflects the portion associated with the other ranks when each rank holds a share. The paper assigns the following cost to Allreduce.

C = 2 × m × (d − 1) / d

C is the assigned communication volume, m is the logical message size, and d is the number of devices in the group. In the data-parallel equations, this group is the set of participating training devices. The 2 accounts for the reduction and distribution portions of Allreduce in this accounting. In the group factor, − 1 excludes the local share and / d expresses the resulting fraction of the payload. The multiplication signs apply this fraction and the operation's coefficient to m. The equality specifies the volume convention used for the calculation.

The costs for Allgather, reduce scatter, and Reduce use the same group factor with a single payload term under the paper's convention.

C = m × (d − 1) / d

C is the cost of one of the named collectives, m is the message size, and d is the number of participating devices. The subtraction by 1 and division by d give the same fraction excluding the local share. The multiplication sign scales the message size by that fraction. The equality gives the cost for the chosen operation.

In distributed data parallelism, or DDP, each rank's contribution covers the gradients of all the learned weights. The calculation therefore uses the parameter count as the gradient payload size and charges the Allreduce once in the iteration account. The ZeRO approach changes how much of the training state each rank stores. Its name stands for Zero Redundancy Optimizer. An optimizer is the part of training that applies an update based on the gradients. It can maintain its own state, distinct from the weights it updates.

ZeRO-1 divides that optimizer state among the data-parallel workers. Each rank updates the weight portion for which it holds the associated state. Allgather then makes the complete updated weights available. ZeRO-2 additionally distributes the gradients. A reduce scatter places the combined gradient portions with the workers responsible for the corresponding updates. Once a portion has been reduced and the operation has finished with the temporary data, the description allows that storage to be released. In the analytical treatment, the combination of reduction into portions and gathering the updated weights uses the same volume as the gradient Allreduce baseline.

C = 2 × P × (d − 1) / d

C is the predicted volume of an iteration for DDP, ZeRO-1, or ZeRO-2, expressed in units of parameter elements. P is the architecture's parameter count and d is the number of data-parallel devices. The 2 counts the two portions of the Allreduce cost for DDP or the two collective contributions in the sharded account. The subtraction by 1 and division by d form the group factor. The multiplication signs scale P by that factor and the coefficient, and the equality gives the volume under the assumptions of the calculation.

ZeRO-3 distributes the weight storage as well. The rank that carries out a computation therefore needs to collect weights that are currently held elsewhere. The paper describes parameter availability for forward and backward computation and illustrates gathering the required weights as the work proceeds through the layers. In the iteration comparison it adds a parameter gather to the previous total. This is an amount-of-data calculation across the required weights. A framework can carry out gathers over many smaller ranges of the parameter collection.

C = 3 × P × (d − 1) / d

C is the predicted ZeRO-3 traffic for an iteration, again counted in parameter elements. P is the parameter count and d is the number of data-parallel devices. The 3 includes the extra gathering contribution alongside the traffic for gradient reduction and weight distribution. Subtracting 1 and dividing by d produce the same group factor as in the baseline. The multiplication signs apply that factor and the coefficient to P, and the equality sets out the resulting volume. The paper expresses this change as a 50% increase over ordinary data parallelism.

The authors also describe ZeRO++ as an extension of ZeRO-3. It applies block quantization to communicated weights and gradients, using a more compact representation for the values being transferred. It keeps another partition of the parameters within the compute node so that some gathers can use the node's own links. These changes concern both message size and placement. The element-count formulas for the numbered stages establish the exchanges underlying the main comparison. Converting a count of elements into bytes requires the representation used for the transfer, while determining which link carries those bytes requires the placement of the ranks.

Count the exchanges between and within layers

For a pipeline boundary, the size is set by the activation array. If each example in a microbatch contributes values at each sequence position and in each hidden feature, the paper uses the following payload count.

m = bsh

m is the payload size in elements, b is the microbatch size, s counts positions in a sequence, and h counts hidden features. Juxtaposition multiplies the dimensions, so the equality gives the number of elements in a send or receive for the activation array or its corresponding gradient.

The forward path carries an activation over each boundary between stages. The backward path carries the associated gradient in the reverse direction over the same boundaries. Both paths terminate at the ends of the pipeline. Counting its stages gives the following expression for the pipeline traffic under the paper's iteration accounting.

C = 2bsh × (p − 1)

C is the aggregate volume attributed to pipeline exchanges across the stages, expressed in element units. b denotes microbatch size, s sequence length, h hidden width, and p the pipeline stage count. Multiplication by 2 accounts for the forward and backward payloads. The subtraction by 1 counts the boundaries between successive stages. Juxtaposition and × both denote multiplication, and the equality assigns the combined two-direction volume. The product makes the role of the input shape explicit even when the layer allocation stays fixed.

A tensor group also communicates intermediate quantities. Here the counts are tied to the operations within layers. The paper counts 6 Allreduce operations per layer, including 2 for forward computation, 2 for activation recomputation, and 2 for backward computation. Recomputation produces intermediate values again when the backward calculation needs them. The accounting also includes an Allreduce at the embedding. These collectives use the intermediate array's dimensions and take place within the tensor group.

C = (12L + 2) × bsh × (t − 1) / t

C is the estimated tensor-parallel communication volume for an iteration. L is the number of layers, b is microbatch size, s is sequence length, h is hidden width, and t is the number of ranks in a tensor group. The coefficient 12 accounts for the Allreduce volume across the 6 calls in a layer. The added 2 is the contribution from the embedding Allreduce under the same cost convention. The term bsh is the payload size, with adjacent symbols multiplied. The subtraction by 1 and division by t give the group factor for tensor ranks. The plus sign adds the embedding contribution to the layer contribution, the multiplication signs apply the payload and group factor, and the equality gives the resulting estimate.

Layer placement changes how that tensor estimate is applied when the schemes are combined. With the layers divided among pipeline stages, the paper substitutes the stage's share of layers into the tensor term.

L → L / p

L is the full depth of the stack and p is the number of pipeline stages. The arrow indicates substitution in the tensor expression. Division by p represents the layer count used for a stage in the combined calculation. The authors view the traffic terms as additive. The pipeline exchange owes its existence to a dependency across stages, while the collective within a tensor group serves the distributed calculation at its stage.

Obtain a trace from a running job

For the empirical side, the authors use EleutherAI's GPT-NeoX framework and its existing size configurations. They train with enwik8 and report a vocabulary padded to 50,304 entries to help reduce runtime irregularities. The dataset supplies the input for the runs that generate the communication traces. The authors vary the training configuration and, in a separate comparison, the number of token positions in a sequence. The investigation follows the work required during training, so the outputs of interest are traffic and achieved hardware throughput.

DeepSpeed provides the ZeRO implementation and communication logging used in the study. The logs allow the authors to accumulate traffic by operation, examine counts at particular message sizes, and use more detailed records when interpreting what was exchanged. A run can include traffic that the iteration equations omit, such as a broadcast during startup. Keeping the operations distinct makes it possible to see whether an apparent surplus is associated with an expected collective, a point-to-point transfer, or additional activity.

Logging imposes an important execution condition. The authors state that DeepSpeed cannot overlap communication with computation while the logger is enabled. The traces and throughput observations are therefore measurements of an execution in which the two activities cannot hide behind each other. This matters when using the measured call times to interpret total performance. The volume calculation, by design, counts payloads without assigning them to an overlap schedule.

The paper also describes a complementary interconnect evaluation using OMB microbenchmarks. The procedure uses the training framework's communication backend to examine operations on the AMD Infinity Fabric and HPE-Slingshot 11 links. A benchmark of a specific call can focus on latency or bandwidth for that operation. The training trace supplies a different piece of information, namely which calls the training job generates and at what sizes. The two views address the capabilities of the underlying path and the demands placed on it by the workload.

Experiments and results

What the comparisons measure

All of the main experiments use the Frontier supercomputer at the Oak Ridge Leadership Computing Facility. The size comparison covers GPT-NeoX configurations of 19M, 125M, 1.3B, and 13B parameters. For data parallelism the reference case is DDP, and the alternatives divide training state according to the numbered ZeRO stages. The pipeline and tensor experiments compare their respective ways of dividing computation and include runs that combine the two. The analytical equations give a second baseline by indicating the traffic expected from the operations intrinsic to each arrangement.

The traffic totals measure the amount of logged data assigned to a run or operation. The proportions compare the amount handled by each operation with the overall logged volume. The message-size distributions count calls at their respective payload sizes, giving repeated operations their own visibility even when each one contributes few bytes. In the sequence-length study, achieved TFLOPs per GPU measure the rate of floating-point operations on each device. Taken together, these measures let the authors ask whether growing the input changes the traffic and whether the devices still achieve a higher rate of arithmetic with that traffic present.

The introductory timing illustrations give a view of an iteration before the detailed comparisons. They use GPT-2-based configurations of 13-billion and 20-billion parameters, both with ZeRO-1 and 8 tensor-parallel stages. The authors use them to illustrate how prominent communication can become relative to computation as the configuration grows. The main comparisons span a different set of sizes and examine the operations and volumes in more detail. The single-iteration profiles help motivate the move from a timing breakdown to a description of the underlying exchanges.

Data-parallel volume follows the parameter account

For the sizes that can run under the relevant schemes, the authors find broad agreement between the data-parallel traffic measurements and their volume predictions. The theoretical comparison assumes a fixed parameter count and the same group-size factor for each scheme being compared. The coefficient shown below multiplies both of those quantities. It summarizes the prediction used to interpret the enwik8 runs and is an analytical quantity instead of a measurement read off a volume plot.

Iteration traffic coefficients for GPT-NeoX data parallelism on enwik8

The predicted cost rises when ranks also divide the weights.

Iteration traffic coefficients for GPT-NeoX data parallelism on enwik8Distributed data parallelism (this paper): 2Distributed data parallelism (thispaper)2ZeRO-1: 2ZeRO-12ZeRO-2: 2ZeRO-22ZeRO-3: 3ZeRO-33
The numbers
System or settingCoefficient of parameter count times the device-group factor
Distributed data parallelism (this paper)2
ZeRO-12
ZeRO-22
ZeRO-33

DDP shares the lowest predicted coefficient with ZeRO-1 and ZeRO-2. Those settings differ in storage requirements. The distinction is visible at the largest size. The formula can give a DDP traffic value for 13B parameters, but the authors say that a run would exceed worker memory. That comparison has an analytical reference without a matching observed DDP run. The ZeRO breakdowns at the other sizes use a single node, while the 13B case requires a different setup because of memory.

The collective breakdowns also make clear why an equal coefficient does not imply identical traces. The analysis assigns reduction and distribution costs according to the purpose of the exchange. DeepSpeed's logs also include what the framework actually invokes, and Allreduce remains a significant contributor to the ZeRO-1 and ZeRO-2 breakdowns. The authors discuss that observation in the context of the smaller configurations fitting on a Frontier MI250X GPU with DDP. The trace shows how the implementation realizes the workload around the exchanges captured by the equation.

Broadcast appears in those records because initial parameters have to be distributed. Its proportion falls as the configuration size increases. A proportion concerns the operation's volume relative to the rest of the recorded traffic, so this finding describes its prominence in the mix. The iteration prediction has a different scope, centered on the traffic required by an ordinary step. Recording initialization alongside ongoing training makes the startup contribution visible and allows readers to distinguish it from the traffic attributed to the update.

ZeRO-3 uses a wide range of message sizes

The detailed frequency comparison for ZeRO-3 covers 19M, 1.3B, and 13B parameters, on 2 nodes with 8 GCDs per node. A GCD is a graphics compute die, the hardware unit counted in that run description. The authors inspect how frequently individual sizes appear, focusing their plotted distributions on Allgather. As parameter count rises, the records show a wider variety of sizes. It matters that the same kind of collective accompanies payloads at several scales because the amount of data in a full training step gives little guidance about which of those calls repeats frequently.

The more detailed logging provides an interpretation for the 1.3B case. Many exchanges involved in supplying weights have sizes in kilobytes. The gradient aggregation activity involves messages from 10s to 100s of megabytes. The difference reflects the uses of the exchanges. Weight gathering makes the appropriate portions available for computation, while the gradient traffic combines contributions needed for updates. The authors contrast that gradient activity with the gradient Allreduce that serves ordinary DDP.

A byte total puts more weight on a large call because that call contributes more data. Counting invocations gives the repeated small calls a distinct presence in the workload. The authors use the ZeRO-3 distribution to argue that communication libraries should pay attention to performance at both ends of the range. The result identifies payload sizes relevant to the training system even when the original reason for distributing the job was the overall size of its parameter collection.

Pipeline and tensor traces include additional activity

For pipeline parallelism the comparison with theory emphasizes sends and receives, since the equations count the activations and gradients crossing from one stage to its neighbor. The tensor-parallel comparison emphasizes Allreduce, the operation charged in the layer-by-layer accounting. The observed mix includes other activity. Where tensor and pipeline parallelism are combined, the volume breakdown is dominated by Allgather in spite of the presence of stage-to-stage traffic. In the pure pipeline case, that Allgather dominance disappears and substantial Allreduce traffic appears.

The authors suspect that the large Allreduce calls in the pipeline-only setting are internal to DeepSpeed. They also report more communication in tensor parallelism than the prediction accounts for and suggest framework internals there as well. The traces establish that the full set of calls exceeds the operations covered by the simple descriptions. The proposed source explains how that could happen, while the volume comparison itself leaves the specific implementation path open.

The pure tensor runs have a gap at 125M parameters. The number of attention heads in that configuration cannot be divided as required by the selected tensor partition. This is a constraint on running the calculation in that layout. It removes that point from the measurement comparison even though the equation can still be read as a description of the volume in a compatible configuration.

The separate traces for pipeline sends and receives expose a further discrepancy. The authors report up to an extra eight megabytes on sends and suggest that these bytes may be metadata sent along with the intended payload. The trace shows that the sender's recorded traffic can exceed the simple activation or gradient count. The paper leaves the metadata explanation as a possibility.

Timing adds a different asymmetry. The authors describe the receive operation as having a startup penalty, especially at small message sizes. In the opening iteration, the overhead for some receives is on the order of thousands of milliseconds. They refer to this as cold-cache behavior and point to its significance for pipeline runs at larger sizes. The observation locates a delay at a particular endpoint and moment. The analysis does not derive that delay from the payload count or identify a specific cache or initialization operation as its source.

Sequence length changes pipeline traffic and achieved throughput

The sequence-length experiments keep the parameter configuration at 1.3B and use 2 nodes with 8 GCDs per node. The authors examine data-parallel and layer-partitioned layouts in that setup. Wherever Allgather is applicable, the plotted traffic is effectively steady from sequences of 512 tokens to 4096 or higher. The observation concerns the amount gathered during the reported runs. In this comparison, the exchanges captured by the Allgather totals have little visible response to a change in the number of token positions processed.

Sends and receives show a different pattern. The transfers cross pipeline boundaries with arrays that have a sequence-position axis. As the input gets longer, the reported receive volumes rise by 2x in the comparison the authors describe. The send plot shows an increase that the authors describe as approximately doubling or slightly greater than 2x. These statements concern the plotted changes as sequence-length values increase. The source of the data in the transfers explains the direction of the result. The measured payload must carry intermediate values or gradients for the positions handed to the pipeline. A pure tensor layout omits that stage-to-stage operation, since it shares calculations inside layers.

The data-parallel throughput plot shows an approximate 2-2.5x increase in achieved floating-point work per GPU across the sequence lengths discussed. The paper also finds that ZeRO more often reduces that throughput when configurations are compared at the same sequence length. These trends refer to different comparisons. One follows the workload as its sequences grow. The other compares storage and communication arrangements within a given input size. The ability of a sharded configuration to fit its training state on the available devices can matter even in settings where an ordinary replicated run, if feasible, achieves a higher rate of arithmetic.

The pipeline and tensor throughput comparisons also show higher per-GPU throughput with longer sequences. For the settings plotted for throughput, the paper compares a pipeline with two stages and a tensor-parallel size of two. In that comparison, tensor parallelism gives up to nearly 2x the TFLOPs per GPU of pipeline parallelism. The operation breakdown shows that the two workloads use different exchanges. The throughput outcome includes the consequences of the division of arithmetic and when each device can begin its next calculation, alongside the costs of the operations recorded in the traces.

The rise in pipeline traffic and the rise in throughput can occur together. Extending the input changes the arithmetic the workers perform as well as the size of data handed across a pipeline boundary. TFLOPs per GPU describe how rapidly floating-point work is being performed. The send and receive measurements describe how much of the intermediate data crosses the boundary. Reading the curves together establishes that larger transfers did not prevent a higher achieved arithmetic rate in these runs. It leaves the individual contributions of computation, communication, and scheduling to that change unresolved.

What the ablations show

The paper presents controlled comparisons and diagnostic analyses in place of component-removal ablations.

Changing who owns the training state

The variation across ZeRO stages is a comparison of ownership. A replicated run holds the state needed to apply a shared update at each worker. The earlier ZeRO stages give ranks responsibility for particular portions of the optimizer state and, at ZeRO-2, the gradients. The authors can then ask whether organizing the update around those portions alters the traffic total. The broad agreement with the equations supports an interpretation based on the required movement of data. The reduction into pieces and the gathering back of updated weights can occupy the same volume budget as the reduction and distribution in DDP.

With ZeRO-3, the ownership change extends to the parameters used directly in the layer calculations. A rank computing a layer can require weight values held by other ranks. Gathering those values adds to the expected volume, and the logs generally support the higher traffic level for that stage. The observed rise has an explanation in the arrangement of the data. It follows from an additional availability requirement introduced by splitting the weights. This is more specific than attributing the change to the fact that the run uses a different optimizer configuration.

Changing ZeRO stage affects several properties of execution together. Sharding changes what a worker stores, what it can update locally, and the operations that make results available. The comparisons support the traffic interpretation across those arrangements. They leave open how much throughput changes because of an individual collective, the timing of a gather, or other differences in the framework's schedule. A total that agrees with the equation allows readers to connect the volume to the change in ownership without treating the stage comparison as a measurement of each implementation choice in isolation.

The detailed ZeRO-3 trace takes this analysis inside the volume total. Assigning small messages to weight exchanges and large ones to gradient aggregation shows that different training activities create distinct communication demands within the same run. The activity associated with the largest payload gives one guide to the bandwidth a job uses. Repeated calls to obtain weights give a separate guide to the message sizes for which per-call costs can matter. The paper establishes the presence of both demands through the distribution and the roles associated with the calls.

Changing the input while holding the workload size fixed

The sequence-length comparison plays a different role from the ZeRO-stage comparison. Here the authors use the same nominal parameter size and the same stated node and die counts. They vary the input axis that is explicit in the shape of the exchanged activations. This is a test of whether the operation that transports those activations responds in the expected direction. The growth in the pipeline sends and receives, alongside steady Allgather traffic, distinguishes exchanges with payloads shaped by the current input from the gathers observed in the same set of runs.

The parameter equation itself contains a position embedding term with a sequence dimension. The flat Allgather result is consequently best read as evidence about the logged exchanges in this sweep. The architecture equation could describe a different parameter count if the learned position table changes. The results show which traffic was sensitive to the tested input setting. They do not establish an algebraic rule that every operation gathering weights is independent of every way an architecture can change its sequence capacity.

The per-GPU throughput comparison also benefits from keeping the two changes distinct. A sequence-length sweep shows what happens as the work performed on each input grows. Comparing partitioning arrangements at one sequence length shows what happens when the same input shape is processed with a different distribution of storage or calculations. Even when the volume equation predicts how a selected message changes, the gap between arithmetic rates reflects the run as a whole. That is why the measurements support separate conclusions about payload growth and about observed throughput.

Comparing necessary operations with everything the framework invokes

The pipeline and tensor comparisons test how far an operation count derived from the data dependencies will explain a software trace. One can identify pipeline sends as carrying intermediate data across stages and tensor Allreduce calls as combining contributions from within a layer. Each category provides a target for comparing theory with observation. When a pure pipeline run has large additional Allreduce activity, the placement of layers alone gives no account of those calls. The authors' explanation points towards activity performed by the framework beyond the stage boundary exchange.

The comparison produces a more precise result than an overall excess of measured traffic. It identifies which kind of operation lacks an explanation in the simple pipeline calculation. The tensor volume discrepancy and the additional send bytes likewise point to particular parts of the trace. The analysis proposes origins for them but does not isolate those origins by removing the suspected activity and comparing runs. The trace can locate the disagreement even where its underlying source is still uncertain.

The small receive delays add timing evidence to an argument also supported by frequency. The ZeRO-3 logs make a case for examining small calls because weight exchanges repeatedly use them. The pipeline trace makes a case because an individual receive in that size range can incur substantial delay at startup. These are separate observations about different parts of the workload. Neither requires the small calls to account for a large share of the total bytes. Measuring sizes, counts, and timing separately lets each observation retain its meaning.

Limitations

Limits stated by the authors

The paper explicitly puts raw performance prediction outside its scope. Its equations assign data volume to exchanges under a given division of the work. To predict elapsed time, a calculation would also need the costs of calls along the relevant paths and a description of when the workers can issue those calls relative to their computation. Iteration volume predicts neither the observed startup delay nor the per-GPU arithmetic rate by itself. Those quantities come from measurement in the tested arrangement.

The authors also state that logging prevents communication from overlapping with computation in DeepSpeed. That condition affects the interpretation of the measured timings and throughput. An execution that can do useful computation while a transfer is underway may expose a different amount of waiting to the training step. Whether it can do so depends on the dependencies and the schedule. The recordings characterize the calls generated by the instrumented run and their performance under that condition. They give no direct timing comparison with the same runs using overlap.

Some comparisons are limited by whether the training layouts are feasible. The authors can calculate the hypothetical DDP traffic for the 13B case, but sufficient space for the training state is unavailable on a worker in the run they describe. A different node allocation is needed for the largest ZeRO comparison. The pure tensor case at 125M is absent for a separate reason, the division of attention heads. An evaluation of how traffic changes with size therefore has to keep track of whether a point is predicted, directly observed, or absent because the specified arrangement cannot run.

Frontier is one system and software combination in the authors' account. They identify other systems, including Aurora and Vista, as settings for investigating how the picture might change. They also leave further parallel methods, including expert parallelism and additional multidimensional arrangements, for future work. The equations explain why certain transfers arise from the ways of partitioning work that the paper covers. The measurements characterize the behavior of those arrangements with the tested placement, backend, and training stack.

Limits visible in the setup

The sequence-length study examines one parameter scale and a fixed node and die count. Its throughput comparison for pipeline and tensor parallelism displays selected degrees of both. The observed advantage in that comparison could depend on how much work fits on each stage, how many workers share a layer, and where those workers are placed. The pipeline equation provides guidance about the number of boundaries and the size of their payloads if those settings change. Additional measurements are needed to establish whether the throughput ordering persists at different degrees or scales.

The traffic equations have their own level of abstraction. They express amounts in elements, account for the exchanges identified in the derivation, and take a particular view of group size and how contributions add. Bytes on a particular link depend on the representation of those elements and the route the implementation uses. Detailed training traces can contain an initialization phase, unexpected collectives, and extra data in sends. The data-parallel fit supports the volume account for the covered workload. The discrepancies in the pipeline and tensor cases show the consequences of extending that account to a complete trace without further implementation detail.

The startup timing observation has a similarly narrow interpretation. The authors associate long small-message receives with the beginning of a run and use cold-cache behavior to describe the pattern. The analysis does not identify which internal process produces the delay or quantify the benefit of a change to that process. The same distinction applies to the suspected metadata and framework calls. Measured amounts and times can flag where the computation-based description is incomplete while leaving the specific cause undetermined.

The training dataset and framework also set the scope of the measurements. The study uses enwik8 and GPT-NeoX with DeepSpeed, so the observed frequencies reflect how this stack schedules, groups, and implements the work. Another implementation can satisfy the same dependency through a different collection of calls. A per-operation benchmark can characterize the cost of a named operation on a specific communication path. Using that cost to account for a full iteration would additionally require knowing how the operations in the trace map onto paths and how they are scheduled.

Finally, the throughput metric addresses achieved floating-point work on each GPU. The study offers no comparison of the time required to reach a specified training loss or downstream result. A longer sequence changes the amount and shape of the work assigned to a training step. A change in the rate at which arithmetic is performed establishes an execution result for the tested job. Training progress per unit of elapsed time would require its own measure of what the updates achieved. The evidence here supports conclusions about communication and execution, with learning outcomes outside the experiment.

What came after

There are no documented later citing studies to discuss. The authors' conclusion proposes extending the comparison to expert parallelism and other multidimensional layouts, then examining how the communication patterns change on Aurora and Vista. The proposed follow-up would test which findings reflect the division of training work itself and which depend on the framework and interconnect. In particular, it leaves open how frequently other systems encounter the small weight exchanges, unexpected collectives, and delayed pipeline receives observed on Frontier.

Cite

Cite as Quentin Anthony, Benjamin Michalowicz, Jacob Hatef, Lang Xu, Mustafa Abduljabbar, Aamir Shafi, Hari Subramoni and Dhabaleswar Panda. 2024. Demystifying the Communication Characteristics for Distributed Transformer Models. arXiv:2408.10197.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2408.10197 · arXiv 2408.10197

@misc{anthony2024demystifying,
  title = {{Demystifying the Communication Characteristics for Distributed Transformer Models}},
  author = {Quentin Anthony, Benjamin Michalowicz, Jacob Hatef, Lang Xu, Mustafa Abduljabbar, Aamir Shafi, Hari Subramoni and Dhabaleswar Panda},
  year = {2024},
  doi = {10.48550/arxiv.2408.10197},
  eprint = {2408.10197},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2408.10197}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/anthony-2024-demystifying-communication-characteristics-distributed-transformer/