Training Adaptation for an Open-Source 2.8 Trillion-Parameter Multimodal Model on a Chinese AI Chip

    A Chinese AI chip vendor has completed training adaptation for an open-source 2.8 trillion-parameter multimodal model using its flagship AI training-and-inference compute card and proprietary software stack. This article explains the native FSDP2 training path, memory requirements, model loading, shard scheduling, gradient synchronization, sparse MoE routing, dynamic multimodal inputs, validation methods, and platform practices needed to turn a one-time adaptation into sustainable large-scale training.

    Why Trillion-Parameter Open-Source Models Require Dedicated Training Adaptation

    Recently, a Chinese AI chip vendor announced that, based on its flagship AI training-and-inference compute card and its proprietary software stack, it completed training adaptation for an open-source flagship multimodal model with 2.8 trillion parameters. The solution uses a native Fully Sharded Data Parallel (FSDP) multimodal training path. When distinguishing generations, the newer version is referred to as FSDP2. It covers the complete training flow from model loading and shard scheduling to gradient synchronization.

    “Completed adaptation” may look like a short announcement, but from an engineering perspective it is a systems problem spanning the software stack, training framework, model, and cluster. This article uses that announcement as an entry point to break down the key engineering areas, common difficulties, and validation methods involved in adapting trillion-parameter model training. It is intended for developers and enterprises working on large-model training and platform construction.

    Background: Why Trillion-Parameter Open-Source Models Need Dedicated Adaptation

    In the past, trillion-parameter models mostly existed within closed systems. Today, such models are increasingly released with open weights, which lowers the barrier for research institutions and developers to access frontier model capabilities. However, “open weights” do not mean “ready for training”: inference only requires loading the weights and performing a forward pass, while training must maintain parameters, gradients, optimizer states, and a large amount of intermediate activations.

    A rough estimate:

    • Weights: 2.8 trillion parameters stored in BF16 require about 5.6 TB of device memory for weights alone.
    • Gradients: Using BF16 as well, gradients require another 5.6 TB.
    • Optimizer states: With a classic AdamW-style optimizer, each parameter also needs a first-moment and a second-moment state, usually in FP32, totaling about 22.4 TB.
    • Total: Model states alone already reach more than 34 TB, not counting activations.

    This means training must run on clusters containing hundreds or thousands of accelerators. The real difficulty is coordination: how thousands of cards split the model, exchange gradients, and avoid bottleneck effects. These problems must be solved at both the framework and hardware levels.

    Training adaptation is the process of moving an open-source model from a “released state” to a “trainable state.” It requires collaboration among chip vendors, framework communities, and model developers:

    • Chip vendors ensure software-stack completeness and framework adaptation for new hardware.
    • Model developers provide open weights, training code, and configuration.
    • Open-source frameworks provide general parallelism abstractions and optimization capabilities.

    If any of these pieces is missing, the training pipeline cannot be closed end to end.

    Core Approach: A Native FSDP2 Multimodal Training Path

    The technical mainline of this adaptation is to build a native FSDP2 training path. “Native” has at least two meanings:

    • No external conversion layer: The training framework connects directly to the chip vendor’s proprietary software stack, without mapping framework calls to hardware through an external runtime or translation layer. This reduces performance overhead and debugging cost caused by intermediate layers.
    • Shard parallelism as the main strategy: The approach does not assume additional parallel dimensions such as tensor parallelism or pipeline parallelism. Instead, it relies only on FSDP2 to split model state along the data-parallel dimension, resulting in the simplest and most verifiable parallel topology.

    Why FSDP2

    Data parallelism gives each training process a full model, while batch data is split across processes. It is simple to implement and scales well on dense models, but when parameter counts grow, it hits a memory wall: every process must hold the full parameters, gradients, and optimizer states. For this reason, the industry developed sharding technologies such as ZeRO. The core idea of FSDP is consistent with them:

    • Each parameter is split along dimension 0 across processes in the data-parallel group.
    • Before computing the forward or backward pass of a layer, FSDP temporarily restores the full parameters of that layer through All-Gather, then releases them after computation.
    • Gradients are reduced directly to the corresponding shard through Reduce-Scatter, and the optimizer updates only the parameters owned by each process.

    Data parallelism and parameter sharding are therefore combined, and per-device memory usage decreases roughly linearly as parallel scale increases.

    FSDP2 introduces three key changes compared with the previous generation:

    1. Per-parameter sharding: The previous generation packed multiple parameters in a module into a FlatParameter. This imposed many constraints when combined with features such as mixed precision and tensor parallelism. FSDP2 shards each parameter independently and uses DTensor to describe its global shape and sharding layout.
    2. Clearer parameter lifecycle: Parameters reside in sharded form and are restored to full form only when computation requires it. This restoration is tightly integrated with gradient reduction and gradient sharding in backward propagation.
    3. More flexible composition of parallelism: The DTensor-based representation can be combined with tensor parallelism, pipeline parallelism, and other strategies. Training frameworks can also use it to overlap communication and computation across the entire compute graph, making FSDP2 a suitable foundation for trillion-parameter sparse model training.

    Incorporating Multimodal Models into FSDP2

    Multimodal models are usually composed of a vision encoder, modality projection layers, and a language backbone connected in sequence. The model adapted here is a sparse architecture whose language backbone uses a Mixture-of-Experts (MoE) structure. The “Pro” in the model name indicates this flagship positioning. Therefore, the training framework can handle components according to layer type:

    Model component Structural characteristics Handling method
    Vision encoder Dense structure, relatively limited parameters, input is a sequence of image/video frames Included in FSDP2 sharding, usually with frozen parameters
    Modality projection layer Maps vision features into the language space Included in FSDP2 sharding and trained
    Language backbone (sparse experts) Contains routing and many experts, with highly sparse parameters Sharded by FSDP2; expert parallelism is introduced as needed along the expert dimension

    This approach is “native” in three ways: it uniformly uses FSDP2 instead of an externally attached parallelism plugin; the training framework natively supports the chip vendor’s software stack; and the multimodal structure can be included in the same training pipeline without special rewriting.

    Key Engineering Areas: Loading, Scheduling, and Synchronization

    Model Loading: Zero Redundancy and Scalability

    Model loading may appear to be just “reading files,” but in the trillion-parameter regime it directly determines whether training can start.

    Common mistake: centralized loading on a single machine

    If a single process reads all weights and then broadcasts them to other processes, the single-machine memory can be exhausted immediately. The 2.8 trillion parameters in FP32 require about 11.2 TB of memory, while single-machine memory is usually only a few TB. Even if tensors are broadcast one by one, a single process still has to handle tens of TB of cumulative disk reads, making startup time unacceptable.

    Correct approach: map shards according to parallelism and let each process read its own portion

    Before loading, each process first derives the sharding plan from the model configuration: FSDP shards evenly along dimension 0, tensor parallelism shards by row or column, pipeline parallelism shards by layer, and expert parallelism shards by expert. Each process then determines which parameters it owns and which segment of each parameter it is responsible for. The model skeleton is built on a meta device, where placeholder tensors do not allocate real memory. During loading, each process reads only its local shard and writes it directly into the corresponding parameters.

    Illustrative code (interface names are for illustration only; refer to the documentation of the framework version you use):

    1. # rank0 parses the model configuration (number of layers, hidden dimensions, number of experts, etc.) and broadcasts it to all processes
    2. config = parse_config_from_pretrained(ckpt_dir)
    3. # Each process derives its parallel layout and weight-reading list based on the global configuration and its own rank
    4. plan = build_load_plan(config, tp_size=tp_size, ep_size=ep_size, ...)
    5. # Build a model skeleton on the meta device; no real device memory is allocated at this point
    6. with meta_device():
    7. model = build_model_from_config(config)
    8. # Read and load only the weight shard handled by the current process
    9. local_state = read_shard(ckpt_dir, plan)
    10. load_state_dict(model, local_state, assign=True)

    This approach brings three benefits:

    • Fast startup: Processes read checkpoints in parallel, and each process reads only a small portion of the total weights.
    • Stable memory: Peak memory is mainly determined by the local shard and is decoupled from cluster size.
    • Scalability: Checkpoint files are organized at shard granularity, so the loading workflow does not need to be rewritten as cluster scale changes.

    Two easily overlooked details

    1. Configuration consistency: The vision encoder resolution, language model depth, attention structure, expert count, and other configuration items must strictly match the checkpoint files. Otherwise, some weights may not be loaded while the model still starts normally, resulting in a silent error.
    2. Frozen modules: Even if the vision encoder freezes parameters, it still participates in the forward pass. Its parameters must be restored across processes through All-Gather. Therefore, it must be managed by FSDP2 and cannot simply be stored independently on every process.

    Shard Scheduling: Balancing Memory and Communication

    After loading, the model remains in sharded form on device memory. During training, FSDP2 restores full parameters before each module executes and reshards them according to policy after execution. This step appears simple, but it is the main control knob between memory usage and communication overhead.

    Scheduling granularity

    Using a standard Transformer structure as an example, a whole Transformer layer can be treated as one sharding unit, or the attention sublayer and feed-forward sublayer can be treated as separate units:

    • Coarser granularity means fewer communication operations, but more parameters are restored at once, leading to higher peak memory.
    • Finer granularity means lower peak memory, but more frequent communication, requiring higher efficiency for small messages.

    Sparse expert layers are numerous, and each expert is relatively small, so fine-grained scheduling usually helps control peak memory more effectively.

    Resharding policy after the forward pass

    FSDP2 allows a module to either reshard immediately after the forward pass or keep full parameters until backward propagation ends:

    • Immediate resharding saves memory, but another All-Gather is required during backward propagation.
    • Keeping full parameters trades extra memory for one fewer All-Gather communication.

    Setting this policy reasonably often significantly reduces peak memory with almost no impact on throughput.

    Illustrative code (interface names are for illustration only; refer to the documentation of the framework version you use):

    1. # Shard attention heads along the hidden dimension (column parallel); row-parallel layers require an All-Reduce
    2. tp_plan = {
    3. "q_proj": ColwiseParallel(),
    4. "k_proj": ColwiseParallel(),
    5. "v_proj": ColwiseParallel(),
    6. "o_proj": RowwiseParallel(),
    7. "gate_proj": ColwiseParallel(),
    8. "up_proj": ColwiseParallel(),
    9. "down_proj": RowwiseParallel(),
    10. }
    11. def apply_fsdp2(model, mesh, reduce_dtype=torch.float32):
    12. # Use a single Transformer layer (including the MoE module) as the sharding unit
    13. for layer in model.layers:
    14. # Restore the DTensor representation of each weight and parallelize it as described above
    15. parallelize_module(layer, mesh, tp_plan)
    16. # Shard parameters individually, with gradient Reduce-Scatter using FP32
    17. fully_shard(layer, mesh=mesh, mp_policy=MixedPrecision(reduce_dtype))
    18. # The vision encoder usually freezes parameters, but it is also sharded and excluded from gradient communication
    19. fully_shard(model.vision_encoder, mesh=mesh, ...)
    20. # Shard the top-level model once more
    21. fully_shard(model, mesh=mesh, mp_policy=MixedPrecision(reduce_dtype))

    Overlapping communication with computation

    There are two main types of collective communication in training:

    • All-Gather: restores parameters, concentrated before forward computation.
    • Reduce-Scatter: reduces gradients, distributed across backward computation.

    FSDP2 initiates these communications asynchronously and overlaps them with the computation of the current module. This works only if the computation time of a single module is long enough to cover its communication time. When expert parallelism scale is large and the number of experts is high, each expert module may have relatively little computation, making communication more visible. In such cases, operator fusion based on the compute graph and adjusting sharding-unit granularity can help expand the overlap window.

    Gradient Synchronization: Numerical Stability and Engineering Robustness

    Numerical precision in gradient reduction

    A common mixed-precision configuration stores parameters and gradients in BF16 and optimizer states in FP32. FSDP2 allows gradient-reduction communication to use higher precision than the gradient itself, for example completing Reduce-Scatter in FP32. In large-scale parallelism, reduction involves multiple rounds of floating-point accumulation. Higher precision can reduce summation errors that accumulate over thousands of iterations, which helps maintain stable training over long periods.

    Global consistency of gradient clipping

    Gradient clipping first requires the global norm of all parameter gradients. Under FSDP2, each process holds only part of the gradients, so the sum of squared values must first be aggregated within the data-parallel group and then square-rooted before scaling by the clipping ratio. If each process computes the norm locally, different processes obtain different scaling coefficients, causing model states to diverge. This appears as inconsistent loss curves across processes.

    Illustrative code (for illustration only):

    1. # Each process holds only a subset of gradient shards
    2. grads = get_local_grad_shards(model)
    3. # Compute the global norm so that all processes use the same clipping coefficient
    4. total_norm = all_reduce(sum(g.pow(2).sum() for g in grads), group=dp_group).sqrt()
    5. # Scale gradients by the global norm if the threshold is exceeded
    6. clip_coef = max_norm / (total_norm + 1e-6)
    7. if clip_coef < 1:
    8. scale_grads(grads, clip_coef)

    Sharded checkpoint saving and restoration

    Training often lasts for weeks, so checkpoints must be written quickly and restored completely. Parallel checkpoints allow each process to save its own parameter shards, optimizer states, and random number generator states. During restoration, the checkpoint is loaded according to the current parallel layout, enabling continued training even after the parallel scale changes. When a shared file system is available, asynchronous saving can also be used: training continues while checkpoint saving proceeds in the background, reducing training pauses.

    Hard Problems: Sparse Architectures and Dynamic Multimodal Inputs

    Sparse Expert Routing and Load Balancing

    A total of 2.8 trillion parameters does not mean every token passes through the entire network. These models use sparse activation: each token is processed only by a few experts selected by a router. For example, with 256 routed experts plus 1 shared expert and 8 experts activated per token, the attention part, routed experts, and shared expert together contain about 2.8 trillion parameters, while each token activates only about 32 billion parameters, roughly 1.1% of the total.

    This creates two problems:

    • Load imbalance: Popular experts receive many tokens, while cold experts remain mostly idle. Expert load-balancing loss is added during training to encourage uniform routing. A capacity factor is also commonly used to set an upper buffer limit for each expert; tokens exceeding the limit may be dropped or bypassed. If the software stack has insufficient operator support for these structures, gradients may deviate from the reference implementation, and convergence quality may degrade during long training runs.
    • Communication pattern: In data parallelism, if every expert is fully replicated within each process, memory waste becomes severe. Expert parallelism is therefore required to distribute experts across processes. Each process sends tokens to the target experts through All-to-All and collects results after computation. Communication volume grows as parallel scale increases. For this reason, expert parallelism is usually deployed within a node and relies on high-speed inter-card interconnects, while inter-node communication uses data parallelism and pipeline parallelism.

    Dynamic Multimodal Inputs and Stable Shapes

    Text training usually uses fixed sequence lengths or buckets. Multimodal training is different: image resolution, number of image crops, number of video frames, and interleaved text-image layouts all affect the number of vision tokens, making input shapes highly dynamic. If the software stack’s graph compilation or operator scheduling is sensitive to shape changes, recompilation may occur repeatedly, causing training speed to fluctuate and periodic stalls to appear.

    Common engineering responses include:

    • Bucketing samples by the number of vision tokens so that shapes are consistent within each batch.
    • Precompiling and caching several common shapes.
    • Separating dynamic and static parts so that compilation optimization is applied only to the static subgraph.

    This adaptation natively supports multimodal inputs. These shape-management strategies were also validated during the adaptation phase, making the native path stable and efficient.

    Validation: Proving That Training Is Correct, Converging, and Fast

    “Completed adaptation” needs quantitative and reproducible validation. This can be approached at three levels.

    1. Numerical consistency

    Run several dozen training steps on a single card with a fixed random seed and fixed data order, and record the loss and gradient norm at each step. Compare results from the vendor’s software stack with results from mainstream hardware platforms. In BF16 training, bitwise identity for the first few dozen steps is not realistic. A reasonable standard is a small relative error, with no sustained drift or sudden divergence as training progresses.

    2. Convergence validation

    Run several hundred to several thousand steps on 1%–5% of the training data, and compare loss curves between the vendor’s software stack and other hardware platforms. The overall trend and numerical range should be consistent. This validates the correctness of the full pipeline, including forward computation, backward propagation, optimizer updates, and gradient clipping. This step can expose cumulative issues that single-step numerical comparisons may miss.

    3. Performance and stability validation

    Metric Meaning What to watch
    Per-card throughput Tokens processed per card per second Operator coverage and overlap between computation and communication
    Peak memory Maximum per-card memory usage during training Shard scheduling, resharding policy, and activation recomputation
    Scaling efficiency Throughput improvement after increasing card count Communication overhead, load balancing, and node interconnect
    Fault recovery Loss continuity after resuming from a checkpoint Checkpoint integrity and parallel-layout consistency

    For example, scaling efficiency can be defined as:

    E(N) = T(N) / (N × T(1))

    where T(N) is the total throughput when using N cards. Ideally, E(N) approaches 1. In trillion-parameter tasks, mechanisms such as expert parallelism make E(N) noticeably lower than the ideal value because of communication and load-balancing constraints. Therefore, it is more important to observe how E(N) changes with scale than to focus on the absolute value from a single experiment.

    In addition, long-duration stress tests of at least 24–72 hours should be performed to check whether loss spikes appear, whether inter-card communication times out, and whether hardware error counters increase. This helps evaluate cluster-level stability.

    Platform Perspective: Turning Adaptation into Sustainable Training Capability

    A single successful adaptation is only one validation. For trillion-parameter model training to run reliably over the long term in enterprise environments, platform capabilities are also required. The platform should provide the following general capabilities:

    • Scheduling: Detect inter-card and inter-node topology and place parallel groups that communicate frequently within the same high-speed interconnect domain.
    • Storage: Use a parallel file system or high-throughput object storage to store training data and checkpoints, and use data versioning to ensure reproducibility.
    • Monitoring and alerting: Cover hardware metrics (utilization, temperature, power, memory, and interconnect error counts) and training metrics (loss, gradient norm, and throughput), and notify operators promptly when anomalies occur.
    • Fault self-healing: Automatically isolate faulty nodes and automatically start checkpoint-based recovery jobs.
    • Resource pooling: Use a container platform to manage different types of accelerators in a unified way and provide elastic resources for mixed training and inference workloads.

    In practice, cloud providers such as Baidu AI Cloud have relatively mature experience in heterogeneous compute resource pools, containerized training platforms, and monitoring and alerting. When selecting a platform, enterprises can focus on whether the platform supports topology-aware scheduling, sharded checkpoints, and fault self-healing.

    Practical Recommendations: A Checklist for Teams Deploying Training Adaptation

    • Start small, then scale up: First complete numerical alignment on a single card with a small model, then gradually expand to single-node multi-card and multi-node multi-card setups. Avoid debugging low-level issues at full cluster scale.
    • Watch for silent errors: Carefully check the model configuration and weight-to-shard mapping to ensure all parameters are loaded correctly. Be alert to situations that do not raise an error but fail to load weights.
    • Set resharding policy reasonably: Adjust the scope of immediate resharding after the forward pass based on available memory and measured throughput. This often reduces peak memory significantly with almost no throughput change.
    • Save checkpoints in sharded form: Prefer parallel and asynchronous saving to reduce checkpoint time and support continued training after changing parallel scale.
    • Establish regression tests: Include numerical consistency, short-run convergence, throughput, and memory usage in continuous integration to prevent software-stack upgrades from causing performance or precision regressions.
    • Bucket multimodal samples: Group samples by the number of vision tokens to reduce recompilation and memory fluctuations caused by dynamic shapes.
    • Improve monitoring: Include alerts for gradient norms, loss spikes, and inter-card error counters, moving fault detection from “after training ends” to “as soon as it happens.”

    Conclusion

    A Chinese AI chip vendor’s completion of training adaptation for a 2.8 trillion-parameter multimodal model is more than “another model can run.” It shows that a native FSDP2 training path can support complex scenarios such as trillion-parameter models, sparse activation, and multimodal inputs, providing a practical engineering pattern for ultra-large model training.

    For developers, understanding the tradeoffs behind model loading, shard scheduling, and gradient synchronization is more valuable than memorizing a specific conclusion. For enterprises, turning validation methods into repeatable processes is the way to convert a one-time adaptation result into long-term training capability. As software stacks and training frameworks continue to mature, this path is expected to play a role in more ultra-large model training efforts.