A Domestic AI Computing Platform Completes Adaptation for 2.8T Parameter Model Training, Streamlining the Distributed Training Pipeline
This article explores the engineering practices and technical solutions for adapting a domestic AI computing platform (based on the MUSA software stack) to train a 2.8 trillion parameter model. It details the challenges of extreme memory management, parallel strategy coordination, and long-term stability. By leveraging a native FSDP2 multimodal training path, the platform achieves high memory utilization, efficient communication overlap, and near-linear scalability from 512 to 2048 GPUs, providing a reusable engineering framework for large-scale model training.
I. Background and Challenges: Systemic Issues in Trillion-Parameter Model Training
In recent years, the parameter scale of Large Language Models (LLMs) has grown exponentially, jumping from hundreds of billions to the trillion level. Taking a 2.8 trillion parameter model as an example, its storage requirement (calculated in FP16 precision) exceeds 5.6TB, far surpassing the memory capacity of a single card (mainstream accelerator cards have around 80GB). Furthermore, intermediate activation values and optimizer states (such as Adam’s second moment) during training multiply the memory footprint several times over. This requires the training system to possess the following capabilities:
- Extreme Memory Management: Parameters, gradients, and optimizer states must be distributed and sharded, requiring a dynamic balance between memory and communication overhead.
- Efficient Parallel Strategy Coordination: Data Parallelism (DP), Tensor Parallelism (TP), and Pipeline Parallelism (PP) must be used in combination and adaptively adjusted for different layers and operators.
- Stable Long-Term Operation: Trillion-parameter training cycles last for weeks. The system must handle hardware failures, communication timeouts, gradient overflow, and other exceptions, while supporting checkpoint recovery.
- Hardware-Software Co-design: The underlying accelerator card’s instruction set, high-speed interconnect topology, and upper-layer training frameworks (such as PyTorch, MindSpore) require deep adaptation to prevent performance bottlenecks caused by missing drivers or operators.
This article uses the practice of a domestic GPU computing platform (based on the MUSA software stack) completing the adaptation of a 2.8 trillion parameter model training as a blueprint. By abstracting away specific brands, it outlines a general technical solution that can serve as a reference for large-scale model training teams.
II. Key Engineering Paths: From Model Loading to Gradient Synchronization
The “native FSDP2 multimodal training path” mentioned in the original report is the core innovation. FSDP (Fully Sharded Data Parallel) is a parameter-sharded data parallel scheme proposed by the PyTorch community. Its second generation (FSDP2) has significant improvements in sharding granularity, communication overlap, and memory efficiency. For trillion-parameter models, the complete training pipeline can be broken down into four major modules:
1. Model Loading and Parameter Sharding
Model files are often stored in a sharded format (e.g., 1GB~4GB per shard). Two issues must be resolved during loading:
- Metadata Parsing: Read model configuration files (e.g., JSON/YAML) to parse structural information such as the number of layers, hidden dimensions, and attention heads, thereby constructing the computation graph description.
- Parameter Sharding Strategy: FSDP2 adopts a “per-parameter sharding” strategy, where a single parameter tensor is sliced by dimension, rather than slicing the entire model layer as in traditional ZeRO-3. This avoids CPU/GPU memory peaks caused by cross-layer communication.
Code illustration (pseudo-code):
# Register model and initialize shardingmodel = load_model(config_path)fsdp_model = FSDP2(model,sharding_dim=0, # Slice along the first dimensionflatten_params=True, # Flatten parameters to improve memory access efficiencysync_module_states=True # Sync scattered parameters at startup)
Key optimization point: A “lazy loading + async publication” mechanism is used during loading. Parameters are first mapped to virtual memory and swapped to VRAM just before operator execution, avoiding instantaneous memory doubling.
2. Communication Topology Design for Sharding Scheduling
During FSDP2 training, each GPU only holds a portion of the parameters. Forward computation triggers AllGather (to collect full weights), and backward propagation triggers ReduceScatter (to aggregate gradients). The communication volume formula is: Communication volume = Model size × 2 × Gradient accumulation steps. For a 2.8 trillion parameter model, the communication volume for a single AllGather + ReduceScatter is as high as 5.6TB×2. Therefore, key optimizations are needed:
- Hierarchical Communication Overlap: Divide the computation graph into multiple micro-batches based on dependencies, allowing computation of one part to execute in parallel with the communication of another. For example, during the backward pass of layer i, the gradient communication of layer i-1 occurs simultaneously.
- Topology-Aware Communication Grouping: Utilize NUMA affinity and NVLink/PCIe topologies to divide GPUs into multiple communication domains. High-speed interconnects are used within domains, and RDMA is used between domains to reduce cross-node bottlenecks.
- Gradient Compression: Apply TopK sparsification or 1bit quantization to gradients (requiring error compensation), but the impact on convergence accuracy must be evaluated. For trillion-parameter models, aggressive compression is usually avoided, relying instead on high-bandwidth networks.
3. Special Handling for Multimodal Training Paths
The original model supports multimodality (text, images, video, etc.), and the parameter volume and computation modes of encoders for different modalities vary greatly. The training path must support:
- Heterogeneous Parallelism: The visual encoder (such as ViT) uses Tensor Parallelism, while the text decoder uses Pipeline Parallelism. The two are connected via a “pooling alignment layer,” which must synchronize gradients.
- Dynamic Shape Support: The variable sequence length of images leads to unfixed attention matrix shapes. FSDP2 must support dynamic sharding rather than static fixed shapes.
- Mixed Precision Strategy: In multimodality, certain layers (like LayerNorm) need to maintain FP32 precision, while other layers use BF16. During sharding, parameters must be grouped by precision to avoid conversion overhead.
4. Gradient Synchronization and Optimizer State Management
FSDP2 shards optimizer states (such as Adam’s momentum variables) synchronously with parameters. Each GPU only updates its held shards. Key designs include:
- Sharded Optimizer: Optimizer states are not replicated; instead, each GPU maintains the states corresponding to its local parameters. After updating, the full parameters are immediately discarded, keeping only the shards.
- Gradient Accumulation and Reduction: A two-level reduction of “domain-internal ReduceScatter first, then inter-domain AllReduce” is applied to cross-parallel-domain gradients to reduce bandwidth peaks.
- End-to-End Validation: Regularly use gradient norm (grad norm) and parameter change rates for consistency checks to prevent divergence caused by desynchronized shards.
III. Stability and Fault Tolerance: The Lifeline of Trillion-Parameter Training
Training a 2.8 trillion parameter model means that any single point of failure will halt the entire cluster. The following are core safeguard measures practiced:
1. Asynchronous Checkpointing
- A “sharded local save + global metadata” mechanism is adopted. Each GPU only saves its own parameter shards. The total checkpoint size remains equal to the model size, but the write speed can be parallelized.
- Asynchronous DMA transfers are used to write to object storage (such as general cloud storage) to avoid blocking computation. Simultaneously, the two most recent checkpoints are retained to support rollback.
2. Communication Timeout and Fault Self-Healing
- Heartbeat monitoring is set up; if no communication message is received for over 30 seconds, fault detection is triggered.
- If a node fails, the global parameter index is used to recover that node’s shard from the most recent checkpoint while other nodes continue training, without requiring an overall restart (requires an elastic training framework).
3. Numerical Stability
- BF16 mixed precision is adopted. Its exponent bits are identical to FP32 (8-bit exponent), avoiding the overflow risk associated with FP16.
- Gradient clipping is based on the global gradient norm (across all shards), requiring an AllReduce to first calculate the global norm before synchronizing the scaling factor.
IV. Performance Gains and Empirical Experience
Through the above optimizations, the domestic computing platform achieved the following in the 2.8 trillion parameter model training:
- Memory Utilization: Single-card usage stably remained above 90% with no memory fragmentation.
- Communication-Computation Overlap Ratio: About 85% of the communication time was covered by computation, achieving a Model FLOPs Utilization (MFU) of 48% (this is a general benchmark; actual results depend on network bandwidth and operator implementation).
- Scalability: When scaling from 512 cards to 2048 cards, a near-linear speedup ratio of 0.92 was achieved (limited by global synchronization frequency, requiring gradient accumulation to increase the effective batch size).
Lessons learned: Initially, uneven sharding granularity caused some GPUs to exceed memory limits. This was later changed to adaptive sharding based on the number of intra-layer parameters. Additionally, FSDP wrapping should be avoided in frequently called operators (such as FlashAttention), as it adds extra control flow overhead.
V. Conclusion and Future Outlook
Completing the training adaptation for trillion-level parameter models is not just about “fitting” the model into a GPU cluster; it requires end-to-end co-design spanning the software stack, communication libraries, parallel strategies, and scheduling systems. The native FSDP2 multimodal training path described in this article is essentially a reusable engineering framework:
- For model developers, it provides “zero-code change” scaling capabilities (automatic sharding via registered hooks).
- For computing platforms, it validates the stability and performance of domestic GPUs in ultra-large model scenarios.
In the future, as model parameters continue to grow toward the 10 trillion level, it will be necessary to further explore composite strategies like “Mixture of Experts (MoE) + Sequence Parallelism” and combine Auto-Parallelism with topology-aware scheduling to reduce manual tuning costs. Every breakthrough in this field relies on the deep collaboration of hardware, frameworks, and algorithms.
