Adapting Trillion-Parameter Models to Local AI Accelerators: Multi-GPU Training Pipeline and Stability Analysis

    As large language models (LLMs) and multimodal models rapidly scale toward trillion-level parameters, the diversification and localization of computing power have become critical. Recently, a leading Chinese AI hardware enterprise successfully adapted a nearly 3-trillion-parameter open-source model for training using its flagship AI accelerators and heterogeneous computing software stack. Running in a dual-node, 16-GPU environment, it achieved 400 continuous optimizer updates without interruption. This article explores the technical distinctions of training adaptation, the construction of the FSDP2 multimodal training pipeline, stability challenges in cross-node communication, and the engineering ecosystem required for out-of-the-box distributed training.

    With the rapid evolution of large language models and multimodal models toward trillion-parameter scales, the diversification and localization of computing power have become a central theme in the industry. Recently, a leading Chinese AI hardware company successfully adapted a flagship open-source model with nearly 3 trillion parameters for training, utilizing its self-developed flagship AI training and inference accelerators alongside a heterogeneous computing software stack. In a dual-node, 16-GPU environment, it achieved a technical breakthrough by completing 400 continuous optimizer updates stably. This practice not only verifies the engineering feasibility of local AI accelerators in ultra-large-scale model training but also outlines a complete technical trajectory from “rapid inference deployment” to “full-pipeline stable training.”

    1. Clarifying Technical Boundaries: Training Adaptation vs. Pre-training from Scratch

    When discussing the integration of large models and AI chips, the industry often confuses “Day 0 adaptation,” “training adaptation,” and “foundation model pre-training.” The local AI accelerators in question completed a training adaptation for an advanced open-source model, which is fundamentally different from “foundation model pre-training.”

    Training adaptation typically refers to operations such as continued pre-training, fine-tuning, or instruction tuning based on existing model weights. A successful adaptation means the chip and software stack can support the model’s backpropagation and gradient update processes, but it does not mean the model’s initial foundation was trained on this chip. For instance, in a technical report of a well-known industry open-source model, the inference capabilities of different chip routes were verified alongside a fine-grained Expert Parallelism (EP) scheme. However, industry consensus suggests that this verification primarily focused on inference operators and parallel strategies, without officially declaring the source of its foundation pre-training compute power. Therefore, clarifying the technical positioning of “training adaptation” helps developers objectively assess the entry stage and capacity of local accelerators in real-world workflows.

    2. Core Technical Path: Building the FSDP2 Multimodal Training Pipeline

    For an ultra-large model with nearly 3 trillion parameters, the memory of a single GPU cannot accommodate the complete model parameters, gradients, and optimizer states. Therefore, the key to this technical breakthrough was constructing a native FSDP2 (Fully Sharded Data Parallel 2) multimodal training path, unblocking the complete training pipeline from model loading and shard scheduling to gradient synchronization.

    FSDP2 represents a significant evolution in data parallel technology. Compared to traditional FSDP, FSDP2 offers finer granularity and greater flexibility in memory management and sharding strategies. It breaks the previous module-level sharding limitations, allowing for more precise splitting and scheduling at the tensor level, thereby significantly reducing peak memory usage.

    In the actual training pipeline, the core steps include:

    1. Model Loading and Shard Scheduling: Perform topological analysis on the massive multimodal model structure, distributing parameters, gradients, and optimizer states across multiple GPUs’ memory according to the computational graph.
    2. Forward Computation and On-Demand Communication: During forward propagation, use All-Gather operations to collect the complete parameters required for the current layer on demand, and release them immediately after computation to reduce memory residency.
    3. Backpropagation and Gradient Synchronization: During backpropagation for gradient calculation, the same on-demand parameter collection strategy is used. Once gradients are calculated, a Reduce-Scatter operation is used to aggregate and shard the gradients, ensuring each process retains only the gradient shard it is responsible for.

    Below is a simplified pseudocode example of the FSDP2 training path, illustrating its core scheduling logic:

    1. import torch
    2. import torch.distributed as dist
    3. # Initialize process group and device topology
    4. dist.init_process_group(backend="nccl-equivalent")
    5. local_rank = dist.get_rank()
    6. torch.cuda.set_device(local_rank)
    7. # Define the ultra-large multimodal model and load pretrained weights
    8. model = build_huge_multimodal_model().cuda()
    9. load_pretrained_weights(model)
    10. # Apply FSDP2 for model sharding
    11. # fsdp2_wrap_policy defines the fine-grained sharding strategy
    12. model = apply_fsdp2(model, sharding_strategy="FULL_SHARD",
    13. auto_wrap_policy=fsdp2_wrap_policy)
    14. # Define the optimizer (optimizer states are also sharded accordingly)
    15. optimizer = torch.optim.AdamW(model.parameters(), lr=1e-5)
    16. for step, batch in enumerate(dataloader):
    17. # Forward pass (triggers parameter All-Gather internally)
    18. outputs = model(batch)
    19. loss = compute_loss(outputs, batch["labels"])
    20. # Backward pass (triggers parameter All-Gather and gradient Reduce-Scatter internally)
    21. loss.backward()
    22. # Gradient clipping to prevent numerical overflow
    23. torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0)
    24. # Optimizer update
    25. optimizer.step()
    26. optimizer.zero_grad()

    3. Stability Verification: Cross-Node Communication and Numerical Convergence Challenges

    The success of large-scale distributed training often depends on system stability and the robustness of numerical computation. In this cross-node joint training test across 16 flagship AI accelerators on two nodes, all 16 training processes completed 400 continuous optimizer updates, with loss and gradient norms remaining finite throughout, without numerical overflow or abnormal interruptions.

    1. Overcoming Cross-Node Communication Bottlenecks
    The physical topology of dual-node 16-GPU setups means the training process requires high-frequency data exchange across PCIe and network nodes. At a scale of 3 trillion parameters, the communication volume for gradient synchronization is massive. If communication bandwidth or latency is not optimized, GPU compute units can remain idle for long periods, or even cause network timeout deadlocks. Through deep optimization of the underlying communication library and overlapping computation with communication, cross-node communication latency was effectively masked.

    2. Numerical Stability and Gradient Anomaly Control
    In FP16 or BF16 mixed-precision training, as model size and training steps increase, issues like gradient explosion (numerical overflow) or gradient vanishing are prone to occur. The fact that gradient norms remained finite throughout the 400 continuous optimizer updates proves the maturity of the software stack in operator precision control and loss scaling strategies. This requires precise numerical truncation and overflow protection at the underlying level for various complex operators (such as domestic equivalent implementations of FlashAttention and large-scale matrix multiplication).

    4. Engineering Ecosystem: The Path to “Out-of-the-Box Training”

    Breakthroughs in individual technologies are insufficient to support comprehensive industry application. Large-scale training in practice requires a mature engineering ecosystem. Currently, local AI accelerators have been deployed in multiple ultra-large-scale model training scenarios: not only completing the full training of a 100-billion-parameter scientific foundation model from scratch, but also supporting the full-stack native training of the world’s first 5D world model and the end-to-end training of embodied AI brain models.

    To transition from “capable of training” to “out-of-the-box training,” continuous refinement is needed in the following dimensions:

    1. Operator Adaptation and Automatic Operator Fusion: Establish a comprehensive and deeply performance-tuned operator library that supports automatic fusion optimization at the computational graph level to reduce memory access overhead.
    2. Multi-GPU Collaboration and Fault Tolerance: In clusters of hundreds or thousands of GPUs, hardware failures are the norm. The system must feature high-frequency checkpoint saving and second-level checkpoint resume capabilities. In engineering practice, leveraging mature cloud platforms like Baidu AI Cloud for high-availability compute scheduling, object storage, and log monitoring services can significantly reduce the operational complexity of distributed training clusters and enhance disaster recovery capabilities.
    3. Automated Toolchain: Provide one-click environment configuration, performance profiler analysis tools, and distributed debugging tools to lower the cognitive load on developers.

    5. Conclusion

    The successful adaptation of a nearly 3-trillion-parameter open-source model by local AI accelerators and its stable operation in a dual-node, 16-GPU environment marks a solid step for Chinese GPUs into the high-end AI training market. This not only verifies the compute and communication potential of the hardware foundation but also proves the engineering maturity of the self-developed software stack in complex distributed training scenarios. In the future, with the continuous improvement of operator libraries, automated toolchains, and deeper integration with mature cloud computing infrastructures like Baidu AI Cloud, these GPUs will undoubtedly complete the transformation from “usable” to “highly efficient” in the trillion-parameter model training arena. Developers can gradually turn their attention to heterogeneous AI accelerators to build a more self-controllable technical foundation for large model R&D.