Technical Paths for Adapting Ultra-Large-Scale Model Training to Domestic Compute

    This article examines how engineering teams can adapt ultra-large-scale model training to non-mainstream hardware ecosystems. It covers the memory and communication walls, layered operator/compiler/distributed-framework adaptation, native FSDP2 training paths, multimodal data pipeline requirements, stability validation, and the broader implications of compute diversification.

    1. Background: Open-Source Large Models Drive Diversification of Training Infrastructure

    Recently, the industry has seen the emergence of open-source flagship models with parameter counts reaching the 2.8-trillion level. The release of such models is not only a milestone in model capability but also poses unprecedented challenges to training infrastructure. At the same time, multiple domestic AI accelerator vendors have announced that they have completed adaptation for the training or inference stages of such models. This indicates that domestic compute is moving from “usable” to “runs well” and is gradually gaining the engineering capability to support frontier large-model R&D.

    This article does not focus on any specific vendor or product. Instead, it centers on a general technical question: how to complete ultra-large-scale model training adaptation on non-mainstream hardware ecosystems. It systematically reviews the key technical challenges and solution approaches to provide a reference for engineering teams working on large-model training.

    2. Core Challenges of Ultra-Large-Scale Model Training

    1. The Memory Wall

    For a model with 2.8 trillion parameters, even storing the weights in half precision requires several terabytes of memory, far exceeding the capacity of a single GPU or even a single machine. Common industry practices include:

    • Parameter sharding: Partition model parameters, gradients, and optimizer states across multiple GPUs. A typical approach is fully sharded data parallelism.
    • Mixed-precision training: Trade low-precision computation for throughput while using master weights to maintain numerical stability.
    • Activation recomputation: Do not retain all intermediate activations during the forward pass; recompute them during the backward pass, trading time for space.

    2. The Communication Wall

    The larger the model, the more significant the cross-node communication overhead becomes. If operations such as gradient synchronization and parameter aggregation are not handled properly, communication time can exceed computation time. Common optimization methods include overlapping communication with computation, gradient bucketing, and topology-aware communication scheduling.

    3. Ecosystem Compatibility

    Mainstream deep learning frameworks and training stacks are mostly built around specific hardware ecosystems. For a new compute platform to run trillion-parameter model training, it must solve a series of engineering problems, including operator coverage, compiler optimization, communication library adaptation, and distributed framework integration. This is the focus of this article.

    3. The Complete Technical Chain for Training Adaptation

    1. Layered Adaptation: From Low-Level to Framework

    Adaptation for heterogeneous compute typically follows a layered strategy:

    • Operator layer: Ensure that all operators involved in the model, such as attention mechanisms, expert network routing, and normalization, have efficient implementations on the target hardware.
    • Compilation and runtime layer: Improve overall execution efficiency through graph compilation optimization, memory planning, and related techniques.
    • Distributed framework layer: Integrate with the sharding, partitioning, and communication primitives of mainstream distributed training frameworks.
    • Application layer: Complete end-to-end integration of model code, data pipelines, and training scripts.

    2. The Significance of a Native FSDP2 Training Path

    A key point in recent adaptation work is the construction of a “native FSDP2 multimodal training path.” Two aspects are worth expanding on.

    First, FSDP2 represents a more modern implementation of sharded data parallelism. Compared with earlier approaches based on flattened parameter wrapping, the new generation manages sharding on a per-parameter basis. Combined with device mesh abstraction, it can control the sharding granularity of parameters, gradients, and optimizer states more precisely, and it is easier to combine with strategies such as tensor parallelism, pipeline parallelism, and expert parallelism. Schematically, its core configuration logic can be abstracted as:

    1. # Conceptual illustration: per-parameter sharded fully sharded data parallel
    2. mesh = init_device_mesh(
    3. backend, # communication backend must support target hardware
    4. mesh_shape=(dp, tp, ep),
    5. )
    6. apply_fully_shard(
    7. model,
    8. mesh=mesh,
    9. reshard_after_forward=True, # release non-local shards after forward to reduce peak memory
    10. mixed_precision_dtype="bf16",
    11. )

    Second, “native” means that this is not a simple port. Instead, the complete path from model loading and shard scheduling to gradient synchronization has been re-established for the target hardware. Specifically, this includes:

    • Model loading: Checkpoints for very large models are usually stored in sharded form. During loading, parameter shards must be correctly reconstructed according to the device mesh to avoid memory peaks caused by aggregating first and sharding later.
    • Shard scheduling: Determine where each parameter shard resides based on device topology, and plan the timing of shard aggregation and release during forward and backward computation.
    • Gradient synchronization: Trigger reduction operations at bucket granularity during backpropagation, and overlap them with computation of subsequent layers as much as possible to hide communication latency.

    3. Additional Complexity in Multimodal Scenarios

    Trillion-parameter models usually have multimodal capabilities, and training data mixes text, images, video, and other modalities. This imposes additional requirements on the training path:

    • Heterogeneous data pipelines: Preprocessing, encoding, and packing workflows differ significantly across modalities. A high-throughput, streaming-capable data loading system is needed to prevent data supply from becoming a bottleneck.
    • Dynamic shape handling: Sequence lengths and resolutions of multimodal inputs vary widely, placing higher robustness requirements on memory planning and kernel tuning.
    • Sample-level balancing: Multimodal mixed training requires controlling the proportion of each modality at the batch construction level to ensure training stability.

    4. Stability Validation: The Last Mile of Adaptation

    Getting the training chain to run is only the first step. Engineering teams also need to validate training correctness and stability:

    • Numerical alignment: Under the same data and hyperparameters, compare loss curves and gradient norms with a reference implementation to confirm consistent numerical behavior.
    • Long-run stability testing: Run continuously for thousands of steps or longer, observing whether loss exhibits abnormal jumps and whether memory leaks slowly.
    • Elasticity and fault tolerance: Validate checkpoint-resume capability, including saving and restoring sharded checkpoints and restarting jobs after node failures. This is critical for training tasks that last for weeks.

    4. Implications for the Industry

    The industry significance of this adaptation work can be understood at three levels.

    First, compute diversification is a certain trend. Demand for compute in large-model training continues to grow, and a single hardware ecosystem cannot meet all requirements. Hardware portability and backend abstraction capabilities of training frameworks will become important evaluation dimensions for infrastructure.

    Second, the software stack is the decisive factor for domestic compute. Paper specifications of hardware are only the starting point. Whether frontier models can run and whether acceptable training efficiency can be achieved depend on the overall maturity of operator libraries, compilers, communication libraries, and distributed frameworks. “Completing flagship model training adaptation” is one way to validate the maturity of the software stack.

    Third, the open-source ecosystem accelerates the adaptation process. Open weights and open training code allow hardware vendors to validate their capabilities on public, reproducible benchmarks, and they lower the barrier for research teams to try heterogeneous compute.

    5. Conclusion and Outlook

    From model loading and shard scheduling to gradient synchronization, adapting ultra-large-scale model training to heterogeneous compute platforms is a systems engineering effort involving operators, compilation, communication, distributed frameworks, and data pipelines. Building a native FSDP2 training path, connecting multimodal data pipelines, and completing long-run stability validation mark a solid step forward for domestic compute platforms at the software stack level.

    Looking ahead, as trillion-parameter models become commonplace, training infrastructure will continue to evolve in areas such as automatic parallel strategy search, deep communication-computation fusion, and elastic fault tolerance. Competition in the diversified compute ecosystem will also be increasingly reflected in the engineering quality and developer experience of software stacks. For engineering teams, understanding these underlying mechanisms is a common foundation for building reliable and efficient training systems, regardless of the hardware platform chosen.