Technical Practices for Adapting Domestic AI Accelerators to Train Ultra-Large Open-Source Models

    The recent release of a 2.8-trillion-parameter open-source LLM has set a new milestone, making it crucial to understand how to train such models on domestic AI accelerators. This article explores the technical practices of adapting domestic general-purpose GPUs and proprietary software stacks to enable a complete training workflow. It addresses core challenges such as the memory wall, communication efficiency, and numerical stability, while detailing key solutions including a native FSDP2 implementation, sharding and prefetching strategies, multimodal training pathways, and software stack ecosystem adaptation. It also provides engineering insights for developers and enterprises to plan and optimize their large-scale training infrastructure.

    1. Background: The Intersection of Open-Source Ultra-Large Models and Domestic AI Accelerators

    Recently, a flagship open-source large language model with a parameter scale of 2.8 trillion was officially released to the community, marking a new milestone for open-source models in terms of scale. Simultaneously, adaptation work based on domestic general-purpose GPU accelerators and proprietary software stacks has been completed, successfully打通 a complete training pipeline from model loading and shard scheduling to gradient synchronization.

    This event reflects two major trends. First, the open-source community is continuously driving the democratization of ultra-large parameter models, enabling more institutions to conduct secondary training and capability alignment based on open-source weights. Second, domestic AI computing power is evolving from being “usable for inference” to “usable for training,” with hardware-software collaboration becoming the key benchmark for assessing the maturity of domestic accelerators.

    For developers and enterprise technical teams, understanding the technical details of adapting such ultra-large models for training helps in planning training schemes and evaluating infrastructure bottlenecks within their own computing environments.

    2. Core Challenges in Training Ultra-Large Models

    2.1 The Memory Wall

    A model with 2.8 trillion parameters requires several terabytes of memory space just to store the model weights, even when using common mixed-precision formats like BF16. This far exceeds the capacity of a single accelerator or even a single node. Furthermore, the training process requires additional memory for:

    • Optimizer States: Taking the Adam optimizer as an example, each parameter requires storing the first moment, second moment, and a master weight copy. The memory overhead is typically several times that of the weights themselves.
    • Gradient Cache: Gradients generated during backpropagation must reside in memory until synchronization and updates are completed.
    • Activations: Depending on the sequence length and batch size, activations in long-context scenarios can become the primary memory bottleneck.

    2.2 Communication and Scaling Efficiency

    When a model is partitioned across hundreds or thousands of accelerators, the time consumed by collective communications—such as inter-layer activation passing and gradient all-reduce/all-gather operations—increases significantly. If communication bandwidth is insufficient or operator scheduling is suboptimal, the cluster’s linear speedup ratio will degrade rapidly.

    2.3 Numerical Stability and Convergence Quality

    Ultra-large-scale training is highly sensitive to numerical precision, loss spikes, and gradient explosion/vanishing. It requires a careful combination of initialization strategies, gradient clipping, learning rate scheduling, and mixed-precision management.

    2.4 Fault Tolerance and Elasticity

    Training cycles often span several weeks, making hardware failures and node drops inevitable. The ability to save and restore checkpoints, along with elastic scaling capabilities, directly determines the effective output time of a training task.

    3. Analysis of Key Technical Solutions

    3.1 Fully Sharded Data Parallel (FSDP)

    A major highlight of this adaptation work is the construction of a native FSDP2 training path. The core idea of FSDP is to fully shard model parameters, gradients, and optimizer states across all training processes, aggregating them on-demand and releasing them immediately after use. This compresses the memory footprint of a single accelerator from a “full model” down to a “model shard + temporary aggregation.”

    Compared to early FSDP implementations, the new-generation solution typically features the following improvements:

    1. Finer Sharding Granularity: Supports sharding at different granularities, such as by parameter or by Transformer layer, to balance memory savings against communication overhead.
    2. Native Construction Instead of Wrapping: Initializes the model in a sharded manner directly during the model building phase, avoiding the memory peak during initialization that occurs when instantiating the full model before sharding.
    3. Deep Coordination with Mixed Precision: Uses low precision for computation and high-precision master weights for updates, balancing speed with stability.

    3.2 Sharding Scheduling and Prefetching Strategies

    In the training pipeline, sharding scheduling determines “when to aggregate and when to release.” Common practices include:

    • Forward Prefetching: Asynchronously prefetches the parameter shards for layer N+1 while computing the forward pass for layer N, thereby hiding communication latency.
    • Immediate Backward Release: After backpropagation completes for a layer, the aggregated parameters for that layer are immediately released, retaining only the gradient shards.
    • Compute-Communication Overlap: Utilizes asynchronous streams to overlap gradient synchronization with the computation of subsequent layers.

    A schematic pseudocode is as follows:

    1. for layer in model.layers:
    2. with prefetch(layer.next):
    3. params = all_gather(layer.shard_params) # Aggregate the parameter shards
    4. output = layer.forward(x, params)
    5. x = output
    6. loss.backward() # Compute gradients and perform reduce-scatter during backpropagation
    7. free_full_params(layer) # Release the aggregated copy

    3.3 Enabling the Multimodal Training Path

    The adaptation work mentioned the construction of a multimodal training path, meaning the training framework must handle heterogeneous inputs such as text and images simultaneously. Technically, this requires addressing:

    • Unified Data Pipeline: Samples from different modalities differ significantly in serialization, tokenization, and sampling strategies, requiring a unified batching and packing mechanism.
    • Parallel Strategies for Heterogeneous Modules: Vision encoders and language model backbones may be suited for different parallelism approaches (e.g., data parallelism for the former, combined with tensor parallelism for the latter), necessitating flexible parallel configurations.
    • End-to-End Gradient Flow: Ensuring that gradients are correctly passed back across modal modules, and that mixed-precision conversions do not introduce numerical error accumulation.

    3.4 Ecosystem Adaptation of the Software Stack

    For domestic AI accelerators to support complete training, the software stack must cover multiple layers, including operator libraries, compilation optimization, distributed communication libraries, and containerized runtime environments. The key lies in compatibility with mainstream training frameworks: model definitions, parallel APIs, and checkpoint formats should align with the mainstream open-source ecosystem as much as possible to reduce migration costs. This is the practical value of the adaptation work—enabling open-source models to be “trainable out of the box” rather than requiring massive rewrites of training code.

    4. Insights for Enterprises and Developers

    1. Training Adaptation is Essentially a Systems Engineering Problem: From operator coverage and communication library efficiency to scheduler fault tolerance, a weak link in any area will drag down the whole. When evaluating a computing platform, one should look at the complete pipeline rather than single-point peak compute power.
    2. Combine Memory Optimization Strategies: FSDP, activation recomputation, gradient checkpointing, and CPU-offload each have their pros and cons. They should be combined and tuned based on model size and cluster topology.
    3. Open-Source Ultra-Large Models Lower the Barrier to Weights, Not Engineering: Having open-source weights is just the starting point. The accompanying data engineering, parallel strategy tuning, and stability assurance remain the primary workload.
    4. Portability Design in the Era of Heterogeneous Compute: It is recommended to abstract device and communication interfaces in the training code to avoid deep coupling with specific hardware, enhancing the ability to migrate across different computing environments.

    5. Conclusion

    The open-sourcing of a 2.8-trillion-parameter model and the completion of its training adaptation reflect the collaborative evolution direction of “open-source models + heterogeneous computing.” For technical teams, paying attention to the evolution of distributed training paradigms like FSDP, the construction of software stack compatibility, and the engineering capabilities of the entire training pipeline provides more long-term value than chasing a single metric. In the future, as collaborative optimization between training frameworks and hardware deepens, the training of ultra-large models will gradually transition from “a capability exclusive to a few players” to “a reproducible, migratable engineering practice.”