Validating the Large Model Training Pipeline on Domestic AI Accelerators

    This article details the comprehensive validation process for running large model training pipelines on domestic AI accelerator cards. It covers the complete technical link from hardware compatibility to distributed multi-node execution, outlining progressive validation strategies, stability checks, and common troubleshooting methods for achieving a reliable and reproducible training environment.

    I. Validation Background and Goals

    Large model training relies not only on single-card computing power but also on various components, including computing devices, driver runtimes, communication components, deep learning frameworks, model code, data pipelines, and monitoring systems. Compatibility issues at any layer can lead to training failures, throughput drops, out-of-memory (OOM) errors, or anomalies after running for several steps.

    The core objective of this validation is not merely to test the theoretical performance of a single accelerator card, but to confirm whether a domestic accelerator computing environment can fully support a large model training pipeline. The validation scope includes:

    1. Whether the single-card and single-node environments can correctly execute forward, backward, and parameter updates;
    2. Whether stable and correct communication connections can be established between multiple cards;
    3. Whether data parallel or hybrid parallel logic operates correctly in dual-node multi-card scenarios;
    4. Whether the model, optimizer, gradient synchronization, and checkpoint saving functions remain consistent;
    5. Whether the training task can continuously complete hundreds of steps and yield a reproducible loss trend;
    6. Whether issues can be quickly located through logs, monitoring, and minimal testing when anomalies occur.

    From an engineering perspective, completing hundreds of training steps is far more valuable than simply ensuring the “program can start.” It exposes issues that are hard to detect in short-term tests, such as communication timeouts, gradual memory growth, inconsistent random number states, data loading blockages, and specific operator failures under certain inputs.

    II. Overall Technical Pipeline

    A complete training pipeline can typically be abstracted into the following layers:

    1. Training scripts and model code
    2. │
    3. Deep learning frameworks and distributed runtimes
    4. │
    5. Accelerator compiler, runtime, and operator libraries
    6. │
    7. Device drivers and communication components
    8. │
    9. Operating system, network, and storage infrastructure

    Building on this, training tasks also require supporting capabilities like datasets, configuration management, log collection, metric monitoring, and checkpoint management.

    The basic workflow for dual-node multi-card training is as follows:

    1. Read configuration
    2. ↓
    3. Initialize process group
    4. ↓
    5. Establish inter-node communication
    6. ↓
    7. Load model and shard parameters
    8. ↓
    9. Read batch data
    10. ↓
    11. Execute forward computation
    12. ↓
    13. Calculate loss and backpropagation
    14. ↓
    15. Synchronize gradients
    16. ↓
    17. Update parameters and record metrics
    18. ↓
    19. Save checkpoint or proceed to the next step

    Among these, the “synchronize gradients” step is the most easily overlooked. Single-node training only needs to focus on device memory and computation execution, while multi-node training must ensure that different processes complete communication at the same stage. If any process exits prematurely, reads data too slowly, or takes significantly longer to execute an operator, other processes may be left in a waiting state.

    III. Environment Preparation and Compatibility Checks

    1. Fixed Software Versions

    The training environment should ideally be managed reproducibly. Before starting a task, it is recommended to record the following information:

    • Operating system version
    • Accelerator driver version
    • Device runtime version
    • Compiler and operator library versions
    • Deep learning framework version
    • Distributed communication component version
    • Python and dependency package versions
    • Model code commit version
    • Dataset and configuration file checksums

    Version information should not just be recorded in manual documents; it is best automatically collected by scripts and written to the training output directory. This ensures that when issues arise, you can quickly determine whether they are caused by code, environment, or data changes.

    2. Check Device Visibility

    Before launching a distributed task, confirm that each node can recognize the expected number of accelerator devices and check if the device numbering is stable. Common issues include:

    • Containers unable to see host devices
    • Inconsistent device numbering mappings across different nodes
    • Some devices in an abnormal state
    • Insufficient remaining device memory
    • Multiple tasks unexpectedly occupying the same card

    It is recommended to run a minimal device detection program first, followed by a single-card matrix multiplication test, memory allocation test, and a simple backpropagation test. Only proceed to the multi-card validation phase after basic computation is proven stable.

    3. Verify Inter-Node Network

    Dual-node training has high requirements for network connectivity and stability. In addition to confirming that nodes can access each other, you should also check:

    • Whether communication ports are open
    • Whether the master node address is accessible to all processes
    • Whether inter-node latency and bandwidth meet expectations
    • Whether firewalls or security policies actively terminate long connections
    • Whether network interfaces are experiencing packet errors or drops
    • Whether hostname resolution results are consistent

    Network issues often manifest as long unresponsiveness during training initialization or communication timeouts after a certain step. Therefore, network status should be continuously monitored alongside system monitoring, not just checked once before task launch.

    IV. Progressive Validation: From Single-Card to Dual-Node Multi-Card

    Directly launching dual-node multi-card training increases the difficulty of problem localization. A more reasonable approach is a progressively scaling validation strategy.

    Phase 1: Single-Card Validation

    Single-card testing primarily confirms that the model itself can run on the target device. It should cover:

    • Model initialization
    • Forward computation for a batch of data
    • Loss calculation
    • Backpropagation
    • Optimizer update
    • Mixed precision or low precision computation
    • Memory changes in a single step

    If unsupported operators, data type mismatches, or out-of-memory errors occur during the single-card phase, prioritize resolving these basic compatibility issues rather than increasing the number of devices.

    Phase 2: Single-Node Multi-Card Validation

    Single-node multi-card validation mainly verifies intra-device communication and process management. This phase focuses on:

    • Whether each process is bound to the correct device
    • Whether the global batch is correctly split according to the number of devices
    • Whether parameters across processes remain consistent after gradient synchronization
    • Whether the data sampler prevents different processes from reading the same samples
    • Whether resources are correctly reclaimed when processes exit

    After a few training steps, compare key parameters or gradient summaries across processes. If the difference exceeds floating-point error ranges, it usually indicates issues with data partitioning, random number control, or synchronization logic.

    Phase 3: Dual-Node Multi-Card Validation

    Entering dual-node multi-card requires additional confirmation of the global process count, node rank, process rank, and communication initialization parameters. It is recommended to clearly document the launch configuration, for example:

    1. Number of nodes: 2
    2. Devices per node: 8
    3. Global process count: 16
    4. Devices bound per process: 1
    5. Data parallel size: Consistent with the global process count

    The values here only represent the organizational method in the validation scenario; actual configurations should be adjusted based on model size, memory capacity, and parallelization strategy.

    V. Training Stability and Result Verification

    Completing hundreds of training steps requires looking beyond whether the task process is still alive; a multi-dimensional verification mechanism must be established.

    1. Loss Curve

    Under the same data, random seed, and effective batch size, the loss should exhibit a reasonable trend. If the loss suddenly becomes infinity or NaN, common causes include:

    • Learning rate too high
    • Mixed precision overflow
    • Gradient clipping not taking effect
    • Insufficient numerical stability of a specific operator
    • Inconsistent data or parameter states across processes

    Note that loss fluctuations in distributed training do not necessarily indicate an error; they should be evaluated alongside the effective batch size, gradient norm, and learning rate.

    2. VRAM and System Memory

    During training, continuously observe device VRAM, host memory, and cache growth. If VRAM continuously rises with each step, it may indicate:

    • The computation graph is not released
    • Logs are saving unnecessary tensors
    • Checkpoint cache is not cleared
    • Data prefetch queue is too large
    • Abnormal lifecycles of certain temporary objects

    Dual-node tasks should also monitor whether resources are balanced across nodes. If one node’s VRAM or memory is significantly higher than others, it may indicate deviations in data sharding, process binding, or model loading strategy.

    3. Communication and Throughput

    Training throughput should be evaluated using the average during stable operation, rather than instantaneous data during the startup phase or before caches are established. You can record:

    • Time per step
    • Data loading time
    • Forward and backward time
    • Gradient synchronization time
    • Device utilization
    • Network send and receive volume
    • Idle wait ratio

    If computation time is short but communication time accounts for a high proportion, consider optimizing the communication topology, gradient bucketing, batch size, or parallelization strategy. If data loading becomes a bottleneck, start by addressing storage throughput, prefetch depth, and data preprocessing methods.

    VI. Common Issues and Troubleshooting

    1. Stuck During Initialization

    First, check if the master node address, port, total process count, and node rank are consistent, then confirm network access permissions for each node. If logs only show output from some processes, it usually means certain processes failed to join the communication group successfully.

    2. Communication Timeout During Operation

    Differentiate between network anomalies and compute anomalies in a specific process. Compare the last log entry of each process: if a process has not entered the synchronization phase for a long time, it may have encountered a data reading block, an operator execution anomaly, or device frequency throttling.

    3. Inconsistent Multi-Card Results

    Check the random seed, data sampler, global batch calculation, gradient synchronization, and parameter update order in sequence. In particular, avoid situations where every process reads the exact same data while mistakenly assuming effective data parallelism has been achieved.

    4. Out of Memory After Dozens of Steps

    Save VRAM snapshots every few steps to observe whether the growth is linear, staircase-like, or sudden. Linear growth is usually related to unreleased objects; staircase growth may be related to caching strategies; sudden growth may be triggered by a special batch creating larger temporary tensors.

    5. Task Runs but Speed is Unstable

    Time data loading, computation, communication, and synchronization waiting separately. Simply looking at device utilization cannot explain all problems, as devices may briefly idle while waiting for data or communication. Only through phase-based timing statistics can you determine the optimization direction.

    VII. Future Scaling Recommendations

    Completing a few hundred steps of dual-node multi-card validation only proves that the basic training pipeline is runnable; further evaluation is needed before formal production. Future efforts can focus on the following areas:

    1. Expand the number of training steps to verify long-term operational stability;
    2. Increase coverage of data with different lengths, batches, and boundary cases;
    3. Test checkpoint resumption to ensure model, optimizer, and random states can be restored;
    4. Establish automated environment checks and regression testing;
    5. Compare throughput and VRAM usage under different parallelization strategies;
    6. Improve logging, monitoring, alerting, and fault recovery mechanisms;
    7. Formulate standardized images and configuration templates to reduce environment drift;
    8. Conduct reproducibility verification on training results to avoid focusing only on a single success.

    Overall, the key value of validating the large model training pipeline on a domestic accelerator computing environment lies in proving that a complete closed loop—from device recognition to distributed training, and from operator execution to result monitoring—has been established. By continuing engineering efforts around compatibility, stability, observability, and scale expansion, a one-time validation task can be progressively transformed into a reusable, maintainable model training infrastructure.