Trillion-Parameter Multimodal Model Training on Domestically Developed AI Accelerator Cards: A Practical Adaptation Path
This article examines the practical technical path for adapting a domestically developed AI accelerator card and its in-house unified software stack to trillion-parameter multimodal model training. It outlines the infrastructure challenges posed by such models, describes a five-layer training adaptation architecture, and analyzes key techniques including native FSDP-style fully sharded data parallelism, multimodal training path construction, communication and gradient synchronization optimization, and adaptation to heterogeneous software stacks. It also summarizes engineering practices for phased validation, numerical consistency checks, memory profiling, fault tolerance, and continuous performance analysis.
1. Background: Training Challenges of Trillion-Parameter Multimodal Models
Recently, the industry open-sourced a flagship multimodal large model with 2.8 trillion parameters, prompting broad discussion about training infrastructure. Training such models places extremely high demands on compute, memory, interconnect bandwidth, and the software stack: single-card memory is far from sufficient to hold model weights, optimizer states, and activations; gradient synchronization and parameter-sharding communication across many cards become major bottlenecks; and the mixed loading of multimodal data such as text and images makes the data pipeline more complex.
Against this backdrop, whether domestically developed AI accelerator cards, in addition to mainstream general-purpose GPUs, can support this class of ultra-large-scale training has become a focus of industry attention. Using a domestically developed training-and-inference integrated AI accelerator card and its in-house unified software stack as a reference, this article breaks down the key technical steps required to complete one round of training adaptation for a trillion-parameter multimodal model.
2. Overall Architecture of Training Adaptation
A complete training adaptation effort usually needs to connect the following layers:
- Model loading layer: Load a trillion-parameter model into multi-card memory in sharded form, avoiding full loading.
- Sharding and scheduling layer: Partition and schedule parameters, gradients, and optimizer states based on distributed parallelism strategies.
- Communication and synchronization layer: Insert collective communication operations such as reduce and broadcast between forward and backward computation to ensure consistency across shards.
- Data pipeline layer: Perform asynchronous preprocessing, packing, and prefetching of multimodal samples so that data supply does not become a compute bottleneck.
- Fault tolerance and monitoring layer: Provide checkpoint resume, anomaly detection, and performance profiling capabilities to support long-cycle training stability.
Together, these five layers form the complete path from “getting the model to run” to “running training stably and efficiently.”
3. Key Technical Points
3.1 Native FSDP-Style Fully Sharded Data Parallelism
For trillion-parameter models, the core parallelism strategy is Fully Sharded Data Parallelism (FSDP-style). Typical features of second-generation schemes include:
- Independent sharding of parameters, gradients, and optimizer states, reducing memory usage to a fraction of traditional data parallelism;
- A “prefetch–compute–release” pipeline: while computing the current layer, prefetch the sharded parameters of the next layer in advance to hide communication latency;
- Support for automatic module-granularity wrapping, so developers only need to apply a small amount of wrapping at the model top level to obtain sharding capability.
An illustrative pseudocode example is as follows:
from torch.distributed.fsdp import fully_shardmodel = MultimodalModel(config)for block in model.layers:fully_shard(block) # Sharding layer by layerfully_shard(model) # Sharding the root module
The advantage of this “native” integration approach is that the sharding logic is embedded in the framework core rather than wrapped externally, reducing extra copy overhead and compatibility issues.
3.2 Building the Multimodal Training Path
A multimodal model usually contains two main parts: a vision encoder and a language model. During training, the following points require attention:
- Parameter grouping strategy: The vision side and language side often use different learning rates and weight decay, so independent optimizer parameter groups need to be configured.
- Sample concatenation and packing: Image tokens and text tokens are concatenated according to a specific template and then packed; the attention mask must correctly isolate different samples.
- Uneven memory pressure: The vision encoder has larger activations when processing high-resolution inputs, so activation recomputation or chunked processing can be enabled separately for it.
3.3 Communication and Gradient Synchronization Optimization
During cross-card gradient synchronization, common optimization methods include:
- Gradient bucketing and overlapped communication: Divide gradients into buckets and overlap backward computation with all-reduce/all-gather communication.
- Mixed precision and gradient accumulation: Compute in low precision such as BF16, store gradients in low or main precision, and use accumulation to reduce communication frequency.
- Topology-aware communication: Select different communication algorithms and bucket sizes based on the different bandwidths of intra-node high-speed interconnects such as NVLink and inter-node networks.
3.4 Adaptation Points for Heterogeneous Software Stacks
Domestically developed accelerator cards usually come with an in-house unified compute software stack. Adaptation requires attention to:
- Operator coverage: Confirm that all operators involved in the model have efficient implementations in the software stack; missing operators need fallback or completion.
- Communication backend: The collective communication library must support large-scale inter-card and inter-node communication and correctly connect with the training framework’s process group mechanism.
- Compilation and kernel optimization: Use graph compilation or kernel fusion to reduce memory access overhead, and perform targeted optimization for hot operators such as attention.
4. Engineering Practice Recommendations
Based on this type of adaptation experience, the following general recommendations can be summarized:
- Phased validation: First validate link correctness with a small model and a small number of cards, then gradually scale up and locate problems layer by layer.
- Numerical consistency checks: Compare loss curves with a reference implementation to ensure that parallelism strategies and precision configurations do not introduce numerical divergence.
- Memory profiling first: Before formal training, use memory profiling tools to complete occupancy profiles for each stage, and reasonably set sharding granularity and recomputation strategies.
- Establish fault tolerance mechanisms: Configure automatic checkpoint saving and automatic task restart. Checkpoints for trillion-parameter models can reach the terabyte scale, so distributed checkpoint storage solutions are needed.
- Continuous performance profiling: Regularly collect metrics such as MFU (Model FLOPs Utilization) and communication ratio, identify bottlenecks, and iterate on optimization.
5. Conclusion
Training adaptation for trillion-parameter multimodal models is essentially a comprehensive test of four-layer collaboration: compute hardware, parallel software stack, training framework, and data pipeline. By natively integrating fully sharded parallelism capabilities and improving operator and communication support in the in-house software stack, domestically developed accelerator cards can already connect the complete training path for this class of ultra-large-scale models. This provides the industry with more diverse compute options and also drives large-model training infrastructure toward diversification and autonomy. For engineering teams, mastering general methodologies such as sharded parallelism, multimodal data pipelines, and communication optimization is a key capability for handling next-generation training at even larger scales.
