Domestic GPU Completes End-to-End Training Pipeline for a Trillion-Parameter MoE Multimodal Model

    This article examines what it takes for a new domestic AI accelerator stack to reliably take on trillion-parameter pretraining. Using a recent lab validation—a two-node, 16-card run that completed 400 consecutive steps on a trimmed configuration of a 2.8-trillion-parameter MoE multimodal model without numerical overflow—it walks through the real engineering questions behind such announcements: why sparse activation makes memory the first bottleneck, why dynamic sparse attention complicates operators, how to layer training-pipeline validation from operator tests to long-run stability, how MoE forward/backward and sharded parallelism work, and how to read loss curves, gradient norms, and peak memory. It closes with a reusable acceptance path for teams evaluating or migrating to domestic compute.

    Introduction: The Focus Shifts from “Can It Run” to “Can It Train Stably”

    Over the past two years, domestic compute adaptation on the model-training side has advanced rapidly. From thousand-card cluster pretraining to extensions at ten-thousand-card scale, and further to full-stack domestic runs completing major model versions, the industry’s attention has gradually shifted from “single-card inference that works” to “whether multi-machine, multi-card setups can train stably.”

    Recently, a domestic AI accelerator vendor announced that its lab had completed the training-pipeline adaptation for a trillion-parameter-class MoE architecture native multimodal model. Under a two-node, 16-card configuration, the model completed 400 consecutive training steps without numerical overflow or abnormal interruption, with a steadily decreasing loss curve. The vendor explicitly noted that this was only a pipeline validation under a trimmed configuration, not equivalent to full-scale pretraining.

    For developers and technical decision-makers, the real value of such announcements lies not in any single number but in the core question they answer: what conditions must a new domestic compute stack satisfy before it can confidently take on trillion-scale model pretraining? This article follows a main thread of “architectural challenges → layered validation → operator implementation → parallelism and memory → interpreting results → scaling,” explaining both the engineering meaning of this validation and a reusable acceptance methodology.

    1. Where the Training Challenges Lie for Trillion-Parameter MoE Multimodal Models

    1.1 Sparse Activation Brings the Memory Bottleneck Before the Compute Bottleneck

    Trillion parameters usually refers to the total parameter count of the model. Take a sparse MoE that configures several routed experts per layer and activates only a few experts per token: the parameters actually involved in a single forward pass may be only a small fraction of the total. This leads to two direct consequences:

    • Memory determines whether the model fits. Weights, gradients, and optimizer states are all sized for the full parameter set, and memory usage does not shrink with sparse activation.
    • Communication determines how fast training runs. Experts are spread across different devices, and every token must “visit” its experts across cards, making both the volume and the pattern of communication more complex than for a dense model.

    So the primary engineering conflict is usually “how to fit the model and its states,” with “how to compute fast” coming second.

    1.2 Dynamic Sparse Attention Makes Both Operator Shapes and Numerical Behavior Uncertain

    Dynamic sparse attention decides at runtime, based on input content or task patterns, which tokens and which blocks participate in attention computation. Different samples, different batches, and even different positions within the same sample can take different computation paths. The concrete effects include:

    • Masks and sparse patterns are hard to pre-compile. Traditional fused attention operators are mostly optimized for dense or regularly sparse shapes; dynamic sparsity often has to take a relatively generic execution path, making both performance and numerical behavior hard to lock in ahead of time.
    • The “dynamic” of MoE and attention stacks up. Every layer must complete a routing decision, and a single forward pass may involve dozens of expert dispatch and combine communications. Combined with cross-modal concatenation of visual features and text tokens, variable-length inputs further amplify load imbalance.

    1.3 Multimodal Structures Add a Cross-Branch Joint Optimization Problem

    A native multimodal model generally has three parts: a vision encoder (the “vision tower”), a cross-modal projection or connector module, and a language backbone. During training, image-text pairs are encoded through two branches separately, then fed into the language backbone for joint optimization.

    An error at any stage of this chain may ultimately manifest as “slow loss decrease” or “abnormal loss fluctuation,” rather than throwing an explicit error. Therefore, validation must cover every component, every parallelism dimension, and the end-to-end flow as a whole.

    2. Training Pipeline Verification: What to Verify and How to Judge “Pass”

    “Training-pipeline validation” is often misunderstood as “getting the model to run without errors.” Rigorous validation should be a layered funnel:

    1. Unit-level operator validation: Are the forward results and backward gradients consistent with a reference implementation?
    2. Component-level parallelism validation: A network that runs on a single card—does its result stay equivalent after sharding and cross-card communication?
    3. End-to-end short-run training validation: Over a few hundred steps, does the loss decrease as expected, and are gradients and memory stable?
    4. Scaling and long-run stability validation: After scaling up, does throughput scale linearly, and can it run continuously for weeks?

    This public validation mainly corresponds to the third layer while accumulating data for the fourth. A simplified decision flow can express what “pipeline validation passed” means:

    1. # Pseudocode: decision flow for training pipeline validation (illustrates logic only)
    2. def validate_training_link(train_iter, val_iter, max_steps=400):
    3. losses, val_losses, grad_norms, peak_mems = [], [], [], []
    4. for step in range(max_steps):
    5. batch = next(train_iter) # Data loading: image-text samples, vision tower and language backbone concatenated
    6. loss = train_step(batch) # Forward + backward + gradient reduction + optimizer update
    7. g_norm = global_grad_norm() # Global gradient norm across all shards and all parameters
    8. # Numerical health check: fail immediately on NaN/Inf instead of continuing
    9. assert is_finite(loss) and is_finite(g_norm), f"step {step}: numerical overflow"
    10. grad_norms.append(g_norm)
    11. peak_mems.append(device_memory_peak())
    12. losses, val_losses = smooth(losses), [eval_loss(val_iter) for _ in range(2)]
    13. return {
    14. "loss_trend": losses[-1] < 0.5 * mean(losses[20:70]), # Loss drops significantly and steadily
    15. "val_trend": val_losses[-1] < val_losses[0], # Validation loss decreases in tandem
    16. "grad_finite": all(map(is_finite, grad_norms)), # No NaN/Inf throughout
    17. "grad_stable": stable(grad_norms), # Gradient norms show no sustained drift or spikes
    18. "mem_stable": not growing(peak_mems), # Memory level is stable, no sign of a leak
    19. }

    3. Trimmed Configuration: Exposing Real Problems at Low Cost

    Full-scale pretraining often requires thousands to tens of thousands of cards running continuously for weeks, which is too costly to use directly for pipeline validation. In practice, a “trimmed configuration” is commonly used: keep the key structures that can expose problems, and compress model size and training steps. The trimmed scheme in this validation is representative:

    • The language backbone is truncated to 13 layers, with routed experts compressed to 16 (Top-8 activation). Fewer layers, but the core communication paths—MoE routing, expert dispatch, and combine—are fully preserved.
    • The complete 27-layer vision tower and cross-modal projection module are retained. The vision branch is not just along for the ride; it actually participates in parameter updates, ensuring the cross-modal gradient back-propagation path is thoroughly exercised.
    • Random-initialization training on a public image-text QA dataset is used, rather than loading pretrained weights. This rules out irrelevant variables such as weight loading and checkpoint resume, directly examining “whether it can keep learning from scratch.”

    The boundary must be emphasized: a trimmed configuration validates functional correctness and reasonable trends of the pipeline; it cannot be used to infer the effectiveness or efficiency of full-scale training. With fewer layers, the communication rounds per step, memory usage, and the vision encoder’s share of compute all differ substantially from the real model. Therefore, the conclusion of a trimmed configuration only answers “does the pipeline hold together,” not “how many cards and how long will full training take.”

    4. Operator Layer: Completing Forward and Backward for Hybrid Attention and MoE

    The part of a training pipeline most prone to problems is the backward implementation—which inference does not need but training does expose. The core difference between the two:

    • Inference needs only the forward pass. An operator only has to compute the result correctly once, and intermediate values can be released after use.
    • Training must retain what backward needs. For example, the Softmax output, the attention probability matrix, routing decisions, and so on—otherwise gradients have nothing to flow back through.
    • MoE backward is more complex. Gradients must first be “returned” per expert, then flow back along the routing path to the gating network; routing itself is a discrete selection and cannot be differentiated directly, so gradients can only be back-propagated through the weighting coefficients of the selected experts.

    The outline below shows this:

    1. # Pseudocode: key points of MoE layer forward/backward for training
    2. def moe_forward(x, router, experts, top_k=8, capacity_factor=1.25):
    3. # 1) Gating scores: score every token against all experts
    4. scores = router(x) # [tokens, num_experts]
    5. topk_val, topk_idx = topk_softmax(scores, top_k) # Top-k selection and normalization over selected experts
    6. # 2) Load-balancing auxiliary loss: prevent "a few experts saturated while the rest idle"
    7. aux_loss = num_experts * sum(f_e * P_e for e in range(num_experts))
    8. # f_e: fraction of tokens assigned to expert e; P_e: average gating probability of expert e
    9. # 3) Capacity limit: capacity = tokens * top_k / num_experts * capacity_factor
    10. # Overflow tokens fall back to a residual shortcut, keeping output shape and values predictable
    11. x_e, w_e, slot = dispatch_with_capacity(x, topk_idx, topk_val, capacity_factor)
    12. # 4) Expert parallelism: all-to-all sends tokens to the devices holding the corresponding experts
    13. x_e, w_e, meta = all_to_all(x_e, w_e, slot, scatter="dispatch")
    14. # 5) Expert computation: grouped batched matmul by expert (grouped GEMM)
    15. y_e = experts(x_e)
    16. # 6) Combine: all-to-all gathers back, weighted sum by gating weights, add to residual
    17. y = combine(all_to_all(y_e, meta, scatter="combine"), w_e)
    18. return y + x, aux_loss
    19. # Backward: gradients first go back to each expert by gating weight; then reverse through the
    20. # combine and dispatch all-to-all communication; then flow back to expert parameters
    21. # and the gating network respectively; auxiliary loss gradients are also accumulated.

    Given such structures, the training operators on a domestic accelerator should be checked against the following list:

    • Dynamic mask consistency: All devices compute based on the same routing and mask decisions, avoiding reduction-order differences from divergent execution paths.
    • Variable-length and irregular shapes: Do grouped expert GEMM and variable-length sequence attention cover common shape ranges?
    • Backward alignment: Are the backward gradients within mixed-precision tolerance of a single-card reference implementation?
    • Long-sequence memory: Does attention intermediate memory grow quadratically with sequence length, and can recomputation trade memory for it?
    • Numerical boundaries: Under boundary cases such as very long sequences, extreme lengths, and empty experts, does overflow or silent degradation occur?

    5. Parallelism and Memory: Making Trillion Parameters “Fit”

    5.1 Sharded Data Parallelism: Store Params, Gradients, and Optimizer State Once Each

    Take an Adam-class optimizer with mixed-precision training: beyond the parameter itself, each parameter carries a gradient, a master-weight copy, and first- and second-order moments. The memory magnitude of training states can be roughly estimated with the formula below:

    1. Training state memory ≈ params × (2 + 2 + 4 + 4 + 4) bytes ≈ 16 × params

    Here 2 bytes are for BF16 weights, 2 bytes for BF16 gradients, 4 bytes for the master-weight copy, and 4 bytes each for the first- and second-order moments. This means a trillion-parameter model needs about 16 TB of memory for training states alone—roughly the footprint of about 347 cards with 80 GB of memory each, before “doing any computation at all.”

    The idea of sharded data parallelism is:

    • Each card stores only one shard of the parameters, gradients, and optimizer state, cutting per-card memory to about 1/N.
    • During the forward and backward passes, full parameters are temporarily gathered on demand.
    • After gradients are computed, they are reduced and sharded, and the optimizer update is done by each card only for its own portion.
    1. # Pseudocode: single-step flow of sharded data parallelism
    2. def sharded_step(model, batch, world_size):
    3. for layer in model.layers:
    4. # Forward: all-gather each card's shard, temporarily assemble full weights, release immediately
    5. param = all_gather(layer.param_shard, dim=0)
    6. out = layer.forward(param, batch)
    7. del param
    8. loss = model.head(out)
    9. grads = backward(loss) # Backward: reassemble weights to compute gradients, avoiding holding all full weights long-term
    10. for layer, g in zip(model.layers, grads):
    11. # After gradient reduction, split per card; each card keeps only the shard it is responsible for
    12. layer.grad_shard = reduce_scatter(g, dim=0)
    13. # Each card updates only its local shard and syncs its local optimizer state
    14. layer.param_shard, layer.opt_state = optimizer.step(layer.param_shard,
    15. layer.grad_shard)
    16. return loss

    What the pseudocode deliberately “hides” is the multiple global weight-gathering and gradient-reduction operations within each step. For a trillion-parameter model, one round of gathering can move data on the order of several TB. Whether it can efficiently overlap with computation, and whether communication is organized by node topology, often determines end-to-end throughput more than peak compute does.

    5.2 Two Nodes, 16 Cards: The Cross-Node Divide in Performance

    The 16 cards are usually spread across two servers. Within a node, communication generally goes over a high-bandwidth interconnect; between nodes, it must go through an RDMA network. Communication performance therefore shows clear tiering, and parallelism strategies must make corresponding trade-offs:

    • Pipeline parallelism splits by layer. Cross-node links only transmit activations at layer boundaries, making them well suited to carry cross-node communication.
    • Tensor parallelism splits a single layer’s computation. Each layer needs multiple synchronizations, imposing the highest bandwidth requirement, so it is generally kept within a node.
    • Data parallelism and expert parallelism. Gradient reduction and expert dispatch/combine need to happen across nodes.

    If expert-parallel all-to-all happens across nodes, it can easily become the weakest link—the short board in the barrel—of the whole pipeline.

    5.3 Peak Memory: What’s Behind the 44.80 GiB

    The peak memory in this validation was 44.80 GiB. Peak memory is typically the sum of several parts:

    1. The parameters, gradients, and optimizer-state shard that reside on this card;
    2. The full weights of the current layer (a temporary all-gather buffer);
    3. Activations saved in the forward pass and used in the backward pass;
    4. Communication staging buffers, temporary tensors, and fragmentation reserved by the memory allocator but not yet released.

    The first item drops as the shard count increases; the second and fourth are closely tied to the parallelism strategy and communication implementation; the third relates directly to batch size, sequence length, and whether recomputation is enabled. Here is a handy estimation function for teams to self-check:

    1. # Pseudocode: itemized estimation of training memory
    2. def estimate_memory(n_params, world_size, seq_len, batch, hidden, bytes_bf16=2):
    3. state = n_params * 16 / world_size # Params + gradients + master weights + first/second moments
    4. activation = seq_len * batch * hidden * 10 * bytes_bf16 # Rough estimate: coefficient must be calibrated per model
    5. comm_buffer = 2 * n_params * bytes_bf16 / world_size # Staging for gathered weights and reduced gradients
    6. return {"state": state, "activation": activation, "comm": comm_buffer}

    6. Reading the Results: What Loss Curves and Gradient Norms Reveal

    Based on the disclosed data, the key metrics of this validation are as follows:

    Metric Start End Notes
    Training loss 8.9365 (mean of steps 21–70) 2.1802 (mean of last 50 steps) Continuous, steady decrease under random initialization
    Validation loss 6.5297 4.6873 Generalization trend consistent with training loss
    Peak memory — 44.80 GiB Memory level on the two-node, 16-card setup under the trimmed config
    Consecutive steps 0 400 steps No numerical overflow, no abnormal interruption

    6.1 Loss Curve: Direct Evidence the Pipeline Holds

    In a small-scale run under random initialization, whether the loss decreases steadily is a strong signal that back-propagation is correct. When the backward implementation is flawed, gradients are often only correct for some parameters, and training may visibly slow within a few steps or even diverge outright.

    This validation deliberately used segmented-mean reporting (the mean of steps 21–70 and the mean of the last 50 steps) rather than single-point values. This has two benefits:

    • Smoothing noise. It avoids misreadings caused by single-step fluctuation.
    • Ease of verification. When others reproduce the same configuration, they can compare the trend curve over the same intervals rather than an instantaneous value.

    Reporting validation loss rather than looking only at training loss also avoids the illusion of “memorizing the training samples.”

    6.2 Gradient Norm: The Most Overlooked “Health Indicator”

    Loss decrease is the result; gradient health is the process. It is recommended to monitor at least three kinds of signals:

    • Global gradient norm: Compute the L2 norm across all shards and all parameters; NaN/Inf indicates a numerical problem in backward or reduction.
    • Norm spikes: A sudden norm increase often corresponds to bad samples or abnormal load on some expert, frequently appearing together with a gradient-clipping threshold being triggered repeatedly.
    • Per-card consistency: The gradient norms computed on each card should match one another. If one card’s norm stays persistently low, it usually means incomplete gradient reduction or a lagging slow node.

    6.3 Peak Memory: Look at Absolute Values, But More at Stability

    A single peak of 44.80 GiB only represents the memory level of the two-node, 16-card setup under this trimmed config and this parallelism strategy, and cannot be linearly extrapolated to the full model. More important is how the peak changes over hundreds of steps:

    • If the peak keeps slowly rising with step count, there may be a memory leak;
    • If the peak stays stable, it means the allocator’s behavior matches the model’s lifecycle.

    7. Industry Perspective: From “Runs” to “Runs Stably”

    From public disclosures, the pace of domestic compute on the model-training side has clearly accelerated:

    • One vendor disclosed that several large-model companies had completed multimodal pretraining and reinforcement learning on its thousand-card-class clusters, with accuracy aligned to mainstream international products;
    • One vendor stated in an earnings briefing that it is advancing adaptation for multiple mainstream model series on the training side, extending toward thousand-card and ten-thousand-card cluster scenarios;
    • One cloud provider announced that a fully domestic cluster had completed training of a major version of its large model, with an effective training rate of about 97%;
    • Another vendor disclosed that its accelerator cards had already adapted to more than 400 mainstream large models.

    A horizontal comparison shows that the disclosure metrics are shifting from “adaptation completed” toward metrics that better reflect engineering maturity, such as “cluster scale + effective training rate.” By contrast, this validation separately published details such as consecutive step count, segmented loss, validation loss, and peak memory. Disclosing such engineering data for a 2.8-trillion-parameter-class MoE multimodal model is still rare in the industry, which is also why it provides a reference engineering node for reproducibility on the domestic GPU training side.

    That said, a rational view should be maintained:

    • Trimmed configuration ≠ full scale. It can only show that the pipeline holds.
    • Some institutions forecast that China’s high-end AI chip shipments in 2026 will reach about 5 million units, up about 83% year over year, with domestic solutions (including cloud vendors’ self-developed ASICs) approaching 90% share. Whether shipment growth translates into real training-side capacity ultimately depends on the ability to scale clusters and run stably for long periods.

    8. From Two Nodes to Thousands of Cards: Scaling and Long-Run Stability Checklist

    8.1 Communication Efficiency: The Key to Scaling Ratios

    Once the scale grows from 16 cards to thousands or tens of thousands, communication patterns stack into a three-dimensional combination of “pipeline parallelism + data parallelism + expert parallelism.” Optimization priorities include:

    • Topology awareness: Map communication-heavy dimensions onto high-bandwidth links, such as the intra-node interconnect or the same network tier;
    • Compute-communication overlap: Interleave gradient bucketing, backward computation, and communication;
    • all-to-all optimization: Hierarchical aggregation—aggregate locally, then transfer across nodes—to reduce the number of cross-node messages.

    8.2 Effective Training Rate: From “Computes Fast” to “Keeps Computing”

    The effective training rate is the core metric for measuring long-run capability, with losses coming mainly from:

    • Startup and save overhead: checkpoint saving and data-loading jitter;
    • Communication exposure: time the computation waits on communication;
    • Stragglers: one slow card forcing the whole cluster to wait in sync.

    The roughly 97% effective training rate of the domestic cluster mentioned earlier is precisely a reflection of this kind of engineering capability.

    8.3 Fault Tolerance and Checkpoint Resume: The “Safety Belt” for Trillion-Parameter Models

    The larger the scale, the higher the probability of single-point failures, so fault-tolerance design must be built in from the start:

    • Multi-tier checkpoints: In-memory fast snapshots plus persistent full checkpoints, balancing recovery speed and overhead;
    • Asynchronous saving: Overlap checkpoint writes with training computation to reduce pauses;
    • State consistency: Parameter shards, optimizer states, data-loading progress, and random-number states must be saved together; otherwise the loss curve will show a “gap” after resuming.

    8.4 Observability: Catching Problems Before They Worsen

    It is recommended to collect and alert on the following metrics at fine granularity:

    • Metric dimensions: loss, gradient norm, per-card memory, per-step time, communication share;
    • Storage and query: Use log services and a monitoring/alerting system to form traceable training records;
    • Data handling: Samples are distributed via object storage, with a message queue decoupling the pipeline to ensure stable data supply;
    • Job orchestration: A container platform handles elastic scheduling and fault restarts.

    Baidu AI Cloud’s experience across heterogeneous computing, training job orchestration, and general cloud products such as log services, monitoring/alerting, and object storage can serve as a general reference for such a training engineering system.

    8.5 Determinism: Making Reproduction the Norm

    After fixing random seeds, fixing data order, and enabling deterministic operators, the same configuration should reproduce a similar loss curve on similar hardware. This is the dividing line between “running in the lab” and “operationally maintainable in production.”

    Conclusion

    Back to the original question: does a domestic compute stack now have the capability to take on trillion-scale model pretraining? This two-node, 16-card, 400-step trimmed-configuration validation gives the answer that “the pipeline already holds”: the forward and backward implementations of dynamic sparse attention and MoE are complete, sharded parallelism and cross-node communication are working, the loss curve converges steadily, and numerics stay stable throughout.

    But from a trimmed configuration to full-scale training of the complete trillion-parameter model, two hurdles remain:

    1. Cluster scaling: communication efficiency, topology awareness, and compute-communication overlap across three-dimensional parallelism;
    2. Long-run stability: effective training rate, fault-tolerant resume, observability, and reproducibility.

    For teams preparing to migrate to or evaluate domestic compute, the recommended adoption path is:

    1. Operator-level unit tests;
    2. Single-machine multi-card equivalence comparison;
    3. Two-node trimmed-configuration short-run training;
    4. Hundred-card scaling-ratio tests;
    5. Thousand-card long-run trial runs.

    Set a clear pass criterion for each step and retain the data. Only then can “pipeline validation passed” truly translate into “usable for production training.”