Training a Trillion-Parameter Model on Domestic AI Accelerators: A Technical Deep Dive
A recently released multimodal flagship LLM with 2.8 trillion parameters has pushed training infrastructure to its limits, and domestic AI accelerators are increasingly capable of supporting full training workflows. This article walks through the complete technical chain of adapting trillion-parameter model training on a domestic flagship training-and-inference accelerator card, covering model loading, sharding and parallelism strategies, multimodal training paths, gradient synchronization, and the role of a mature software stack—along with practical engineering recommendations for large-scale training.
1. Background: Why Trillion-Parameter Models Stress Training Infrastructure
The industry recently open-sourced a multimodal flagship large model with 2.8 trillion parameters. Models at this scale place extreme demands on training infrastructure: single-node multi-GPU setups are no longer viable, and thousands of accelerators, efficient parallelism strategies, and a mature software stack must work together. At the same time, diversifying training compute has become an industry trend—beyond mainstream general-purpose GPUs, AI accelerators based on domestic architectures are gradually gaining the ability to support the full lifecycle of large model training.
Using the practice of “adapting trillion-parameter multimodal model training on a domestic flagship training-and-inference accelerator” as a case study, this article abstracts the general technical points to help readers understand the complete pipeline of large-scale heterogeneous training systems.
2. Breaking Down the Core Training Adaptation Pipeline
A complete large model training adaptation typically requires打通-ing—connecting end to end—the following four key stages:
1. Model Loading and Weight Initialization
Even stored in half precision, a trillion-parameter model has weights totaling several terabytes, which cannot be loaded onto a single card or even a single machine at once. The common approach is metadata-driven lazy initialization: first construct the model structure on the CPU side using empty tensor placeholders, then stream weight shards into the corresponding devices according to the parallel sharding strategy. This process must align strictly with the distributed framework’s device mesh definition; otherwise, subsequent shard scheduling will produce consistency errors.
2. Sharding Scheduling and Parallelism Strategies
The current mainstream approach combines multiple parallelism schemes:
- Data Parallelism (DP): multiple replicas process different batches of data;
- Tensor Parallelism (TP): single-layer weight matrices are split row-wise or column-wise across cards;
- Pipeline Parallelism (PP): the model is divided into multiple stages by layer;
- Expert Parallelism (EP): expert modules in MoE architectures are distributed across devices;
- Sequence/Context Parallelism: attention computation is split to handle extremely long contexts.
In engineering practice, the native FSDP2 (Fully Sharded Data Parallel, second generation) path can further fully shard model parameters, gradients, and optimizer states along the data-parallel dimension, significantly reducing per-card memory usage. Compared with hook-based first-generation implementations, FSDP2 uses DTensor (distributed tensor) directly as the underlying representation of parameters, making sharding semantics more explicit and traceable—easier to debug and profile.
# Example: defining multi-dimensional parallelism via a device meshmesh = DeviceMesh("cluster", [[0, 1, 2, 3], [4, 5, 6, 7]], dim_names=["dp", "tp"])model = apply_fully_shard(model, mesh=mesh["dp"])model = apply_tensor_parallel(model, mesh=mesh["tp"])
3. Building the Multimodal Training Path
Multimodal models typically consist of a vision encoder, a text embedding layer, and cross-modal fusion modules, and the computational characteristics of these submodules differ significantly: the vision branch is mostly convolutional or ViT-based with high compute density, while the language branch is heavily constrained by memory bandwidth. When building a native multimodal training path, you need to configure differentiated parallelism strategies and gradient checkpointing granularity for different submodules, and implement mixed image-text sample packing and dynamic padding on the data loading side to avoid load imbalance between batches of different modalities.
4. Gradient Synchronization and Communication Optimization
At the scale of thousands of cards, the communication overhead of gradient synchronization often becomes the bottleneck. Common optimization techniques include:
- Gradient bucketing and overlap: pipelining the backward computation to overlap with gradient All-Reduce/Reduce-Scatter;
- Communication precision control: compressing gradient transfers to low precision (e.g., BF16) to balance numerical stability and bandwidth;
- Topology-aware communication grouping: a hierarchical communication strategy that uses high-bandwidth interconnects within a node and high-speed networks across nodes to reduce cross-node traffic.
3. The Role of the Software Stack: From “It Runs” to “It Runs Reliably”
Hardware is only the foundation; the real difficulty of training adaptation lies in the completeness and maturity of the software stack. A heterogeneous computing software stack for large models typically includes: parallel computing and communication libraries (matching collective communication semantics), operator libraries with automatic code generation, compiler optimizations (such as operator fusion and memory planning), and a runtime layer compatible with mainstream deep learning frameworks. In this adaptation, it was the complete software stack that enabled low migration costs for training code on heterogeneous hardware—a key indicator of whether a domestic hardware-software ecosystem is mature.
4. Engineering Best Practices
Based on experience with this type of large-scale training adaptation, engineering teams should focus on the following:
- Observability first: before connecting the training pipeline, establish comprehensive monitoring and profiling capabilities covering communication, operators, and memory;
- Numerical consistency validation: compare loss curves and gradient norms between the reference implementation and the target hardware on small-scale configurations to locate precision deviations;
- Elastic fault tolerance: large-scale training runs are long-lived, so checkpoint snapshots, resume-from-checkpoint training, and automatic faulty-node removal are essential;
- Progressive scaling: from a single 8-card node to multi-node to thousand-card clusters, verify parallel efficiency and linear speedup step by step, avoiding exposing too many issues at once.
5. Conclusion
Completing training adaptation for a trillion-parameter model on domestic AI accelerators marks an important step for domestic heterogeneous compute from “usable for inference” to “capable of training.” For engineering teams, the methodology involved—native distributed training paths, explicit sharding semantics, differentiated multimodal parallelism, and full-pipeline software stack support—has broad reference value. As hardware-software co-optimization continues to deepen, practices for supporting ultra-large model training with diversified compute will only mature.
