Adapting Trillion-Parameter Multimodal Models for Domestic Compute Clusters

    Training ultra-large AI models has shifted focus from sheer compute capacity to managing memory, communication efficiency, and scheduling stability. Recently, a domestic GPU vendor successfully adapted a 2.8-trillion-parameter sparse Mixture-of-Experts (MoE) multimodal model using its proprietary software stack, establishing a native Fully Sharded Data Parallel (FSDP) training pipeline. This article systematically reviews the core technical challenges—such as the memory wall and communication overhead—and general engineering methodologies involved in adapting trillion-parameter models on domestic compute clusters, providing a reference for teams facing similar large-scale training challenges.

    As large model parameter scales move from hundreds of billions to several trillions, the core conflict in training engineering has evolved from “is there enough compute?” to “can it fit in memory?”, “is communication efficient?”, and “is the scheduling pipeline stable?”. Recently, a representative engineering practice emerged: an AI lab open-sourced its flagship sparse MoE multimodal model with 2.8 trillion parameters; simultaneously, a domestic GPU vendor completed full training adaptation using its integrated training and inference acceleration cards and proprietary software stack. This established a complete, native Fully Sharded Data Parallel (FSDP) training pipeline covering model loading, shard scheduling, and gradient synchronization. This article systematically reviews the key technical issues and general engineering methods for adapting ultra-large models on domestic compute, offering a reference for teams facing similar challenges.

    1. Why is Training Trillion-Parameter Models Difficult?

    To understand the technical value of this adaptation, we must first address the fundamental challenges of training ultra-large sparse models.

    1. The Memory Wall. A model with 2.8 trillion parameters requires about 5.6TB of memory just for parameters at 16-bit floating-point precision. Factoring in optimizer states (such as first and second momentums and master weight copies for adaptive optimizers), the memory demand multiplies. Single cards or even single machines cannot handle this; it relies on sharded storage and collaborative computing across thousands of accelerators.

    2. Load Imbalance from Sparse Activation. The Mixture-of-Experts (MoE) architecture activates only a subset of expert subnetworks during each forward pass. While this reduces per-step computation, it introduces load skewing among experts and dynamic routing communication issues. The training framework must perceive this dynamism, otherwise some devices will overheat while others sit idle.

    3. Communication Overhead and Compute Overlap. At a scale of thousands of cards, if operations like gradient synchronization, parameter shard aggregation, and inter-expert token routing cannot fully overlap with computation, the effective compute utilization will drop significantly. Larger clusters may paradoxically become less cost-effective.

    4. Software Stack Maturity. Domestic compute hardware has seen significant performance improvements recently, but the depth of adaptation among training frameworks, operator libraries, communication libraries, and upper-layer ecosystems determines whether the model can actually run—and run well and stably.

    2. Building a Native Fully Sharded Data Parallel Training Path

    The core highlight of this adaptation is the construction of a “native” FSDP multimodal training path. “Native” means the training pipeline is not awkwardly grafted via compatibility conversions or external patches; instead, it aligns naturally with the training framework’s sharding semantics from the model representation layer. This pipeline consists of four main stages.

    1. Model Loading and Weight Sharding. Facing terabyte-scale weight files, the primary concerns are loading efficiency and memory safety. The standard engineering approach uses a lazy loading mechanism, materializing the corresponding weight tensors only on the target shard devices. It also supports parallel reading of weight shard files at the device granularity to prevent single-point serial loading from becoming a startup bottleneck. The schematic shard initialization logic is as follows:

    1. # Schematic pseudo-code: Lazy initialization based on meta tensors + shard materialization
    2. with torch.device("meta"):
    3. model = build_model(config) # Placeholder only, does not allocate real GPU memory
    4. sharded_model = fully_shard(
    5. model,
    6. mesh=init_device_mesh("cuda", (dp_size,)),
    7. reshard_after_forward=True,
    8. )
    9. # Each process reads and materializes only the shards assigned to the local device
    10. load_state_dict_from_shards(
    11. sharded_model,
    12. shard_dir="checkpoint/",
    13. device_rank=local_rank,
    14. strict=True,
    15. )

    This approach avoids instantiating the full model on a single device before distributing it, compressing the cold start time for trillion-parameter models from hours to minutes.

    2. Shard Scheduling and Compute Planning. The essence of FSDP is splitting parameters, gradients, and optimizer states along the data parallel dimension; each device holds only a fraction, aggregating as needed during forward and backward passes. For MoE models, this is usually combined with expert parallel dimensions to form a multi-dimensional sharding grid of “Data Parallel × Expert Parallel × Pipeline Parallel”. The scheduler must automatically search or manually assign reasonable sharding strategies based on communication costs and memory constraints across dimensions, ensuring balanced batch distribution for multimodal inputs (e.g., text and images with varying sequence lengths).

    3. Communication and Compute Overlap. On-demand aggregation of parameter shards during forward passes and gradient reduction during backward passes are the two main communication operations. Optimization typically uses a prefetching mechanism: initiating the aggregation request for layer i+1 parameters while computing layer i, and hiding gradient communication behind backward computation using gradient bucketing and asynchronous reduction. For multimodal scenarios, synchronization rhythm differences between the visual encoder and the language backbone due to scale disparity must also be handled.

    4. Gradient Synchronization and Checkpoint Resumption. Under the FSDP paradigm, gradient reduction is inherently sharded. Each device only handles the reduction and optimizer updates for its owned shards, significantly reducing communication volume and single-node storage pressure. Combined with distributed checkpoint saving and restoration—where each shard is saved independently and reassembled on demand—it can withstand progress loss from hardware failures during long-term training, which is crucial at scales exceeding a thousand cards.

    3. Software Stack Collaboration: Full-Stack Optimization

    The success of training adaptation ultimately depends on the coordination quality across every layer of the software and hardware stack.

    At the operator layer, deep tuning is required for high-frequency operators in multimodal models, such as attention, routing gating, and normalization, ensuring high theoretical compute utilization on new hardware architectures. Discretization operations related to sparse routing (e.g., Top-K selection, token dispatch, and recycling) are often performance hotspots and require fused operators to reduce memory access and synchronization overhead.

    At the communication layer, adaptation of underlying collective communication primitives is necessary to ensure that all-gather, reduce-scatter, and all-to-all operations required for FSDP execute efficiently over high-bandwidth interconnects. It must also support flexible splitting of communication groups to match multi-dimensional parallel topologies.

    At the framework layer, the training framework’s sharding abstractions must seamlessly interface with the model code. This includes the compatibility of memory-saving techniques like mixed precision strategies, activation recomputation, and gradient checkpointing with the sharding mechanism, avoiding the awkward situation of “running but running out of memory.”

    At the stability layer, long-term, large-scale training requires a complete observability system. Metrics like per-device compute utilization, memory watermarks, communication latency, and gradient norms must be collected and alerted in real-time. The standard practice is to use object storage for checkpoints, log services for aggregating training logs, and monitoring/alerting systems to track cluster health. These general cloud capabilities (such as object storage, message queues, container platforms, logging, and monitoring) can all be used to build this infrastructure.

    4. Industry Implications

    This practice releases several noteworthy signals. First, domestic compute is now capable of undertaking training tasks for the most cutting-edge model architectures, with software-hardware coordination maturity rapidly approaching top-tier standards. Second, the approach of building native training paths—keeping model representation, parallel splitting, and underlying communication semantics consistent—offers better performance and maintainability than post-hoc compatibility adaptations, serving as a valuable reference for all teams working on large model engineering. Third, the combination of open-source flagship models and diverse compute foundations is lowering the barrier to entry for ultra-large model training. The future dual-driven landscape of “model freedom + compute freedom” is highly anticipated.

    For developers, the truly transferable experience is this: when facing trillion-parameter models, rather than fixating on single-point compute capacity, systematically design the training solution across four dimensions—sharding semantics of the training paradigm, communication overlap strategies, checkpoint recovery mechanisms, and full-stack observability. This is the engineering essence that determines the success of large-scale training.