Engineering Checklist for Training Ultra-Large MoE Models on Domestic Compute Clusters

    A Chinese compute vendor recently announced that its domestic AI cluster completed training adaptation for an open-source 2.8-trillion-parameter MoE model. This article breaks such adaptation work into verifiable engineering checkpoints—covering hardware metrics, FSDP2 mechanics, model loading, MoE load balancing, numerical stability, fault recovery, and multimodal parallelism—so training engineers can evaluate their own clusters against each item.

    Introduction

    A Chinese compute vendor recently disclosed that its domestic AI compute cluster completed training adaptation for an open-source 2.8-trillion-parameter Mixture-of-Experts (MoE) model. Details of such announcements typically come from the vendor’s own statements; cluster scale, training duration, and throughput figures have not been independently verified. This article breaks this kind of adaptation work into engineering checkpoints that can be verified one by one, so training engineers can evaluate them against their own clusters.

    1. Define the Information Boundary First

    Before reading such case studies, distinguish three categories of information:

    • Verifiable technical facts, such as the parallelism strategy, framework versions, and communication operators used;
    • Vendor-disclosed performance figures, such as throughput, speedup, and linear scaling efficiency, which must be interpreted in the context of the test configuration;
    • Content that cannot be judged from public materials, such as undisclosed kernel optimizations and driver details.

    If public materials do not specify the number of GPUs, sequence length, batch size, and compute precision used in testing, performance figures can only serve as a reference and should not be used directly as a basis for hardware selection.

    2. Which Metrics Matter for the Compute Foundation

    When training ultra-large models, peak per-GPU compute is usually not the only bottleneck. The following factors more often limit actual efficiency:

    • Memory capacity and bandwidth: Parameters, gradients, optimizer states, and activations all consume memory. Sharding reduces the parameters each GPU holds, but activations still grow with sequence length and batch size.
    • Inter-GPU interconnect: Expert parallelism generates large volumes of token-level All-to-All communication. Interconnect bandwidth and topology directly determine this overhead.
    • Framework and operator coverage: Confirm the PyTorch version, the distributed backend, and whether collective communication operators such as All-Gather, Reduce-Scatter, and All-to-All have corresponding implementations—and whether critical operators run on native implementations or fallback paths.

    A simple way to test software stack maturity: run the same model on a reference implementation and on the domestic backend, and observe whether the loss curves over the first several thousand steps are broadly consistent. If the curves diverge noticeably, investigate operator precision and randomness settings first before discussing performance.

    3. Core Mechanics of FSDP2

    FSDP2 is the new-generation implementation of Fully Sharded Data Parallelism in PyTorch. Compared with FSDP1, it shards at the parameter level, with sharded parameters represented as DTensor. Sharding metadata is therefore clearer, and composition with other parallelism strategies is more straightforward.

    One forward and backward pass roughly involves the following communication steps:

    1. Before computing a layer in the forward pass, All-Gather collects the full parameters of that layer. After computation, non-local shards are released to save memory.
    2. During the backward pass, parameters are All-Gathered again. Once the layer’s gradients are computed, Reduce-Scatter distributes the gradients back to each GPU’s local shard.
    3. The prefetch mechanism can issue the next layer’s All-Gather in advance while the current layer is computing, overlapping communication with computation as much as possible.

    Whether overlap actually takes effect must be verified with a profiler by checking whether communication kernels and compute kernels run concurrently on the timeline. If they are serialized, common causes include insufficient prefetch depth, poorly partitioned communication groups, or operators that trigger implicit synchronization.

    4. Three Critical Stages of the Training Pipeline

    4.1 Model Loading

    Trillion-scale weights cannot be read into memory by a single process and then distributed. A common approach:

    • Build the model structure on the meta device first, consuming no actual memory;
    • Read the weight index file (for example, the index of a safetensors format) to determine which rank each shard belongs to;
    • Each process reads its own shard in parallel and writes directly into its local sharded parameters.

    Checkpoints to verify: whether the bytes read by each process are balanced, and whether the storage system’s aggregate bandwidth becomes the bottleneck. The latter can be judged by observing the relationship between the number of parallel processes and read time—when read time no longer decreases with more processes, the bottleneck has shifted to the storage side.

    4.2 MoE Sharding and Scheduling

    In MoE models, experts are assigned to tokens by a router. Routing results can change at every step, so the distribution of experts across GPUs also affects load balance.

    Metrics that require continuous monitoring include:

    • The number of tokens each expert receives per batch, and its coefficient of variation;
    • The compute time of each GPU, and the gap between the slowest GPU and the average;
    • The proportion of communication time in a single step.

    If certain experts are persistently overloaded, common remedies include introducing an auxiliary load-balancing loss or adjusting the expert capacity factor. Whether to re-place experts should be decided based on statistics over multiple consecutive steps; single-step fluctuations are not sufficient evidence.

    Topology awareness matters as well. Placing experts that frequently exchange data within the same high-speed interconnect domain can reduce the share of cross-node communication.

    4.3 Gradient Synchronization and Numerical Stability

    Under BF16 mixed precision, master weights are typically kept in FP32, forward and backward computation uses BF16, and gradient reduction must also maintain sufficient precision.

    BF16 has the same exponent bits as FP32, so its numeric range is large enough and dynamic loss scaling is usually unnecessary. Loss scaling is only needed in FP16 training to prevent small-gradient underflow. This point is easily overlooked when copying prior experience.

    To prevent numerical issues mid-training, monitor the following:

    • The global gradient norm and its sudden changes;
    • The occurrence count of NaN and Inf;
    • The maximum absolute activation value of each layer.

    Once an anomaly occurs, you can skip that step, roll back to the most recent checkpoint, and lower the learning rate or inspect the corresponding data batch. This fallback strategy must be written into the training script in advance and validated in small-scale experiments.

    5. Fault Recovery

    In long-running training, single-GPU or single-node failures are almost inevitable. Recovery capability depends on two things: how checkpoints are written, and how fast the process group can be rebuilt after a restart.

    • Use distributed checkpointing so each rank writes only its own shard, avoiding a single-point write bottleneck.
    • Checkpoint frequency requires a trade-off between write overhead and maximum lost progress; define the recovery point objective (RPO) explicitly.
    • Also define the recovery time objective (RTO), and measure in fault drills how long it takes from failure to resumed training.
    • Preserve the process group topology and random number states so the post-recovery training trajectory is reproducible.

    6. Parallelism Configuration for Multimodal Modules

    If the model includes a vision encoder, projection layers, and a language model, the compute characteristics of these modules differ significantly, and parallelism can be configured separately for each. For example, use data parallelism for the vision part when its compute load is small, and tensor parallelism or sharded parallelism for the language part.

    Frozen modules require extra checks: confirm their parameters genuinely produce no gradients, that the optimizer maintains no state for them, and that sharded frozen parameters are still correctly gathered during the forward pass.

    The data side also needs tuning. The DataLoader’s prefetch depth, number of decoding threads, and the degree of overlap between data processing and GPU computation together determine whether GPUs sit idle waiting for data. Regular gaps in the GPU utilization curve usually indicate data starvation.

    7. Implementation Checklist

    • Test conditions (GPU count, sequence length, batch size, compute precision) are fully recorded
    • Framework versions and the implementation paths of collective communication operators are confirmed
    • With prefetching, communication and computation genuinely overlap on the timeline
    • Expert load statistics are connected to monitoring
    • Automatic fallback strategies for NaN and gradient norm anomalies exist and have been rehearsed
    • Checkpoint RPO and RTO are defined and validated in fault drills