Elamur Research

Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism

Paper · 2019 · Mohammad Shoeybi, Mostofa Patwary, Raul Puri et al.

Summary

What happens when a neural network is too large to train on one GPU? Giving different examples to more GPUs can speed up training, but it does little for the memory required by each copy of the network. Megatron-LM divides the network itself. It splits the largest calculations inside each transformer layer, so a group of GPUs can train a single network whose weights and optimizer state would exceed the capacity of an individual device. The paper tests this approach on both left-to-right text prediction and bidirectional language pretraining. Transformer and attention · Language model

The partition is designed around what happens between matrix multiplications. In the feed-forward block, each GPU computes a different set of output features, applies the activation to those features, and feeds them directly into its part of the next projection. In the attention block, each GPU handles complete attention heads and passes their outputs to its own part of the output projection. Both blocks combine their partial results only after that projection. The authors also split the vocabulary weights and compute the training loss without gathering all the vocabulary scores onto every worker. A few communication operations integrate these changes into PyTorch.

The largest run discussed in the paper’s headline uses 512 GPUs to train a GPT-2-style network with 8.3 billion parameters. It combines 8-way model parallelism, which distributes one copy of the network, with 64-way data parallelism, which trains distributed copies on different examples. The abstract reports sustained throughput of 15.1 PetaFLOPs and 76% scaling efficiency against a single-GPU baseline of 39 TeraFLOPs. The detailed weak-scaling study gives 74% for its largest combined configuration. On the language benchmarks, the largest GPT-2-style network scores 10.81 adjusted test perplexity on WikiText103 against the cited previous best of 15.8, and 66.51% test cloze accuracy on LAMBADA against 63.2%.

Greater capacity also helps the bidirectional BERT-style networks, provided that training stays stable. The authors compare two ways to place a residual connection around layer normalization. Allowing the connection to carry the input from before normalization stabilizes a larger network in their comparison. With that arrangement, held-out pretraining perplexity improves across the tested sizes up to 3.9 billion parameters, and the downstream evaluations improve as well. The ensemble reaches 90.9% test accuracy on RACE. Together, the experiments show where extra GPUs make larger training runs practical and where the architecture itself determines whether those runs yield better predictions. BERT

Deep dive: Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism

Megatron-LM shows how to split transformer layers across GPUs, train networks with billions of parameters, and measure the gains from scaling. · about 40 minutes to read

The problem and its context

Why pretraining became a systems problem

The paper traces an increase in the amount of learned machinery that researchers carry from a general text corpus to a particular language task. Early approaches transferred a table in which each word had a learned vector. A downstream system could start with those vectors instead of learning its entire vocabulary representation from its own training examples. In the studies the paper cites, this improved downstream results. Since each entry belonged to a word type, the same table entry could be reused whenever that word appeared. Word embeddings · GloVe · Distributed Representations of Words and Phrases

Later work transferred a network that produces representations from the surrounding text. The object learned from the corpus could now distinguish uses of the same word through their context. The next step was to train the whole pretrained network further on a downstream task. In that arrangement, the task can change how the network represents its inputs, since the parameters that produce those representations are updated along with the task-specific output. The authors place BERT and other contemporary approaches in this progression. They point to question answering, natural language inference, and article completion as tasks where larger pretrained networks had proved useful. Deep Contextualized Word Representations · Fine-tuning · Question answering

The shift from transferring a table to training and transferring entire networks raised the importance of accelerator memory. Keeping a weight in memory is only part of the cost of training with it. Differentiation needs gradients and intermediate values from the computations that produced the loss. The optimizer also maintains information used in its updates. With Adam, this includes momentum and other state associated with the weights. Increasing the number of learned parameters puts pressure on memory even before accounting for the activations created by a batch. Adam

Activation checkpointing addresses the intermediate values. The training program keeps selected activations and reconstructs others when it differentiates the network. This adds computation during the backward pass and reduces the number of intermediate tensors that have to remain resident. A checkpointing policy therefore changes the cost of processing a batch. A worker still needs to store the weights and optimizer state assigned to it, and those requirements can determine whether a training run fits at all.

What more workers can share

The paper distinguishes two ways to use additional accelerators. With data parallelism, each worker has a copy of the network and receives a portion of the batch. Workers combine gradients so their copies can make a shared update. Increasing the total batch along with the worker count can bring a nearly proportional increase in the amount of data processed per unit time. How quickly training reaches its objective is a separate question. The authors point to work on the optimization difficulties of very large batches and to methods developed to mitigate them. The memory needed for the complete network remains a requirement for each worker in this arrangement. GPU and parallel computing · Accurate, Large Minibatch SGD

With model parallelism, the workers share responsibility for a single copy. One route is parameter sharing, which attacks the storage requirement by reusing learned weights across parts of a network. The paper discusses ALBERT in this context and treats reduced independent capacity as the tradeoff of sharing. Its own partitioning route gives different devices responsibility for distinct weights and their computation. It opens up a way to increase the amount of work that can run in parallel while leaving the number of examples in a local batch fixed. ALBERT

Pipeline parallelism places successive groups of operations on different devices. Each stage completes its part and hands its output to the next stage. The paper discusses parameter-server approaches to this arrangement and notes problems with consistency. It describes GPipe as addressing consistency through synchronous optimization. Keeping a pipeline busy also requires scheduling the computation and transfers between stages. A stage can have idle time while it waits for an input or for work from a preceding group of operations to reach it. The authors refer to these gaps as pipeline bubbles.

A worker can also share an operation with other workers at the same stage. That is the idea behind distributed tensor computation. The paper describes FlexFlow as a framework for choosing a parallel execution strategy. In Mesh-TensorFlow, the user specifies dimensions along which the computation is distributed, and a compiler inserts the group communication needed to carry it out. Megatron-LM takes advantage of similar properties of distributed tensor operations and expresses a partition for the transformer directly in PyTorch. Its design can be combined with a pipeline because decisions about which device owns a stage and which devices share the work within that stage can be made together.

Why the transformer is a good case for a targeted partition

The transformer was introduced for translation, with an encoder for the input sequence and a decoder for the output. The two families studied in Megatron-LM use different parts of that design. GPT-2 uses a decoder-style network for prediction from preceding text. BERT uses an encoder-style network in which a masked position can draw on context from both directions. The predictions used for learning are different, but the repeated layers contain similar expensive operations. Attention Is All You Need

The repeated unit has a self-attention block and a feed-forward block. Self-attention combines information from positions in the sequence. Its heads are distinct groups of computations whose outputs meet at a later projection. The feed-forward block transforms the features at each position through a pair of learned projections, with an activation function between them. The arithmetic in both blocks gives the authors a specific opportunity. They can choose a division of work in the first projection that the following operations can use immediately.

A division that spreads a matrix over several devices solves part of the storage problem. To make the division practical across a deep network, it must also leave enough useful work between exchanges. The paper’s design question is therefore where each block first needs information from all workers. The answer depends on what each worker’s intermediate values mean. A set of finished output features can pass through a featurewise nonlinearity. Several contributions to the same unfinished feature have to be combined before that operation. This difference drives the arrangement of the feed-forward block and has a counterpart in the treatment of attention heads.

The method, step by step

Follow an activation through a layer

A group of GPUs starts a transformer block with the same input activation. Each worker uses that input with the portion of the weights assigned to it. On the attention path, this produces projections for complete heads. Those heads can finish their own calculations before the workers exchange anything. The output projection turns each worker’s head outputs into a contribution to the block’s result. Once the group has summed those contributions, every worker can carry out the same surrounding operations and enter the feed-forward block with matching activations.

