Ultra-Large Model Training Adaptation: Sharding, Communication, and Fault Tolerance Practices
This article explores the systematic adaptation required for training ultra-large models, focusing on sharding strategies. Using a hypothetical 2.8 trillion parameter model as an example, it estimates VRAM requirements and compares FSDP1 with FSDP2 in detail, highlighting their differences in sharding representation, memory management, and compatibility with other parallel strategies.
1. Why Ultra-Large Model Training Requires Systematic Adaptation
Using a hypothetical case of a 2.8 trillion parameter model, we can first estimate the VRAM requirements. The BF16 weights alone occupy approximately 5.6 TB. Mixed precision training also requires storing FP32 master weights, as well as the first and second momentums of the Adam optimizer. Estimating at about 16 bytes per parameter (2 bytes for BF16 weights, 2 bytes for BF16 gradients, 4 bytes for FP32 master weights, and 4 bytes each for the two momentums), the static states total around 44.8 TB.
Even if these states are evenly distributed across 1,024 GPUs, each card still has to handle about 44 GB. Activation values, communication buffers, and memory fragmentation will consume additional space, meaning the VRAM of most accelerator cards will be exhausted quickly. The above figures depend on the precision strategy, optimizer type, and whether parameter offloading is applied; actual projects should recalculate based on their specific configurations.
2. Differences Between FSDP1 and FSDP2
Some resources describe FSDP2 as a new mechanism that breaks through FSDP1’s limitation of only sharding parameters. This statement is inaccurate. FSDP1 already supports full sharding (FULL_SHARD) of parameters, gradients, and optimizer states. The main differences between the two generations lie in the representation of shards and their ability to combine with other parallel strategies.
| Comparison Item | FSDP1 | FSDP2 |
|---|---|---|
| Sharding Object | Parameters, gradients, optimizer states | Parameters, gradients, optimizer states |
| Sharding Representation | Multiple parameters are concatenated into a FlatParameter before sharding | Parameters are sharded individually, using DTensor to represent the sharded state |
| Combination with Other Parallel Strategies | More constraints when combining | Based on DTensor, making it easier to combine with tensor parallelism and other strategies |
| VRAM Usage | Relies on large concatenated buffers | Per-parameter management, making VRAM usage more predictable |
FSDP2 itself is modality-agnostic. The uniqueness of multimodal training stems from differences in data shapes and module structures, rather than the sharding operations.
