Training Adaptation for a Nearly 3-Trillion-Parameter LLM on Domestic GPUs

    This article examines what it takes to adapt a nearly 3-trillion-parameter flagship open-source model for training on domestic GPUs. It distinguishes inference adaptation from training adaptation, explains key techniques such as fully sharded data parallelism, multimodal training paths, model loading and shard scheduling, and cross-node gradient synchronization with numerical stability, and describes a 400-step validation on two nodes with 16 GPUs. It also outlines the engineering path from “can train” to “out-of-the-box training.”

    In large-model engineering, the term “adaptation” is often reduced to “the model can run normally on a certain type of hardware or software stack.” For training scenarios, however, that standard is far from sufficient. A flagship open-source model with nearly 3 trillion parameters involves forward propagation, backward propagation, gradient aggregation, optimizer updates, mixed-precision scaling, checkpoint saving, and other stages during training. If any stage has numerical overflow, communication ordering errors, or shard-mapping mismatches, training may diverge completely within dozens of steps. The industry therefore needs to clearly distinguish inference adaptation from training adaptation.

    1. The Essential Difference Between Training Adaptation and Inference Adaptation

    Inference adaptation mainly validates model loading, input encoding, forward computation, and sampling logic. Such tasks do not involve gradient computation or parameter updates, so requirements for operator coverage, memory bandwidth, and numerical stability are relatively loose. Training adaptation is completely different: every iteration must complete a full loop from data loading to loss computation to parameter updates. For a model with nearly 3 trillion parameters, it must also address systemic issues such as parameter sharding, gradient synchronization, optimizer state storage, and communication topology design.

    A common misconception is to equate “the model can be integrated on a certain type of hardware” with “the model was trained on that hardware.” In fact, successful integration or inference validation only shows that the hardware’s operator implementations can cover the model’s forward computation path. It cannot prove that the backward propagation path is correct, nor can it prove numerical consistency in multi-node gradient synchronization. To fully support training, it is necessary to verify that parameters after optimizer updates actually change in the expected direction and that loss and gradient norms remain finite and do not diverge over consecutive iterations.

    2. Key Technologies for Training Adaptation of a Nearly 3-Trillion-Parameter Model

    2.1 Fully Sharded Data Parallelism

    Nearly 3 trillion parameters mean that a single GPU cannot hold the complete model weights. Traditional data parallelism requires a full copy of the model on every GPU, and memory demand quickly exceeds single-GPU capacity. The core idea of fully sharded data parallelism is to split model parameters, gradients, and optimizer states into multiple shards along tensor dimensions, with different compute devices holding different shards. Before each forward or backward computation, shards are gathered from other devices as needed; after computation, they are released or synchronized in time. This significantly reduces peak memory per GPU while allowing more devices to participate in parallel computation.

    This strategy places extremely high demands on the communication system. Shard gathering and gradient synchronization involve frequent exchange of many small messages. If the communication topology is poorly designed, training efficiency will be severely slowed. Adaptation work therefore needs to consider both memory footprint and communication overhead, finding a balance between the two.

    2.2 Multimodal Training Path

    Flagship open-source models often include encoding and interaction logic for multiple modalities such as text, images, audio, and video. Multimodal training adaptation is not just about enabling each modality to complete forward computation separately. It also requires designing a unified flow for data loading, input construction, modality alignment, and loss computation. The parameter counts of different modality branches are often unbalanced; some branches may be dense structures, while others may be sparse mixture-of-experts structures. During adaptation, differentiated sharding strategies are needed for different branches to avoid some devices becoming bottlenecks and reducing overall training utilization.

    A complete native multimodal training path needs to correctly map different modality branches into the parallel strategy during the model loading stage and maintain gradient synchronization relationships among modalities during training. Only in this way can the model iterate continuously and stably on multimodal data.

    2.3 Model Loading and Shard Scheduling

    Large-model parameters are usually organized by layer, while parallel training requires partitioning parameters by row, by column, or at finer granularity across multiple devices. The model loading stage needs to parse the model structure, generate the shard layout, and ensure that each device loads only the parameter shards it is responsible for. Shard scheduling maintains cross-device parameter indexes and communication relationships so that parameter gathering and gradient synchronization occur locally as much as possible, reducing cross-node communication.

    For sparse models using mixture-of-experts architectures, shard scheduling is more complex. Different experts may be assigned to different devices, and the expert combinations activated in each iteration change with the input. Training adaptation must ensure that under such dynamic scheduling, gradients can still be correctly aggregated into the corresponding expert parameters without communication waits or memory conflicts.

    2.4 Cross-Node Gradient Synchronization and Numerical Stability

    When training scales from a single node to multiple nodes, cross-node communication bandwidth and latency become major constraints. Each iteration needs to aggregate gradients computed by each device according to the correct topology, then update parameter replicas on all devices in the same order. If a communication failure or ordering error occurs, the model state in all subsequent iterations will deviate from the target and eventually cause training to collapse.

    Numerical stability is equally critical. In mixed-precision training, gradients are prone to overflow or underflow during scaling and unscaling; optimizer states may also drift during long-term accumulation. Training adaptation therefore needs to provide mechanisms such as dynamic loss scaling, gradient clipping, and gradient norm observation. Keeping the loss function and gradient norm finite across consecutive iterations is the basic basis for judging numerical stability.

    3. Validation Approach: 400 Consecutive Steps on Two Nodes and 16 GPUs

    Whether training adaptation is truly working cannot be judged only by whether the program can start. A widely accepted validation method is to run enough iterations in a real training task and check whether key metrics remain within the normal range.

    This validation used two nodes with a total of 16 domestic full-function GPUs to build a cross-node joint training environment. All 16 training processes participated in parameter sharding and gradient aggregation, and each completed optimizer update counted as one step. The experiment completed 400 consecutive optimizer updates. Loss remained finite throughout, gradient norms did not abnormally expand, and no numerical overflow or abnormal process interruption occurred.

    The pseudocode below represents the validation logic of this training loop:

    1. for step in range(max_steps):
    2. loss = forward(batch)
    3. backward(loss)
    4. apply_gradient_clipping()
    5. update_optimizer()
    6. zero_grad()
    7. if step % log_interval == 0:
    8. log(step, loss, gradient_norm)

    Although a 400-step continuous run cannot cover a complete pretraining cycle on a time scale, it can already rule out the most frequent failure types in the training link: early divergence, communication deadlock, memory overflow, optimizer state mismatch, and cross-node synchronization errors. For the staged goal of verifying that the training link is connected, this result is strongly representative. Larger-scale and longer-duration training tasks are still needed to continuously test engineering stability.

    4. Engineering Path from “Can Train” to “Out-of-the-Box Training”

    “Can train” means that a model can run on target hardware after customized modifications. “Out-of-the-box training” requires that after users obtain standard model scripts, with only a small amount of environment configuration, the training task can automatically select suitable parallel strategies, operator implementations, and optimization parameters and remain stable over long runs.

    To achieve this goal, a mature engineering system must be built:

    • Operator coverage: Provide unified and efficient implementations for attention, normalization, activation, mixed precision, communication, and other operators in the model, reducing manual replacement costs.
    • Automated parallel strategies: Automatically select fully sharded data parallelism, expert parallelism, or hybrid parallelism based on model structure, memory usage, and network topology, lowering the burden of manual tuning.
    • Observability and fault tolerance: Continuously output key metrics such as loss, gradient norm, communication time, memory watermark, and device utilization during training; support checkpoint resume and automatic recovery after abnormal interruption.
    • Training and inference loop: Training adaptation and inference adaptation share underlying operators and runtime, allowing training artifacts to quickly enter deployment validation and shortening model iteration cycles.

    In large-scale training practice, related technical routes have covered multiple model types: complete training from random initialization of scientific foundation models with more than 200 billion parameters, full-stack native training of a five-dimensional world model, full-process training of an embodied intelligence brain model, and training of trillion-parameter models currently being advanced. These practices show that training adaptation capability is moving from single-model adaptation toward platformization and productization.

    Looking ahead, as chip compute, communication bandwidth, and software toolchains continue to improve, training adaptation for ultra-large-scale models will gradually become standardized. The boundary between hardware and software stacks will blur further, and users will no longer need to care about low-level sharding logic and communication details, but instead focus on model innovation and data quality. Moving from “can train” to “out-of-the-box training” is a key leap in this process.