In the feed-forward block, the first projection also produces a different set of completed features on each worker. The activation and the second projection can then use these local features. The second projection produces partial contributions to a common output, which the group adds. Back-propagation follows the same division of labor in reverse. Each worker can compute derivatives for its own weights, while the group combines the contributions that go back to a shared input. The embedding and loss extend this pattern to the boundaries of the transformer stack.

Computation through a partitioned transformer

The steps in order.

Computation through a partitioned transformerStep 1: Look up tokens in vocabulary shards1. Look up tokens in vocabulary shardsStep 2: Sum contributions to the input embeddings2. Sum contributions to the input embeddingsStep 3: Compute complete attention heads on each worker3. Compute complete attention heads on each workerStep 4: Project local head outputs and sum contributions4. Project local head outputs and sum contributionsStep 5: Apply GeLU to local feed-forward features5. Apply GeLU to local feed-forward featuresStep 6: Project activated features and sum contributions6. Project activated features and sum contributionsStep 7: Score vocabulary shards and compute cross-entropy7. Score vocabulary shards and compute cross-entropyStep 8: Combine gradient contributions during backpropagation8. Combine gradient contributions during backpropagation

The feed-forward split and the role of GeLU

The paper starts with a general matrix multiplication, abbreviated GEMM, followed by GeLU. A projection computes each output feature as a weighted combination of input features. GeLU then transforms each resulting value individually. The first projection and activation are written together as follows.

Y = GeLU(XA)

Here X is the matrix of input activations, A contains the first projection’s learned weights, and Y contains the activated results. Juxtaposing X and A means matrix multiplication. GeLU is the nonlinear activation applied to each entry of the product. Its position after the multiplication determines which partition can be carried through to the next operation.

An available split gives different workers different parts of the input feature dimension. Using the paper’s notation for a split into two parts, the input is written as follows.

X = [X₁, X₂]

X₁ and X₂ are the two groups of input columns, and the comma inside the brackets indicates that they are placed side by side to form X. The subscripts label corresponding partitions throughout this example. For a multiplication with this partition of X, the weights have to be divided along their input dimension.

A = ⎡A₁⎤
    ⎣A₂⎦

A₁ and A₂ are groups of weight rows, shown stacked vertically to make A. Each has the rows that correspond to the input columns held by its worker. Though the workers start from different input features, their products contribute to the same output positions. To obtain the activation prescribed by the original block, their products enter GeLU as a sum.

Y = GeLU(X₁A₁ + X₂A₂)

X₁A₁ and X₂A₂ are partial matrix products, and the plus sign adds their entries at matching output coordinates. Y is the matrix obtained when GeLU acts on those combined values. Applying the activation earlier would generally change the answer.

GeLU(X₁A₁ + X₂A₂) ≠ GeLU(X₁A₁) + GeLU(X₂A₂)

The symbol ≠ indicates that the two expressions are generally unequal. The left side first adds contributions to each output coordinate and then applies GeLU. The right side applies GeLU to each contribution by itself and then adds the transformed values. The difference matters even if every local multiplication is correct. The activation in this split would force the devices to synchronize before they can proceed.

Megatron-LM changes what a worker owns. It gives each worker the full input X for the block and a subset of A’s output columns. The notation again uses A₁ and A₂, now for parts with a different orientation.

A = [A₁, A₂]

A₁ and A₂ here contain disjoint groups of columns from A, and the brackets show them next to each other. Each worker’s multiplication can see all the input features required for its assigned outputs. Its results are finished values for those outputs, with the other worker responsible for different coordinates.

[Y₁, Y₂] = [GeLU(XA₁), GeLU(XA₂)]

Y₁ and Y₂ are the activated output columns assigned to the respective workers. X is the shared block input, and XA₁ and XA₂ produce the local outputs of the first projection. Since the coordinates to which GeLU is applied are already complete, each worker can produce its part of Y locally. The brackets describe the complete result mathematically. The program can leave the values distributed.

The second projection is chosen to accept that distribution. The authors split its matrix, B, along its rows. The row partition B₁ corresponds to the columns in Y₁, and B₂ to those in Y₂. A worker multiplies the activation it has just produced by the associated rows of B. This time the two products are contributions to the same block output. The forward pass sums them before applying dropout.

Z = Dropout(YB)

Z is the block’s output after dropout, Y is the activated intermediate representation, and B contains the second projection’s weights. YB denotes the full matrix product, obtained by adding the local contributions in the distributed implementation. Dropout is the training operation that randomly suppresses some activation values. It acts on the combined output before the result is added to the residual path.

The important consequence of pairing the partitions is that the wide intermediate after the first projection stays where it was computed. Its coordinates pass through GeLU and feed directly into the next projection. The exchange is delayed until the devices hold partial contributions to the output that goes back into the layer’s common representation. The same choice also determines how gradients travel through the block.

Put the communication at the boundaries

The paper expresses the communication through two operations, f and g, with different behavior during the forward and backward passes. Their collective is an all-reduce. In this application it adds values across the participating GPUs and returns the combined value to each of them. A worker can therefore continue from the same complete activation as its peers after summation.

The operation f is placed at the entrance to a partitioned block. In the forward pass it returns the input unchanged. The workers already have the common input, so passing through f requires no exchange. During differentiation, each branch of the computation can contribute to the gradient of that input. The backward rule for f adds those contributions with an all-reduce. This gives each worker the gradient appropriate to the full shared input before back-propagation proceeds into earlier operations.

The operation g is placed where partial outputs meet. It performs the all-reduce on the forward pass. In the backward pass, the gradient arriving at the sum can be passed to each contributing branch. It enters those branches as it is, so g does not repeat the collective there. The paper illustrates f with a small PyTorch automatic differentiation function. The program explicitly supplies the backward communication rule, and it can express g by reversing which pass performs the collective. These rules describe how to differentiate the distributed block as one calculation.

For the feed-forward block, there is one forward reduction at the output and one backward reduction at the input. The workers can differentiate their local projections and their own portions of the GeLU activation between those boundaries. Giving each matrix multiplication its own fully assembled output would discard the locality that the paired partitions create.

Apply the same placement principle to attention

In self-attention, a learned projection constructs queries, keys, and values from the incoming features. A query describes what a position can use from the sequence, keys contribute to the scores that determine which positions receive attention, and values provide the information mixed into the result. A head performs this calculation with its own projected features. The paper aligns the column splits of the projections so that all the features needed for a head are available on the same GPU.

Q = [Q₁, Q₂]

Q denotes the projected queries, while Q₁ and Q₂ are the groups of query columns associated with the assigned heads. The brackets represent a division along columns, and the subscripts identify the partitions.

K = [K₁, K₂]

K denotes the projected keys. K₁ and K₂ are the corresponding sets of key columns, using the same head assignment as the queries.

V = [V₁, V₂]

V denotes the projected values. V₁ and V₂ contain the value columns for those same groups of heads. Keeping each group’s query, key, and value features together allows the worker to carry out the full head calculation locally.

Within a head, the worker computes scores from the queries and keys, applies a softmax to obtain weights over context positions, and combines the value representations with those weights. The attention diagram also shows dropout applied to the weights during this local computation. All the quantities needed by that dropout and by the weighted combination belong to the same head. Having a complete head on a device thus preserves the scope of the calculation that connects positions in the sequence.

