Training Trillion-Parameter Models on Domestic Accelerators: Technical Practice and Lessons

    This article breaks down the engineering work behind adapting a 2.8-trillion-parameter open-source model for training on a domestic GPU accelerator. It covers the memory, communication, and software-stack challenges of trillion-parameter training, explains key components such as sharded checkpoint loading, FSDP2 sharding, gradient synchronization with communication-computation overlap, and the multimodal training pipeline, and closes with practical recommendations for teams training large models on heterogeneous or domestic compute infrastructure.

    Background and Challenges: What Trillion-Parameter Models Demand from Training Infrastructure

    In recent years, the open-source community has produced flagship models with parameter counts reaching the trillion scale, placing extreme demands on underlying compute and the software stack. Take a recently open-sourced 2.8-trillion-parameter model as an example: even though its Mixture-of-Experts architecture significantly reduces the compute cost of each forward pass, training still faces three major challenges.

    First, the memory wall. The weights, optimizer states, and gradients of a trillion-parameter model far exceed the memory capacity of a single accelerator. Multi-level sharding strategies are required to distribute these states across the entire cluster.

    Second, the communication bottleneck. Once the model is sharded, parameter gathering and gradient synchronization during forward and backward passes introduce heavy cross-node communication, and communication efficiency directly determines training throughput.

    Third, software ecosystem compatibility. Mainstream training frameworks and operator ecosystems are largely built around general-purpose GPU architectures. A domestic accelerator must provide a complete, high-performance software stack to take on training workloads of this scale.

    Recently, a domestic GPU vendor announced that it had completed training adaptation of the open-source model mentioned above, using its training-and-inference AI accelerator card together with its self-developed unified computing software stack, and built a native Fully Sharded Data Parallel (FSDP2) multimodal training path. This effort offers a useful case study for understanding how domestic compute can handle ultra-large model training.

    Breaking Down the Core Training Adaptation Pipeline

    1. Model Loading and Weight Sharding

    Loading a trillion-parameter model is a non-trivial task in itself. The adaptation team first had to solve sharded checkpoint reading: model weights are typically stored in a specific sharded format, and at load time they must be re-sharded and distributed to each accelerator according to the target parallel topology (a combination of data, tensor, and pipeline parallelism).

    A typical loading flow can be abstracted as:

    1. # Pseudocode: sharded weight loading flow
    2. shard_spec = build_shard_plan(model_config, world_size)
    3. for name, tensor in stream_load_checkpoints(ckpt_dir):
    4. for rank, shard in split_tensor(tensor, shard_spec[name]):
    5. distribute(rank, shard)

    The key engineering point is streaming loading. The full weights must never be loaded into memory at once; instead, they should be read, sharded, and distributed layer by layer in a streaming fashion to keep peak memory usage under control.

    2. FSDP2 Shard Scheduling

    FSDP (Fully Sharded Data Parallel) is one of the mainstream parallelism schemes for large model training. Unlike traditional data parallelism, where every card holds a full replica, FSDP shards parameters, gradients, and optimizer states across all devices. Parameters are temporarily gathered when the forward or backward pass reaches the corresponding layer and released immediately afterward, dramatically reducing memory footprint.

    The core improvement of FSDP2 over earlier implementations is exact per-parameter sharding, replacing the previous flattened-parameter packaging approach. This brings two benefits:

    • Finer-grained memory management, which composes more flexibly with strategies such as activation recomputation and CPU offloading;
    • Shard granularity aligned with model structure, making fine-grained control of mixed precision and quantized training easier.

    The difficulty of implementing FSDP2 on a domestic accelerator lies in communication primitives (such as all-gather and reduce-scatter), which must be deeply co-optimized with the underlying compute libraries. Otherwise, the communication overhead of gathering parameters can offset the memory savings gained from sharding.

    3. Gradient Synchronization and Mixed-Precision Training

    After the backward pass completes, the gradient shards held by each card must be reduced efficiently. For trillion-parameter models, the communication volume of gradient synchronization is on the same order as the parameter count. A common combination of techniques includes:

    1. Gradient bucketing with communication-computation overlap: gradients are bucketed by layer, and the reduction of one bucket runs in parallel with the backward computation of earlier layers, hiding communication latency;
    2. Low-precision communication: gradients are transmitted in BF16 or lower precision to reduce the number of bytes communicated;
    3. Gradient accumulation: in small-batch scenarios, gradients are accumulated over multiple steps before synchronization, amortizing communication cost.
    1. # Illustration of communication-computation overlap
    2. for layer in reversed(model.layers):
    3. grad_bucket.add(layer.grad)
    4. if grad_bucket.is_full():
    5. async_reduce_scatter(grad_bucket) # asynchronous reduction
    6. layer.compute_backward()

    4. Enabling the Multimodal Training Path

    A “multimodal training path” means the training pipeline handles not only text but also mixed inputs such as image-text pairs. This adds extra complexity: stitching together the data flows of multimodal encoders and the language model backbone, batching and packing strategies for samples of different modalities, and high-throughput feeding from multimodal data loaders. A mature training path must keep data preprocessing, tokenization, packing, and loading fully pipelined, so that data supply never becomes the bottleneck on the compute side.

    What This Means for the Domestic Compute Ecosystem

    From an industry perspective, the signaling value of this adaptation goes beyond the single event itself:

    First, it validates the completeness of the domestic software stack. Being able to train a trillion-parameter model means the entire chain—from the operator library and distributed communication library to the training framework—has reached industrial-grade usability, rather than achieving only isolated wins on the inference side.

    Second, it is a concrete example of the “training-inference-in-one” approach. Having the same hardware cover both training and inference helps reduce the migration cost between training clusters and inference clusters and improves overall compute utilization.

    Third, it shows a healthy interplay between the open-source ecosystem and technological self-reliance. Open-source ultra-large models provide domestic hardware with real, high-intensity validation scenarios, while domestic hardware gives open-source models a more diverse runtime foundation. The two reinforce each other.

    Practical Recommendations for Developers

    If your team plans to train large models on heterogeneous or domestic compute, consider the following path:

    • Go inference first, then fine-tuning, then pre-training: use inference to validate the base software stack, then small-scale fine-tuning to validate the training pipeline, and only then take on large-scale pre-training, surfacing problems progressively;
    • Prefer framework-native sharding schemes: avoid assembling your own parallelism strategies; native FSDP-style implementations have generally undergone more thorough consistency validation;
    • Establish a gradient consistency baseline: after changing the parallelism strategy, compare loss curves under a small-scale deterministic configuration to ensure numerical correctness;
    • Take data pipeline throughput seriously: in ultra-large model training, data loading and preprocessing are often hidden bottlenecks and should be included in performance stress testing.

    Overall, the completion of trillion-parameter model training adaptation on domestic compute marks a key step for domestic AI infrastructure moving from “usable” to “genuinely effective.” As the software stack continues to iterate and integrates more deeply with the open-source ecosystem, the engineering systems that let heterogeneous compute power large model training will mature steadily, offering the industry a more diverse set of compute options.