Technical Deep Dive: Adapting Massive-Scale Model Training to Domestic AI Accelerators
This article examines the technical process of adapting a 2.8-trillion-parameter multimodal model to run on domestic AI accelerators in China. It breaks down the adaptation effort into three core dimensions: hardware requirements, software stack compatibility, and parallel training architecture. The discussion covers the role of train-inference integrated accelerators, the engineering work required in custom software stacks (including operator, framework, and communication library layers), and the implementation of a native FSDP2 multimodal training pipeline. It also highlights key challenges such as memory capacity, interconnect bandwidth, fault tolerance, and the verification methodology used to ensure numerical correctness. The article concludes with broader implications for building heterogeneous computing capabilities for large-scale model training.
Introduction: The Computational Demands of Trillion-Parameter Models
The recent open-sourcing of a 2.8-trillion-parameter multimodal flagship model has placed unprecedented demands on underlying computing infrastructure. For mainstream GPU ecosystems, the mature CUDA platform makes such adaptation relatively straightforward. However, for domestic AI accelerators, supporting training at this scale requires simultaneous breakthroughs across three dimensions: hardware capability, software stack compatibility, and parallelization strategy.
The adaptation effort can be distilled into three key elements:
- Hardware layer: Training tasks are carried by flagship-grade, train-inference integrated domestic intelligent computing accelerators.
- Software layer: Full adaptation of model training is completed through a self-developed unified computing software stack.
- Training architecture layer: A native FSDP2 (Fully Sharded Data Parallel 2) multimodal training pipeline is established, covering the complete chain from model loading and shard scheduling to gradient synchronization.
These three points encompass the entire core workflow of large-model training adaptation and are examined in detail below.
Hardware Foundation: Positioning and Capability Requirements of Train-Inference Integrated Accelerators
What Does “Train-Inference Integrated” Mean?
Traditionally, training and inference chips emphasize different strengths: training demands high-precision compute (BF16/FP16, even FP8), large memory capacity, and high interconnect bandwidth, while inference prioritizes throughput and cost efficiency. A train-inference integrated accelerator is designed to handle both types of workloads simultaneously, requiring a balanced architecture that covers memory capacity, compute precision, and interconnect capability.
Hard Requirements for Trillion-Parameter Training
For a model with 2.8 trillion parameters, even with mixed-precision training, the combined storage for model weights, gradients, and optimizer states (for Adam-style optimizers, typically including FP32 master weights, first-order momentum, and second-order momentum) far exceeds what a single GPU can hold. Industry-standard estimation suggests mixed-precision training requires roughly 16–20 bytes of state storage per parameter, meaning 2.8 trillion parameters would need approximately 45–56 TB of memory. This leads to several implications:
- Large-scale clustering is mandatory: Even with high-capacity memory on each card, hundreds or thousands of accelerators must work in coordination.
- Interconnect bandwidth becomes a bottleneck: Cross-node communication relies primarily on high-speed networking (such as RDMA-class interconnects), while intra-node communication depends on high-speed direct links between accelerators. Communication efficiency directly determines training throughput.
- Fault tolerance is critical: Failures in thousand-card clusters are the norm rather than the exception. Hardware and software must work together to support checkpoint-based resumption and automatic recovery.
Software Stack Adaptation: Core Work of MUSA-Class Self-Developed Stacks
Why the Software Stack Is the Greatest Challenge
For domestic accelerators built on proprietary instruction sets and programming models, the software stack must complete three layers of adaptation:
- Operator layer: Large-model training involves a vast number of operators (Attention, GEMM, LayerNorm, various optimizer updates, etc.). Each operator must be efficiently implemented on the custom architecture.
- Framework integration layer: Mainstream deep learning frameworks interface with hardware through CUDA-like APIs or plugin mechanisms. The device-side backend of these frameworks needs modification so model code can migrate seamlessly.
- Communication library layer: Collective communication libraries (AllReduce, AllGather, ReduceScatter, etc.) form the backbone of distributed training and require deep optimization on custom interconnect topologies.
The Verification Path for Adaptation
A complete adaptation typically follows an “inference-first, training-second” route: first, ensure the model can perform forward inference on the hardware with correct numerical outputs; then progressively enable backpropagation, gradient updates, and multi-card coordination. At each step, metrics such as loss curves and gradient norms must be compared layer by layer against a reference environment to confirm that computational accuracy does not drift. This layer-by-layer alignment methodology is a universal best practice for all heterogeneous computing adaptation efforts.
FSDP2 and Multimodal Training Paths: Engineering Parallelization Strategies
The Core Idea Behind FSDP
FSDP (Fully Sharded Data Parallel) is one of the mainstream solutions to the memory bottleneck of extremely large models. Its core idea: shard model parameters, gradients, and optimizer states across data-parallel ranks. During forward and backward passes, only the required shards are temporarily gathered on demand and released immediately after computation. This reduces static memory usage to roughly 1/N of the original (where N is the degree of parallelism).
FSDP2 builds on this foundation with key improvements, including:
- DTensor-based finer-grained sharding semantics, aligning sharding logic with tensor dimensions for cleaner code and easier debugging.
- Better composability with tensor parallelism and pipeline parallelism, supporting multi-dimensional hybrid parallel strategies.
- More flexible mixed-precision and communication-computation overlap configurations.
Why Multimodal Models Need a “Native Training Path”
Multimodal models typically include a vision encoder, a language model backbone, and modality alignment modules, each with vastly different structural characteristics:
- Imbalanced parameter scales: Visual and language components may differ in parameter count by several times, making a uniform sharding strategy lead to imbalanced memory load.
- More complex computational graphs: Preprocessing and fusion of multi-source inputs (images, text) increase pipeline design difficulty.
- Heterogeneous data pipelines: Loading, tokenizing, and concatenating multimodal data requires efficient data loaders and prefetching mechanisms to prevent GPU idle waiting.
A “native FSDP2 multimodal training path” means more than simply applying a text-only language model training script. It requires systematic design choices around sharding granularity, offload strategies, and checkpoint saving granularity tailored to these specific characteristics.
Three Key Stages in the Complete Training Pipeline
The original text’s reference to “model loading, shard scheduling, and gradient synchronization” maps to the following engineering essentials:
1. Model Loading: Weight files for trillion-parameter models can themselves reach tens of terabytes. Support for sharded loading and lazy initialization (via meta device techniques) is required to avoid CPU memory overflow during the loading phase. An illustrative loading strategy:
# Pseudocode: lazy initialization using meta devicewith torch.device("meta"):model = build_model(config) # no real memory allocatedfsdp_model = FSDP2(model, sharding_strategy="full_shard")fsdp_model.to_empty(device="cuda") # allocate based on actual shards
2. Shard Scheduling: Sharding strategies are determined dynamically based on per-layer parameter counts. Extra-large single layers such as Embedding and LM Head receive special handling, combined with activation checkpointing (recomputation) to further reduce peak memory usage.
3. Gradient Synchronization: Leveraging the natural “gradient AllGather” property of sharded architectures, communication is overlapped with backward computation. Combined with gradient accumulation and mixed-precision loss scaling, this maximizes effective cluster compute utilization.
Industry Implications and Outlook
This adaptation effort signals that domestic computing stacks are transitioning from “inference-capable” to “trillion-scale model training-capable.” For enterprises building heterogeneous computing training capabilities, several considerations deserve attention:
- Software stack maturity matters more than raw compute specs: Operator completeness and framework integration quality directly determine deployment efficiency.
- Parallel strategies must be co-designed with hardware topology: No one-size-fits-all parallelization scheme exists; solutions must be tailored to cluster scale and interconnect layout.
- Observability and fault tolerance should be established first: In large-scale training, monitoring loss spikes, hardware failure rates, communication time ratios, and similar metrics is as important as the training itself.
As the domestic AI software ecosystem continues to mature, heterogeneous computing supporting ultra-large-scale model training will become the industry norm. Mastering the adaptation methodology will become a core competency for AI infrastructure teams.