Y = Self-Attention(X)

Here X is the common input to the attention block, Self-Attention denotes the head computations just described, and Y is their combined representation before the output projection. The partitioned calculation keeps different groups of these head outputs on the respective workers. Their union corresponds to the columns of Y.

The next projection can mix information from different heads by giving each worker the rows of the output matrix that correspond to its local head outputs. Its products are contributions to the same output coordinates, just as in the second feed-forward projection. The all-reduce takes place after these products, and the complete output passes to replicated dropout and the residual addition. The f and g operations again determine which gradients and activations need to be added across the group.

There are two forward all-reduces and two backward all-reduces for the distributed attention and feed-forward work in a transformer layer. The count applies to those blocks within one layer. The embedding operations and the exchange of gradients across different copies of the network are additional parts of training. The authors describe the adjacent matrix multiplications as grouped because their partitions make it possible to connect them locally even with an operation such as GeLU or attention in between.

Keep the vocabulary scores distributed through the loss

At the bottom of the stack, an embedding supplies a hidden representation for a token. At the top, the output projection scores candidate tokens from the hidden features. The paper shares the vocabulary weights between these operations. The matrix has a hidden dimension H and a vocabulary dimension v. Since GPT-2’s original vocabulary has 50,257 entries, the output projection is worth distributing in addition to the projections inside the layers. A split of the shared weights has to serve both uses.

E = [E₁, E₂]

E is the H × v embedding matrix, where H is the hidden size and v is the number of vocabulary entries. E₁ and E₂ hold different groups of vocabulary columns. A worker can supply the embeddings for tokens in its part of the vocabulary. The input lookup uses g to reduce the results from workers so that the complete input representation is available to the transformer stack.

The output operation has a different communication problem. A worker produces scores for the vocabulary entries it owns from the hidden activations supplied by the transformer.

[Y₁, Y₂] = [XE₁, XE₂]

X here is the hidden activation input to the output projection. E₁ and E₂ are the vocabulary weight partitions, and Y₁ and Y₂ are the corresponding scores, called logits. The logits are the raw inputs used to determine the predicted probabilities. At this stage every GPU already has the scores for its part of the vocabulary.

Y = all-gather([Y₁, Y₂])

This expression describes an available approach in which Y contains the entire score tensor and all-gather assembles the separate vocabulary partitions on the workers. Here the entries are joined along the vocabulary dimension. In an all-reduce, by comparison, entries at matching coordinates are added.

b × s × v

This is the number of elements in the gathered score tensor described by the paper. The symbol b denotes batch size, s is sequence length, and v is vocabulary size. There is a score for every vocabulary entry at every sequence position for each example in the batch. The output projection may therefore be distributed while its immediate successor still creates a large communication demand.

Megatron-LM connects the local output projections to distributed cross-entropy. Cross-entropy measures the prediction loss associated with the target. Its computation must account for the vocabulary scores relevant to the probability, but the objective needs a scalar loss at each position. The implementation uses the partitioned scores without first collecting the full tensor.

b × s

Here b and s are again the batch size and the sequence length. The expression describes the loss-sized quantities discussed by the authors. Communicating quantities at this scale removes the vocabulary dimension from the large exchange. The paper explains the change in communication size but leaves the internal numerical steps of its distributed cross-entropy computation unspecified.

Preserve agreement where the work is replicated

Some operations can be repeated on the workers after a distributed block has returned a common activation. Layer normalization adjusts the scale and location of features using statistics of the representation. A residual connection carries an activation along a bypass and adds it to the result of a transformation. Megatron-LM keeps copies of the normalization parameters on the devices and lets each worker perform the surrounding normalization, dropout, and residual computation. The worker can use the resulting tensor as the input to the next partitioned block without waiting for another GPU to send it. Layer Normalization

Dropout makes agreement across the workers an explicit requirement. When they all hold a copy of the same activation before the residual addition, they need to apply the same random mask. Otherwise the devices would enter the next block with different versions of the input that was supposed to be common. The authors initialize the corresponding random-number generators with the same seed across the workers in the group. Repeated computations can then produce matching dropout patterns.

Attention dropout within a partitioned block acts on different values on different devices. The independent head calculations need separately drawn masks. The paper therefore uses another random-number generator for dropout in the partitioned regions, with a seed specific to each worker. These two uses of randomness follow directly from the data layout. The outer computation is replicated, including its random decisions. Inner attention computation covers distinct parts of the layer, including the draws for those parts.

Each worker’s optimizer updates the parameters it holds. Parameters assigned to a partition are already located with their local computation. Duplicated parameters are maintained through the replicated operations. The authors’ formulation therefore does not require the devices to communicate newly updated parameter values. When the run has data-parallel replicas, gradient communication for the corresponding weights takes place as part of the update procedure.

Train distributed replicas on different examples

In the hybrid arrangement, several GPUs within a server form a model-parallel group. Together they run one complete network instance. Other groups can be located in the same server or on additional servers. They hold corresponding partitions and process different examples. The device that owns a particular subset of weights in one group has a counterpart that owns the same subset in each other group.

These counterpart devices form a data-parallel group. As back-propagation computes the weight gradients, their all-reduce combines gradients for that weight partition across replicas. Other data-parallel groups can carry out the corresponding reduction for other partitions in parallel. The communication inside a model-parallel group and the communication across its replicas thus reach different sets of workers. An activation reduction connects the workers evaluating one copy on a batch of examples. A weight-gradient reduction connects workers evaluating different examples with corresponding copies of the weights.

The paper’s 8. In the example with 3 billion parameters, 64-way data parallelism and 8 GPUs per model-parallel group bring the total to 512 GPUs. The implementation calls NCCL from Python through PyTorch for both kinds of collective. The placement is important to interpreting the measurements because the exchanges inside the transformer occur repeatedly through its depth. The authors released the Megatron-LM implementation together with its training and evaluation pipelines.

Assemble and clean the pretraining text

The authors build a corpus intended to provide diverse text and examples of dependencies across longer passages. The main sources are Wikipedia, CC-Stories, RealNews, and OpenWebtext. The BERT runs additionally use BooksCorpus. The GPT-2 runs leave it out because of overlap with LAMBADA, one of their evaluation datasets. The authors also remove the Wikipedia articles used in the WikiText103 test set and clean CC-Stories of line breaks attributed to preprocessing. BooksCorpus

Combining sources also creates a risk of repeating content that appears in more than one collection. The authors first filter out documents shorter than 128 tokens. They use locality-sensitive hashing to find similar content and deduplicate material above a Jaccard similarity threshold of 0.7. Jaccard similarity describes how much two sets share relative to their union. Locality-sensitive hashing helps detect likely matches in a collection where comparing every document directly would be a different search problem. The resulting aggregate corpus is reported as 174 GB of deduplicated text.

The cleaning serves several purposes. Removing short documents is part of building the desired pretraining corpus. Removing known test material addresses the independence of later evaluation. Deduplication addresses repetition across the sources. These steps concern different aspects of the data, even when the same preparatory pipeline carries them out. The paper subsequently measures some remaining overlap with the test sets, providing a check on the separation at the level of short token sequences.

Set the numerical and optimization procedure

To make use of the V100 Tensor Cores, training combines mixed precision and dynamic loss scaling. Mixed precision uses more than one numerical precision in the calculation. Loss scaling adjusts the magnitude used during differentiation to help represent gradients in lower precision. The distribution of weights across workers changes where those computations occur, while these numerical choices govern how the local training arithmetic is carried out.

