Training Trillion-Parameter LLMs on Domestic AI Accelerators: A Technical Practice Guide

    This article examines the engineering challenges and solutions behind adapting a 2.8-trillion-parameter open-source large language model for training on domestic heterogeneous GPU hardware. It covers parallelism and sharding strategies for overcoming the memory wall, communication optimization for gradient synchronization, numerical stability in mixed-precision training, the software-stack and framework adaptation path for non-mainstream accelerators, and a reusable checklist of best practices for large-scale distributed training.

    1. Background: Where Open-Source Frontier Models Meet Domestic Compute

    A team recently open-sourced a flagship large language model with 2.8 trillion parameters, once again pushing industry attention toward the infrastructure required for ultra-large model training. Around the same time, a domestic GPU vendor announced that it had completed training adaptation for this model on its flagship AI training-and-inference accelerator card and self-developed software stack, establishing a complete training pipeline from model loading and sharded scheduling to gradient synchronization. The significance of this event lies not in any single product announcement, but in a broadly relevant technical question it raises: how to stably and efficiently train trillion-parameter-scale models on heterogeneous accelerators outside the mainstream ecosystem.

    This article does not focus on any specific product. Instead, it analyzes the core technology stack and engineering practices involved in this kind of adaptation work from a general technical perspective, as a reference for engineers building large-model training systems.

    2. Core Challenges in Training Ultra-Large Models

    2.1 The Memory Wall and Parameter Sharding

    With 2.8 trillion parameters, even storing the weights in BF16 requires roughly 5.6 TB of memory—far beyond any single-machine configuration. The standard industry solution is a combination of parallelism and sharding strategies:

    • Data Parallelism (DP): replicates the model and splits the data to scale throughput;
    • Tensor Parallelism (TP): shards weight matrices within each layer across multiple devices, reducing per-device memory pressure;
    • Pipeline Parallelism (PP): partitions the model by layers and executes them as a cross-device pipeline;
    • Fully Sharded Data Parallelism: evenly shards parameters, gradients, and optimizer states across all devices, materializing them on demand.

    The second-generation implementations of fully sharded data parallelism (commonly referred to in the community as FSDP2-style solutions) manage fine-grained parameter sharding over device meshes and natively compose with tensor parallelism, context parallelism, and other strategies. They are now among the mainstream choices for training trillion-scale models.

    2.2 Communication Bottlenecks and Gradient Synchronization

    Sharding introduces frequent, high-volume collective communication. During training, parameter gathering (all-gather) in the forward pass, gradient reduction (reduce-scatter) in the backward pass, and optimizer-state synchronization form the three main communication flows. In practice, engineers typically need:

    1. # Illustration: gradient bucketing with async all-reduce
    2. buckets = bucket_gradients(model, bucket_size_mb=64)
    3. for bucket in buckets:
    4. comm.async_all_reduce(bucket) # overlap communication with computation
    5. overlap_with_backward(bucket)

    The degree of communication–computation overlap, together with topology-aware scheduling (e.g., prioritizing the NVLink domain and routing cross-node traffic over high-speed interconnects), directly determines the linear scaling efficiency of training.

    2.3 Numerical Stability

    Trillion-scale models place extreme demands on the numerical robustness of mixed-precision training. Common practices include BF16 as the primary precision with FP32 master weights, dynamic loss scaling, gradient clipping, and periodic full checkpoint saving for fault rollback.

    3. The Key Engineering Path for Heterogeneous Accelerator Adaptation

    For domestic accelerator cards outside the mainstream ecosystem, training adaptation generally involves the following layers of work:

    3.1 Software Stack and Compilation Layer

    A self-developed accelerator must ship a complete software stack: a CUDA-like runtime, a graph compiler, high-performance operator libraries (matrix multiplication, attention, normalization, optimizer kernels), and a communication library. The first requirement of adaptation is that the operators used by mainstream training frameworks have equivalent implementations on this stack, and that compilation optimizations (operator fusion, memory planning) bring compute utilization to an acceptable level.

    3.2 Porting and Enabling the Training Framework

    Taking a native FSDP2-style path as an example, the core of adaptation is making the framework’s sharding-state management, device-mesh abstraction, and checkpoint formats run seamlessly on heterogeneous hardware. The typical pipeline includes:

    • Model loading: efficient loading and resharding from common formats (such as distributed sharded checkpoints), avoiding the serial I/O bottleneck of tens of thousands of weight files;
    • Sharded scheduling: automatically deriving parameter placement and gather timing from the device mesh, while correctly handling topology differences across heterogeneous cards;
    • Gradient synchronization: implementing high-bandwidth collective communication primitives on the self-developed communication library and overlapping them with backpropagation.

    3.3 Multimodal Extension

    Modern flagship models are generally multimodal architectures, so the training path must support joint optimization of the vision encoder and the language model. This requires the framework to provide unified sharding across heterogeneous modules, along with high-throughput preprocessing for mixed image-text data pipelines.

    4. A Reusable Best-Practices Checklist

    1. Validate single-machine convergence first, then scale to thousand-card clusters, so numerical issues are isolated from distributed-system issues;
    2. Build fine-grained observability: MFU, communication ratio, peak memory usage, and straggler detection are all indispensable;
    3. Prioritize checkpoint fault tolerance: failures are routine at the ten-thousand-card scale, and asynchronous checkpointing plus fast recovery determine effective training time;
    4. Favor ecosystem compatibility over proprietary optimization: keeping interfaces consistent with mainstream training frameworks reduces migration and maintenance costs.

    5. Conclusion

    At its core, adapting ultra-large model training is a cross-disciplinary practice spanning distributed systems, compiler optimization, and numerical engineering. Completing the full training pipeline for a trillion-parameter model on domestic compute marks a key step for the local heterogeneous-computing ecosystem—from “inference-capable” to “training-capable.” For engineers, understanding the underlying logic of sharded scheduling, gradient synchronization, and software-stack coordination is far more valuable in the long run than remembering any specific product name.