Adapting Domestic AI Accelerators for Trillion-Parameter Model Training: Technical Practices

    Training trillion-parameter large models presents unprecedented challenges in memory capacity, compute throughput, and communication bandwidth. Recently, a domestic AI chip vendor successfully adapted a 2.8-trillion-parameter model using its proprietary hardware and software stack, establishing a native FSDP2 multimodal training pipeline. This article explores the technical implementation of this adaptation, covering FSDP2 fully sharded data parallel strategies, gradient synchronization optimizations, and the engineering details of completing a multimodal training pipeline. It also highlights key implications for alternative AI hardware ecosystems and software stack maturity.

    1. Background: Training Challenges of Trillion-Parameter Models

    Recently, a large model team open-sourced a flagship large model with a parameter scale of 2.8 trillion, attracting widespread industry attention. The transition to the trillion-parameter level means that the VRAM capacity, compute throughput, and communication bandwidth required for a single training run have reached unprecedented levels. Even when calculated using BF16 precision, the model weights alone require several terabytes of storage space, far exceeding the capacity limits of a single card or even a single machine.

    In this context, training a model of this scale is no longer just an algorithmic problem, but a system engineering problem. Recently, a domestic AI chip vendor announced that it had completed the training adaptation of this trillion-parameter model based on its flagship integrated compute card and proprietary software stack, constructing a native FSDP2 multimodal training path. This event provides a valuable practical sample for “running ultra-large-scale training on domestic computing power.”

    2. Core Technical Path: FSDP2 Fully Sharded Data Parallel

    1. Why Fully Sharded is Needed

    Traditional Data Parallel (DP) requires each card to store a complete model replica, which is completely unfeasible in trillion-parameter scenarios. The mainstream solution in the industry is Fully Sharded Data Parallel (FSDP), whose core ideas are:

    • Parameter Sharding: Evenly distribute model weights, gradients, and optimizer states across all compute cards;
    • On-Demand Aggregation: During forward and backward calculations, temporarily aggregate the complete parameters required for the current layer, and release them immediately after calculation;
    • Memory Benefits: Optimizer states are usually several times the size of the parameters. After sharding, the per-card memory footprint can be reduced to a fraction of the original.

    An important evolution of FSDP2 compared to early implementations is the use of parameter-level granularity for sharding management, rather than operating on a flattened 1D parameter buffer. This approach provides more natural support for heterogeneous parameter shapes and mixed precision strategies, and integrates more easily with the modular design of modern training frameworks.

    2. Engineering Details of Sharding Scheduling

    A complete sharding scheduling pipeline needs to solve several key problems:

    1. # Pseudocode: Core flow of FSDP2 sharding wrapper
    2. model = wrap_fully_sharded(
    3. model,
    4. sharding_strategy="FULL_SHARD", # Fully shard parameters, gradients, and optimizer states
    5. mixed_precision=bf16_policy, # Mixed precision policy
    6. reshard_after_forward=True, # Release gathered parameters immediately after forward pass
    7. )

    First is sharding balance. Trillion-parameter models usually contain a large number of heterogeneous modules (embedding layers, attention, MoE expert layers, etc.). If the sharding is uneven, it will lead to memory overload on some cards. Secondly, the orchestration of aggregation timing directly affects the overlap efficiency of computation and communication. The ideal state is that while the current layer is computing, the parameters of the next layer are being aggregated through collective communication.

    3. Gradient Synchronization: Communication Bottlenecks in Large-Scale Training

    After the backward pass is completed, each card holds a local gradient shard, which needs to be synchronized through collective communication operations such as All-Reduce or Reduce-Scatter. On clusters of a thousand cards or more, communication overhead often becomes the primary bottleneck for throughput.

    Common optimization methods include:

    1. Gradient Bucketing and Overlap: Bucketing gradients by layer and pipelining backward computation with communication to execute in parallel;
    2. Reduce-Scatter + All-Gather Combination: In FSDP scenarios, gradient synchronization can directly output sharded results, reducing communication volume;
    3. Topology-Aware Communication: Utilizing the hierarchical structure of intra-node high-bandwidth interconnects and inter-node networks to design hierarchical aggregation strategies.

    For domestic chips, the maturity of communication libraries and interconnect protocols directly determines large-scale scaling efficiency. This is also one of the areas requiring the most engineering effort during training adaptation.

    4. Completing the Multimodal Training Pipeline

    The original mention of “a complete training pipeline from model loading, sharding scheduling to gradient synchronization” encompasses an entire engineering system:

    • Model Loading: Weight initialization and checkpoint resuming for trillion-parameter models require support for distributed loading and saving of sharded state dicts to avoid single-point memory bottlenecks;
    • Multimodal Data Processing: When joint training a vision encoder and a language model, the data pipelines, sequence packing methods, and loss calculation logic of different modalities need to be uniformly orchestrated;
    • Numerical Consistency Verification: When migrating from a reference implementation to new hardware, it is necessary to compare forward outputs and gradient values layer by layer to locate and fix operator precision issues;
    • Fault Tolerance and Elasticity: On large-scale clusters, hardware failures are the norm. Periodic asynchronous saving and fast fault recovery capabilities are the foundation for ensuring training continuity.

    5. Implications for the Industry

    The significance of this practice extends beyond the adaptation itself:

    First, domestic software stacks are transitioning from “capable of inference” to “capable of training.” Inference has relatively loose requirements for operator coverage and numerical precision, whereas ultra-large-scale training is a comprehensive test of hardware stability, communication efficiency, and software stack completeness.

    Second, open-source large models are becoming the “touchstone” for computing ecosystems. Open-source weight models allow various hardware platforms to verify their capabilities under public and reproducible standards, accelerating the iteration of software-hardware co-optimization.

    Third, general parallel technologies like FSDP2 are becoming de facto standards. With interface designs compatible with mainstream training frameworks, new hardware can integrate into existing training ecosystems at a lower cost. This is crucial for lowering migration barriers and fostering the domestic computing ecosystem.

    6. Conclusion

    From model loading and sharding scheduling to gradient synchronization, the completion of the full training pipeline marks a substantive step for domestic computing power in ultra-large-scale training scenarios. In the future, as technologies like 10,000-card cluster interconnects, MoE training optimization, and long-context parallelism continue to evolve, the depth of domestic software-hardware collaboration will further increase, providing a more solid computing foundation for the continuous iteration of trillion-parameter models. For engineering teams, understanding general technical principles like FSDP2 full sharding, communication overlap, and multimodal orchestration is an essential capability for mastering the next generation of large model training.