W ∼ 𝒩(0, 0.02)

W denotes the weights before the additional residual-path scaling. The symbol ∼ indicates that their initial values are sampled from the normal distribution denoted by 𝒩. Its first argument, 0, is the center, and 0.02 is the spread setting in the authors’ initialization notation.

1 / √(2N)

This factor scales the initial weights immediately before the residual additions. N is the number of transformer layers, each containing an attention block and a feed-forward block. The square root applies to the product of 2 and N, and the expression takes its reciprocal. As the depth increases, the factor decreases the initial scale of the weights to which it is applied.

λ = 0.01

The symbol λ is the weight-decay coefficient used with Adam. Weight decay restrains the growth of the learned weights during optimization. The setup also clips the global gradient norm at 1.0, limiting the overall magnitude of large gradients, and applies dropout at 0.1. Activation checkpointing is performed after every transformer layer. The checkpoints provide points from which activations can be recomputed in the backward pass. Decoupled Weight Decay Regularization

For GPT-2, the training sequence contains 1024 sub-word units. A sub-word vocabulary allows a word to be represented by one or several tokens. The training batch size is 512, and the schedule runs for 300k iterations. The learning rate warms up to 1.5e-4 over 3k iterations, then follows a cosine decay over the remaining 297k iterations. The decay stops at a floor of 1e-5. This is the schedule for learning the text predictor. The fixed local batch used for the systems measurements is discussed with those measurements. Subword tokenization

BERT uses its original dictionary of 30,522 entries. During pretraining the network learns to recover masked tokens using the surrounding sequence. The masking follows the whole-word n-gram approach associated with SpanBERT. It treats whole words as the units for selecting what to hide and can mask consecutive words together. The authors also follow ALBERT in replacing next-sentence prediction with sentence-order prediction. The latter asks the network to distinguish how the parts of a presented pair are ordered. The BERT batch size is 1024. The learning rate of 1.0e-4 has a warmup of 10,000 iterations and a linear decay schedule of 2 million iterations. The paper keeps the remaining settings in line with the original BERT training procedure. N-gram · SpanBERT

Choose what the BERT residual connection carries

The BERT change can be described by following the two paths into an addition. In both of the paper’s comparison diagrams, the path through attention begins with layer normalization. The path through the feed-forward transformation likewise begins with normalization. In the original arrangement as drawn by the authors, the bypass branches off after normalization. Accordingly, the tensor added at the end of each sublayer is the normalized copy of its input.

In the revised arrangement, the bypass begins before normalization. The transformed path still starts with normalization, but the tensor carried directly into the addition is the original input to the sublayer. The change applies at the attention addition and at the feed-forward addition. In effect, the input can travel along the short path through the layer without going through the normalization on the transformed branch. This is the architectural choice the authors test for training stability before adopting it in their larger BERT runs.

Score the left-to-right predictions in comparable units

The WikiText103 evaluation uses perplexity. If a predictor assigns high probability to the observed text, the accumulated negative log probability is smaller. Perplexity exponentiates an average of that loss, so a lower result indicates better predictive fit. The choice of what counts as a token affects the denominator. The benchmark was supplied with a word-level segmentation, while the training system predicts sub-word units.

PPL = exp(−(1 / Tₒ) Σₜᵀ log P(t | 0:t−1))

PPL denotes perplexity, exp is the exponential function, and log is the logarithm of the predicted probability. The symbol Tₒ is the original token count of the benchmark corpus, with the subscript marking the original segmentation. T denotes the token count after applying the network’s sub-word vocabulary. The summation adds the log probabilities for positions indexed by t in that tokenized text. P is the predictive probability, and P(t | 0:t−1) is the probability of the observed token at position t given its preceding text. The vertical bar means “given,” and 0:t−1 denotes the prefix ending just before t. The negative sign turns the sum of log probabilities into a loss. Dividing by Tₒ retains the original benchmark’s unit of normalization while using the sub-word predictions to determine the numerator.

The evaluation begins with invertible detokenization to remove punctuation and whitespace artifacts that differ from the training text. The word-level count is taken before this adjustment. In the WikiText103 test set the paper gives Tₒ as 245,566 and T as 270,329. The two values explain why simply reporting ordinary perplexity per internal sub-word would change the comparison with the earlier results.

A fixed window also limits which text the network can condition on. The paper describes the windowed probability using the following expression.

P(t | t−w:t−1)

The variable t is the position of the observed token and w is the context-window size, 1024 tokens in this evaluation. The range t−w:t−1 identifies the preceding context that fits within a full window. Evaluating a separate full window for every prediction would repeat much of the calculation. The authors slide overlapping windows through the corpus using an advance of 32 tokens, the quantity they call o, and count the losses for the final o positions in each window. Most of the window can thus supply context while a smaller part supplies the losses for that step of the evaluation.

LAMBADA expresses the prediction task at the word level through a missing final word. The paper describes a general cloze example as a sequence with a missing element.

x = x₁:ₜ

Here x represents the sequence, and x₁:ₜ means the word tokens indexed from the first position through position t. The notation xⱼ identifies the token at a masked position j. In LAMBADA, the masked word is xₜ, the last word of a passage of 4-5 sentences.

For this benchmark the authors use the raw text and score the sub-word sequence belonging to the target word. They use teacher forcing. This means that each successive prediction within the word is made with the correct earlier parts of the word in its prefix. The whole answer receives credit only when every required sub-word prediction is correct. This makes the reported result a word-level accuracy even though the predictor works in sub-word units.

Experiments and results

The systems baseline and the scaling experiments

The training installation has up to 32 DGX-2H servers, with a total of 512 Tesla V100 SXM3 GPUs. Each GPU has 32GB of memory. According to the paper, NVSwitch provides 300 GB/sec of bandwidth between GPUs on the same server, while the interconnect between servers delivers 100 GB/sec with eight InfiniBand adapters on each server. The hybrid grouping can take advantage of the within-server connection for the repeated layer exchanges, while the data-parallel replicas can extend across servers.

The reference for scaling is a network with 1.2 billion parameters that fits on one GPU. Over the training application it sustains 39 TeraFLOPs, which the authors identify as 30% of the theoretical peak for the configured device. Sustained throughput measures arithmetic performed per unit time during the application. By establishing a measured reference, the paper can compare the larger runs with the level of throughput that an already functioning single-device configuration achieves.

The main scaling runs increase the parameter count as they assign more GPUs to a copy of the network. The paper calls this weak scaling with respect to the network parameters. A conventional weak-scaling experiment could give additional data workers more examples per update while leaving the network fixed. Here the aim is to expand capacity, keeping the local batch size at 8 across the model-parallel configurations. The hidden size per attention head stays at 96, while the authors change the number of heads and layers. Fixing the head dimension helps keep the relevant matrix multiplications comparable in shape across the configurations.

The output matrix is also adjusted for efficient multiplication. The vocabulary starts with 50,257 entries, and the authors want the per-GPU portion to be a multiple of 128. For the largest partition they express the divisibility requirement as follows.

128 × 8 = 1024

The value 128 is the desired granularity in vocabulary entries per worker, 8 is the maximum model-parallel width studied, and 1024 is the resulting divisor for the padded vocabulary. The product and divisor are given in the paper. The chosen padded size is 51,200. This is a systems setting for the output computation, separate from the token counts used to score WikiText103.

