Training Adaptation of a Trillion-Parameter Model on Domestic GPUs: Practices for Stable Full-Pipeline Training

    This article examines the technical transition from inference-only adaptation to full training adaptation for large language models on domestic GPU accelerators. It analyzes a real-world case where a flagship open-source model with nearly three trillion parameters was trained across two nodes and 16 GPUs using FSDP2, completing 400 consecutive optimizer steps without numerical instability. The discussion covers the core challenges of training adaptation, the complete FSDP2 training pipeline, stability verification metrics, and the engineering layers required to move from single-point breakthroughs to a mature platform capability. The article concludes with a forward-looking perspective on what it takes to evolve from "can train" to "out-of-the-box training" in domestic AI infrastructure.

    From Inference Adaptation to Training Adaptation: A Fundamental Shift

    In the large model ecosystem, it has become industry practice for accelerator vendors to provide “Day 0 adaptation” for newly released open-source models. However, most of these rapid adaptation efforts are essentially inference adaptation: ensuring the forward computation graph of the model executes correctly on the target hardware, including operator coverage, numerical precision alignment, and inference performance optimization. While such work is not trivial, it is an entirely different magnitude from training adaptation.

    Training adaptation requires supporting the full backward propagation process on the target hardware, which introduces several core challenges:

    • Bidirectional operator coverage: Not only forward operators but also the gradient operators for each operator must be supported, with numerical behavior strictly aligned to the reference implementation.
    • Doubled complexity of memory management: Training requires simultaneously holding model parameters, gradients, and optimizer states. With mixed-precision training, high-precision master weight copies must also be maintained, making memory pressure several times higher than inference.
    • Correctness of distributed communication: Gradient synchronization, parameter sharding, and activation recomputation all depend on deep coordination between the underlying communication library and the upper-level distributed framework.
    • Long-horizon numerical stability: Training is an iterative process spanning tens of thousands to hundreds of thousands of steps. Any subtle numerical error can accumulate and amplify, leading to loss divergence.

    Recently, a domestic GPU vendor used its flagship inference-and-training integrated accelerator card and proprietary software stack to complete training adaptation of a flagship open-source model with nearly three trillion parameters. The test used a two-node, 16-card setup for cross-node joint training, with all training processes completing 400 consecutive optimizer updates. Both the loss and gradient norms remained finite throughout, with no numerical overflow or abnormal interruptions. This case provides a valuable reference for understanding the engineering depth of training adaptation.

    The FSDP2 Training Path: A Complete Chain from Model Loading to Gradient Synchronization

    The core achievement of this adaptation is the construction of a native FSDP2 (Fully Sharded Data Parallel, second generation) multimodal training path. FSDP is one of the most mainstream distributed parallel paradigms for large model training. Its core idea is to shard model parameters, gradients, and optimizer states across devices, temporarily aggregating full parameters only when needed via all-gather, then immediately releasing them after computation. This reduces per-GPU memory usage from the full model size to model size / N.

    A complete FSDP2 training chain includes the following stages:

    1. Model loading and lazy initialization: Models with extremely large parameter counts cannot be instantiated on a single card. Instead, meta-device placeholders combined with on-demand materialization are used, with parameter tensors directly shard-initialized across cards.
    2. Sharding strategy: Determines sharding granularity (by layer, module, or parameter group), the trigger timing for all-gather and reduce-scatter, and the pipeline overlap scheme between communication and computation.
    3. Gradient synchronization and optimizer update: After backward propagation, reduce-scatter aggregates gradient shards, and each card updates only the parameter shards it owns.
    4. Mixed precision and numerical protection: Configure loss scaling, gradient norm monitoring, and overflow fallback mechanisms on low-precision computation paths such as FP8/BF16.

    At the code level, a typical FSDP2 wrapping logic looks like this (simplified pseudocode):

    1. # Simplified pseudocode illustrating sharded training organization
    2. for layer in model.transformer_layers:
    3. fully_shard(layer, mesh=device_mesh) # shard each layer
    4. fully_shard(model)
    5. for batch in dataloader:
    6. loss = model(batch).loss
    7. loss.backward() # automatically triggers gradient reduction
    8. grad_norm = clip_grad_norm_(model.parameters(), max_norm=1.0)
    9. assert torch.isfinite(loss) and torch.isfinite(grad_norm)
    10. optimizer.step()
    11. optimizer.zero_grad()

    The real engineering difficulty is not calling framework interfaces, but making the underlying software stack strictly align with the upper-level framework semantics in terms of communication primitives, memory allocators, and operator fusion. Any discrepancy can manifest as training interruptions or numerical anomalies.

    Stability Verification: What Does 400 Consecutive Steps Mean?

    For a model with nearly three trillion parameters, a two-node, 16-GPU hardware configuration is clearly insufficient to support actual pretraining. The purpose of such an experiment is verification of training pipeline correctness and stability. The validity of the verification depends on three key indicators:

    • Finite loss with a reasonable trend: Loss must remain finite and show normal descent or a stable plateau, without NaN or Inf.
    • Finite gradient norms with controlled fluctuation: Gradient norm is a barometer of training health; continuous spikes usually indicate numerical problems.
    • Zero process interruption: Cross-node training is highly sensitive to network jitter and memory fragmentation. All processes completing hundreds of consecutive optimizer updates indicates that communication, scheduling, and memory management form a closed loop.

    It is important to have a realistic view: hundreds of steps of verification mainly prove that “the pipeline works and numbers are stable.” Full pretraining still requires validation on larger clusters for long-duration fault tolerance, throughput efficiency, and convergence consistency. This is the necessary ladder from “able to train” to “training well.”

    Engineering System: From Single-Point Breakthroughs to Platform Capability

    Training adaptation is not a one-off project; it must be consolidated into a reusable engineering system. A mature system generally includes four layers of capability:

    • Operator layer: Covers all forward and backward operators required by mainstream model architectures, with support for low-precision computation paths.
    • Parallelism layer: Supports flexible combinations of data parallelism, tensor parallelism, pipeline parallelism, expert parallelism, and sequence parallelism — especially fine-grained expert parallelism for mixture-of-experts (MoE) architectures.
    • Fault tolerance layer: Provides mechanisms such as failure detection, automatic restart, and asynchronous checkpoint saving to ensure long-duration training is not interrupted.
    • Toolchain layer: Offers a complete set of tools from model migration scripts and performance profiling to automated tuning, reducing the learning curve for users.

    Industry practice also shows that “training domestic models on domestic chips” is moving from scattered verification to large-scale deployment: a 200-billion-parameter scientific foundation model has completed full training from scratch on domestic compute, and full-pipeline training for frontier directions such as multimodal world models and embodied intelligence models has also been run on domestic GPUs, with progress extending to trillion-parameter scales.

    Outlook: From “Can Train” to “Out-of-the-Box Training”

    The ultimate goal of training adaptation is to make developers unaware of the underlying hardware — model code requires no modifications, training scripts run out-of-the-box, and performance is predictable. Achieving this demands sustained investment in automated operator adaptation, multi-GPU coordination optimization, and native integration with mainstream training frameworks. For enterprise users choosing training compute solutions, it is recommended to evaluate: operator coverage for the target model architecture, flexibility in combining distributed parallelism, measured stability over long training runs, and the completeness of the accompanying toolchain. The progress of domestic compute from “can train” to “out-of-the-box training” will directly shape the diversity of the large model training ecosystem.