Training and Stable Operation of Near-Three-Trillion-Parameter Large Models: Adaptation Practices

    This article explains why adapting a near-three-trillion-parameter open-source flagship model to non-mainstream hardware is harder than simply getting it to run. It clarifies the difference between pre-training, training adaptation, and inference adaptation; breaks down the core constraints at the trillion-parameter scale, including memory, communication, numerical stability, and fault recovery; and examines a native fully sharded data parallel (FSDP2-style) training path as the core approach. It also outlines a verification checklist for long-run stability, the engineering system needed for full-pipeline training, and practical recommendations for technical teams.

    1. Background: Why “Adaptation” Is Much Harder Than “Getting It to Run”

    A recent industry report drew attention: a domestic compute vendor completed training adaptation for an open-source flagship model with nearly three trillion parameters on its flagship training-and-inference integrated AI accelerator card and self-developed software stack, running stably for 400 consecutive steps in a dual-node, 16-card environment. The report itself is brief, but it touches one of the hardest problems in current large-model engineering: training adaptation and long-cycle stability for ultra-large models on non-mainstream hardware.

    First, a conceptual clarification is needed, since this is where many discussions get confused: “training adaptation” is not the same as “completing pre-training on that chip.” The two differ greatly in engineering meaning.

    • Pre-training: starting from random initialization, consuming massive corpora and thousands of card-months of compute to produce base weights. It determines the model’s capability ceiling, and the compute source is usually not explicitly disclosed in public technical reports.
    • Training adaptation: given an existing model architecture definition and weights, making the training pipeline (forward pass, backward pass, optimizer updates, gradient synchronization, checkpoints) run correctly, efficiently, and stably on the target hardware and software stack.
    • Inference adaptation: only guaranteeing correct forward computation and operators, with a significantly smaller validation scope than training.

    A common industry practice is to present validation results for two types of hardware side by side in the same technical report, but such validation mostly focuses on the correctness of inference-side operators and parallel strategies, and cannot establish where the compute for base pre-training came from. Therefore, when evaluating an “adaptation” result, what really matters is: whether the pipeline is complete, whether parallel strategies are natively supported, and whether long-run stability is reproducible.

    2. Technical Challenges: What Three Trillion Parameters Mean

    When parameter scale crosses from hundreds of billions to the trillion level, engineering constraints change qualitatively, mainly in four dimensions.

    1. The memory wall. Taking mixed-precision training as an example, once parameters, gradients, and optimizer states (first- and second-order momentum) are combined, memory usage can reach more than ten times the parameter count in bytes. Even with sharding, the memory resident on each card for three trillion parameters remains extremely tight, requiring triple sharding of parameters, gradients, and optimizer states.

    2. The communication wall. Gradient synchronization in data parallelism, intra-layer partitioning in tensor parallelism, inter-stage transfer in pipeline parallelism, and routing distribution in expert parallelism stack up communication volume across different links. If the network topology does not match the parallel partitioning, communication becomes the main bottleneck, showing up as persistently low compute utilization.

    3. Numerical stability. Ultra-large models have activation distributions with a wide dynamic range, making loss spikes, abnormal gradient norms, and low-precision overflow likely. Loss scaling strategies for mixed precision, normalization layer implementations, and numerical stability handling in attention all directly affect whether training can run through hundreds of steps continuously.

    4. Fault recovery. In thousand-card-scale jobs, single-point failures are the norm rather than the exception. Whether faults can be located in minutes and training resumed from a checkpoint determines the effective compute of long-cycle jobs.

    3. Native Fully Sharded Data Parallel: The Core Adaptation Path

    The key approach in the case above is building a native fully sharded data parallel (FSDP2-style) training path. “Native” means the parallel capability is directly supported by the framework and operator layers, rather than relying on external patches or large amounts of hand-written glue code. Its engineering value shows in three ways.

    First, balancing memory and compute. Full sharding splits parameters, gradients, and optimizer states across multiple cards, aggregating shards on demand during forward and backward passes and releasing them immediately after use. Compared with traditional data parallelism, where each card holds a complete copy of the model, memory usage drops substantially, so more cards can be used to increase throughput rather than merely to fit the model.

    Second, compatibility with multimodal architectures. Modern flagship models are generally not purely dense, but contain mixed components such as multimodal encoders, sparse expert layers, and long-context attention. The native path must ensure these components do not conflict in sharding, recomputation, and mixed-precision strategies, and this is where most of the adaptation work concentrates.

    Third, verifiable pipeline completeness. A complete pipeline means every step, from model loading, shard scheduling, forward and backward passes, gradient reduction, to optimizer updates and checkpoint saving, is observable and reproducible. The structure of the training main loop can be expressed with the following illustrative code (general pseudocode only, not a specific product interface):

    1. for step in range(total_steps):
    2. batch = next(dataloader)
    3. with autocast(dtype=bf16):
    4. loss = model(batch) # Shards aggregated on demand
    5. loss.backward() # Backward + sharded gradient reduction
    6. clip_grad_norm_(model, max_norm) # Numerical stability guardrail
    7. optimizer.step() # Sharded optimizer update
    8. optimizer.zero_grad(set_to_none=True)
    9. if step % ckpt_interval == 0:
    10. save_sharded_checkpoint(step) # Sharded checkpoint

    4. Long-Run Stability Validation: The Methodology Behind 400 Steps

    A metric like “400 consecutive stable steps” is not about peak performance but about reproducibility. A validation checklist can be built along these dimensions:

    • Correctness baseline: run a small isomorphic model first and compare its loss curve against a reference implementation;
    • Numerical health: monitor gradient norms, loss spike frequency, and activation distribution drift;
    • Throughput stability: observe per-step time variance rather than only the first step or the average;
    • Recovery capability: actively inject single-card faults to verify checkpoint recovery and training resumption;
    • Resource levels: check whether peak memory, communication bandwidth usage, or host-side input supply forms a bottleneck.

    5. From Inference Deployment to a Full-Pipeline Training Engineering System

    Having only inference deployment capability is a different engineering maturity level from having full-pipeline training support. The former focuses on operator correctness and latency, while the latter must also cover distributed scheduling, fault tolerance, observability, and experiment management. A practical deployment combination typically includes: a container platform to host training images and resource isolation, object storage for corpora and checkpoints, a message queue to decouple the data preprocessing pipeline, and logging plus monitoring and alerting systems for anomaly detection and localization. In Baidu AI Cloud’s related practices, such general capabilities are typically offered as standard cloud product categories, making it easy for teams to combine them as needed rather than building the entire infrastructure themselves.

    6. Action Recommendations for Technical Teams

    1. Define acceptance criteria first: clarify whether it is inference adaptation, training adaptation, or pre-training, to avoid over-extrapolating conclusions.
    2. Prioritize native parallel paths: reduce glue code and lower long-term maintenance and upgrade costs.
    3. Make stability part of the pipeline: incorporate fault injection, checkpoint recovery, and metrics dashboards into routine regression.
    4. Build a layered validation matrix: single-card operators → single-node multi-card → dual-node multi-card → multi-node multi-card, narrowing the problem domain layer by layer.
    5. Preserve portability design: decouple model definitions, parallel strategies, and hardware backends to ease cross-platform migration and cost optimization.

    In summary, the value of a high-quality training adaptation lies not in a single successful run, but in forming a reproducible, observable, and portable engineering methodology. For most teams, consolidating this methodology brings more long-term benefit than chasing a specific adaptation result.