For the combined runs, the global batch stays at 512, with 64-way data parallelism. The detailed analysis reports 77% of linear scaling for the 8.3 billion parameter configuration with 8-way model parallelism. The largest hybrid configuration reaches 74% relative to linear scaling from the 1.2 billion parameter single-GPU reference. The authors associate the decline in efficiency in the combined setting with the additional communication needed to combine gradients across replicas.

The abstract gives sustained application throughput of 15.1 PetaFLOPs on 512 GPUs and reports 76% scaling efficiency against the single-GPU baseline. The 74% figure is the value stated in the detailed weak-scaling discussion for the largest hybrid configuration. The paper gives both figures without explaining the discrepancy. In either context, the measured achievement is sustained throughput across training while accommodating the larger network. The efficiency expresses how that throughput compares with the corresponding linear reference.

GPT-2-style training and prediction quality

The language-quality study compares networks labeled 355M, 2.5B, and 8.3B by parameter count. The paper describes the 355M configuration as comparable to BERT-Large in size and configuration. It uses 64 GPUs for that GPT-2-style run. The 2.5B configuration matches its counterpart in the scaling study. For 8.3B, the quality-training configuration uses 24 attention heads, while the scaling configuration uses 32. The parameter label alone therefore leaves out a difference that matters to how attention is computed.

The GPT-2-style runs follow the 300k-iteration schedule. The paper describes an epoch as 68,507 iterations and says that the 8.3B configuration takes around two days per epoch on 512 GPUs. This gives a sense of how long it takes to advance through the training text under the reported setup. The convergence plot puts iterations on the horizontal axis and shows the larger runs reaching lower validation perplexity earlier in the training progression. The 8.3B run reaches 9.27 validation perplexity. That value is from language-training validation, before considering the separate benchmark test scores.

The benchmark comparisons use the pretrained predictors in a zero-shot setting, without fitting them further on the evaluation tasks. For WikiText103, one test asks how much probability the predictor assigns to the successive tokens of the test corpus under the adjusted perplexity calculation. The paper describes a progression towards better results with size and reports 10.81 for the largest network. The earlier reference value, 15.8, comes from the previous best result cited by the authors. The difference in predicted distributions appears through a common token-count convention, even though the networks need not use the same representation internally. Pointer Sentinel Mixture Models

Previous best and Megatron-LM on WikiText103 test perplexity

The largest Megatron-LM network has lower perplexity under the adjusted test procedure.

Previous best and Megatron-LM on WikiText103 test perplexityPrevious best cited in the paper: 15.8Previous best cited in the paper15.8Megatron-LM 8.3B (this paper): 10.81Megatron-LM 8.3B (this paper)10.81
The numbers
System or settingperplexity
Previous best cited in the paper15.8
Megatron-LM 8.3B (this paper)10.81

LAMBADA asks for a decision about the last word of each passage. The exact-word scoring procedure gives credit when the predictor selects all of the correct sub-words that make up the answer. The paper reports that accuracy rises across its GPT-2-style sizes and reaches 66.51% on the test set for 8.3B. The cited previous best is 63.2%. This complements the perplexity measurement by asking whether the correct answer is selected on individual examples where preceding context is central to the task.

Previous best and Megatron-LM on LAMBADA test cloze accuracy

The largest Megatron-LM network recovers the missing final word more often than the cited previous best.

Previous best and Megatron-LM on LAMBADA test cloze accuracyPrevious best cited in the paper: 63.2Previous best cited in the paper63.2Megatron-LM 8.3B (this paper): 66.51Megatron-LM 8.3B (this paper)66.51
The numbers
System or settingaccuracy %
Previous best cited in the paper63.2
Megatron-LM 8.3B (this paper)66.51

The paper’s abstract gives the headline benchmark gains in shorter forms, with WikiText103 at 10.8 perplexity and LAMBADA at 66.5% accuracy. The detailed results specify the adjusted perplexity and cloze accuracy used in the comparisons above. Beyond the aggregate scores, the authors include continuations produced from text prompts by the largest GPT-2-style network. Those examples show how it continues a topic and follows the form of a supplied passage. The paper presents them as samples alongside the measured evaluations.

Compare the training and test texts

The authors calculate the fraction of test-set 8-grams found in their training set. They report at most 10.8% for the WikiText103 test set and at most 1.4% for the LAMBADA test set. As a reference, they give 9.09% overlap between the WikiText103 test split and that benchmark’s own training split. This helps put shared short sequences in context. Their presence can arise even where train and test originate as separate collections.

The authors use the overlap figures alongside the corpus exclusions to support their confidence that test documents were not inadvertently included in pretraining. The figures answer a narrower question than the benchmark evaluations themselves. They measure shared stretches of text, while the evaluations measure the performance of the trained predictors on previously defined tasks. The distinction matters because a corpus can share some common phrases with a test set even after deliberate removal of known evaluation articles.

BERT pretraining and transfer to downstream tasks

With the revised residual arrangement, the BERT study covers 336M, 1.3B, and 3.9B parameters. The smallest has the size of BERT-large. The middle configuration matches the BERT-xlarge case discussed in ALBERT, where going beyond BERT-large had produced worse results with the original approach. To reach the largest configuration the Megatron-LM authors increase both the hidden size and the depth. They hold the hidden size per attention head at 64 across these BERT runs.

The 336M and 1.3B runs each train for 2 million iterations. The 3.9B evaluation comes after 1.5 million iterations, while the largest run is still in progress. On the 3% held-out portion of the pretraining data, the measured perplexities are 1.58, 1.30, and 1.16 in order of increasing parameter count. Each result describes the corresponding pretrained network and its state at the time of evaluation. This shows how the larger configurations perform under the revised arrangement and the reported training durations.

Pretraining perplexity by BERT size on the held-out split

Perplexity declines with increasing size under the revised residual arrangement.

Pretraining perplexity by BERT size on the held-out splitBERT 336M: 1.58BERT 336M1.58BERT 1.3B: 1.30BERT 1.3B1.30BERT 3.9B (this paper): 1.16BERT 3.9B (this paper)1.16
The numbers
System or settingperplexity
BERT 336M1.58
BERT 1.3B1.30
BERT 3.9B (this paper)1.16

The next evaluations ask whether the improvements transfer to specific uses. The authors fine-tune on MNLI and QQP from GLUE and on the two versions of SQuAD used in the paper. They also evaluate reading comprehension on RACE. The BERT study therefore has a pretraining validation result and several results obtained after additional task training. Each task then has its own comparison across the pretrained starting points. GLUE · SQuAD · SQuAD 2.0

For fine-tuning, the authors follow the RoBERTa procedure. They tune the batch size and learning rate, then report the median development result across 5 random initialization seeds. The reported comparisons for MNLI, QQP, SQuAD 1.1, and SQuAD 2.0 use development sets. The paper says performance improves across the tested BERT sizes on each of its downstream tasks and that the 3.9B configuration establishes the strongest results in its BERT-based development comparisons. It also reports 5-way ensemble results for the SQuAD development evaluations. RoBERTa

For RACE, development performance guides checkpoint selection. The checkpoint associated with the median development outcome across 5 seeds supplies the individual test result. The paper separately reports a 5-way ensemble on the RACE test set. It reports new best results for both the individual and ensemble evaluations of the 3.9B network. The ensemble’s test accuracy is 90.9%, compared with the cited previous best of 89.4%. This result belongs to a fine-tuned reading-comprehension evaluation. The WikiText103 and LAMBADA comparisons, in contrast, score the GPT-2-style predictors directly after pretraining.

