Trillion-Parameter Model Training on Domestic AI Compute: Adaptation and Engineering Practices
This article examines the engineering challenges of training trillion-parameter-scale models on domestically developed AI training-and-inference accelerator cards. It covers memory and communication bottlenecks, software-stack adaptation, an FSDP2-based native multimodal training path, and practical guidance on model loading, sharding, gradient synchronization, mixed precision, fault tolerance, and performance tuning. It also discusses what a fully connected training pipeline implies for infrastructure planning and developer skills.
In recent years, the parameter scale of open-source large models has continued to rise, and flagship models at the trillion-parameter level are beginning to enter public view. This places unprecedented demands on underlying compute platforms and software stacks. In particular, when model parameters reach the multi-trillion scale, the memory of a single accelerator card is far from sufficient to hold the complete model state. How to complete training adaptation on domestically developed AI training-and-inference integrated accelerator cards and their accompanying software stacks—and to connect the full pipeline from model loading to gradient synchronization—has become a key engineering issue for deploying large models in practice. This article provides a systematic discussion of the topic, from technical challenges and architecture design to engineering practices.
1. Core Challenges in Trillion-Parameter Model Training
1.1 The Memory Wall
For a multi-trillion-parameter model, even with half-precision floating-point storage, the model weights alone require several terabytes of memory. Once optimizer states, gradients, and activations are included, total memory demand reaches tens of terabytes. This means any training solution must be based on distributed partitioning; there is no possibility of hosting the model on a single card or a single machine.
1.2 Communication Bottlenecks
Once a model is partitioned across thousands or tens of thousands of accelerator cards, inter-card communication overhead quickly becomes a decisive factor in training efficiency. Parameter fetching, gradient aggregation, and activation recomputation all depend on a high-bandwidth, low-latency interconnect. If communication and computation cannot overlap effectively, cluster compute utilization will drop significantly.
1.3 Software-Stack Adaptation Cost
Different accelerator architectures correspond to different operator libraries, communication libraries, and compiler toolchains. A training framework validated on a mainstream ecosystem often requires rewriting or adapting a large number of low-level operators when migrated to a new hardware platform, and numerical precision consistency must be verified. The engineering effort involved often exceeds expectations.
2. Designing a Native FSDP2 Multimodal Training Path
Fully Sharded Data Parallel (FSDP) is one of the mainstream technical approaches the industry uses for ultra-large-scale model training. Its core idea is to shard model parameters, gradients, and optimizer states across compute devices, aggregating full parameters only as needed during forward and backward computation. This reduces per-device memory usage to one several-hundredth of the original or even lower.
The newer generation of FSDP, commonly referred to as FSDP2, introduces important improvements to the programming model:
- Tensor sharding as the basic abstraction: Distributed tensor primitives describe how parameters are partitioned, decoupling sharding logic from model code. Developers can organize model structures much as they would in single-machine code.
- On-demand communication instead of full synchronization: Parameter aggregation occurs only when computation requires it, and it can overlap with the compute pipeline, significantly hiding communication latency.
- Native support for multimodal structures: Multimodal models typically contain vision encoders, language backbones, and cross-modal fusion modules, whose compute density and parameter counts differ greatly. A native multimodal training path allows differentiated sharding strategies for different submodules—for example, replication for smaller encoders and full sharding for the backbone—balancing memory and communication.
Building such a training path requires connecting three key stages:
- Model loading: Weight files for trillion-parameter models are enormous, so distributed parallel loading must be supported. Each card should read and instantiate only the shard it is responsible for, avoiding the memory peak caused by loading the full model first and partitioning it afterward.
- Sharding scheduling: Sharding plans for each submodule should be derived automatically from model topology and aligned with the cluster network topology, so that high-frequency communication occurs within high-bandwidth interconnect domains as much as possible.
- Gradient synchronization: During backpropagation, gradients are produced in sharded form. Communication must be organized by bucket to overlap with backward computation and to ensure numerical stability under mixed precision.
3. Engineering Practices on Training-and-Inference Integrated AI Accelerator Cards
3.1 Software-Stack Collaboration
The success of training adaptation depends heavily on the completeness of the software stack. A mature in-house software stack typically includes an operator library, a collective communication library, a graph compiler, and a runtime scheduler. For trillion-parameter models, particular attention should be paid to:
- Precision alignment for custom operators: Core operators such as attention mechanisms, normalization, and rotary position encoding need to be reimplemented on new hardware and compared against reference implementations at bitwise or tolerance-level numerical precision.
- Coverage of communication primitives: Collective operations such as all-reduce, all-gather, and reduce-scatter are the foundation of FSDP and must be deeply optimized for the cluster interconnect topology.
3.2 Mixed Precision and Stability
Large-scale training generally uses mixed-precision strategies, but numerical range issues must be handled carefully. Common best practices include dynamic loss scaling, higher-precision accumulation in critical reduction operations, gradient clipping, and health monitoring of the loss curve in the early stage of training to detect numerical divergence as early as possible.
3.3 Fault Tolerance and Elasticity
For training jobs at the scale of more than a thousand accelerators, hardware failure is the norm rather than the exception. Engineering systems must support frequent distributed checkpointing and fast recovery, and should automate the removal and hot replacement of failed nodes as much as possible, keeping the time loss from a single failure at the minute level.
3.4 Performance Tuning Methodology
A practical tuning order is: first ensure correctness (the loss curve aligns with the reference implementation), then optimize per-step throughput (operator fusion, communication overlap, activation recomputation ratio), and finally optimize cluster-level efficiency (topology-aware scheduling and load balancing). Avoid pursuing throughput metrics before correctness has been verified.
4. Implications for the Industry
The combination of trillion-parameter open-source models and domestic AI compute platforms sends a clear signal: the hardware ecosystem for large-model training is moving toward diversification. For enterprise users, this means that when planning training infrastructure, they should prioritize solutions that follow open standards, provide a complete software stack, and offer mature distributed training capabilities. They should also leverage general cloud capabilities such as container platforms, object storage, logging, and monitoring and alerting to build an observable, elastically scalable training environment. For developers, mastering hardware-decoupled distributed training paradigms such as FSDP offers more long-term value than familiarity with a specific product—because paradigms are general, while hardware continues to evolve.
Overall, connecting the full pipeline from model loading and sharding scheduling to gradient synchronization indicates that domestic AI compute can already undertake frontier large-model training tasks. As the software ecosystem continues to mature, the barrier to ultra-large-scale model training will decrease further, and more teams will have the opportunity to participate in model innovation in the trillion-parameter era.
