Adapting Domestic AI Computing Infrastructure for Trillion-Parameter Model Training: A Practice Guide

    This article examines the computational and engineering challenges of training ultra-large-scale models with trillions of parameters, and presents a practical adaptation case in which a fully sharded data parallel (FSDP2) multimodal training pipeline was built on domestic AI infrastructure. It covers hardware-software co-design, the engineering implementation of model loading, shard scheduling, and gradient synchronization, along with the resulting benefits and future directions such as heterogeneous computing scheduling, unified training-inference optimization, and automated parallelism search.

    1. Computational and Engineering Challenges in Training Ultra-Large-Scale Models

    As the parameter counts of large language models and multimodal models climb into the trillions, the core challenge for AI infrastructure has shifted from simply “stacking more compute” to “releasing compute efficiently.” Take an open-source model with 2.8 trillion parameters as an example: its training places extremely high demands on memory capacity, cross-node communication bandwidth, parallelism strategy design, and the maturity of the software stack.

    From a technical standpoint, once a model exceeds several hundred billion parameters, no single AI accelerator card or server can hold the model weights, optimizer states, and intermediate activations. The industry commonly adopts a combination of data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism under Mixture-of-Experts (MoE) architectures, partitioning the model across large-scale clusters. However, a more complex parallelism strategy is not necessarily better—there is a delicate trade-off between communication overhead and computational efficiency. For instance, tensor parallelism reduces per-card memory pressure but introduces high-frequency All-to-All communication; pipeline parallelism improves throughput but suffers from bubble overhead. Therefore, tailoring the parallelism scheme to the underlying hardware characteristics becomes the key determinant of training efficiency.

    Moreover, the engineering complexity of large-scale training is reflected in cluster stability and fault recovery. With thousands of accelerator cards running for extended periods, the probability of single-point failures rises significantly, requiring efficient checkpointing mechanisms and fault-tolerant scheduling as safeguards. Without fine-grained state management capabilities in the software stack, the time and economic costs of training interruptions become incalculable.

    2. Hardware-Software Co-Design: Building a Resilient and Efficient Training Foundation

    In addressing these challenges, hardware-software co-design has become an industry consensus. The hardware layer provides foundational compute and memory resources, while the software layer is responsible for efficiently mapping hardware capabilities into actual training throughput. In this adaptation practice, the core work centered on a flagship AI training-and-inference accelerator card and a self-developed full-stack software environment, with the goal of building a native Fully Sharded Data Parallel (FSDP2) multimodal training path on domestic infrastructure.

    FSDP2 is an advanced form of the data parallelism strategy. Unlike traditional data parallelism, FSDP2 shards all model parameters, gradients, and optimizer states, gathering full or partial parameters (All-Gather) only when needed. This design dramatically reduces the peak memory footprint on each compute device, making it feasible to deploy trillion-parameter models on distributed clusters. FSDP2 also natively supports flexible mixed-precision configurations, fully exploiting the low-precision compute power of new-generation accelerators while maintaining training stability.

    In this project, implementing FSDP2 was not a matter of simply calling existing interfaces—it required deep co-design with the underlying hardware. Specifically, the development team jointly optimized communication primitives and compute kernels: at the communication layer, the overlap strategy between prefetching and computation was carefully tuned to hide the latency of All-Gather and Reduce-Scatter; at the compute layer, operator implementations were customized for the accelerator’s arithmetic logic unit (ALU) architecture to eliminate unnecessary memory access overhead. This “software driving hardware, hardware optimizing software” approach effectively broke through the performance bottleneck that general-purpose distributed training frameworks face on heterogeneous hardware.

    3. Engineering Implementation of a Native FSDP2 Multimodal Training Path

    The main thread of this adaptation work was to establish the complete training pipeline of “model loading — shard scheduling — gradient synchronization.” These three stages are tightly interlocked; a breakdown in any one of them can cause the entire training job to fail or its efficiency to collapse.

    3.1 Model Loading: Fine-Grained Reorganization and Preprocessing

    For a model with 2.8 trillion parameters, the original weight file format is typically designed for generality rather than training efficiency. During model loading, the engineering team must perform format conversion, weight renaming, and shard mapping. Since the model contains both dense layers and sparse expert layers (in an MoE architecture), the loading process also needs differentiated memory layout strategies for different parameter types. The goal at this stage is to distribute model weights evenly across cluster nodes while minimizing random-access overhead in subsequent data reads, laying the data foundation for efficient shard scheduling.

    3.2 Shard Scheduling: Dynamic Planning and Resource Awareness

    Shard scheduling is the core execution engine of FSDP2. At this stage, the system performs online planning and dynamic partitioning based on the current cluster topology (such as NVLink domains and InfiniBand subnets) and remaining device memory. Horizontal assembly follows a matrix decomposition approach, splitting large parameter matrices into independently storable and computable sub-blocks; the sequence dimension must account for the heterogeneity of multimodal inputs (such as text and visual tokens), assigning them differentiated computation paths.

    Critically, scheduling must be online and adaptive. During training, the access frequency of parameters at different layers fluctuates, and a static strategy easily leads to local hotspots or idle resources. By introducing a self-developed fine-grained monitoring and scheduling module, the solution dynamically senses memory water-level changes across distributed clusters at the scale of tens of thousands of devices, guiding on-demand allocation of shares among compute nodes and avoiding the long-tail effects caused by data skew.

    3.3 Gradient Synchronization: Implementing a Low-Latency Communication Topology

    Gradient synchronization determines the convergence consistency and efficiency of multi-card training. At the end of this pipeline, the Reduce-Scatter operation reduces gradients across devices and distributes them to the corresponding shards. In conventional implementations, such operations are often constrained by communication topology congestion. In this practice, the engineering team reconstructed the logical topology of communication groups, optimizing ring-based All-Reduce into a tree-based hierarchical Reduce-Scatter. Combined with lossless network characteristics, communication message sizes were dynamically tuned into a more optimal range, significantly reducing synchronization latency.

    In addition, pipeline overlap between synchronization and backward computation is another key optimization point. Through fine-grained event orchestration, gradient computation and communication transfer proceed in a highly parallel fashion, effectively improving overall GPU utilization. In actual testing, this approach delivered noticeably higher end-to-end training throughput than conventional schemes, and the growth of communication overhead was kept within a reasonable range even as the cluster scaled to the thousand-card level.

    4. From Adaptation to Practice: Benefits and Industry Implications

    The outcome of this adaptation is more than getting a single model to run—it represents an important validation of domestic AI infrastructure’s capability to support frontier-scale model training. For enterprises and research institutions exploring trillion-parameter model training, its value lies in three areas:

    • Lowering the barrier to ultra-large-scale training: With this technical solution, enterprises can deploy FSDP2 strategies on domestic hardware without building a complex distributed training engine from scratch, focusing their efforts on model architecture innovation and business applications.
    • Improving infrastructure utilization efficiency: Through continuous refinement of sharding strategies and gradient synchronization, hardware compute is effectively maximized, achieving better training throughput within a limited budget and thereby reducing per-unit training costs.
    • Strengthening a critical piece of the domestic software ecosystem: This practice provides a valuable reference for the stability of domestic accelerators in ultra-large-scale cluster scenarios, communication library performance, and compatibility with mainstream parallelism strategies—advancing AI infrastructure from “usable” to “genuinely effective.”

    It is particularly worth emphasizing that, at the ecosystem level, this adaptation works through a general-purpose technology stack rather than being bound to a specific product. This means developers can freely schedule resources and build training systems tailored to their own business needs, as long as they conform to the interface specifications.

    5. Technical Outlook and Directions for Continued Evolution

    Although this training adaptation has achieved significant results, technical evolution is far from over. Looking ahead, the following directions are likely to become the focus of the next phase:

    First, heterogeneous compute fusion scheduling. Future AI clusters will inevitably feature accelerator cards from multiple vendors coexisting. How to achieve unified communication semantics and memory management in heterogeneous environments—and how to implement global parallelism strategies compatible with different compute units—is a highly promising research direction that helps maximize the use of existing assets.

    Second, unified training-and-inference optimization. The emergence of combined training-and-inference accelerator cards requires the technology stack to balance high training throughput with low inference latency. Developing a sharded inference engine for online inference scenarios on top of FSDP2 will be key to expanding application boundaries.

    Finally, automated parallelism strategy search. Manually tuning parallelism configurations demands deep expertise and is extremely time-consuming. Combining machine learning methods to automatically search for better parallelism schemes based on cluster state and model structure is an important means of unlocking infrastructure potential.

    There is no silver bullet for training ultra-large-scale models—it is a systematic undertaking spanning algorithms, software, and hardware. As this practice demonstrates, only by deeply understanding model characteristics and fully extracting every bit of potential from the underlying hardware can we build a solid, efficient AI infrastructure foundation in the trillion-parameter era. The complete implementation of this technical path provides a valuable template for the domestic deployment and training of more frontier models, and signals that domestic AI infrastructure is entering a new stage of high-quality, coordinated development.