What the ablations show

###-Which residual path lets the larger BERT train?

The most direct architectural comparison is the BERT loss experiment. The paper shows a 336M configuration with the original residual arrangement and a 752M configuration under each of the two arrangements. The original form trains successfully at 336M. At 752M the same arrangement shows an unstable training trajectory after an initial period of falling loss. The revised 752M run continues training stably and reaches a lower training loss. This comparison concerns the pretraining loss over iterations, whereas the held-out perplexities and downstream scores assess the networks adopted for the larger study.

The two 752M runs are particularly informative because they let the reader follow an architectural intervention at the same size. In both diagrams the transformed branch goes through normalization. The bypass carries a different value in the revised version, allowing the unnormalized input to reach the addition directly. The observed performance of the larger run changes with that path. As a consequence, the earlier observation that a larger version of BERT could perform worse is compatible with a failure of the original training arrangement at scale.

This evidence also clarifies the role of the distributed implementation. Multiple GPUs can provide enough memory to attempt the larger network in either arrangement. The stability comparison asks whether the optimization succeeds once the network can be run. In this case the architectural modification is part of the experimental recipe that makes the additional capacity productive. The subsequent BERT size comparisons use that recipe throughout. They show its behavior across sizes without independently retesting the original arrangement at every size.

Attention-head count affects the work done on each GPU

In the appendix the authors keep the configuration at 8.3 billion parameters with 8-way model parallelism and vary the attention-head count from 16 to 32. They report a slight decrease in scaling efficiency as the head count increases. This experiment examines the shape of the computation under an architectural change that does not simply enlarge the reported parameter budget.

The paper gives two reasons that the amount and shape of useful work can change. Some of the attention matrix multiplications become smaller, and the softmax over attention scores covers more elements. The matrix products and the softmax have different computational roles, so the resulting execution time depends on more than the headline number of learned weights. The authors raise the choice of head count as a balance between speed and accuracy. Their head-count experiment measures the systems side of that choice. It gives no corresponding downstream accuracy series for those same settings.

This comparison also bears on interpretation of the large GPT-2 results. The 8.3B quality run and the 8.3B scaling configuration use different numbers of heads. The appendix establishes a reason to keep those configurations identifiable when reporting the work. It would take a matched throughput measurement to assign the detailed scaling figure to the quality-training configuration on the basis of its parameter count alone.

Strong scaling holds network size and batch size fixed

The authors also test whether distributing a network that already fits on one GPU can accelerate training. This is strong scaling. The network stays at 1.2 billion parameters and the batch stays at 8 samples per iteration. The number of GPUs assigned to share the network changes. Using two GPUs makes training 64% faster in this setting, according to the paper. The benefit then diminishes as more GPUs are added.

The authors explain the result through the shrinking amount of arithmetic assigned to each device. Communication and memory bandwidth account for more of the cost when the local calculation becomes smaller. Because the network and batch are fixed, this comparison exposes a tradeoff that an experiment with a growing network can conceal. In the weak-scaling runs, added GPUs accommodate added computation and storage. In strong scaling, they divide the same work more finely, so there is less computation between the communication boundaries.

The comparison between model parallelism alone and the hybrid setup offers a related observation about communication. The hybrid setup also exchanges gradients across replicas. Its largest reported efficiency and the largest result for the model-parallel-only setup describe runs with different GPU counts and batch arrangements. These runs show that the extra exchanges can be accommodated at the reported scale. They cannot by themselves give the time attributable to each collective in a matched run.

Which choices are isolated by the experiments?

The paper explains several implementation choices analytically. The feed-forward equations show why applying GeLU before combining partial sums changes the calculation. The vocabulary example shows how the shape of the quantities communicated for the loss can avoid a full vocabulary gather. Those are explanations of where communication arises and what the revised computation requires. The measured scaling results come from the complete implementation. The paper does not give separate timing comparisons that disable each of these choices in turn.

The validation curves and benchmark comparisons answer a different question. They show what happens when the authors train larger configurations with the reported procedure. Parameter count increases together with architectural dimensions, and the recipe includes the data preparation, numerical settings, and optimization choices. The direct BERT residual comparison isolates a particular instability. The head-count and strong-scaling studies isolate specific questions about execution. These controls support more focused conclusions than the full size comparisons, which provide end-to-end evidence about the networks that were actually trained.

Limitations

Limits identified by the authors

The authors see optimizer memory and efficiency as constraints on further scaling. Partitioning the weights lets each GPU keep only its assigned share of much of the network. The optimizer still has work and storage associated with those weights, and increasing the total size eventually puts pressure on the available hardware again. The authors estimate that training a network with more than 16 billion parameters would exceed the memory available across the 16 GPUs of a DGX-2H server. They propose combining partitioning within a layer with partitioning between layers and extending model-parallel communication across servers.

That proposal reaches beyond the principal deployment tested in the paper. Their measured layout puts the workers sharing a network instance within a server and uses replicas to extend training further. An implementation that shares a layer across servers or that combines the intra-layer scheme with pipeline stages will have additional placement and scheduling decisions. The paper establishes that the methods are compatible in principle and identifies the combination as a direction for larger runs.

The authors also identify open questions about the kinds of networks and tasks that would benefit. They propose pretraining XLNet and T5-style families and evaluating large pretrained networks on generative question answering, summarization, and conversation. They also suggest using the large networks as teachers for smaller students through knowledge distillation. In that case the research question shifts from how to train the large network to how much of what it learned can be transferred to a smaller one. These are directions the authors name for future experiments. XLNet · T5 · Text summarization · Dialogue systems

Limits of the systems measurements

The communication pattern is part of the method, while its execution cost depends on the system running it. The reported measurements come from a cluster with fast within-server connections and a specified interconnect between servers. A different worker layout changes which exchanges cross which links. Different acceleration hardware can also change the time spent in the local matrix multiplications relative to the time spent communicating. The paper’s own head-count and strong-scaling tests show that this balance varies even on the same installation.

The throughput metric shows the rate of arithmetic sustained during training, compared with a linear reference based on the single-GPU run. To estimate time to a particular level of predictive quality, a reader would also need to know how fast training progresses under the competing setups. Iteration counts, an example epoch duration, and the validation curves address parts of that question. The paper does not compare the wall-clock time required for alternative parallel systems to attain a matched accuracy or perplexity. It also leaves 76% in the headline account and 74% in the detailed hybrid comparison without an explanation relating them.

Limits of the quality comparisons

Increasing size in the experiments changes the amount of computation spent processing the training text. The GPT-2-style validation curves compare learning over the iteration schedule, which allows a reader to compare progress in updates. They do not determine the best network size under a fixed budget of computation or elapsed time. The larger BERT configuration is evaluated at 1.5 million iterations, while the smaller ones complete 2 million. Its favorable result describes the checkpoint available in the reported run. A resource-allocation study would have to compare additional settings for training duration and capacity.

The benchmark comparisons with earlier work likewise use complete trained systems. Relative to those earlier results, the authors’ networks differ in more than the number of parameters. The corpus and the training procedure belong to the comparison. BERT additionally uses sentence-order prediction, its masking procedure, and the revised residual connection. The matched residual comparison provides evidence about stability with that intervention. The final downstream differences reflect all the ingredients present in the successful runs.

