Training Trillion-Parameter Open-Source LLMs: A Full-Link FSDP2 Adaptation Guide

    When a 2.8-trillion-parameter flagship model is open-sourced, the practical question for engineering teams is whether it can be trained on new AI accelerators. This article explains why trillion-parameter training is difficult and how a domestic AI accelerator vendor built a native FSDP2 multimodal training path. It breaks down the three key adaptation links (model loading, shard scheduling, and gradient synchronization) and describes the native multimodal training pipeline. It also covers tuning, checkpointing, and infrastructure, and gives three guidelines for teams evaluating new accelerators.

    1. From Open Source to Actually Trainable

    A major AI research lab recently open-sourced a flagship large model with 2.8 trillion parameters. After the announcement, many engineering teams found themselves focused less on the model’s raw capabilities and more on a practical question: can it be trained stably on domestic AI accelerators?

    A domestic AI accelerator vendor answered that question by adapting the model on its flagship training-and-inference accelerator card and accompanying software stack. The result is a native FSDP2 (fully sharded data parallel, second generation) multimodal training path. This path connects the entire training chain, from model loading and shard scheduling to gradient synchronization.

    “Adaptation” here does not mean dropping the model code onto new hardware and expecting it to run. It is system-level engineering that spans operators, parallelization strategies, communication, memory management, and numerical consistency.

    2. Why Trillion-Parameter Training Is Hard

    2.1 The memory gap far exceeds single-card and single-node capacity

    The first hurdle is memory. A rough estimate based on mixed-precision training (illustrative figures for principle illustration only):

    • Weights and gradients stored in 16-bit: 2.8 trillion parameters take roughly 5.6 TB.
    • Optimizer states stored in 32-bit: roughly 33.6 TB.
    • Activations, temporary buffers, and communication buffers push the total even higher.

    In practice, training more often uses a form of optimizer state with 32-bit master weights plus 32-bit first- and second-order moments. These tens of terabytes of memory must be spread across hundreds or even thousands of cards before each card has enough headroom left for computation.

    2.2 Sparse and multimodal architectures compound the complexity

    Flagship trillion-parameter models typically use a mixture-of-experts (MoE) sparse architecture. Each token activates only a subset of experts. The compute per forward pass is far lower than for a dense model, but the design adds extra communication: routing tokens to experts, dispatching them across cards, and aggregating the results.

    These models are usually multimodal as well. A vision encoder converts images into token sequences, and the large language model backbone models image and text tokens in a unified way. Training data contains both image-text pairs and pure text, so sequence shapes vary widely. No single parallelization strategy fits every submodule, so the adaptation work extends from a “single layer” to the “entire chain.”

    2.3 Software and hardware ecosystem gaps are the main friction point

    On mature hardware platforms, framework-level parallelism, collective communication implementations, and high-performance operators have typically been refined over many years. When domestic accelerators move into training workloads, the friction comes mainly from three areas:

    • Operator coverage: whether key operators such as attention, normalization, and MoE routing perform well against the hardware’s characteristics.
    • Communication optimization: whether collective communication can fully exploit inter-card and inter-node interconnect bandwidth.
    • Automatic parallelization strategies: whether the framework’s sharding and partitioning schemes can be implemented efficiently on the new hardware.

    Only by getting each of these working does new hardware have a foundation for trillion-scale training.

    3.1 Model loading: making trillion-parameter weights fit

    Trillion-parameter models cannot be loaded by simply loading the whole model and then sharding it. Building the full model on a single card first can exhaust memory during initialization.

    A sounder approach starts by parsing the model configuration and weight shard metadata. The model skeleton is then built on a meta device, which keeps only the structure and shape information for each layer and allocates no real memory.

    Sharding plans and communication domain layouts can therefore be designed before the weights arrive. This keeps memory usage concentrated exactly where it is needed.

    3.2 Shard scheduling: why FSDP2 has become the mainstream choice

    FSDP2 shards model parameters, gradients, and optimizer states into units, with each device holding one shard. During the forward pass, the full parameters for a layer are temporarily gathered when that layer is reached and released immediately after the computation.

    The core improvement over the first generation is that FSDP2 expresses tensor layouts as “one shard per device (DTensor).” This ties parameter sharding explicitly to the device mesh. The benefits:

    • Easier composition with tensor parallelism and expert parallelism.
    • Clearer sharding logic, which lowers cross-platform porting and debugging costs.
    • Easier on-demand trade-offs among communication, memory, and recomputation.

    A schematic configuration:

    1. # Illustrative pseudocode: per-module full sharding with communication/compute overlap
    2. def build_train_plan(model, mesh):
    3. # Assign a sharding strategy to every trainable module
    4. for layer in model.transformer.layers:
    5. fully_shard(layer, mesh=mesh,
    6. mixed_precision=bf16_policy,
    7. reshard_after_forward=True)
    8. # The vision encoder is usually smaller, so it can use a separate policy
    9. fully_shard(model.vision_encoder, mesh=mesh,
    10. reshard_after_forward=False)
    11. fully_shard(model, mesh=mesh,
    12. mixed_precision=bf16_policy,
    13. reshard_after_forward=True)
    14. # Overlap forward/backward computation with communication to hide latency
    15. enable_comm_compute_overlap(
    16. forward_pre_hook="all_gather",
    17. backward_hook="reduce_scatter",
    18. )

    For trillion-scale models, data-parallel sharding alone is not enough: even one shard of the weights would still exceed a single card’s memory. Combining several forms of parallelism is therefore necessary:

    Parallelism What it shards Problem it solves
    Fully sharded data parallelism (FSDP) Parameters, gradients, optimizer states Reduces per-card memory for weights and optimizer states
    Tensor parallelism (TP) Matrix operations within a single layer (restricted to high-speed intra-node interconnect) Reduces per-card, per-layer memory and compute pressure
    Pipeline parallelism (PP) Layers split across different device groups Scales across nodes and balances memory
    Expert parallelism (EP) MoE experts spread across different devices Relieves per-card overload from too many expert parameters

    On domestic accelerators, orchestration focuses on two things. First, keep tensor parallel communication domains on the higher-bandwidth inter-card interconnect. Second, create a separate communication group for the expert routing All-to-All traffic so it does not interfere with data-parallel communication.

    3.3 Gradient synchronization: balancing communication, precision, and stability

    In sharded data parallelism, gradient synchronization relies on an All-Gather of parameters in the forward and backward passes, plus a Reduce-Scatter of gradients in the backward pass. The main tuning levers:

    • Communication/compute overlap: split the All-Gather and Reduce-Scatter into finer-grained chunks and pipeline them with forward and backward computation to hide communication latency.
    • Bucketing: combine many small, scattered gradients into larger communication buckets. This reduces the number of communication calls and the associated synchronization overhead.
    • Gradient accumulation: reduce the number of optimizer updates across iterations within accumulation steps, which lowers global synchronization frequency.
    • Mixed precision and numerical stability: compute weights and activations in 16-bit, while keeping optimizer states and gradient accumulation in 32-bit. Loss scaling or dynamic range control can be introduced where necessary to prevent gradient underflow.

    At trillion-parameter scale, even a tiny numerical deviation accumulates and amplifies across training steps. Adaptation on domestic accelerators therefore also needs numerical comparisons of key operators against mature platforms. Engineers locate the layers and steps where maximum absolute and relative errors appear to determine whether the cause is the operator implementation, the precision policy, or the order of accumulation during communication.

    4. The Multimodal Training Path: Training “Image + Text” on One Chain

    Fully sharded data parallelism solves parameter sharding, but multimodal training also has to handle heterogeneous data and heterogeneous submodules. Its native path typically has four stages:

    1. Data loading: after preprocessing, images go to the vision encoder and text goes to tokenization, and both ultimately become token sequences.
    2. Feature alignment: a projection layer maps visual tokens into the language model’s feature space, where they are concatenated with text tokens before entering the backbone.
    3. Parallel orchestration: the vision encoder and projection layer use different sharding granularities from the language backbone, and their communication is orchestrated separately.
    4. Loss and backward propagation: image and text tokens are jointly optimized under a unified loss function.

    “Native” means the parallelization strategy and data pipeline were rewritten for this hardware platform, rather than ported from another platform and patched repeatedly afterward.

    5. After the Training Chain Is Connected: Three More Things to Do

    First, build an “align–locate–optimize” tuning loop. Start by validating sharding, mixed precision, and gradient synchronization on a small-scale benchmark model. Then scale up gradually to trillion parameters, and finally use profiling tools to locate communication bottlenecks.

    Second, design checkpointing and fault tolerance into the system. When training stops or exits abnormally, every shard should be saved completely. When resuming, the model can be re-sharded for the current cluster size and then loaded. This aligns with FSDP2’s “shard as layout” design philosophy.

    Third, rely on general-purpose engineering capabilities to run the training workload. Training jobs are typically orchestrated through a container platform. Checkpoints go to object storage, job logs feed into a logging service, and key metrics are tracked in real time through monitoring and alerting. Together, these capabilities support the long-term, stable operation of large-scale training.

    6. What This Means for Engineering Teams

    An open-sourced trillion-parameter model shifts the competition from “do we have the model?” to “can our compute infrastructure support it?” For engineering teams, this suggests three things:

    • Evaluate hardware on the full stack. Peak compute is only part of the picture. Also consider how mature the framework’s parallelization support is, how well key operators are covered, and how deep the communication optimizations go.
    • Benchmark the entire training chain. Use end-to-end throughput, memory utilization, and training stability as the measures, rather than performance numbers from a single compute case.
    • Phase the investment. First complete small-scale alignment validation, then scale up gradually to keep adaptation risk under control.

    Adapting a trillion-parameter model on domestic accelerators is valuable beyond whether a single model runs. It validates a methodology for full-link adaptation. For teams planning to introduce domestic compute into large-model training, it offers a reusable engineering reference path.