Technical Paths for Training Ultra-Large Models on Domestic AI Accelerators
Training trillion-parameter models presents significant infrastructure challenges, including memory walls, communication bottlenecks, and hardware compatibility issues. This article analyzes a complete engineering path for adapting open-source trillion-parameter multimodal models to domestic AI accelerators. It explores key technologies such as FSDP2 for full sharding, the construction of native multimodal training pipelines, and the end-to-end link from model loading to gradient synchronization. It also highlights the critical value of a mature software stack in achieving operator coverage and numerical precision on alternative hardware.
1. Background: Infrastructure Challenges in Ultra-Large Model Training
In recent years, the parameter scale of open-source large models has continued to climb, with flagship models reaching the trillion-parameter level. Training such models is no longer a simple matter of stacking GPUs, but a comprehensive test of computing hardware, communication interconnects, software stacks, and parallel strategies. Taking a multimodal model at the 2.8 trillion parameter level as an example, its training adaptation faces at least the following challenges:
- Memory Wall: The memory of a single card is far from sufficient to accommodate model parameters, optimizer states, and activations. In standard mixed-precision training, each trainable parameter requires more than 16 bytes of state storage (parameters, gradients, first-order and second-order momentum, etc.). A trillion-parameter model requires tens of TBs just for optimizer states, necessitating multi-level sharding and offloading strategies.
- Communication Wall: Gradient synchronization in data parallelism, activation passing in pipeline parallelism, and intra-layer communication in tensor parallelism all amplify communication overhead as the cluster size expands. If interconnect bandwidth is insufficient or communication patterns are poorly designed, GPU utilization will drop significantly.
- Heterogeneous Compatibility Wall: When training migrates from mainstream accelerators to domestic accelerators, operator coverage, numerical precision, and communication library maturity must be verified one by one. The completeness of the software stack directly determines adaptation costs.
Recently, a cloud provider announced the completion of training adaptation for an open-source trillion-parameter multimodal model based on a domestic flagship training-inference unified accelerator and a proprietary software stack, building a native Fully Sharded Data Parallel (FSDP2) multimodal training path. This case clearly demonstrates the complete engineering path for ultra-large model training and is worth an in-depth breakdown.
2. Core Technology I: FSDP2 and Fully Sharded Training
FSDP (Fully Sharded Data Parallel) is currently one of the mainstream solutions for ultra-large model training. Its core idea is to shard all model parameters, gradients, and optimizer states across various computing devices, aggregate them on-demand via all-gather during forward and backward passes, and immediately release non-local shards after computation. This compresses memory usage to a level equivalent to the single-card shard size.
Compared to the first-generation implementation, FSDP2 adopts dimension-level sharding via DTensor, offering several significant advantages:
- More Uniform Sharding Granularity: It directly slices parameter tensors at the dimension level, avoiding the uneven sharding issues caused by nested flat parameters.
- Better Compatibility with Quantization and Low-Precision Training: The sharding unit is the original tensor, making it easier to apply different precision strategies to specific modules.
- More Accurate Memory Prediction: Engineering teams can more accurately estimate peak memory and plan micro-batch and gradient accumulation strategies.
The schematic sharding configuration logic is as follows:
# Pseudo-code: FSDP2 sharding configurationfrom torch.distributed.fsdp import fully_shardfor block in model.transformer_blocks:fully_shard(block, sharding_strategy=ShardingStrategy.FULL_SHARD)fully_shard(model, sharding_strategy=ShardingStrategy.FULL_SHARD)
In trillion-parameter scenarios, it is usually necessary to combine tensor parallelism and pipeline parallelism to form 3D parallelism, or offload some states to host memory to further approach the memory limit.
3. Core Technology II: Constructing the Multimodal Training Path
The training path for multimodal models is much more complex than that for pure text models, mainly reflected in:
- Heterogeneous Module Coexistence: Vision encoders, text tokenizers, projection layers, and the language model backbone have different computational characteristics and memory usage patterns, requiring differentiated parallelism and precision strategies. For instance, the vision side can use lower precision to boost throughput, while critical layers of the language backbone must maintain high numerical stability.
- Complex Data Pipelines: Data sources like image-text pairs, video, and pure text require unified sampling, concatenation, and packing. Sequence packing is typically used to reduce padding waste, paired with sample-level masking to ensure attention computation isolation.
- Layered Training Stages: A multi-stage process of “alignment first, fusion later, then reinforcement” is generally followed. Freezing strategies, learning rates, and loss weights for each stage must be flexibly configured within the training framework.
The so-called “native multimodal training path” means the training framework supports unified sharding and scheduling of multimodal modules from its initial design, rather than patching them together afterward. This significantly reduces engineering friction during stage transitions.
4. Core Technology III: The Complete Link from Loading to Gradient Synchronization
A complete training adaptation requires connecting the following key links:
- Model Loading and Shard Initialization: Supports streaming loading from checkpoints and direct sharding initialization by device, avoiding bottlenecks caused by first loading the entire model into a single node’s memory or VRAM.
- Shard Scheduling: Automatically determines sharding granularity and device mapping based on module type and parameter scale to balance the load across cards.
- Gradient Synchronization: Triggers reduce-scatter on demand during backpropagation and deeply coordinates with communication libraries to achieve compute-communication overlap.
- Fault Tolerance and Resumption: Periodically saves sharded checkpoints and supports breakpoint resumption and node failure recovery, which is the baseline guarantee for long-term training stability.
5. The Value of Domestic Software and Hardware Stack Adaptation
The underlying support for training adaptation is a complete software stack, including the porting and optimization of a CUDA-like unified programming model, operator libraries, communication libraries, and distributed training frameworks. For domestic accelerators to be practically deployed in ultra-large model training, they must achieve dual standards of operator coverage and numerical precision. In mixed-precision scenarios, convergence consistency with mainstream solutions must be ensured through methods like gradient scaling and loss normalization. This adaptation demonstrates that domestic training-inference unified accelerators, paired with a mature software stack, already possess the engineering capability to support trillion-parameter model training. This has positive significance for reducing the reliance of large model training on a single supply chain and building a diversified computing power landscape.
6. Conclusion and Outlook
Ultra-large model training adaptation is a system engineering effort requiring the synergy of hardware, software stacks, and parallel strategies. From model loading and shard scheduling to gradient synchronization, the maturity of each link determines the efficiency and stability of training. In the future, as low-precision training, Mixture of Experts (MoE) architectures, and automatic parallelism technologies mature further, the demands of training frameworks on hardware will become more diversified, and the domestic computing power ecosystem will continue to improve through the tempering of real training workloads. For engineering teams, mastering full-sharding technologies like FSDP and the construction of multimodal training paths will be a core capability for handling the next generation of model scales.
