Training Trillion-Parameter Models on Heterogeneous AI Computing Platforms: A General Technical Path
As open-source trillion-parameter multimodal models emerge, adapting them to new GPU platforms requires solving memory, communication, software ecosystem, and multimodal data pipeline challenges. This article outlines a general training adaptation path, focusing on FSDP2 fully sharded data parallelism, model loading, sharding scheduling, gradient synchronization, and software-hardware co-design. It also summarizes practical lessons for large-scale training infrastructure.
1. Background: New Compute Requirements for Ultra-Large Model Training
In recent years, the open-source community has released flagship large models with parameter counts reaching the trillion level. These models are not only extremely large in parameter scale but often also integrate multimodal capabilities such as text, image, and visual understanding, placing extremely high demands on the underlying compute system. At the same time, domestic GPU computing platforms are catching up quickly. Whether they can stably and efficiently complete training adaptation for ultra-large models has become an important measure of the maturity of domestic AI infrastructure.
Recently, a domestic AI computing platform announced that, based on its flagship training-and-inference integrated AI accelerator card and self-developed software stack, it had completed training adaptation for a 2.8-trillion-parameter open-source multimodal model. The work covered the complete training pipeline, from model loading and sharding scheduling to gradient synchronization. This article does not evaluate the specific technical details of that event. Instead, it focuses on the general technical question of how ultra-large models can complete training adaptation on heterogeneous domestic compute, and breaks down the key stages involved.
2. Core Challenges in Training Adaptation
When migrating a trillion-parameter model to a new hardware platform, several common challenges arise.
1. Memory wall
Even when stored in mixed precision such as BF16, the weights of a trillion-parameter model alone require several terabytes of memory, far exceeding the capacity of a single GPU or even a single node. Large-scale parameter sharding, activation recomputation, and optimizer state partitioning are required to distribute the training state across the entire cluster.
2. Communication wall
The larger the model, the higher the share of total training time taken by cross-device communication. If gradient synchronization, parameter broadcast, and shard reassembly lack efficient communication primitives and topology-aware scheduling, GPUs can easily enter a waiting state, and cluster utilization can drop sharply.
3. Software ecosystem wall
The operator libraries, compiler optimizations, and communication libraries of mainstream deep learning frameworks are mostly deeply optimized for a certain class of mainstream hardware. A new hardware platform must provide a functionally complete and performance-acceptable software stack, including compilers, operator libraries, distributed communication libraries, and containerized runtime environments, so that upper-layer training frameworks can run without pain.
4. Multimodal complexity
Multimodal models usually contain two backbone paths: a vision encoder and a large language model. Their data pipelines, sample organization, and loss computation differ from those of pure text models. The training framework therefore needs to support heterogeneous data loading and forward computation graphs.
3. FSDP2: Technical Principles of Fully Sharded Data Parallelism
The adaptation discussed here builds a native FSDP2 multimodal training path. FSDP, or Fully Sharded Data Parallel, is a distributed strategy widely used in current large-model training. Its core ideas are:
- Parameter sharding: Model parameters, gradients, and optimizer states are split according to the number of devices, and each device holds only 1/N of the complete training state.
- All-gather on demand: When forward or backward computation reaches a certain layer, the required parameter shards are temporarily gathered through collective communication, and released after computation.
- Reduce-scatter: After backward propagation, gradients are reduced and re-sharded to avoid full gradients occupying memory.
Compared with traditional data parallelism such as DDP, FSDP reduces memory usage from a complete model replica to model shards plus temporarily gathered layer parameters, making trillion-level model training engineering-feasible. Compared with classic 3D parallelism, which combines data parallelism, pipeline parallelism, and tensor parallelism, FSDP has lower configuration complexity and can be combined more flexibly with pipeline parallelism.
The main improvement of FSDP2 over the first-generation implementation is that it adopts finer-grained per-parameter sharding management, supports independent sharding policies for each parameter, and is decoupled from mechanisms such as activation offload and CPU parameter offload, making memory management more fine-grained and controllable. An illustrative pseudo-code example is as follows:
# Conceptual example: apply sharding wrappers to model modulesfor name, module in model.named_children():wrap_fsdp2(module,shard_policy="per_parameter", # per-parameter shardingmixed_precision="bf16", # mixed precisionreshard_after_forward=True, # release gathered parameters immediately after forwardactivation_checkpoint=True # activation recomputation)
A “native” adaptation means that, rather than simply applying a generic implementation, the platform deeply co-optimizes with its own hardware communication libraries and compilers. Examples include topology-aware routing for collective communication and fused compilation of aggregation operators.
4. Three Key Stages of the Complete Training Pipeline
1. Model loading
Loading a trillion-parameter model is itself an engineering challenge. Common practices include:
- Sharded weight loading: Checkpoints are stored in sharded format, and loading directly maps them to the corresponding device shards, avoiding memory peaks caused by “aggregate first, then split.”
- Metadata first: The model metadata such as layer count, shape, and data type is parsed first, and loading tasks are then assigned according to device topology.
- Lazy initialization: Memory is not actually allocated before device assignment is determined. Mechanisms such as meta device are used to delay instantiation.
2. Sharding scheduling
Sharding scheduling determines how the training state is distributed. It requires comprehensive consideration of:
- Differences in memory capacity and bandwidth among devices;
- Imbalanced sizes of model layers, such as embedding layers and output projection layers, which are often unusually large and need independent sharding;
- The tradeoff between the number of data-parallel replicas and sharding granularity: more replicas bring higher throughput but also more communication.
A good scheduler completes static planning before training starts and dynamically adjusts offload policies during runtime according to memory watermarks.
3. Gradient synchronization
After backward propagation, gradients need to be synchronized across devices. Key optimizations include:
- Overlap of computation and communication: Gradient reduction operations are overlapped in time with backward computation of subsequent layers to hide communication latency.
- Gradient splitting and reduce-scatter: Reduction and splitting are completed in one step to obtain sharded gradients directly.
- Sparse communication and quantization compression: In some scenarios, gradient compression can be introduced to reduce bandwidth pressure, but its impact on convergence must be carefully evaluated.
5. Coordination Between Software Stack and Hardware
For a domestic compute platform to run this type of training, a complete self-developed software stack is indispensable. Its typical layers include:
- Operator library and compiler layer: Provides high-performance basic operators and automatic fusion capabilities, and supports mainstream deep learning frameworks as frontends.
- Distributed communication layer: Implements collective communication primitives such as All-Gather, Reduce-Scatter, and All-Reduce, and optimizes them for cluster network topology.
- Runtime and scheduling layer: Handles task orchestration, memory management, and fault recovery.
- Container and cluster management layer: Uses general cloud capabilities such as container platforms, monitoring and alerting, and logging services to support stable operation of large-scale training jobs.
The training-and-inference integrated architecture is also worth attention. A single hardware and software stack serving both training and inference workloads can improve resource utilization and reduce operations complexity. However, it also requires the software stack to maintain high performance under two very different workload characteristics.
6. Lessons for Industry Practice
Several generally applicable lessons can be drawn from this adaptation event:
- Ecosystem completeness matters more than single-point peak performance: Training throughput depends on the weakest link in the entire pipeline. Operator coverage, communication efficiency, and framework compatibility are all indispensable.
- Open-source models are a litmus test for hardware platforms: The ability to adapt the latest open-source flagship models is an effective way to test the maturity of a compute platform’s software stack.
- Sharding strategy requires systematic design: From checkpoint format, loading method, and scheduling policy to gradient synchronization, these should be designed as an integrated problem rather than handled separately.
- Observability determines troubleshooting efficiency: Fault localization in a 10,000-GPU cluster relies heavily on a complete monitoring, logging, and alerting system.
7. Conclusion
Training adaptation for ultra-large models is a systems engineering effort involving hardware, software, and algorithms. The completion of a trillion-parameter multimodal model training pipeline on a domestic compute platform marks an important step forward for domestic AI infrastructure at the software ecosystem level. For technical teams, understanding distributed training mechanisms such as FSDP2 and mastering the engineering details of model loading and scheduling are essential capabilities for large-scale training on any hardware platform. As software-hardware co-optimization continues to deepen, domestic compute will play an increasingly important role in the era of ultra-large models.
