Trillion-Parameter MoE Multimodal Training Pipeline Validation on a Domestic GPU
Passing a training pipeline is not the same as being able to train. This article examines a 400-step validation run of a trillion-parameter sparse Mixture-of-Experts (MoE) native multimodal model on domestic AI accelerators. It explains why training differs fundamentally from inference, breaks down the four hard problems introduced by combining sparse MoE with native multimodality (routing communication, memory distribution, numerical stability, and load balancing), and describes the cropped configuration used for the run. It then walks through the metrics that were observed — training and validation loss, memory peak, gradient checks, and vision-branch updates — the three implementation layers (operators, sharding, and communication), and the four hurdles that still separate a cropped run from full-scale pretraining. A reusable checklist for validating new-hardware × new-model-architecture training pipelines closes the piece.
1. Why “passing the pipeline” is not the same as “being able to train”
Adaptation of domestic AI chips to large models is clearly accelerating. The scope of adaptation has expanded from getting forward inference working to pretraining and reinforcement learning at the thousand- to ten-thousand-accelerator scale. Some domestic cloud providers have publicly stated that their full-stack clusters built on domestic chips have trained major versions of leading large models, with an effective training rate of about 97%.
Being able to complete training is not the same as being able to reproduce it — which is exactly where “training pipeline validation” comes from. Training and inference differ fundamentally: inference involves a single forward pass, with memory dominated by weights and the KV cache; training must compute gradients during backpropagation, store intermediate activations, and maintain optimizer states, all while relying on extensive cross-device synchronization. So the common boundaries are: inference adaptation only proves “it computes correctly,” pipeline validation proves “it can train,” and full-scale pretraining is what answers “it trains stably and succeeds.”
Taking a super-trillion-parameter sparse MoE native multimodal model as the target gives this validation typical significance. Running 400 consecutive training steps on such a model with a cropped configuration, with no numerical overflow or abnormal interruption, the vendor also made clear this was only pipeline validation and not equivalent to full-scale pretraining. 400 steps are just a warm-up in terms of compute scale; the value lies in walking the entire backpropagation chain once — under a real model architecture, a real multimodal data stream, and a real distributed parallelism configuration — while recording, checking, and aligning the key signals. To judge whether such a validation carries real weight, four questions need to be answered:
- What was cropped and what was retained in the configuration;
- Which metrics were observed;
- Which implementation layers were covered;
- How far it still is from full scale.
2. Four hurdles from combining sparse MoE with native multimodality
1. Routing communication: irregularity is the norm. In a MoE forward pass through gating, each token activates only the Top-k experts. Getting a token to the device that hosts its expert, then combining the results back by weight, depends on all-to-all collective communication. Routing is determined by data, so token distribution is both irregular and changes batch to batch, and the amount each device receives varies widely — making both communication volume and tail latency hard to predict. Multimodal input further forces two kinds of token to share the same routing: the number of vision tokens varies with image resolution, and its value distribution differs markedly from that of text tokens. Whether routing is biased toward a particular modality needs to be observed separately.
2. Memory distribution: pressure on both weights and activations. Expert weights are large in total, but a single token activates only a few experts; intermediate activations are generated densely and rely on activation recomputation to compress the peak. Under expert parallelism, experts are split across devices and tokens are routed to different cards, so the local token count on each device is uneven; the device with the heaviest load hits its memory ceiling first and finishes computing later, dragging down the whole iteration. Multimodality additionally requires retaining activations of the vision features and the cross-modal alignment module. So optimizer-state sharding, recomputation strategy, expert capacity factor, and device mapping need joint tuning rather than isolated, item-by-item configuration.
3. Numerical stability: small data and random initialization amplify errors. Large-model training generally uses mixed precision: computation is mostly done in low precision such as BF16/FP16, while the master copy of parameters, optimizer updates, and some sensitive computations stay in FP32. Exponential operations, normalization, and softmax-type operators tend to underflow in the small-value range and overflow in the large-value range; once NaN/Inf appears, it can rapidly contaminate the whole step update through backpropagation. Under a cropped configuration, random initialization combined with a small set of image-text data has a numerical distribution far from that of full pretraining data, which actually makes boundary problems more likely to surface. Feed-forward activation clipping and loss-scaling strategies must be checked one by one.
4. Load balancing: routing collapse and distorted metrics. A gating network tends to route less to experts it rarely calls, so eventually a few experts become overloaded while most sit idle — this is routing collapse. A common approach is to add a load-balancing term (such as an auxiliary loss) to the loss, together with a capacity factor and drop policy, but this introduces two new problems: the extra gradient term requires a correct backward implementation, and the contribution of dropped tokens to the loss needs an explicit convention. In MoE training monitoring, a false-convergence signal often appears — “loss keeps dropping while expert utilization keeps falling” — so expert utilization must be observed alongside loss.
3. Configuration design: why a cropped configuration is a reasonable starting point
For a trillion-scale model, “getting full scale to run” and “validating the pipeline” are two different things, and a single cropped configuration is a reasonable split between them.
- Retaining structure matters more than retaining scale. The language backbone is cropped to 13 layers and experts are shrunk to 16 with Top-8 activation, while the complete vision tower and the cross-modal projection module are retained. What gets cropped — the number of layers, width, and other dimensions that can be scaled uniformly — leaves the original operators, parallelism partition scheme, and control flow unchanged. What is retained is the multimodal coupling point: how vision features are encoded, aligned, and injected into the language backbone. That is the real new implementation work on the training side.
- Controlled tasks reduce interference. Choosing an image-text QA dataset together with random initialization makes it easier to see the loss drop quickly, reduces interference from pretrained weights and a full-scale corpus, and concentrates problem localization on the operator, communication, and numerical chain.
- Record distribution-side signals synchronously. The data shape of image-text QA differs greatly from pretraining, so it is advisable to record distribution-side signals in parallel — such as modality composition, token distribution, and the proportion of tokens each expert receives. These are used to judge “whether the vision branch was actually trained,” not to evaluate pretraining quality.
Two points to keep in mind in practice:
- Cropping is premised on “operators and communication paths unchanged”;
- Interpretation of results must correspond strictly to the configuration.
4. Metrics: reading training state from the loss curve and gradient checks
The data disclosed by the vendor is worth interpreting item by item (dual-node, 16-card configuration):
| Observation | Disclosed data | Interpretation |
|---|---|---|
| Training loss | mean 8.9365 over steps 21–70 → mean 2.1802 over the last 50 steps | The statistical window takes averages to smooth single-step jitter; convergence magnitude is affected by the number of layers, the number of experts, and Top-k, so it should not be compared directly with full-scale models |
| Validation loss | 6.5297 → 4.6873 | The validation set does not participate in backpropagation; it is used to distinguish “memorizing training samples” from “learning generalizable patterns” |
| Memory peak | 44.80 GiB | Corresponds only to this cropped configuration and parallelism strategy; uneven expert load makes peak memory differ across cards, so it is better to look at cluster-wide percentiles |
| Gradient check | gradient norm, NaN/Inf check, and gradient clipping | Whether gradients are finite and whether they are being clipped persistently is the earliest signal of numerical problems |
| Vision-branch update | participates in parameter updates | Confirms the multimodal pipeline is genuinely connected, rather than only the language backbone training |
The choice of statistical window matters. Starting at step 21 is usually meant to skip the initial jitter from data loading and communication setup; taking the mean over the last 50 steps reflects the true level better than citing the final single step. On the gradient side, it is advisable to record simultaneously:
- The global gradient norm and each modal branch’s norm proportion, to judge whether one modality “dominates” the update;
- Per-step time and communication proportion, to locate load imbalance;
- The expert token-received distribution and drop rate, to observe whether routing is healthy.
Whether the gradient state is healthy is usually verified during a “gradient check.” You can compute the mean gradient over several small batches in the first few training steps and check whether the global gradient norm is finite; if it differs too much from a single-batch gradient, that indicates excessive gradient noise or an abnormal numerical scale. Sample code:
import mathdef check_gradients(model, param_groups, loss_fn, batch_sampler, k=5):"""Before training, run k small batches to check gradient consistency,exposing numerical issues earlier than formal training."""reference, probe = None, []for i in range(k):batch = next(batch_sampler)model.zero_grad(set_to_none=True)loss_fn(model(batch)).backward() # compute the gradient for the current batchgrads = {}for group in param_groups: # param_groups split by language trunk / vision tower / projection layerfor p in group:if p.grad is None: # parameter not in the compute graph; must be distinguished in multimodal settingscontinueg = p.grad.detach()if not math.isfinite(g.norm().item()): # numerical check: NaN/Inf is caught hereraise RuntimeError(f"Non-finite gradient detected: {group.name}/{p.shape}")grads[(group.name, id(p))] = g.float()if reference is None:reference = {k_: g.clone() for k_, g in grads.items()}continuetotal = sum(g.norm().item() ** 2 for g in grads.values()) ** 0.5probe.append({"batch": i, "global_grad_norm": total})# Relative deviation: if far beyond expectation, gradient estimation noise is too# large or a numerical anomaly is presentmax_dev = 0.0for key, g0 in reference.items():rel = ((grads[key] - g0).norm() / (g0.norm() + 1e-12)).item()max_dev = max(max_dev, rel)return probe, max_dev# groups: [Group("lm_trunk", ...), Group("vision_tower", ...), Group("projection", ...)]# sampler: an iterator that feeds the model with aligned image-text batches
probe: [{batch:0, global_grad_norm: 12.83},{batch:1, global_grad_norm: 13.41},{batch:2, global_grad_norm: 12.07},{batch:3, global_grad_norm: 14.02},{batch:4, global_grad_norm: 13.66}]max_dev: 0.38 # gradient directions align across parameters and magnitudes are stable;# if the relative deviation far exceeds expectations, investigate
5. Implementation: how the operator, sharding, and communication layers mesh
The engineering focus of this adaptation is not single-card peak compute but the systematic connection of the distributed training pipeline.
Operator layer: forward, backward, and gradient — none can be missing. The custom backend needs a complete implementation for the model’s hybrid attention and MoE operators. Key points for the attention part:
- Select compute kernels by sequence-length tiers;
- Keep softmax numerical-stability techniques (such as online softmax) and mask strategies consistent;
- Ensure the backward pass is recomputable.
Key points for the MoE part include gating selection, capacity-constrained dispatch, and weight-based combine. Most critical is the custom backward: the expert forward runs on the token order produced after dispatch, so the backward gradient must be restored to the original order and aligned with the gradient of the gating weights; otherwise the error only surfaces a few steps later as a loss anomaly.
Taking an MoE layer as an example, the core call can be simplified to:
def moe_layer(x, router, experts, top_k=8, capacity_factor=1.0):# x: [total_tokens, hidden]; router is the gating linear layer; experts are all routed expertslogits = router(x) # gating scoresweights, expert_id = topk_softmax(logits, top_k, dim=-1) # keep the k experts with the highest probabilitiesweights = weights / (weights.sum(-1, keepdim=True) + 1e-9) # normalize weightsflat_x, flat_w, flat_e = flatten_and_align(x, weights, expert_id)y = dispatch(flat_x, flat_e, experts, capacity_factor) # bucket by expert, capacity-limitedout = combine(y, flat_w) # weighted combine in the original token orderreturn out, router.aux_stats() # aux_stats feeds the load-balancing loss and utilization monitoring
Sharding layer: fully sharded data parallelism (FSDP-style). Parameters, gradients, and optimizer states are split within the data-parallel group; each card holds only its shard, temporarily aggregates (all-gather) parameters before forward computation, aggregates (reduce-scatter) gradients after backward, and then updates the local shard. Its benefits are threefold:
- Each card only needs to hold “model parameters + the card’s local activations”;
- Data- and model-dimension parallelism can be orthogonally stacked with expert parallelism;
- The recomputation strategy can be configured hierarchically.
Note that sharding changes each rank’s memory and time usage, so the peak-memory metric in Section 4 can only correspond to a specific partition scheme.
Communication layer: cross-node collective communication. Communication is handled by the vendor’s own collective communication library. Pipeline-level communication can be summarized into four primitive types:
| Parallelism dimension | Main collective primitive | Communication content and trigger timing | Main bottleneck |
|---|---|---|---|
| Sharded data parallelism | all-gather, reduce-scatter | parameter shards / gradient shards, before forward and after backward | bandwidth-intensive, frequent communication |
| Expert parallelism | all-to-all | routed tokens, once each for dispatch and combine | latency-sensitive, uneven token counts across cards |
| Tensor parallelism | all-reduce | forward and backward of some linear layers | two synchronizations per layer, high demand for low latency |
| Pipeline parallelism | point-to-point send/receive | passing activations and gradients between adjacent stages | bubble ratio, whether micro-batch scheduling is reasonable |
The overall training loop can be summarized as:
# fsdp: sharded data parallel wrapper; ep_group: expert parallel communication groupfor step, batch in enumerate(loader, 1):with fsdp.precision_context(bf16=True): # BF16 compute; master copy and optimizer states stay in FP32# batch: image-text pair batch, with the sampler guaranteeing image-text alignmentout, stats = model(batch, ep_group=ep_group)loss = compute_loss(out, batch.labels) # language modeling loss + modality alignment loss + load-balancing termloss.backward() # triggers the custom operators' backward implementationgrad_norm = clip_grad_norm_(model.parameters(), max_norm=1.0) # gradient clipping to suppress spikesoptimizer.step() # update only the local parameter shardif step % log_interval == 0:report(step, loss=loss.detach(), grad_norm=grad_norm,experts_used=stats.tokens_per_expert) # expert utilization must be observed alongside loss
All layers ultimately cooperate through “timeline overlap”: the compute stream handles forward and backward, the communication stream handles parameter aggregation and token exchange, with the latter tucked into the gaps of the former as much as possible; and the communication topology needs to match the device interconnect structure.
6. Toward full scale: four more hurdles after the cropped configuration
Industry research firms forecast that in 2026, shipments of high-end AI chips in the China market will reach about 5 million units, up roughly 83% year over year, with local solutions approaching 90% share (including cloud providers’ in-house ASICs). After penetration rises quickly, the competition focus shifts from “can it compute” to “can it be trained stably at large scale,” and there are at least four hurdles between a cropped configuration and full-scale pretraining.
1. Scaling up: the failure domain grows. Going from 16 cards to thousands is not just doubling the card count:
- Parallelism dimensions need to be re-partitioned, and the ratio of expert count to experts per card changes accordingly;
- Routing imbalance is further amplified at large scale;
- Collective communication primitives may hit scalability limits in large communication groups, the bandwidth cost of parameter aggregation rises, and the strategy needs to switch to hybrid partitioning and similar schemes.
2. Long-run stability: a marathon measured in weeks. 400 steps usually cover only minutes to hours; pretraining runs for weeks at a time, and occasional single-card throttling, link jitter, and ECC errors all surface as failures. This requires three foundational capabilities: a storage service that writes training checkpoints stably or periodically, a logging service that covers throughput and error rates, a monitoring and alerting system with multi-level thresholds, and a training mechanism that can recover from interruptions. The general infrastructure of mainstream domestic cloud platforms usually already covers storage, logging, and monitoring; the focus of adaptation is to plug “training-side metrics” into these capabilities and correlate them automatically.
3. Performance definition: effective training rate must be reproducible. Many public disclosures cite an effective training rate, measuring what proportion of compute is truly used for effective computation after deducting communication wait, data-loading wait, and fault and recompute losses. To make this number reproducible, at least three things are needed:
- A unified definition, including whether downtime is counted in the denominator;
- A measurement method with a fixed baseline;
- Continuous collection based on the monitoring/alerting and logging services.
4. Reproducibility: alignment across different stacks. Under full data, small-sample statistical noise, random seeds, data order, optimizer states, and parallelism partition schemes all affect results. A reproducible reference standard is suggested: under a fixed configuration, the loss curve is reproducible and can maintain trend consistency on another software/hardware stack.
7. A reusable checklist for pipeline validation
Abstracting the practice of this 400-step validation yields a general checklist for “new hardware × new model architecture” training pipeline validation:
- Configuration declaration: State the cropping boundary clearly (number of layers / number of experts / Top-k / sequence length / parallelism strategy), and make explicit which changes are “scale-only” and which are “structural.”
- Define metrics first: Specify the statistical window (skip the first few steps, take the mean of the last N steps), the definition of memory peak (single-card peak or cluster-wide percentile), and the gradient check method, to avoid cherry-picking data after the fact.
- Test operators upfront: Before overall training, compare forward-pass results against a reference implementation’s numerical error with small inputs, verify the numerical stability of the backward gradient, and specifically test edge cases such as mask and padding.
- Continuously observe dynamic signals: Beyond training loss, record the expert token-received distribution, drop rate, each modal branch’s gradient proportion, and the global gradient norm in parallel, to avoid false convergence.
- Fault injection: Drill scenarios such as node dropout, memory overflow, and communication timeout, confirm whether recovery from the training checkpoint is possible, and record the recovery time.
- Bind conclusions to configuration: Annotate all numbers with the configuration and hardware environment, and clearly state the boundary of “this result does not apply to …”.
For technical teams, what is really worth attention is not that a particular chip brand completed adaptation for a particular model, but forming a transferable methodology: use a cropped configuration to locate pipeline problems quickly, use multi-metric observation instead of single-point conclusions, and use long-run stability and reproducibility as the threshold for entering full-scale training. This methodology also applies to teams at domestic cloud providers pushing large-model training on domestic compute, and even to developers preparing to carry out training adaptation.
