End-to-End Practice of Large Model Training Adaptation on Domestic GPUs

    This article explains why adapting large model training to domestic GPUs is fundamentally different from onboarding a model for inference—and why getting a model to run on new hardware is not the same as training it there. It breaks down the three core challenges: operator coverage and numerical precision, distributed coordination, and long-run stability. It then walks through a native training path built around Fully Sharded Data Parallel (FSDP), including framework-agnostic pseudocode of the single-step training loop, followed by a reproducible acceptance test based on continuous optimizer updates. Finally, it covers the engineering stack needed to move from "training works once" to "ready out of the box," plus real-world scenarios of domestic chips training domestic models. The takeaway is a maturity yardstick—inference works → training works → long-term stable → out-of-box training—that applies regardless of the underlying hardware.

    1. First, a key distinction: training adaptation ≠ inference onboarding

    In large model engineering, you often hear claims like “a chip quickly adapted to the latest open-source model.” Before going further, it is worth clarifying an important difference: a successful adaptation does not mean the model’s foundation pretraining was completed on that chip.

    In practice, “adaptation” usually falls into two categories, with very different technical difficulty and validation standards:

    • Inference onboarding (Day 0 adaptation): The goal is to get the model to “run and produce correct results” on new hardware, focusing on operator availability, memory footprint, and throughput/latency. This is closer to a deployment problem.
    • Training adaptation: The goal is to get the model to “converge from scratch or continue training” on new hardware. Beyond inference capability, this requires the full pipeline—forward pass, backpropagation, gradient computation and synchronization, and optimizer updates—to be correct and numerically stable.

    There have been cases where a large model’s technical report validated both domestic NPUs and mainstream international GPUs side by side. Yet the industry consensus is that such validation tends to concentrate at the inference operator level and does not clearly establish the original compute source of the foundation pretraining. This is precisely why the point matters: getting inference to work and getting training to work are problems on entirely different scales.

    2. Why training adaptation is hard: from “single card correct” to “multi-card stable”

    Producing a correct forward result on a single card is far from “stably training for tens of thousands of steps across multiple cards.” A large amount of engineering detail sits in between. The core challenges fall into three categories:

    1. Operator coverage and numerical precision: Training involves a large number of backward operators, mixed-precision accumulation/scaling, and reduction operations. A precision deviation in any single operator may be masked at small scale, yet accumulate into divergence over long iterations.
    2. Distributed coordination: In multi-card and multi-node settings, how parameters, gradients, and optimizer states are partitioned and aggregated, and how communication overlaps with computation, directly determine whether training can proceed both efficiently and correctly.
    3. Long-run stability: What truly tests engineering capability is “how long can it run without failing.” Hundreds or thousands of consecutive iterations without numerical overflow (NaN/Inf) or interruption—that is the convincing result.

    Modern large model training commonly adopts a combined data parallel + sharding strategy. Approaches typified by Fully Sharded Data Parallel (FSDP) partition model parameters, gradients, and optimizer states along the data-parallel dimension, so each card stores only one shard of the full state. This significantly reduces per-card memory pressure and makes it possible to train models at the trillion-parameter scale on a limited number of accelerators.

    A complete native training pipeline typically includes these stages:

    1. Model loading → Parameter sharding → Forward pass → Backward pass
    2. → Gradient reduction (Reduce-Scatter) → Sharded optimizer update → Parameter aggregation (All-Gather)

    Below is a framework-agnostic pseudocode showing the core idea of sharded training:

    1. # Pseudocode: single training step of fully sharded data parallelism (illustrative, not concrete APIs)
    2. for step in range(max_steps):
    3. # 1. All-gather the parameter shards for the current layer as needed
    4. params = all_gather(param_shards, group=dp_group)
    5. # 2. Forward: inputs from different modalities (text/image, etc.) go through the multimodal training path
    6. logits = model.forward(batch, params)
    7. # 3. Backward: compute gradients for the local shard
    8. loss = compute_loss(logits, batch.targets)
    9. grad_shards = backward(loss)
    10. # 4. Reduce-scatter: reduce across cards and keep the shard this card is responsible for
    11. reduce_scatter(grad_shards, group=dp_group)
    12. # 5. The optimizer updates only the parameter shards this card is responsible for
    13. optimizer.step(shard_view(params))
    14. # 6. Numerical health check: monitor loss and gradient norm
    15. assert is_finite(loss) and is_finite(grad_norm(grad_shards))

    The numerical health check in step 6 is the lifeline of long-run training. In practice, teams continuously monitor the loss curve, the gradient norm, and the output distribution of key operators. The moment an Inf/NaN appears, they can immediately locate the specific rank and layer, avoiding wasted compute.

    4. Stability validation: use “N continuous steps” as the acceptance criterion

    How do you judge whether a training adaptation truly meets the bar? A reproducible, quantifiable acceptance method is a cross-node continuous optimizer-update test.

    A typical setup uses two nodes with 16 accelerators in total to run joint cross-node training, letting all 16 training processes complete 400 consecutive optimizer updates together. Acceptance focuses on three hard metrics:

    • Loss stays finite throughout: no NaN or Inf, with a smooth and predictable curve;
    • Gradient norm stays finite throughout: no abnormal spikes or numerical explosions;
    • No abnormal interruption: communication does not time out, and no process crashes or deadlocks occur.

    When all three hold across the entire run, it demonstrates that the complete training pipeline—from model loading and shard scheduling to gradient synchronization—is closed-loop and stable on that hardware, rather than merely “able to do forward inference.” This kind of “stability acceptance measured in steps” is more convincing than a single-point performance test.

    5. The engineering system: from “training works” to “ready out of the box”

    Getting a single run to work is only the starting point; sustainable, reusable capability is what makes a valuable engineering system. It comprises at least three layers:

    • Operator adaptation layer: Provides high-performance implementations and correctness checks (element-wise error comparison against reference implementations) for new or missing training operators, ensuring precision alignment.
    • Multi-card coordination layer: Optimizes the overlap of communication and computation, load balancing, and partitioning strategies, so multi-node, multi-card scaling stays close to linear and communication bottlenecks do not eat into compute gains.
    • Automation toolchain layer: Provides one-click environment setup, job orchestration, logging and monitoring collection, and checkpointing—turning “experts repeatedly tuning parameters” into “ready to use out of the box.”

    In real deployments, these capabilities typically work alongside general cloud infrastructure: object storage to hold training data and checkpoints, a container platform to schedule distributed jobs uniformly, and logging and monitoring/alerting services to track loss and hardware status in real time. General-purpose cloud capabilities such as those offered by Baidu AI Cloud—containers, storage, logging, and monitoring—form the infrastructure foundation that keeps large-scale distributed training running stably.

    6. The deployment landscape: domestic chips training domestic models across scenarios

    The value of training adaptation ultimately shows up in the real results of domestic chips training domestic models. Typical scenarios include:

    • Scientific foundation models: Completing full training of a foundation model at the tens-of-billions-of-parameters scale from the ground up, validating large-scale convergence capability;
    • 5D world models: Supporting full-stack native training of a world model with complex spatiotemporal dimensions, testing multimodal and long-sequence processing capability;
    • Embodied brain models: Partnering with research institutions to complete end-to-end training of an embodied-intelligence brain model, covering the full chain from perception to decision-making.

    These scenarios all point to one goal: working with industry partners to advance the training deployment of trillion-parameter-scale large models.

    7. Conclusion: from “training works” to “ready out of the box”

    Domestic full-feature GPUs supporting large model training are undergoing a pivotal shift from “validating feasibility” to “delivering productivity.” The technical throughline is clear: build a native training path on mature approaches such as fully sharded data parallelism, adopt “multiple continuous steps with finite numerical values throughout” as a hard acceptance standard, and then form a reusable engineering system out of operator adaptation, multi-card coordination, and automation tooling.

    For developers, understanding this throughline is more valuable than memorizing any specific hardware model—because regardless of how the underlying hardware iterates, the progression “inference works → training works → long-term stable → ready out of the box” remains a universal yardstick for measuring the maturity of large model compute.