Estimating Memory, Sharding, and Recovery for Training a 2.8-Trillion-Parameter Model
This article provides a practical framework for estimating GPU memory requirements and selecting parallelization strategies when training a model with 2.8 trillion parameters. It breaks down the per-parameter memory footprint of mixed-precision Adam optimization, calculates model state memory across 1,024 GPUs with full sharding (FSDP/ZeRO-3), and details how to budget for activations with and without activation recomputation, communication buffers for layer-wise all-gather operations, and fragmentation headroom. The guidance emphasizes unit consistency, peak-based activation estimation for multimodal inputs, and the importance of pre-validating sharded checkpoint recovery.
Training a model with 2.8 trillion parameters requires careful upfront planning. The numbers below are estimates, not measurements from any specific model or platform. Teams should base their final budgets on their own precision strategy, optimizer, and hardware.
First Estimate Memory, Then Choose Parallelism
For mixed-precision training with Adam, each parameter typically occupies about 16 bytes: 2 bytes for the bf16 weight, 2 bytes for the bf16 gradient, 4 bytes for the fp32 master weight, and 4 bytes each for Adam’s first and second momentum moments.
For 2.8 trillion parameters, the model states alone require approximately:
2.8 × 10^12 × 16 bytes ≈ 44.8 TB (decimal)
With fully sharded data parallelism (FSDP or ZeRO-3), the model states are evenly distributed across N GPUs. Per-GPU model state is approximately 44.8 TB / N. For 1,024 GPUs:
44.8 TB / 1,024 ≈ 43.75 GB (decimal) ≈ 40.74 GiB (binary)
Framework and hardware memory capacity is typically reported in GiB, so be consistent with units when checking your budget. The figures above do not include activations, communication buffers, or fragmentation.
A complete per-GPU memory budget can be written as:
Per-GPU Memory ≈ Model States / N + Activations + Communication Buffers + Fragmentation Headroom
Estimating Each Component
Activations: As a rule of thumb, a standard Transformer layer requires about 34 × h bytes per token per layer during bf16 training (excluding the attention score matrix, without activation recomputation). Consider a hypothetical configuration: hidden dimension h = 8,192, 80 layers, per-GPU microbatch of 1, and sequence length 4,096. Each layer needs about 34 × 4,096 × 8,192 ≈ 1.14 GB, totaling roughly 91 GB across 80 layers—already exceeding the capacity of a single 80 GB GPU. With activation recomputation enabled, only the layer inputs need to be stored: 2 × s × b × h ≈ 67 MB per layer, or about 5.4 GB for 80 layers. For multimodal inputs, token counts for images or videos can vary widely; estimate peak memory using the P99 length rather than the average.
Communication buffers: During layer-wise all-gather, a full layer’s complete parameters must be temporarily stored. Assuming 2.8 trillion parameters are evenly distributed across 200 layers, each layer has about 140 billion parameters, requiring roughly 28 GB for the full bf16 parameters. During backpropagation, the complete gradient must also be stored. Each additional prefetch depth level adds one more layer of buffer.
Fragmentation headroom: Reserve 10–15% of memory as a safety margin to accommodate fragmentation and runtime fluctuations.
Sharding, Checkpointing, and Recovery Validation
Distribute the model states evenly across all GPUs. For instance, with 1,024 GPUs, each GPU holds roughly 40.74 GiB of model states, leaving the rest of the memory budget for activations and communication buffers. This motivates activation recomputation, since full activations alone can exceed the memory capacity of a single GPU.
Before launching a long training run, validate that sharded checkpoints can be reliably saved and restored. Confirm that checkpoint files are accessible after sharding, that the optimizer states are fully reconstructed upon loading, and that the training loop resumes from the correct step. This validation step is critical for avoiding costly restarts on a multi-day job.
