Multi-GPU Training of Large Models on Domestic GPUs: A Dual-Node, 16-GPU Practice

    How to validate and stabilize large model training across two nodes and 16 domestic GPUs. This article breaks down the full training pipeline—from model loading and parameter sharding to gradient synchronization and optimizer updates—and shares six engineering practices for achieving continuous, stable multi-node training, including 400 consecutive optimizer updates with no numerical overflow or interruption.

    Multi-GPU Training of Large Models on Domestic GPUs: A Dual-Node, 16-GPU Practice

    As large model parameter counts and multimodal data complexity continue to grow, the core question facing training systems has shifted from “can it run on a single GPU” to “can it run stably across multiple nodes and GPUs over the long term.” A successful training adaptation goes beyond verifying that a model can load and that forward and backward passes execute—it must verify that the complete pipeline, including cross-node communication, parameter sharding, gradient synchronization, optimizer updates, and anomaly monitoring, remains continuous, controllable, and recoverable.

    Recently, a fully functional domestic GPU completed training adaptation for a cutting-edge multimodal large model in a dual-node environment with 16 accelerator cards in total. During the experiment, 16 training processes completed 400 consecutive optimizer updates, with loss values and gradient norms staying finite throughout—no numerical overflow or unexpected interruptions occurred. The significance of this result lies not in peak performance but in validating the engineering stability of the complete training pipeline, from model loading and sharding to gradient synchronization. This article breaks down the key stages of multi-node, multi-GPU large model training and discusses the engineering path from “can train” to “train out of the box.”

    1. Validation Goals: Continuous Stable Updates Matter More Than a Single Successful Run

    Training adaptation for large models involves multiple layers: operator coverage, model architecture compatibility, GPU memory capacity, communication connectivity, and correct optimizer state updates. Many issues don’t surface during single-step execution but amplify over continuous training. For example, numerical overflow under mixed precision may only occur on specific batches; cross-node gradient synchronization latency may leave some processes waiting; inconsistent checkpoint saves may cause loss curve jumps after recovery. Therefore, the validation standard for training adaptation should be upgraded from “single-step runnability” to “continuous stable updates across multiple processes.”

    In this practice, dual-node, 16-GPU cross-node joint training was used, with 16 training processes completing 400 consecutive optimizer updates together. Three types of metrics were validated: first, whether loss values and gradient norms remained finite to avoid numerical overflow; second, whether training processes experienced unexpected interruptions, communication hangs, or out-of-sync updates; third, whether the complete pipeline covered model loading, parameter sharding, gradient synchronization, and optimizer updates. Only when all three are satisfied can the training path be considered reproducibly stable from an engineering standpoint.

    2. Breaking Down the Training Pipeline: From Model Loading to Optimizer Updates

    Multi-node, multi-GPU training is not simply copying a single-node script onto multiple machines—it requires unified orchestration of model state, data flow, and communication topology. A typical sharded data parallel training pipeline can be abstracted into the following steps:

    1. Model loading and parameter sharding: Model parameters, gradients, and optimizer states are sharded across devices according to a strategy to reduce per-GPU memory usage. Multimodal models usually contain multiple encoding branches—text, image, video, and so on—with significantly different parameter scales and compute characteristics. Sharding must balance both memory and compute load.
    2. Data sharding and batch scheduling: Each training process reads a different data shard to keep the global batch valid. For multimodal data, you also need to handle varying sample lengths across modalities and uneven encoder compute, so that some devices don’t become communication or compute bottlenecks.
    3. Forward computation and loss construction: Each process runs local forward computation to produce a local loss. In multimodal training, the loss may consist of multiple sub-task losses, so loss scaling and gradient backpropagation paths must stay consistent.
    4. Backward propagation and gradient synchronization: After backward computation produces local gradients, collective communication synchronizes gradients across nodes. The synchronization strategy must match the parameter sharding approach to avoid redundant communication or communication gaps.
    5. Gradient clipping and optimizer updates: Before updating, check whether the loss and gradient norms are finite, and apply global gradient clipping if necessary. Optimizer states also need sharded management to ensure all processes stay consistent after updates.
    6. Checkpoints and observability: Periodically save model, optimizer, and data loading states, and record metrics such as loss, gradient norm, communication time, and memory usage—providing the basis for failure recovery and performance tuning.

    The following pseudocode describes a training loop with health checks:

    1. for step in range(total_steps):
    2. batch = next(data_stream)
    3. loss = forward_with_mixed_precision(model, batch)
    4. backward_with_loss_scaling(loss)
    5. sync_gradients_across_nodes(model)
    6. grad_norm = compute_global_grad_norm(model)
    7. if is_finite(loss) and is_finite(grad_norm):
    8. clip_by_global_norm(model, max_norm)
    9. optimizer_step(model)
    10. zero_grad(model)
    11. else:
    12. reload_latest_checkpoint(model, optimizer)
    13. report_abnormal(step, loss, grad_norm)
    14. log_metrics(step, loss, grad_norm, memory_usage, comm_time)

    The key here is not the specific interfaces but the built-in numerical health checks, gradient synchronization, anomaly rollback, and metric reporting within the training loop. Completing 400 stable consecutive updates is, in essence, the result of this loop executing correctly and continuously in a cross-node environment.

    3. Six Engineering Practices for Multi-Node Stability

    Dual-node, 16-GPU training may seem modest in scale, but it already exhibits the typical complexity of cross-node training: intra-node and inter-node communication coexist, parameter sharding is coupled with gradient synchronization, and a single point of failure can affect the entire job. To keep training running continuously and stably, you need engineering design in the following six areas.

    1. Communication Topology and Compute Overlap

    Cross-node communication is often the main bottleneck in multi-node training. The training system should arrange parameter sharding, gradient synchronization, and communication groups based on intra-node high-bandwidth interconnects and inter-node network capacity. For sharded data parallelism, gradient synchronization can overlap with backward computation to reduce waiting time. In implementation, avoid having all processes communicate at the same moment, which causes network congestion.

    2. Memory and Sharding Balance

    Different branches of a multimodal model vary significantly in parameter count and activation size, so naive layer-by-layer sharding can skew memory usage. Sharding should consider parameter scale, activation footprint, and optimizer states together, with per-device memory monitored throughout training. Unbalanced memory not only reduces the effective batch size but can also trigger local overflow and break continuous training.

    3. Numerical Stability and Gradient Health Checks

    In large model training, mixed precision, loss scaling, and gradient accumulation all introduce numerical risks. The system should periodically check loss values, gradient norms, and parameter update magnitudes, and roll back or adjust promptly when non-finite values are detected. Keeping loss and gradient norms finite across 400 consecutive steps indicates that the numerical health checks and update strategy are effective within the scope of this experiment.

    4. Failure Detection and Resumption from Checkpoints

    In multi-node training, a single abnormal process can hang the entire job. You need communication timeouts, heartbeat detection, and process health checks, along with regularly saved consistent checkpoints. On recovery, model parameters, optimizer states, data loading progress, and random seeds must all be consistent to avoid abnormal loss curve fluctuations after restart.

    5. Observability

    Stable training depends on metric collection. Beyond loss and gradient norms, you should record per-step communication time, memory usage, compute throughput, data loading latency, and device utilization. Correlating abnormal metrics through logging services and monitoring alerts makes it fast to determine whether the bottleneck is data, communication, or numerical. When running in the cloud, general-purpose capabilities such as container platforms, object storage, logging services, and monitoring alerts—such as those offered by Baidu AI Cloud—can serve as reference components for training job scheduling, data persistence, and observability.

    6. Automated Configuration and Regression Validation

    Multi-node, multi-GPU training involves many configuration items: sharding strategy, communication groups, mixed precision settings, checkpoint intervals, and more. Manual configuration easily introduces inconsistencies. An engineering framework should provide configuration templates, pre-launch self-checks, in-training health checks, and post-training reports, and use small-scale regression cases to validate model loading, gradient synchronization, and recovery flows.

    4. Layered Engineering Framework: From Fast Inference Deployment to Full-Pipeline Training

    This adaptation emphasized not just the training job itself but a mature engineering framework. The supporting capabilities can be organized into five layers:

    • Operator adaptation layer: Covers commonly used operators in cutting-edge models, ensuring multimodal architectures execute correctly on fully functional domestic GPUs, with performance optimization for hot operators.
    • Parallel training layer: Provides parameter sharding, data sharding, gradient synchronization, mixed precision, and checkpoint management to support cross-node joint training.
    • Scheduling and resource layer: Handles multi-node job launch, device allocation, process orchestration, and failure isolation, ensuring training jobs can be deployed reproducibly.
    • Toolchain layer: Provides configuration generation, pre-launch self-checks, performance profiling, log aggregation, and regression testing tools to reduce manual tuning costs.
    • Operations and monitoring layer: Collects training and system metrics, supporting alerting, auditing, and resumption from checkpoints.

    This layering shows that fast inference deployment and full-pipeline stable training are not separate endeavors. Inference deployment validates operator coverage and model loading, while training adaptation further validates gradient synchronization, optimizer states, and long-duration runtime stability. Together, they form the engineering foundation for supporting cutting-edge, complex models.

    5. From Single-Model Adaptation to Multi-Scenario Adoption

    On the training side, these capabilities have been validated across multiple scenarios: completing full from-scratch training of a hundred-billion-parameter scientific foundation model; supporting full-stack native training of a high-dimensional world model; completing end-to-end training of an embodied brain model; and currently advancing training of a trillion-parameter large model. The common threads in these scenarios are complex model architectures, long training cycles, and demanding requirements for stability and recoverability.

    Scientific foundation models emphasize numerical stability and data mixing in from-scratch training; high-dimensional world models involve multimodality, spatiotemporal sequences, and large-scale state modeling; embodied brain models require coordinated training of perception, decision-making, and language capabilities. Different scenarios demand different sharding strategies, communication patterns, and checkpoint frequencies, but all rely on the same training pipeline: the model can load, parameters can be sharded, gradients can be synchronized, states can be recovered, and metrics can be observed. Only by distilling single-model adaptation into general engineering capability can rapid migration across scenarios be supported.

    6. Toward “Train Out of the Box” with an Automated Toolchain

    Moving from “can train” to “train out of the box” is fundamentally about reducing the manpower and uncertainty of training adaptation. Three areas need continued refinement: first, operator adaptation and model architecture coverage to reduce manual code changes; second, multi-GPU coordination and communication optimization, making sharding strategies, communication groups, and compute overlap more automated; third, an automated toolchain covering pre-launch environment checks, in-training health checks, automatic anomaly rollback, performance bottleneck analysis, and regression testing.

    For developers evaluating a domestic GPU training solution, don’t just look at single-GPU compute or single-step latency—focus on the stability of the complete pipeline: Can it update continuously? Can it synchronize across nodes? Can it recover after a failure? Does it provide observable metrics? Can configurations be distilled into templates? The dual-node, 16-GPU run with 400 consecutive stable updates is one concrete validation of training pipeline engineering. For trillion-parameter models and more multimodal scenarios, continued iteration on operators, communication, scheduling, and tooling is still needed. Stable training is not a single-point capability—it is the synthesis of system-level capability.