Adapting Trillion-Parameter Open-Source Model Training to Domestic AI Accelerators: Practices and Challenges
This article examines the engineering practices for adapting trillion-parameter open-source multimodal model training to a domestic AI accelerator platform. It covers FSDP-based memory sharding, multimodal load balancing, model loading and sharding initialization, memory management, gradient synchronization and communication optimization, checkpointing and fault tolerance, and recommended validation and monitoring practices for teams planning similar work.
Recently, an AI laboratory in China open-sourced a flagship multimodal model with 2.8 trillion parameters, drawing widespread industry attention. At the same time, a domestic GPU vendor announced that it had completed training adaptation for the model using its self-developed training-and-inference integrated AI accelerator cards and supporting software stack. The work established a native Fully Sharded Data Parallel (FSDP) multimodal training path and connected the full training chain from model loading and shard scheduling to gradient synchronization. This article sets aside specific product attributes and, from a general technical perspective, systematically reviews the core methods, key challenges, and engineering practices for adapting trillion-parameter-scale open-source model training to a domestic compute platform, providing a reference for developers and enterprise technical teams.
1. Why Training Adaptation for Trillion-Parameter Models Is a Systems Engineering Task
For a 2.8-trillion-parameter model, even storing the model weights in mixed precision (BF16, 2 bytes per parameter) requires about 5.6 TB of accelerator memory. If optimizer states are included—such as the momentum and variance of Adam-like optimizers, typically stored in FP32 at 8 bytes per parameter—along with gradient copies, the memory required for the full training state exceeds 30 TB. This is clearly far beyond the capacity of a single accelerator card or even a single multi-card server, so large-scale distributed training is mandatory.
Therefore, “training adaptation” is not simply about making a model run on new hardware. It is a systems engineering task involving multiple layers:
- Operator-layer adaptation: Core operators used by the model, such as matrix operations, attention mechanisms, and normalization, must have high-performance implementations in the target hardware’s compute libraries. Missing operators need to be developed based on the hardware’s native instruction set.
- Framework-layer compatibility: Backend adaptation of mainstream deep learning frameworks on domestic hardware requires the software stack to provide complete tensor computation, automatic differentiation, and distributed communication capabilities.
- Parallel strategy design: Choosing the appropriate combination of parallelism for the model structure—especially for Mixture-of-Experts (MoE) architectures—determines the upper limit of training efficiency.
- Multimodal data pipeline: Preprocessing, packing, and pipeline supply of mixed image-text data directly affect training throughput.
2. Fully Sharded Data Parallel: The Memory Foundation for Ultra-Large Model Training
For trillion-parameter scale, traditional data parallelism—where each card keeps a full model replica—is no longer feasible. The core idea of Fully Sharded Data Parallel is to shard model parameters, gradients, and optimizer states across the data-parallel dimension, so that each card holds only about 1/N of the full state (where N is the degree of parallelism). Before computation, the required parameter shards are temporarily aggregated through communication; after computation, they are released immediately.
The training flow can be summarized as follows:
- Before forward computation: Each card collects the full parameters required for the current layer through AllGather communication.
- Forward/backward computation: Local computation is performed using the aggregated parameters.
- After backward computation: Gradient shards are returned to each card through ReduceScatter, and the aggregated parameters are released.
- Optimizer update: Each card updates only the parameter shards it owns.
This mechanism reduces per-card memory usage from O(total model size) to O(total model size / N), making it possible to train hundred-billion- and even trillion-parameter models on clusters of hundreds to thousands of cards. When implementing this path on domestic accelerator cards, the key is whether the software stack’s communication library can efficiently support AllGather and ReduceScatter primitives and whether it can overlap communication with computation to hide communication overhead.
3. Special Characteristics of the Multimodal Training Path
Unlike pure text models, multimodal model training introduces heterogeneous components such as visual encoders and modality alignment projection layers, creating several adaptation challenges:
- Load imbalance: The computational cost of image samples and text samples differs greatly. If batches are split evenly by sample count, computation time across cards will vary significantly, causing a severe bottleneck effect. In engineering practice, dynamic batch balancing by token count or computational load is usually required.
- Differentiated parallelism for heterogeneous modules: The visual encoder and language backbone differ significantly in parameter count and activation scale, so different modules may require different sharding granularity and parallel strategies.
- Data preprocessing pipeline: Image decoding, augmentation, and tokenization are CPU-intensive operations. If data supply cannot keep up with GPU computation, compute resources will sit idle. Multi-stage pipelines and prefetch caching mechanisms are needed.
In this adaptation, the native multimodal training path was designed across the full chain to address these issues from the model-loading stage onward: during loading, parameters are placed directly according to the shard mapping to avoid the memory peak caused by loading the full model before sharding; during scheduling, multimodal batches are balanced with compute-awareness; during gradient synchronization, communication operations are interleaved with backward computation to maximize hardware utilization.
4. From Loading to Synchronization: Key Stages of the Full Training Chain
Model loading and shard initialization. Weight files for trillion-parameter models often reach several terabytes, so reading the entire model into memory before sharding is impractical. A common industry approach is lazy loading with direct shard reading: each process reads only the parameter fragments it owns from the checkpoint file according to a precomputed shard mapping table. Combined with memory mapping (mmap) and asynchronous I/O, this can reduce loading time from hours to minutes.
Fine-grained memory management. In addition to parameter sharding, techniques such as activation recomputation (gradient checkpointing, trading compute for memory), mixed-precision training, memory pooling, and fragmentation management must be combined. For MoE architectures, the distributed placement of expert parameters (expert parallelism) and optimization of routing communication are particularly critical.
Gradient synchronization and communication optimization. In large clusters, communication bandwidth is often the bottleneck. Common optimizations include gradient bucketing, which merges small tensors into larger communication blocks to improve bandwidth utilization; overlapping communication with backward computation; and communication scheduling for specific network topologies such as multi-rail RDMA networks. At this stage, the domestic software stack needs deep coordination with underlying network interface cards and switch chips.
Fault tolerance and checkpointing. In thousand-card-scale training, hardware failures are the norm rather than the exception. Sharded checkpointing—where each card saves only its own shard—combined with asynchronous persistence can minimize save overhead. Periodic health checks and automatic failure recovery help ensure stability over long training runs.
5. Industry Significance of Domestic Compute Adaptation and Recommended Best Practices
The completion of training adaptation for a very large open-source model on domestic training-and-inference integrated hardware means that the full-stack software ecosystem—from operator libraries and distributed frameworks to cluster scheduling—can support training needs at the scale of frontier models. This has positive significance for diversifying compute supply and improving self-reliance and controllability.
For teams planning similar adaptation work, the following practice path is recommended: first validate operator correctness and numerical precision alignment using a medium-scale model; then gradually expand the parallel dimensions and stress-test communication efficiency and memory usage; finally, conduct long-duration stability validation at the target scale and establish a complete monitoring and alerting system (possibly using general-purpose logging and monitoring/alerting capabilities) to continuously observe throughput, memory usage, and communication time.
Conclusion
Training adaptation for trillion-parameter open-source models is a touchstone for testing the combined software and hardware capabilities of a compute platform. From sharded parallel strategies and multimodal load balancing to communication-computation coordination, every stage requires solid engineering expertise. As the domestic compute ecosystem continues to mature, such adaptation practices will provide more enterprises and developers with a feasible path for large-model training on self-controlled platforms, driving the AI infrastructure field toward a more open and diverse direction.