The tasks cover predictive fit to WikiText103, last-word recovery on LAMBADA, and fine-tuned performance on the BERT benchmarks. Perplexity aggregates how much probability the observed text receives. LAMBADA requires selecting the correct final word in a particular kind of passage. RACE evaluates reading comprehension under a task-specific fine-tuning procedure. These measurements do not directly test the factual accuracy of free-form continuations. The paper’s sample outputs show how the GPT-2-style network continues prompts, but the samples are unscored and support no estimate of the reliability of its claims.

What the overlap check can establish

The authors link their overlap measurements to the deliberate removal of some potential test material. Counting shared 8-grams adds a check on the cleaned collection, with the benchmark’s own train-test overlap providing context for WikiText103. That statistic does not show the distribution of matches across individual documents. Similar overall rates could arise from many widely scattered matching phrases or from passages with concentrated matches. It also measures exact shared stretches at a particular length. These are limits of the diagnostic, separate from the authors’ stated confidence about document inclusion.

What came after

The paper itself records a subsequent Megatron training run. In collaboration with NVIDIA, Microsoft researchers used it to train Turing-NLG, a GPT-2-style network of 17 billion parameters. The authors report further accuracy improvements with the increase in scale. This is a documented reuse of the training system and a continuation of its left-to-right experiments. The account gives neither a matched extension of the earlier scaling curves nor a corresponding extension of the BERT residual comparison.

Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM explicitly takes Megatron-LM forward as a way to train large networks across GPU clusters. It continues the line of work that treats the training arrangement as part of the experiment. The connection is direct in its stated scope. Megatron-LM supplies the starting point for the cluster-training study, whose subject is the efficient use of groups of GPUs for large-scale training.

GShard places conditional computation and automatic sharding at the center of another approach to scaling. Megatron-LM demonstrates selected divisions within a transformer layer, with the program explicitly managing communication at the boundaries. GShard’s stated emphasis on automatic sharding puts the description and assignment of distributed work at the center of the problem. The citation connects the approaches through distributed computation at scale. Its title identifies the different mechanisms it investigates, without detailing which Megatron operations, if any, are used.

Scaling Language Models: Methods, Analysis & Insights from Training Gopher takes large-scale training as an object of analysis in its own right. Its connection to Megatron-LM runs through the pairing of a training method with empirical questions about the resulting network. Megatron-LM uses throughput, pretraining loss, and downstream evaluations to make that connection concrete. The Gopher work identifies its own training run as the basis for investigating scaling. The citation links the research questions, while the named scope leaves details of the inherited execution machinery open.

Language Models are Few-Shot Learners takes up a question about how pretrained predictors are evaluated. Megatron-LM tests its GPT-2-style networks directly on text prediction and final-word recovery. The cited work makes few-shot learning its subject, considering performance from a small number of examples. The link concerns what researchers can investigate with large pretrained networks. The citation establishes a connection to Megatron-LM as prior work on training at scale and gives no details about whether the same partitioning scheme was used. Few-shot learning

FlashAttention-2 studies efficient attention through parallelism and the division of work. Attention is already an example in Megatron-LM of how the unit of partitioning shapes the work that can proceed independently. Its complete heads stay on their assigned devices until the projection that combines their outputs. The later paper’s stated focus is the execution of attention itself. The relationship is a shared systems question about arranging work so hardware can carry it out efficiently, with a different scope from the full training arrangement measured in Megatron-LM.

LoRA addresses adaptation after a large pretrained network is available. It makes low rank the basis of its approach to that stage. Megatron-LM studies the cost of training large networks and then uses end-to-end fine-tuning in its BERT evaluations. LoRA’s stated subject places the resource problem at the point where a pretrained network is adapted. The citation connects that question to the work of making large pretrained networks available, without establishing that LoRA inherits the original layer partition.

These later works show how the training problem opened onto several distinct questions. Some take Megatron-LM as named infrastructure for larger training runs. Others cite it while studying how to assign computation, what pretrained networks can do with examples, or how they can be adapted. The direct evidence of reuse comes from the accounts that name Megatron as part of training. The remaining connections locate the paper within a larger investigation of how training capacity, execution efficiency, and the evaluation of learned behavior depend on one another.

Cite

Cite as Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper and Bryan Catanzaro. 2019. Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism. arXiv:1909.08053.

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

@misc{shoeybi2019megatron,
  title = {{Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism}},
  author = {Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper and Bryan Catanzaro},
  year = {2019},
  doi = {10.48550/arxiv.1909.08053},
  eprint = {1909.08053},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1909.08053}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/shoeybi-2019-megatron-lm-training-multi-billion/

References

