Integrating LLM Training Pipelines on Domestic Heterogeneous Computing Platforms: A Dual-Node Multi-Accelerator Practice

    As large language model (LLM) parameters scale exponentially, the demand for underlying computing power surges. Over-reliance on a single type of hardware introduces cost pressures and supply chain risks. This article explores how to integrate LLM training pipelines on domestic heterogeneous computing platforms. It details the adaptation of compute backends, mixed precision training support, the design of a dual-node 16-accelerator distributed architecture, and the optimization of collective communication. Finally, it analyzes a 400-step iterative training validation, verifying the correctness, communication efficiency, and memory management of the integrated solution.

    As large language model (LLM) parameters scale exponentially, the demand for underlying computing power surges sharply. Over-reliance on a single type of computing hardware not only brings cost pressures but also increases supply chain risks. Therefore, building a diversified computing foundation, especially completing 100-billion-level LLM training on domestic heterogeneous computing platforms, has become a key technical focus in the industry. This article provides an in-depth analysis of how domestic heterogeneous computing power integrates the LLM training pipeline and completes an engineering practice of hundreds of iterations based on a dual-node 16-accelerator architecture.

    1. Heterogeneous Computing Adaptation and Training Pipeline Integration

    Running LLM training on heterogeneous hardware presents the primary challenge of connecting the complete pipeline from the deep learning framework down to the underlying hardware. This is not merely a simple interface replacement but a comprehensive adaptation involving compute graph compilation, operator library construction, and memory management.

    1.1 Operator Library and Compute Backend Adaptation
    Mainstream deep learning frameworks (like PyTorch) typically accelerate based on underlying operator libraries specific to certain hardware architectures. On domestic heterogeneous platforms, a custom compute backend compatible with standard operator interfaces must be developed. For key operators common in large models, such as Attention, LayerNorm, and GeLU, hand-written assembly-level optimization is required to fully utilize the underlying hardware’s compute units (like matrix compute engines). Concurrently, a custom operator registration mechanism must be implemented to ensure the framework correctly routes to the heterogeneous hardware’s operator implementation during compute graph construction.

    1.2 Mixed Precision Training Support
    LLM training typically utilizes BF16 or FP16 mixed precision to increase compute throughput and reduce memory footprint. Heterogeneous platforms must natively support the storage and computation of these low-precision data types. During adaptation, it is necessary to ensure that the underlying hardware’s accumulators have sufficient precision protection to prevent numerical overflow or underflow during gradient updates.

    1. # Example code: Mixed precision training configuration for custom backend
    2. from custom_accelerator import amp
    3. scaler = amp.GradScaler(enabled=config.use_fp16)
    4. for step, batch in enumerate(dataloader):
    5. with amp.autocast(enabled=config.use_fp16):
    6. outputs = model(batch)
    7. loss = loss_fn(outputs, batch.labels)
    8. scaler.scale(loss).backward()
    9. scaler.step(optimizer)
    10. scaler.update()

    2. Dual-Node Multi-Accelerator Distributed Architecture Design

    This practice adopts a dual-node 16-accelerator (8 accelerators per node) topology. Validating distributed training capabilities in a limited-scale cluster is a necessary step toward larger 1,000-accelerator clusters.

    2.1 Parallelism Strategy Selection
    For models with tens to hundreds of billions of parameters, the memory of a single accelerator cannot accommodate the full model parameters, gradients, and optimizer states. Therefore, a 3D parallelism strategy (Data Parallelism, Tensor Parallelism, Pipeline Parallelism) is required. In a dual-node 16-accelerator environment, Tensor Parallelism (TP) is typically restricted within the single-node 8 accelerators to reduce communication latency using the intra-node high-speed interconnect bus. Meanwhile, Data Parallelism (DP) or Pipeline Parallelism (PP) is adopted across the two nodes. This nested strategy maximizes intra-node bandwidth utilization and reduces cross-node network communication pressure.

    2.2 Collective Communication Optimization
    The bottleneck of multi-node multi-accelerator training often lies in communication. Since domestic heterogeneous platforms cannot directly use traditional closed-source collective communication libraries, a communication middleware compatible with standard MPI and NCCL interfaces must be ported or developed. At the dual-node interconnection level, it is recommended to use a RoCEv2 (RDMA over Converged Ethernet) network with SmartNICs to offload CPU load. The communication library requires topology-aware optimization for high-frequency operations like All-Reduce and All-Gather, such as using Ring or Tree algorithms, and dynamically adjusting slice sizes based on the intra-node and inter-node bandwidth ratio to achieve overlap between computation and communication.

    3. Large-Scale Training Stability and Engineering Assurance

    LLM training is a long-tail task. During the validation of 400 iterations on the dual-node 16-accelerator setup, stability engineering is key to ensuring the pipeline is genuinely “running through.”

    3.1 Fault Tolerance and Checkpoint Resume Mechanism
    During training, occasional hardware failures or gradient anomalies can cause task interruptions. The system must have a high-frequency checkpoint saving mechanism. To prevent the saving process from blocking training, an asynchronous saving strategy is typically adopted to persist optimizer states, model parameters, and random number states to a distributed file system. Leveraging general cloud components, such as object storage, can further enhance the read/write throughput of massive checkpoints, ensuring fast recovery for checkpoint resume.

    3.2 Monitoring and Logging System
    In a dual-node environment, it is necessary to monitor the power consumption, memory usage, temperature, and network throughput of each accelerator in real-time. By building a unified logging service, training logs from each node are collected. When a node encounters anomalies like NCCL timeout or CUDA Error, the monitoring and alerting system can immediately capture them and trigger automatic restart or node isolation strategies, ensuring high availability of the cluster.

    4. Practice Validation: 400-Step Iterative Training Analysis

    After completing the pipeline integration and architecture design, the dual-node 16-accelerator cluster successfully completed an end-to-end training validation of 400 iterations. This result carries significant engineering meaning:

    1. Compute Correctness Validation: 400 iterations are sufficient for the Loss curve to show a clear downward trend, proving that the forward computation and backward propagation logic of the underlying heterogeneous operators are completely correct, and the numerical precision meets expectations.
    2. Communication Non-blocking Validation: During the dual-node interaction process, no training stagnation occurred due to collective communication deadlocks or bandwidth bottlenecks. The computation and communication overlap strategy effectively improved the overall MFU (Model FLOPs Utilization).
    3. Memory Management Validation: Under mixed precision and 3D parallelism strategies, the 16 accelerators smoothly passed the peak period of memory allocation without OOM (Out of Memory) errors, proving that the interaction between the underlying memory allocator and the framework memory pool is healthy.

    5. Summary and Outlook

    Integrating the LLM training pipeline based on domestic heterogeneous computing platforms and successfully completing hundreds of iterative training steps on a dual-node 16-accelerator setup marks a solid step forward for diversified computing in supporting complex AI workloads. From operator-level adaptation to distributed communication optimization, and to system-level stability assurance, this is a complex system engineering project. In the future, as underlying drivers and communication libraries mature, heterogeneous computing platforms will gradually evolve toward larger 1,000- and 10,000-accelerator clusters. Combined with the elastic scheduling capabilities of container platforms and cloud-native AI infrastructure, developers will be able to conduct LLM R&D at lower costs and higher efficiency, further promoting the popularization and autonomous development of AI technology.