Adapting Trillion-Parameter LLM Training on Domestic AI Accelerators: A FSDP2 Practice
Recently, a domestic AI accelerator vendor successfully adapted its hardware and software stack to train a 2.8 trillion-parameter Mixture-of-Experts (MoE) model. By constructing a native FSDP2 multimodal training path, this milestone demonstrates that domestic AI hardware can handle the end-to-end training of cutting-edge ultra-large models. This article explores the systemic challenges of training trillion-parameter MoE models, delves into the technical details of the FSDP2 training pipeline, and highlights the implications for enterprise AI infrastructure planning.
1. Background: The Convergence of Ultra-Large Open-Source Models and Domestic AI Accelerators
Recently, an AI research institution open-sourced its flagship model, featuring a total parameter scale of 2.8 trillion and a Mixture-of-Experts (MoE) architecture, making it one of the largest open-source models in the community. Simultaneously, a domestic GPU vendor successfully adapted its flagship AI training-inference unified accelerator card and proprietary software stack to train this ultra-large model. They constructed a native FSDP2 multimodal training path, connecting the entire pipeline from model loading and shard scheduling to gradient synchronization.
The technical significance of this progress goes far beyond a simple “run-through verification.” It indicates that domestic AI hardware and software ecosystems now possess the capability to support the complete training pipeline of cutting-edge ultra-large models, providing a viable path for enterprises to build autonomous and controllable LLM training infrastructure.
2. Why is Training Adaptation for Trillion-Parameter Models So Challenging?
To understand the value of this adaptation work, we must first recognize the systemic challenges faced in training ultra-large MoE models.
1. The Memory Wall
What do 2.8 trillion parameters mean? Even using BF16 half-precision storage, the model weights alone require about 5.6TB of VRAM. Training also requires saving optimizer states (such as the first and second momentums of Adam), gradient replicas, and activation values, meaning actual VRAM demand is often several times that of the weights. Since a single accelerator card typically has only tens to hundreds of GB of VRAM, clusters of thousands of cards must collaborate, and the model states must be split to the extreme.
2. Communication Complexity of the MoE Architecture
Mixture-of-Experts models dynamically route tokens to different expert sub-networks during each forward pass. This introduces an All-to-All communication pattern, where the communication volume and pattern differ significantly from dense models. It places extremely high demands on cluster interconnect bandwidth, topology-aware scheduling, and the ability to overlap communication with computation.
3. The Adaptation Gap in Software Stacks
Mainstream LLM training frameworks and parallel strategy implementations are mostly built around international mainstream GPU platforms. For domestic chips to handle such training tasks, they must not only meet hardware compute requirements but also achieve engineering-level maturity in their software stacks regarding operator coverage, collective communication library performance, memory management efficiency, and compatibility layers with upper-level training frameworks. This is where the core investment in “training adaptation” work lies.
3. Technical Analysis: Constructing a Native FSDP2 Training Path
The biggest technical highlight of this adaptation is the construction of a native FSDP2 (Fully Sharded Data Parallel, second generation) multimodal training path. FSDP is currently recognized as the mainstream parallel solution for large model training. Its core idea is to shard all model parameters, gradients, and optimizer states across compute devices, aggregating them temporarily via collective communication only when needed for computation. This reduces the per-card VRAM footprint to 1/N of the original (where N is the parallelism degree).
1. Key Improvements of FSDP2 Over Previous Generations
In general industry consensus, the new generation FSDP emphasizes the following in its design:
- Tensor-granularity sharding abstraction: Refines the sharding unit from “module” to “tensor,” making the sharding strategy more flexible and easier to combine with strategies like Tensor Parallelism (TP) and Expert Parallelism (EP).
- More efficient communication scheduling: Achieves deep overlap between communication and computation through more refined AllGather and ReduceScatter arrangements, reducing bubble time.
- Deterministic memory management: Reduces memory fragmentation, making the training of ultra-large models more stable under limited VRAM.
2. Three Key Stages of the Complete Training Pipeline
The adaptation work connected three key stages, each corresponding to numerous engineering details:
Model Loading: The weight files of a trillion-parameter model are measured in terabytes, making full loading onto every card obviously unfeasible. Engineering practices typically combine lazy loading with direct shard reading—each process only reads the parameter shards it is responsible for, paired with a loading protocol where metadata precedes data. This compresses model initialization time from hours to minutes. A schematic sharded loading logic is as follows:
# Example code: Sharded model loading logicdef load_sharded_weights(checkpoint_dir, rank, world_size):meta = read_metadata(checkpoint_dir) # Read metadata index firstmy_shards = assign_shards(meta, rank, world_size) # Assign shards according to sharding strategystate_dict = {}for shard_file in my_shards:state_dict.update(stream_read(shard_file)) # Stream read the current shardreturn state_dict
Shard Scheduling: For MoE models, differentiated sharding for both dense layers (like attention, shared experts) and sparse layers (routed experts) must be handled simultaneously. The dense parts use standard FSDP sharding, while the expert parts combine expert parallelism, placing different experts on different device groups. A topology-aware placement strategy is used to ensure communication-intensive expert pairs are located within the same high-speed interconnect domain.
Gradient Synchronization: After backpropagation, gradients from each shard need to be efficiently reduced. Engineering practices typically use ReduceScatter instead of traditional AllReduce, combined with a gradient bucketing strategy—merging multiple small gradient tensors into large buckets for unified communication. Different trigger timings are set for different buckets to overlap communication with backward computation as early as possible. For multimodal models, differences in gradient scales between the visual encoder and the language model must also be handled, introducing gradient clipping and loss scaling strategies when necessary to ensure numerical stability.
4. The Value of Unified Training-Inference Architecture and Software Stack Synergy
Notably, this adaptation was completed using unified training-inference accelerator cards. A unified design means the same hardware platform can handle high-throughput distributed training and low-latency inference services. This has practical significance for enterprises looking to control infrastructure complexity: models trained can be directly deployed for inference on the same hardware and software stack, avoiding secondary costs like precision alignment and operator rewriting caused by cross-platform migration.
At the software stack level, domestic GPU platforms need to provide programming interfaces and operator libraries compatible with mainstream international ecosystems, allowing upper-level training frameworks to migrate with minimal modifications. The successful implementation of the native FSDP2 path indicates that its software stack has reached an engineering-ready level in the following capabilities:
- Efficient implementation of distributed communication primitives (AllGather, ReduceScatter, All-to-All);
- Automatic type conversion and numerical stability guarantees required for mixed-precision training;
- Compatibility adaptation layers for mainstream parallel training frameworks;
- Support for fault detection, resumable training, and elastic scheduling in large-scale clusters.
5. Implications for Enterprise LLM Practices
1. Compute Selection Moves from “Single Source” to “Diversified Combination”
The successful training of ultra-large open-source models on domestic accelerators means enterprises have more choices when planning AI infrastructure. Diversified compute combinations not only enhance supply chain resilience but also help gain the upper hand in procurement negotiations and cost control.
2. Cloud Platforms as the Best Carrier for Digesting Heterogeneous Compute Complexity
For most enterprises, directly building a ten-thousand-card cluster is unrealistic. A more pragmatic path is to acquire compute services through cloud platforms: cloud providers handle the pooling, scheduling, and maintenance of heterogeneous hardware, while enterprises use it on-demand. For instance, on cloud platforms like Baidu AI Cloud, enterprises can quickly build a complete pipeline from data processing and distributed training to model deployment based on general cloud capabilities like container platforms, object storage, log services, and monitoring/alerting, without worrying about underlying hardware differences.
3. Focus on the Engineering Methodology Behind “Training Adaptation”
This practice verifies a reusable technical route: anchoring on mainstream open-source parallel frameworks, prioritizing the connection of industry-standard training paths like FSDP2, and then performing differentiated optimizations for specific model structures (MoE, multimodal). When evaluating any compute platform, enterprises should use “support for standard distributed training paradigms” and “completeness of the end-to-end training pipeline” as core acceptance criteria, rather than just looking at single-card compute parameters.
6. Conclusion
The successful integration of a 2.8 trillion-parameter open-source model with domestic unified training-inference compute is a microcosm of the software-hardware co-evolution in the LLM era. It proves that training ultra-large models is no longer the patent of a single technical route and provides the industry with diversified infrastructure options. In the future, as software stack ecosystems continue to mature and parallel training technologies advance, the barrier to LLM training will continue to lower. “Autonomous compute, open frameworks, and engineering standardization” will become the three major benchmarks for measuring the maturity of a training platform. For developers and enterprises, understanding the principles of core training technologies like FSDP2 and mastering the engineering key points of the complete training pipeline will be crucial capabilities to establish themselves in this wave of technology.