51 references, from the paper's own bibliography.

  1. Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I., Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L., Kudlur, M., Levenberg, J., Mané, D., Monga, R., Moore, S., Murray, D., Olah, C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K., Tucker, P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O., Warden, P., Wattenberg, M., Wicke, M., Yu, Y., and Zheng, X. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org. OpenAlex ↗ · Scholar ↗
  2. Ba, J. L., Kiros, J. R., and Hinton, G. E. Layernorm. CoRR, abs/1607.06450, 2016. URL http://arxiv.org/abs/1607.06450. OpenAlex ↗ · Scholar ↗
  3. Chen, C.-C., Yang, C.-L., and Cheng, H.-Y. Efficient and robust parallel dnn training through model parallelism on multi-gpu platform. arXiv:1809.02839, 2018. OpenAlex ↗ · Scholar ↗
  4. Chen, T., Xu, B., Zhang, C., and Guestrin, C. Training deep nets with sublinear memory cost. CoRR, abs/1604.06174, 2016. URL http://arxiv.org/abs/1604.06174. OpenAlex ↗ · Scholar ↗
  5. Dai, Z., Yang, Z., Yang, Y., Carbonell, J. G., Le, Q. V., and Salakhutdinov, R. Transformer-xl: Attentive language models beyond a fixed-length context. CoRR, abs/1901.02860, 2019. URL http://arxiv.org/abs/1901.02860. OpenAlex ↗ · Scholar ↗
  6. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. Bert: Pre-training of deep bidirectional transformers for language understanding, 2018. our card
  7. Goyal, P., Dollár, P., Girshick, R. B., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. Accurate, large minibatch SGD: training imagenet in 1 hour. CoRR, abs/1706.02677, 2017. our card
  8. Harlap, A., Narayanan, D., Phanishayee, A., Seshadri, V., Devanur, N., Ganger, G., and Gibbons, P. Pipedream: Fast and efficient pipeline parallel dnn training. arXiv:1806.03377, 2018. our card
  9. Hendrycks, D. and Gimpel, K. Bridging nonlinearities and stochastic regularizers with gaussian error linear units. CoRR, abs/1606.08415, 2016. URL http://arxiv.org/abs/1606.08415. OpenAlex ↗ · Scholar ↗
  10. Howard, J. and Ruder, S. Fine-tuned language models for text classification. CoRR, abs/1801.06146, 2018. OpenAlex ↗ · Scholar ↗
  11. Huang, Y., Cheng, Y., Chen, D., Lee, H., Ngiam, J., Le, Q. V., and Chen, Z. Gpipe: Efficient training of giant neural networks using pipeline parallelism. CoRR, abs/1811.06965, 2018. URL http://arxiv.org/abs/1811.06965. OpenAlex ↗ · Scholar ↗
  12. Jia, Z., Zaharia, M., and Aiken, A. Beyond data and model parallelism for deep neural networks. arXiv:1807.05358, 2018. our card
  13. Joshi, M., Chen, D., Liu, Y., Weld, D. S., Zettlemoyer, L., and Levy, O. Spanbert: Improving pre-training by representing and predicting spans. arXiv:1907.10529, 2019. our card
  14. Keskar, N. S., Mudigere, D., Nocedal, J., Smelyanskiy, M., and Tang, P. T. P. On large- batch training for deep learning: Generalization gap and sharp minima. ICLR, 2017. OpenAlex ↗ · Scholar ↗
  15. Khandelwal, U., Levy, O., Jurafsky, D., Zettlemoyer, L., and Lewis, M. Generalization through memorization: Nearest neighbor language models. arXiv:1911.00172, 2019. our card
  16. Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. our card
  17. Lai, G., Xie, Q., Liu, H., Yang, Y., and Hovy, E. Race: Large-scale reading comprehension dataset from examinations. arXiv:1704.04683, 2017. our card
  18. Lan, Z., Chen, M., Goodman, S., Gimpel, K., and Soricut, P. S. R. Albert: A lite bert for self-supervised learning of language representations. arXiv:1909.11942, 2019. our card
  19. Li, M., Andersen, D. G., Park, J. W., Smola, A. J., Ahmed, A., Josifovski, V., Long, J., Shekita, E. J., and Su, B.-Y. Scaling distributed machine learning with the parameter server, 2014. OpenAlex ↗ · Scholar ↗
  20. Liu, X., He, P., Chen, W., and Gao, J. Multi-task deep neural networks for natural language understanding. CoRR, abs/1901.11504, 2019a. URL http://arxiv.org/abs/1901.11504. our card
  21. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907.11692, 2019b. URL http://arxiv.org/abs/1907.11692. our card
  22. Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7. our card
  23. McCann, B., Bradbury, J., Xiong, C., and Socher, R. Learned in translation: Contextualized word vectors. CoRR, abs/1708.00107, 2017. our card
  24. Melamud, O., Goldberger, J., and Dagan, I. context2vec: Learning generic context embedding with bidirectional lstm. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pp. 51–61, 01 2016. our card
  25. Merity, S., Xiong, C., Bradbury, J., and Socher, R. Pointer sentinel mixture models. CoRR, abs/1609.07843, 2016. URL http://arxiv.org/abs/1609.07843. our card
  26. Micikevicius, P., Narang, S., Alben, J., Diamos, G. F., Elsen, E., Garcia, D., Ginsburg, B., Houston, M., Kuchaiev, O., Venkatesh, G., and Wu, H. Mixed precision training. CoRR, abs/1710.03740, 2017. OpenAlex ↗ · Scholar ↗
  27. Microsoft. Turing-nlg: A 17-billion-parameter language model by microsoft, 2020. URL https://www.microsoft.com/en-us/research/blog/turing-nlg-a-17-billion-parameter-language-model-by-microsoft/. OpenAlex ↗ · Scholar ↗
  28. Mikolov, T., Deoras, A., Kombrink, S., Burget, L., and Černockỳ, J. Empirical evaluation and combination of advanced language modeling techniques. In Twelfth Annual Conference of the International Speech Communication Association, 2011. OpenAlex ↗ · Scholar ↗
  29. Mikolov, T., Sutskever, I., Chen, K., Corrado, G., and Dean, J. Distributed representations of words and phrases and their compositionality. CoRR, abs/1310.4546, 2013. our card
  30. NVIDIA. Mixed precision training: Choosing a scaling factor, 2018. URL https://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html#scalefactor. OpenAlex ↗ · Scholar ↗
  31. Paperno, D., Kruszewski, G., Lazaridou, A., Pham, Q. N., Bernardi, R., Pezzelle, S., Baroni, M., Boleda, G., and Fernández, R. The LAMBADA dataset: Word prediction requiring a broad discourse context. CoRR, abs/1606.06031, 2016. URL http://arxiv.org/abs/1606.06031. our card
  32. Pennington, J., Socher, R., and Manning, C. D. Glove: Global vectors for word representation, 2014. URL https://www.aclweb.org/anthology/D14-1162. our card
  33. Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., and Zettlemoyer, L. Deep contextualized word representations. CoRR, abs/1802.05365, 2018. URL http://arxiv.org/abs/1802.05365. our card
  34. Radford, A., Józefowicz, R., and Sutskever, I. Learning to generate reviews and discovering sentiment. CoRR, abs/1704.01444, 2017. our card
  35. Radford, A., Narasimhan, K., Salimans, T., and Sutskever, I. Improving language understanding by generative pre-training, 2018. URL https://blog.openai.com/language-unsupervised/. OpenAlex ↗ · Scholar ↗
  36. Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Better language models and their implications, 2019. URL https://openai.com/blog/better-language-models/. OpenAlex ↗ · Scholar ↗
  37. Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv:1910.10683, 2019. our card
  38. Rajpurkar, P., Zhang, J., Lopyrev, K., and Liang, P. Squad: 100,000+ questions for machine comprehension of text. EMNLP, 2016. our card
  39. Rajpurkar, P., Jia, R., and Liang, P. Know what you don’t know: Unanswerable questions for squad. ACL, 2018. our card
  40. Ramachandran, P., Liu, P. J., and Le, Q. V. Unsupervised pretraining for sequence to sequence learning. CoRR, abs/1611.02683, 2016. URL http://arxiv.org/abs/1611.02683. our card
  41. Shazeer, N., Cheng, Y., Parmar, N., Tran, D., Vaswani, A., Koanantakool, P., Hawkins, P., Lee, H., Hong, M., Young, C., Sepassi, R., and Hechtman, B. Mesh-TensorFlow: Deep learning for supercomputers. In Neural Information Processing Systems, 2018. our card
  42. Trinh, T. H. and Le, Q. V. A simple method for commonsense reasoning. CoRR, abs/1806.02847, 2018. URL http://arxiv.org/abs/1806.02847. our card
  43. Turian, J., Ratinov, L., and Bengio, Y. Word representations: A simple and general method for semi-supervised learning. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, ACL '10, pp. 384–394, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. our card
  44. Valiant, L. G. A bridging model for parallel computation. Communications of the ACM, 33(8):103-111, 1990. OpenAlex ↗ · Scholar ↗
  45. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. CoRR, abs/1706.03762, 2017. our card
  46. Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., and Bowman, S. R. Glue: A multi-task benchmark and analysis platform for natural language understanding. ICLR, 2019. our card
  47. Yang, Z., Dai, Z., Yang, Y., Carbonell, J. G., Salakhutdinov, R., and Le, Q. V. Xlnet: Generalized autoregressive pretraining for language understanding. CoRR, abs/1906.08237, 2019. URL http://arxiv.org/abs/1906.08237. our card
  48. You, Y., Gitman, I., and Ginsburg, B. Large batch training of convolutional networks. arXiv:1708.03888, 2017. our card
  49. You, Y., Li, J., Reddi, S., Hseu, J., Kumar, S., Bhojanapalli, S., Song, X., Demmel, J., and Hsieh, C.-J. Large batch optimization for deep learning: Training bert in 76 minutes. arXiv:1904.00962, 2019. our card
  50. Zellers, R., Holtzman, A., Rashkin, H., Bisk, Y., Farhadi, A., Roesner, F., and Choi, Y. Defending against neural fake news. CoRR, abs/1905.12616, 2019. URL http://arxiv.org/abs/1905.12616. our card
  51. Zhu, Y., Kiros, R., Zemel, R. S., Salakhutdinov, R., Urtasun, R., Torralba, A., and Fidler, S. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. CoRR, abs/1506.06724, 2015. our card