GPU Training Adaptation for Large Models: From Trainable to Out-of-the-Box

    This article examines large-model training adaptation on general-purpose GPUs based in China, using a two-node, 16-GPU, 400-step training test as a case study. It clarifies the difference between inference adaptation, training adaptation, and native pretraining; explains why training is more demanding than inference; discusses what 400 consecutive optimizer updates validate; analyzes native sharded data parallelism with FSDP2; outlines a four-stage path from 16-GPU smoke tests to trillion-parameter training; and provides engineering and troubleshooting guidance for moving from "trainable" to "out-of-the-box training".

    Introduction: What a 16-GPU Training Adaptation Shows

    A general-purpose GPU vendor based in China recently announced that it had completed end-to-end training adaptation for a nearly trillion-parameter open-source large model on its flagship training and inference accelerator.

    The experiment used 16 accelerators across two nodes for joint cross-node training. Across 16 training processes, 400 consecutive optimizer updates were completed. Loss and gradient norms stayed finite throughout, with no numerical overflow or abnormal interruption.

    For developers, the more important questions are not the announcement itself, but what it means in practice: What is the essential difference between training adaptation and inference adaptation? What exactly do two-node 16-GPU runs with 400 consecutive updates validate? What engineering capabilities are still needed to move from “trainable” to “out-of-the-box training”? This article addresses these questions.

    1. Clarifying the Concepts: Successful Adaptation Does Not Mean Native Pretraining

    The industry commonly divides hardware support for models into three levels:

    1. Inference adaptation: Loading existing weights on the hardware and running the forward pass correctly. The focus is operator coverage, quantization, and memory usage.
    2. Training adaptation: Establishing the full pipeline of forward pass, backward pass, gradient synchronization, and optimizer update, while maintaining numerical correctness and stable iteration. A common form is continued training or fine-tuning of an existing model on a new platform.
    3. Native pretraining: Training a foundation model from random initialization on the hardware. This has the highest requirements for cluster scale, long-run stability, and total cost.

    The difficulty increases at each level. Therefore, successful adaptation or integration does not mean that the model was pretrained on that hardware. For example, a leading team validated two types of accelerator hardware side by side in a new model technical report and also validated a fine-grained expert-parallel approach. The industry generally views this as inference-side operator validation; the official report did not disclose the compute source used for pretraining its base model.

    For developers, a more useful judgment is: Which of these three levels does your task belong to, and which level has the target platform reached?

    2. Why Training Adaptation Is Harder Than Inference Adaptation

    1. Operators: From “Forward Pass Works” to “Backward Pass Is Accurate”

    Training requires both forward and backward operators. It also needs to handle activation recomputation, fused attention kernels, mixture-of-experts routing, and All-to-All communication.

    More importantly, backward numerical precision matters. Different floating-point accumulation methods on different hardware can introduce subtle deviations. After thousands of iterations, these deviations may be amplified and eventually affect convergence.

    2. Memory: Training Memory Is the Sum of Four Components

    For BF16 mixed precision with an Adam-like optimizer, the rough static memory usage per billion parameters is as follows:

    Component Precision Bytes per parameter
    Parameter copy BF16 2
    Gradient BF16 2
    Master weights FP32 4
    First moment FP32 4
    Second moment FP32 4
    Total — ~16

    This estimate does not include activations, temporary buffers, or memory fragmentation.

    Static memory usage is only the baseline. Variable-length sequences cause fluctuations in activation memory, while dynamic graphs that repeatedly allocate and free memory can cause fragmentation. Poor memory optimization can reduce throughput, or even lead to out-of-memory failures in the middle of training.

    3. Communication: From Single-Machine Scaling Efficiency to Cross-Machine Collective Communication

    • Within a single machine: Collective operations such as ReduceScatter and AllGather use inter-GPU interconnect. The key considerations are bandwidth utilization and topology affinity.
    • Across nodes: Collective operations must be transmitted over network interface cards. The key considerations are protocol selection, timeout and retry strategies, and the degree of overlap between communication and computation.

    An AllReduce operation that looks ordinary may be invoked tens of thousands of times across 16 processes. Any inconsistency in call order, or any process falling behind, can cause training to hang.

    4. Numerical Stability: Finite Loss Is Only the Minimum Bar

    During training, problems can arise from gradient explosion, overflow or underflow caused by improper mixed-precision scaling, and abnormal accumulation of optimizer second moments.

    It is not enough to check only whether loss becomes NaN. A complete assessment of numerical correctness should also consider whether gradient norms remain stable, whether parameter update magnitudes are reasonable, and whether the loss curve follows the same trend as a reference platform.

    3. What 16 GPUs and 400 Consecutive Updates Validate

    A successful single forward and backward pass only proves that the pipeline can run. Stable updates over multiple steps better reflect the real training state.

    Four hundred consecutive optimizer updates are useful because they cover the following risks at the same time:

    • Cross-iteration state: First and second moments accumulate at every step. Abnormal behavior often appears only after dozens or even hundreds of steps.
    • Steady-state memory usage: Every step repeats the cycle of parameter AllGather, forward pass, recomputation, backward pass, and gradient ReduceScatter. Whether memory allocation remains stable, and whether memory grows slowly or fragments accumulate, can only be observed over multiple steps.
    • Scheduling and synchronization: Logic such as gradient accumulation and learning-rate warmup scheduling is fully exercised only during multi-step runs.
    • Cross-node communication: Collective communication across 16 processes interacts repeatedly over hundreds of iterations. Hangs, timeouts, and ordering errors usually surface gradually.

    When evaluating such a run, it is useful to observe three types of signals simultaneously:

    1. Numerical signals: Loss and gradient norms remain finite throughout and show a slow downward trend; gradient norms remain stable without sustained sharp increases; the learning rate changes according to the schedule.
    2. Resource signals: Per-GPU memory usage remains stable without continuous growth; step times across ranks remain close, with no long-term stragglers; interconnect and network links show no abnormal errors.
    3. Continuity signals: There are no abnormal interruptions or process hangs, and the optimizer step count in the logs corresponds one-to-one with the scheduler count.

    Therefore, “two nodes, 16 GPUs, 400 consecutive updates, finite loss and gradient norms throughout, and no abnormal interruption” can be used as a quantitative acceptance result for a training adaptation.

    It demonstrates two things: the full pipeline from model loading and sharding/scheduling to gradient synchronization is working, and cross-node coordination has basic stability.

    However, 400 steps is a small-scale, short-duration validation. Full-parameter training of a trillion-parameter model can last for weeks or even months. Long-run stability, checkpoint resumption, and fault tolerance at the scale of thousands or tens of thousands of GPUs still require further validation.

    4. Why the Native Sharded Data Parallelism Path Matters

    The vendor disclosed that its technical route is a native training path built on FSDP2. The two most important terms here are “native” and “FSDP2”.

    1. Why Sharded Data Parallelism, or FSDP

    Take a 7-billion-parameter model as an example. With ordinary data parallelism, every GPU stores the full state. Parameters, gradients, and optimizer states alone require about 112 GB. Add activations and framework overhead, and even an 80 GB GPU is tight.

    FSDP shards parameters, gradients, and optimizer states across devices, so each GPU stores only 1/N of them.

    Training stage Communication operation Description
    Forward AllGather Gather parameters of the current layer on demand and release them after use
    Backward AllGather / ReduceScatter Re-gather parameters for activation recomputation, then reduce gradient shards
    Optimizer update No collective operation Each rank updates only the parameter shard held on its device

    With 16 GPUs, static usage is about 7 GB per GPU.

    This is the value of a native path: mainstream frameworks can run in their native training modes on the target hardware without deep modification. This makes it easier to support official training configurations and community ecosystems for open-source models.

    2. Key Differences Between FSDP2 and FSDP1

    • Sharding granularity: FSDP1 relies on flattened parameters, such as FlatParameter. FSDP2 uses distributed tensors, or DTensor, with per-device sharding as the unified abstraction.
    • Composability: FSDP2 can be combined more naturally with tensor parallelism, pipeline parallelism, and expert parallelism.
    • Checkpointing: Per-parameter sharding makes distributed checkpoints easier to save and load, and supports resuming training after changing the parallelism degree.

    3. Additional Requirements for Multimodal Paths

    Multimodal models contain heterogeneous components such as vision encoders, modality adapters, and language backbones. The vision side often includes operations such as convolution and interpolation, while the sequence side is mainly based on Transformers. Their operator requirements differ significantly.

    There are also heterogeneous inputs such as image-text pairs and video frames, which require loading and preprocessing. The training framework must support different structures under a unified sharding schedule and align data pipelines across modalities.

    4. Example Training Loop

    1. # Pseudocode: a stable training loop for native sharded data parallelism
    2. for step, batch in enumerate(dataloader, start=1):
    3. # Gradient accumulation: divide each micro-batch by the accumulation steps to stay equivalent to a full-batch update
    4. with autocast(dtype=bfloat16):
    5. loss = model(**batch).loss / accum_steps
    6. loss.backward()
    7. if step % accum_steps == 0:
    8. # Under FSDP, use the clipping interface exposed by the model wrapper to compute a global gradient norm across shards
    9. grad_norm = clip_grad_norm_(model, max_norm=1.0)
    10. # Defensive check: stop immediately and preserve state if Inf/NaN appears, avoiding contamination of later iterations
    11. if not isfinite(grad_norm) or not isfinite(loss.detach()):
    12. raise FloatingPointError(f"step={step}, loss={loss.item()}, grad_norm={grad_norm}")
    13. optimizer.step()
    14. scheduler.step()
    15. optimizer.zero_grad(set_to_none=True)
    16. # Keep logging metrics for comparison against the reference platform
    17. log_metrics(step, loss=loss.item() * accum_steps, grad_norm=grad_norm)

    This code reflects three key points:

    • Aggregate the global norm before clipping.
    • Add defensive checks for gradient norm and loss.
    • Log metrics throughout for cross-platform comparison.

    5. From 16 GPUs to Trillion Parameters: A Four-Stage Validation Path

    A 16-GPU, 400-step run is only the starting point. It is advisable to advance step by step: run it, stabilize it, sustain it, and validate accuracy.

    Stage Scale Core goal Suggested focus
    Smoke test Single machine, 1–8 GPUs Operator coverage and single-step forward/backward correctness No errors; finite loss and gradients
    Short-term stability Around two nodes, 16 GPUs Cross-node communication and multi-step numerical stability Hundreds of steps with finite loss, stable gradient norms, and no hangs
    Medium/long-term stability Tens to hundreds of GPUs Scaling efficiency and continuous-run stability Scaling efficiency, long-run duration, checkpoint-resume drills
    Large-scale training Thousands of GPUs and above Parallel combinations, memory and communication overhead, fault tolerance Model compute utilization, failure recovery time, effective training time

    Full-parameter training of trillion-parameter models cannot be completed on a single machine. Parameter sharding must be combined with the following techniques:

    • Tensor parallelism: Splits the computation of a single layer across multiple GPUs.
    • Pipeline parallelism: Partitions the model by layers.
    • Expert parallelism: Distributes different experts of a mixture-of-experts model across devices.
    • Sequence/context parallelism: Splits long-sequence activations.
    • Activation recomputation: Trades compute for memory.

    After stacking these communication overheads, it is necessary to evaluate model compute utilization, such as MFU, and scaling efficiency. Only then can one answer whether the model can be trained and whether training is efficient enough.

    6. From “Trainable” to “Out-of-the-Box Training”: The Engineering System

    1. Operators and Compilation Capabilities

    Cover high-frequency operators such as attention, normalization, positional encoding, and mixture-of-experts routing, and support graph-level optimization and operator fusion.

    Provide precision-comparison tools so that the backward results of each operator can be compared layer by layer against a reference implementation.

    2. Communication and Topology Optimization

    Implement collective communication primitives such as AllReduce, ReduceScatter, AllGather, and All-to-All, and support overlap between communication and computation.

    At large scale, topology-aware task scheduling is also needed: place tensor-parallel groups inside nodes with the highest inter-GPU interconnect bandwidth, deploy pipeline and data-parallel groups across nodes, and reduce communication volume on slower links as much as possible.

    3. Framework-Native Compatibility

    Making the native distributed training modes of mainstream deep learning frameworks work out of the box is key to reducing migration cost. Developers can directly reuse community scripts and configurations instead of maintaining deeply modified branches.

    4. Observability and Fault Tolerance

    • Continuously collect GPU utilization, memory usage, temperature, and interconnect link metrics.
    • Set alerts for training metrics such as loss, gradient norm, and step time.
    • Use distributed checkpoints and automatic recovery mechanisms so training can resume as quickly as possible after a node failure.

    In cloud environments, teams can rely on common capabilities such as elastic scheduling in container platforms, centralized checkpoints in object storage, log services, and monitoring/alerting to handle deployment and operations.

    5. Standardized Delivery

    Promote standardization across operator adaptation, multi-GPU coordination, and automated toolchains, and deliver training environments in unified forms such as container images.

    Provide reference configuration templates for models of different parameter scales so that validated configurations can be reused directly.

    7. Training Adaptation Troubleshooting Checklist

    Symptom Common causes Investigation direction
    Loss is already NaN at the first step Abnormal backward precision in an operator; improper mixed-precision settings Compare forward and backward outputs layer by layer; run one pass each with BF16 and FP32
    Loss spikes or diverges after tens of steps Gradient explosion; learning rate too high; abnormal optimizer state Check the gradient-norm curve and whether clipping is applied globally; align hyperparameters with the reference platform
    Loss slowly drifts upward after a long run Accumulation of backward numerical errors Run long-duration comparison at a smaller model scale; check accumulation precision of key operators
    Process hangs with no log output Inconsistent collective-communication call order; a rank falls behind; link errors Check control flow across ranks; inspect link and timeout logs
    OOM after running for some time Memory fragmentation; activation memory grows with sequence length Observe memory growth curves; cap the maximum sequence length; enable activation recomputation
    Step times vary greatly across GPUs Load imbalance; slow nodes; inter-node communication not overlapped with computation Measure per-rank step time; check hardware metrics; adjust parallel partitioning

    In addition to routine inspection, it is also useful to enable the framework’s NaN detection mode. This mode has relatively high performance overhead and is recommended only for debugging.

    After a failure, preserve the scene and resume training automatically. In large-scale training, checkpoint saving and recovery are engineering tasks in their own right, and teams should run drills regularly.

    Conclusion

    The essence of training adaptation is to enable frontier models to iterate stably, efficiently, and reproducibly on general-purpose GPUs based in China.

    A two-node, 16-GPU run with 400 consecutive updates and finite loss and gradient norms validates the completeness of the native sharded data parallelism path and basic cross-node stability. It is a solid starting point.

    Existing practices are extending the boundaries of this path:

    • A 200-billion-parameter scientific foundation model has completed end-to-end training from scratch.
    • A five-dimensional world model has achieved full-stack native training.
    • An embodied-intelligence brain model has completed end-to-end training.
    • Training for a trillion-parameter-scale large model is underway.

    These heterogeneous tasks, spanning scientific computing, world modeling, and embodied intelligence, also help refine the hardware’s operator and communication capabilities.

    Looking ahead, out-of-the-box training should meet at least four conditions:

    • Mainstream frameworks can run their native training modes directly.
    • Community configurations can be reused to reduce migration cost.
    • Thousand-GPU long-run stability and fault tolerance have been validated in practice.
    • Model accuracy aligns with reference platforms, with controllable error.

    For teams planning to train on general-purpose GPU platforms based in China, it is advisable to follow the four-stage validation path and use loss and gradient-norm curves, scaling efficiency, long-run duration, and failure recovery time as quantitative criteria. These data points help determine whether a platform can truly train, train stably, and train accurately.