Full-Stack LLM Training Adaptation on Domestic GPUs: From Inference Deployment to Stable Trillion-Scale Training

    This article explains the technical challenges and engineering methodology behind adapting large language model training to domestic (non-mainstream) GPU stacks. It covers why full training adaptation is far harder than inference deployment, the core technical pipeline (model sharding, operator coverage and precision alignment, gradient synchronization), how to validate training stability over long-running jobs, and what it takes to move from a one-off adaptation experiment to a production-grade training system.

    1. Background: Why LLM Training Adaptation Is the Litmus Test for Domestic Compute

    In recent years, open-source LLMs have grown rapidly from hundreds of billions to trillions of parameters. Training models at this scale places extreme demands on the underlying hardware-software stack: it must not only deliver sufficient peak compute, but also guarantee stability, numerical correctness, and operational manageability across long-running, large-scale distributed training jobs.

    For domestic GPUs, there is a huge gap between “can run inference” and “can train stably.” Inference workloads involve relatively simple compute patterns with generous fault tolerance. Training, by contrast, requires backpropagation, gradient synchronization, and optimizer updates to remain numerically consistent across the entire pipeline. Any precision deviation in a single operator, communication anomaly, or scheduling defect can be amplified over thousands of iterations into loss divergence or a training crash. Successfully adapting a near-trillion-parameter frontier open-source model for training on domestic GPUs is therefore a meaningful benchmark of the maturity of a domestic AI compute stack.

    One common misconception is worth clarifying: “training adaptation” means successfully reproducing a model’s training workflow on a specific hardware and software stack, validating the completeness and stability of the training pipeline. It is not the same as “the model’s base pretraining used a certain type of compute.” Industry terms like “Day 0 support” or “inference operator validation” usually only cover inference-side compatibility, whose engineering difficulty and technical depth are not comparable to full-stack stable training. Understanding this distinction helps in objectively evaluating the real capabilities of different compute vendors.

    2. The Core Technical Pipeline of Training Adaptation

    2.1 Model Loading and Sharded Scheduling

    A trillion-parameter model cannot reside on a single GPU or even a single node. The first step of training is solving model partitioning and loading. The mainstream approach today is an improved version of Fully Sharded Data Parallel (FSDP-style paradigms), whose core ideas are:

    • Shard model parameters, gradients, and optimizer states across devices; aggregate them on demand during training and release them immediately after use;
    • Combine tensor parallelism, pipeline parallelism, and expert parallelism (for MoE architectures) into a multi-dimensional hybrid parallelism strategy;
    • Use grouped parameter prefetching and post-backward release to hide communication overhead and keep compute utilization high.

    For multimodal models, the training path must also natively support mixed sharding of heterogeneous modules such as vision and text, so that no single module type becomes a memory or communication bottleneck. A native sharded-training framework tailored to the model architecture is what distinguishes real adaptation work from “simply porting an open-source training script.”

    2.2 Operator Coverage and Precision Alignment

    LLM training relies on hundreds of core operators, including various attention variants (e.g., FlashAttention-style tiled computation), fused normalization, fused activations, MoE routing and expert computation, and distributed optimizer operators. Typical adaptation work includes:

    1. Operator gap-filling: audit the model code layer by layer and implement operators that are missing or behave differently in the hardware software stack;
    2. Precision alignment: for mixed-precision training (BF16/FP16 compute with FP32 master weights and accumulation), verify numerical error operator by operator, using higher-precision intermediate representations where necessary;
    3. Numerical stability: loss scaling, gradient clipping, and optimizer state management must align strictly with the reference implementation, otherwise long-horizon training easily diverges.

    2.3 Gradient Synchronization and Communication Optimization

    In multi-node training, gradient synchronization is the primary bottleneck. Collective operations such as All-Reduce, Reduce-Scatter, and All-Gather need deep optimization for proprietary interconnects, including topology-aware communication scheduling, compute-communication overlap, and gradient bucketing. At the scale of two nodes with sixteen GPUs, inter-node bandwidth typically becomes the limiting factor, so techniques like communication compression and chunked pipelining have a significant impact on end-to-end throughput.

    3. A Methodology for Validating Large-Scale Training Stability

    The accepted industry practice for judging whether a training adaptation is “successful” is not to run a few dozen steps and watch the loss go down, but to perform sufficiently long continuous training runs. In one typical publicly reported validation: two nodes with a total of sixteen flagship training-and-inference accelerator cards completed four hundred consecutive optimizer updates, satisfying throughout:

    • The loss curve converged smoothly, with no jumps or spikes;
    • Gradient norms remained finite at all times, with no numerical overflow (NaN/Inf);
    • No process crashed, and no single point of failure in the cluster forced a training restart.

    Four hundred steps may not sound long, but its significance lies in proving that the full loop — data loading, forward pass, backward pass, gradient synchronization, and optimizer update — works end to end in a multi-node, multi-GPU environment. Stability issues in training systems often only surface after extended iteration, so “continuous stable operation” is itself an important engineering milestone. Beyond this point, mechanisms such as automatic failure recovery, checkpoint resumption, and checkpoint consistency verification are needed to support real pretraining tasks lasting weeks.

    An illustrative approach to training stability monitoring looks like this:

    1. for step, batch in enumerate(loader):
    2. loss = model(batch).loss
    3. loss.backward()
    4. if not (torch.isfinite(loss) and grad_norm_is_finite(model)):
    5. rollback_to_last_healthy_checkpoint() # auto-rollback on numerical anomalies
    6. clip_grad_norm_(model.parameters(), max_norm)
    7. optimizer.step()
    8. log_metrics(loss, grad_norm) # continuously log loss and gradient norm

    4. From a One-Off Validation to an Engineering System

    A single successful adaptation experiment does not equal a reproducible training capability. A mature training engineering system includes at least:

    • Automated adaptation pipelines: when a new model is released, automatically run operator coverage checks, precision baseline comparisons, and smoke-training runs;
    • Observability: full-dimension monitoring and alerting across training metrics, hardware utilization, communication latency, and memory headroom;
    • Fault tolerance and elasticity: checkpoint resumption, hot node replacement, and elastic scaling to reduce MTTR (mean time to recovery) in long-running jobs;
    • Performance tuning toolchains: automatically search parallelism strategies and hyperparameter combinations to maximize MFU (model FLOPs utilization).

    Industry practice shows that domestic compute has already delivered complete from-scratch pretraining cases in several directions, covering scientific foundation models (hundreds of billions of parameters), world models, and embodied AI models of different types. These cases validate the generality of the hardware-software stack, and work is progressing toward full training of trillion-parameter models.

    5. Outlook: From “Can Train” to “Train Out of the Box”

    Training capability on domestic full-featured GPUs is still evolving rapidly. Key areas of future effort include: continuously filling and performance-tuning the operator library, improving multi-GPU and multi-node communication efficiency, packaging parallelism and fault-tolerance strategies into automated toolchains, and keeping pace quickly with the mainstream open-source model ecosystem. When developers can take a newly released frontier model and start training on domestic compute with a near “out-of-the-box” experience — without heavy manual adaptation — that will mark the true maturity of domestic AI infrastructure, and the core leap from feasibility validation to scaled production for training models on domestic chips.