Trillion-Parameter Multimodal Model Training on Domestic Chinese AI Compute: FSDP2 Adaptation Practice
This article covers the main challenges of training trillion-parameter multimodal models, including memory limits, communication overhead, and the added complexity of multimodal architectures. It then describes a native FSDP2 training path on domestic Chinese AI compute, covering model loading, shard scheduling, gradient synchronization, software stack adaptation, and practical recommendations for training at scale.
Trillion-Parameter Multimodal Model Training on Domestic Chinese AI Compute: FSDP2 Adaptation Practice
1. Background: Training Ultra-Large Multimodal Models Gets Much Harder
Recently, an open-source multimodal large language model with 2.8 trillion parameters was released, once again raising the upper bound on the scale of open-source models. Models of this class perform strongly in semantic understanding, visual reasoning, and long-context processing. However, their training cost rises steeply. At the trillion-parameter scale, a single compute node cannot hold the full model state. Training must rely on distributed architectures that span hundreds or even thousands of accelerator cards.
At the same time, diversifying compute supply has become an industry consensus. More companies and research institutions are exploring how to train and fine-tune large models on domestic GPU compute. This improves supply chain resilience and offers a path toward building autonomous, controllable AI infrastructure. Recently, a Chinese GPU vendor used its flagship training-and-inference AI accelerator card and in-house software stack to complete training adaptation for the trillion-parameter multimodal model mentioned above. The work built a native FSDP2 multimodal training path and connected the full training pipeline, from model loading and shard scheduling to gradient synchronization. This article uses that work as a starting point to examine the core technical problems of adapting ultra-large model training to domestic compute.
2. Core Challenges of Trillion-Parameter Training
2.1 The Memory Wall: Model State Far Exceeds Single-Device Capacity
Take a 2.8-trillion-parameter model as an example. Even with mixed-precision training, the model weights alone require several terabytes of device memory. Optimizer states, such as the first and second moments in Adam, and gradients can multiply memory demand several times over. Traditional data parallelism requires each device to hold a full model replica. At this scale, that approach is completely infeasible, so fully sharded parallelism is required.
2.2 The Communication Wall: Sharding Creates Massive Cross-Device Data Exchange
When parameters are split across thousands of devices, each forward and backward pass must gather the sharded parameters in real time. The backward pass also requires a global reduction of gradients. Network bandwidth, topology, and communication operator efficiency directly determine training throughput. If communication cannot overlap effectively with computation, accelerator utilization drops significantly.
2.3 Added Complexity from Multimodal Architectures
Multimodal models typically combine several heterogeneous submodules, such as a vision encoder, a projection layer, and a language model backbone. These modules differ in compute density, memory footprint, and parallelism requirements. The training framework must therefore support differentiated sharding and freezing strategies at the module level. For example, the vision encoder may be frozen while only the backbone is trained. This places higher demands on the flexibility of the distributed training system.
3. The Native FSDP2 Training Path: A Technical Overview
FSDP (Fully Sharded Data Parallel) is the mainstream approach for training ultra-large models. Its core idea is to shard parameters, gradients, and optimizer states across all devices, gather them on demand, and release them after use. This keeps per-device memory at a manageable level. FSDP2 refines the engineering implementation in several ways:
- Sharded tensors as first-class citizens: Parameters exist in sharded form from the moment they are loaded. This avoids the memory spike caused by loading full parameters before sharding them. The change is especially important for cold-starting trillion-parameter models.
- Finer-grained communication scheduling: All-gather and reduce-scatter operations can be prefetched and pipelined per layer, so communication overlaps with computation.
- Flexible hybrid sharding: Sharding and replication can be combined across different dimensions. This suits different network topologies and performs better on typical clusters with high intra-node bandwidth and lower inter-node bandwidth.
The following training configuration sketch shows only the general structure and does not refer to any specific product:
from torch.distributed.fsdp import fully_shard, MixedPrecisionPolicymp_policy = MixedPrecisionPolicy(param_dtype=torch.bfloat16,reduce_dtype=torch.float32,)# Apply sharding to each submodule of the multimodal model separatelyfor layer in model.vision_encoder.layers:fully_shard(layer, mp_policy=mp_policy, reshard_after_forward=True)for layer in model.language_model.layers:fully_shard(layer, mp_policy=mp_policy)fully_shard(model) # Shard the root module last to control overall behavior
4. Key Stages of the Training Pipeline
4.1 Model Loading: From Checkpoint to Sharded Memory
Weights of trillion-parameter models are usually stored as sharded checkpoints. The training system needs to support streaming loading, where each device reads only the parameter shards it is responsible for. Combined with memory mapping and lazy materialization, this avoids creating a full copy of the parameters in CPU or device memory. After loading, the system must validate shard metadata to confirm that the topology matches the checkpoint.
4.2 Shard Scheduling: Differentiated Handling by Module
For multimodal architectures, common practice is as follows. Use standard full sharding for the large, regularly structured language backbone. For smaller modules such as the vision encoder, use replication or hybrid sharding to reduce communication overhead. The system also supports per-module settings such as reshard_after_forward, which trade off memory usage against communication frequency.
4.3 Gradient Synchronization: Communication Efficiency Determines Throughput
During backpropagation, the gradients from each shard are accumulated globally through reduce-scatter. Common engineering techniques for reducing synchronization overhead include gradient bucketing, pipelining communication with backward computation, and topology-aware hierarchical communication that prioritizes high-speed intra-node links. On domestic GPU platforms, the software stack must also deeply adapt the underlying collective communication library. This ensures that operators perform correctly and efficiently in heterogeneous interconnect environments.
4.4 Software Stack Adaptation: End-to-End Integration from Operators to Communication
Adapting training to domestic compute is difficult not only because of hardware performance but also because of the software ecosystem. Core operators of mainstream training frameworks, distributed communication primitives, and memory management mechanisms must be fully ported to the in-house software stack and verified for numerical consistency. Only when operator coverage, communication performance, and numerical precision all meet the required standard does a system move from “able to run” to “able to train.”
5. Engineering Recommendations
- Validate at small scale first: Get the full pipeline running on a small number of cards and confirm that the loss curve converges. Then scale the cluster gradually.
- Monitor from the start: Use general-purpose logging and monitoring services to track memory usage, communication time, and gradient norms in real time, so bottlenecks can be located quickly.
- Checkpoint routinely: Ultra-large training runs last for weeks, so the system must support efficient sharded checkpoint saving and resumption from breakpoints.
6. Conclusion
Completing training adaptation for a trillion-parameter multimodal model on domestic GPU compute marks a step forward in the combined hardware and software capabilities of domestic vendors. The working native FSDP2 path shows that an end-to-end engineering pipeline, from model loading and shard scheduling to gradient synchronization, is feasible. As the software stack matures and cluster sizes grow, domestic compute could play a larger role in training bigger models and in real-world deployments. For developers, understanding the underlying principles and engineering trade-offs of distributed training is more valuable over the long term than committing to any single platform.
