Beyond "Can It Run?": Trillion-Parameter Multimodal Model Training Adaptation with FSDP2

    This article examines the engineering work required to adapt trillion-parameter multimodal models for distributed training. It covers memory consumption, communication bottlenecks, multimodal gradient synchronization, software-stack adaptation, and the practical value of a native FSDP2 training path. The goal is to explain how teams can move from a model that merely runs on a single card to a stable, scalable, and observable large-scale training workflow.

    1. Introduction: A Capability Milestone Reveals System Engineering Challenges

    A hardware vendor recently announced that it had completed training adaptation for a flagship multimodal model with approximately 2.8 trillion parameters. The work was performed on its flagship integrated training-and-inference AI accelerator and self-developed software stack, and it built a native multimodal training path based on FSDP2. The path covers model loading, shard scheduling, and gradient synchronization from end to end.

    For practitioners working with large models, the significance is not simply “who adapted what.” Instead, it highlights a broader fact: in the trillion-parameter era, model training is no longer a one-dimensional hardware competition. It is a system engineering problem involving four tightly coupled layers:

    1. Accelerator hardware
    2. Drivers and software stack
    3. Distributed training framework
    4. Model architecture and training strategy

    Many teams encounter similar problems: a model runs without issue on a single device but becomes unstable in multi-device training; loss converges normally in small-scale experiments but throughput drops sharply at thousand-device scale; or available hardware cannot be used because memory is insufficient for a frontier model.

    This article focuses on the general technical problem of adapting trillion-parameter models for training. It analyzes the issue from four perspectives: memory, communication, multimodality, and software stack. It also presents engineering methods that can be applied in practice.

    2. What Does “Training Adaptation” Actually Mean? From “It Runs” to “It Scales”

    Many teams understand training adaptation as simply whether a model can start running. However, in production environments, adaptation usually includes at least four progressive levels:

    1. Functional availability: The model can complete forward propagation, backward propagation, and parameter updates without errors.
    2. Result credibility: Loss curves converge, and gradient norms and learning-rate behavior remain interpretable under different parallelism strategies.
    3. Efficiency: Memory utilization is reasonable, computation and communication overlap sufficiently, and scaling efficiency remains controllable as the number of devices increases.
    4. Stability and controllability: Long-running training can recover from failures, and key metrics can be observed and monitored.

    Trillion-parameter models are difficult mainly because of three factors: memory, communication, and gradient synchronization semantics. Each is discussed below.

    2.1 Memory: Parameters, Gradients, and Optimizer States

    Consider standard mixed-precision training. The main model parameters and gradients are stored in half precision, while the optimizer usually maintains single-precision master weights and two Adam-style state variables.

    A rough estimate per parameter is as follows:

    • Half-precision parameter: approximately 2 bytes
    • Half-precision gradient: approximately 2 bytes
    • Single-precision master weight: approximately 4 bytes
    • First-order and second-order Adam states: approximately 8 bytes in total

    The total is approximately 16 bytes per parameter.

    Even if activation memory is ignored, the static states for a 2.8-trillion-parameter model require at least about 44.8 TB of memory. If each accelerator provides 80 GB, that is equivalent to filling the memory of about 560 cards completely. This estimate does not even include real-world memory fragmentation or utilization loss.

    Therefore, trillion-parameter training cannot rely on each device holding the full model. Sharding is required to distribute parameters and optimizer states across hundreds or thousands of devices. A typical approach is to use FSDP-based full-sharding strategies.

    2.2 Communication: The Real Bottleneck of Throughput

    Sharding solves the problem of “fitting the model in memory,” but it introduces a new problem: “moving the data efficiently.”

    Under full sharding, each layer needs to gather distributed parameters before its forward computation, and then reduce gradients back to the appropriate shards after backward computation. This means:

    • AllGather is required before forward computation.
    • ReduceScatter is required after backward computation.
    • Each device frequently participates in collective communication.

    When parallel groups span multiple nodes, communication crosses the inter-node network. Inter-node bandwidth is usually much lower than intra-node interconnect bandwidth, and latency is significantly higher. In such cases, communication time can easily exceed computation time and become the true throughput ceiling.

    This is why computation-communication overlap has become a mandatory requirement in large-scale training.

    2.3 Multimodal Models Introduce New Gradient Synchronization Semantics

    A text-only model usually has a single computation graph, so gradient synchronization is relatively straightforward. Multimodal models are different. Their gradient synchronization paths generally involve at least three types of parameters:

    • Vision encoder: Usually has relatively few parameters, but its forward computation is intensive. Whether it is frozen directly affects whether gradient memory must be allocated for it.
    • Modality projector: Usually has very few parameters, but it plays a critical role in cross-modal alignment and generally must be trained.
    • Language backbone: Contains most of the parameters and is the primary target of parallel partitioning.

    A multimodal model can be viewed as a computation graph composed of multiple subgraphs. If the entire model is wrapped as a single unit, small subgraphs may still be forced to participate in full aggregation and gradient reduction. This creates inefficient communication.

    Therefore, a key step in multimodal training adaptation is to align parameter sharding strategy with model structural semantics. This is the core meaning of a “native training path.”

    3. Software Stack Adaptation: Making the Framework Understand a New Compute Platform

    Training on a specialized or self-developed accelerator usually requires software-stack work at three levels.

    3.1 Compute Library Adaptation

    Deep learning frameworks call low-level hardware through operator libraries. The software stack must provide high-performance implementations for common operators, covering categories such as:

    • Matrix multiplication
    • Normalization
    • Attention
    • Activation functions
    • Loss functions

    For trillion-parameter models, additional attention is also required for:

    • Mixed-precision support: Numerical stability and overflow handling in half-precision computation.
    • Distributed communication libraries: Implementations of collective primitives such as AllGather, ReduceScatter, and AllReduce.
    • Large-scale parallel operators: Operators that require cross-device coordination, such as sequence parallelism and context parallelism.

    3.2 Distributed Runtime Adaptation

    Distributed training relies on the runtime to complete process group initialization, device discovery, gradient synchronization, and checkpoint I/O. A self-developed software stack must expose a consistent device abstraction to the framework so that devices can be scheduled and managed uniformly.

    This requires clear interface agreements among device drivers, communication libraries, and the framework.

    3.3 Debugging and Observability Adaptation

    The bottleneck in adaptation is often not whether the model runs, but whether it runs correctly. The software stack should provide:

    • Operator-level precision comparison tools for layer-by-layer alignment with reference implementations.
    • Performance profiling for communication and computation to locate bottlenecks.
    • Memory allocation and fragmentation analysis to optimize memory layout.

    4. FSDP2 Native Multimodal Training Path: From “It Runs” to “It Runs Well”

    4.1 Why a Native Training Path Is Needed

    A common traditional approach is to patch existing unimodal training code. For example, teams may force a multimodal model into an FSDP wrapper or handle the vision and language parts separately while manually synchronizing gradients.

    This approach has several problems:

    • Parameter sharding and gradient reduction for the vision and language components may be handled separately, leading to missed synchronization or duplicate reduction.
    • Frozen parameters and trainable parameters may be placed in the same wrapping unit, wasting communication bandwidth.
    • Model structure and parallelism strategy become tightly coupled, so changing the parallel configuration may require rewriting the training script.

    A native training path means modeling the layered structure, parameter properties, and parallelism strategy of multimodal models as first-class concepts at the framework level, rather than assembling them temporarily at the application layer.

    4.2 Layered Wrapping: Give Each Parameter Category Its Own Sharding Strategy

    One of the most important changes in FSDP2 is the shift from flat parameter management to shard-tensor-based parameter management. Each parameter is sharded independently, and gradients and optimizer states are also represented as shard tensors.

    This provides three direct benefits:

    1. Parameters and optimizer states correspond one-to-one, making saving and loading more intuitive.
    2. Different parameters can use different parallelism strategies flexibly.
    3. Combining sharding with tensor parallelism, expert parallelism, and other partitioning methods becomes semantically clearer.

    In multimodal training, a reasonable layered wrapping pattern is shown below:

    1. # Layered wrapping example: separate sharding strategies for the vision tower, projector, and language backbone
    2. # Note: this is illustrative code; actual interface names depend on the framework version
    3. # 1. Vision encoder: relatively small parameters but compute-intensive forward pass
    4. vision_shard = FSDP(vision_encoder, sharding_strategy="FULL_SHARD")
    5. # 2. Multimodal projector: very few parameters; trained but not separately sharded
    6. projector = FSDP(projector, sharding_strategy="NO_SHARD")
    7. # 3. Language backbone: contains most parameters; use full sharding
    8. llm_shard = FSDP(llm_backbone, sharding_strategy="FULL_SHARD")
    9. # 4. Top-level model: combine the wrapped submodules for forward and backward
    10. class MultimodalModel(nn.Module):
    11. def __init__(self, vision, projector, llm):
    12. super().__init__()
    13. self.vision = vision_shard
    14. self.projector = projector
    15. self.llm = llm_shard
    16. def forward(self, pixel_values, input_ids):
    17. visual_embeds = self.vision(pixel_values) # Vision encoding
    18. visual_embeds = self.projector(visual_embeds) # Project to language space
    19. text_embeds = self.llm.embedding(input_ids)
    20. # Concatenate visual and text embeddings, then feed them into the language backbone
    21. inputs_embeds = torch.cat([visual_embeds, text_embeds], dim=1)
    22. return self.llm(inputs_embeds=inputs_embeds)

    The key point of this layered design is that the vision tower and language backbone use different sharding granularities, while the projector does not participate in sharding. This avoids inefficient communication for small modules while ensuring that cross-modal gradients are propagated correctly.

    4.2.1 Selective Activation Recomputation: Balancing Memory and Compute

    Even after sharding, activations can still become a major source of memory consumption. A common industry technique is activation recomputation. Instead of retaining all intermediate activations during the forward pass, the training framework discards some of them and recomputes them during the backward pass. This trades a small amount of extra computation for reduced memory usage.

    Under the FSDP2 path, selective recomputation is recommended. That is, recompute only compute-intensive modules such as attention blocks that account for a large portion of activation memory, rather than recomputing entire layers indiscriminately.

    1. # Selective activation recomputation example: recompute only attention modules
    2. # Actual configuration depends on the framework version
    3. llm_shard = FSDP(llm_backbone, sharding_strategy="FULL_SHARD")
    4. llm_shard.llm.apply(
    5. lambda m: setattr(m, "recompute", True) if "attention" in m.__class__.__name__.lower() else None
    6. )

    4.3 Combining Parallelism Dimensions and Scaling Efficiency

    FSDP2 addresses sharding along the data-parallel dimension, but trillion-parameter models often require multiple parallelism dimensions:

    • Tensor parallelism: Splits matrix operations within a layer across multiple devices, reducing per-device memory pressure. It is best suited to high-bandwidth intra-node interconnects.
    • Pipeline parallelism: Splits the model by layer and assigns different layers to different device groups, reducing the number of parameters resident on each device.
    • Expert parallelism: Used for sparse architectures, where different experts are placed on different devices. It usually requires AlltoAll communication.
    • Context parallelism: Splits long sequences across devices to reduce memory pressure in long-context training.

    A common practice is to use tensor parallelism and expert parallelism inside a node, while using data parallelism and pipeline parallelism across nodes. This allows communication to remain within high-bandwidth domains as much as possible.

    This is also where integrated training-and-inference hardware can provide value. When training and inference share the same interconnect and software stack, platform adaptation costs can be reduced.

    4.3.1 Parallelism Orchestration Under Super-Pod Topologies

    In recent years, super-pod architectures have become a mainstream form for large compute clusters. These systems organize dozens of accelerators into a tightly coupled unit through high-bandwidth domains, while nodes are connected by a network.

    On a super-pod architecture, parallelism should follow a “inside first, outside second” principle:

    • Keep tensor-parallel groups within high-bandwidth domains.
    • Keep expert parallelism within the same super-pod whenever possible.
    • Allow data parallelism and pipeline parallelism to span across super-pods.

    5. From Model Loading to Gradient Synchronization: Seven Steps of the Full Pipeline

    The value of the FSDP2 native path is that it breaks training into seven verifiable stages. Each stage has clear inputs, outputs, and validation points.

    5.1 Model Loading: From Single-Device Definition to Distributed State

    When training starts, the model is first defined using a normal single-process style. FSDP2 then shards parameters across devices according to the selected sharding strategy. The key requirement is correct shard mapping: the shard location and shard shape of each parameter must correspond exactly to its global shape.

    1. # Model loading and sharding example
    2. # 1. Define the model on a single process
    3. model = MultimodalModel(vision_encoder, projector, llm_backbone)
    4. # 2. Shard the model according to the selected strategy (interface depends on framework version)
    5. model = FSDP(model, sharding_strategy="FULL_SHARD")
    6. # 3. Initialize the optimizer; its states are automatically distributed with sharded parameters
    7. optimizer = torch.optim.AdamW(model.parameters(), lr=1e-4)

    5.2 Shard Scheduling: Ensuring Each Device Holds Only What It Needs

    Shard scheduling determines which device holds which part of the model. A good scheduling strategy should satisfy three principles:

    • Load balance: The number of parameters and amount of computation on each device should be roughly balanced.
    • Communication locality: Parameters that frequently interact should be placed in the same high-bandwidth domain.
    • Recoverability: Shard information should be persistable so that training can resume precisely after interruption.

    5.3 Forward Computation: The Data Flow of Multimodal Fusion

    The forward pass can be divided into four steps:

    1. Vision encoding: Encode images or video frames into visual embeddings.
    2. Modality projection: Map visual embeddings into the language model embedding space.
    3. Embedding concatenation: Concatenate visual embeddings with text embeddings.
    4. Language backbone forward pass: Run attention and feed-forward computation over the concatenated sequence.

    One common pitfall in multimodal training is sequence-length expansion. High-resolution images can produce many visual tokens, and the concatenated sequence may become several times longer than a text-only sequence. This increases both attention computation and activation memory, so strategies such as context parallelism or recomputation may be required.

    5.4 Backward Propagation: Gradient Computation and Synchronization

    During backward propagation, gradients flow back layer by layer along the computation graph. FSDP2 gathers parameters as needed before each layer’s backward computation and reduces gradients immediately after computation completes.

    A key optimization is computation-communication overlap: the gradient reduction of the current layer can run concurrently with the backward computation of the previous layer. This hides communication time inside computation time.

    In multimodal training, frozen parameters also require special attention. If the vision tower is frozen, its parameters should not participate in gradient reduction, otherwise unnecessary communication overhead will be introduced. If partial unfreezing is used, the set of parameters participating in synchronization must be controlled precisely.

    5.5 Gradient Synchronization: From “Synchronized” to “Controllably Synchronized”

    Under full sharding, gradient synchronization is essentially ReduceScatter. Each device holds part of the full gradient, and after reduction each device keeps only the gradients corresponding to its own shard.

    Compared with traditional AllReduce, ReduceScatter transfers less data and is naturally compatible with sharded storage.

    In practice, three details deserve attention:

    • Gradient clipping: Under sharded training, computing the global gradient norm requires cross-device reduction and cannot be done independently on a single device.
    • Gradient accumulation: Gradients from multiple micro-batches should be accumulated locally before synchronization, avoiding repeated communication.
    • Mixed precision: Numerical precision during reduction can affect training stability, so single-precision accumulation is usually preferred.
    1. # Gradient accumulation and synchronization example
    2. # During micro-batches, gradients are accumulated locally without triggering cross-device reduction.
    3. # After accumulation, gradients are synchronized together.
    4. # The exact interfaces depend on the framework version.
    5. for i, batch in enumerate(dataloader):
    6. with model.no_sync() if (i + 1) % accum_steps != 0 else nullcontext():
    7. loss = model(batch)
    8. loss.backward()
    9. if (i + 1) % accum_steps == 0:
    10. optimizer.step()
    11. optimizer.zero_grad()

    5.6 Optimizer Update: Consistency Under Sharded States

    Under FSDP2, each device holds only the optimizer states corresponding to its own parameters. Therefore, optimizer updates are performed locally within each shard and do not require additional communication.

    This is an important advantage of full sharding compared with traditional data parallelism. In traditional data parallelism, every device maintains complete optimizer states. Full sharding distributes those states across all devices.

    However, learning-rate schedules and parameter groups should still remain globally consistent. Otherwise, different devices may apply different update steps due to mismatched grouping.

    5.7 Checkpointing and Recovery: A Safety Net for Long-Running Training

    Trillion-parameter training runs can last for weeks. The checkpoint mechanism must support:

    • Shard saving: Each device saves the parameter and optimizer-state shards it owns.
    • Resharding on load: When parallelism scale changes, shards can be automatically rearranged.
    • Consistency verification: After saving and loading, key parameters and optimizer states should match exactly.

    6. Precision Alignment: The Test of Whether Adaptation Is Trustworthy

    Getting a model to run is only the first step. Precision alignment is the key acceptance criterion. A three-layer validation method is recommended:

    1. Single-device comparison: Compare a small model against a reference implementation on a single device and check layer-by-layer output errors.
    2. Multi-device small-model training: Train a small model on multiple devices to verify gradient reduction and optimizer updates.
    3. Full-scale convergence: Train a large model and compare its loss curve against reference training behavior.

    When performing alignment, three types of metrics are especially useful:

    • Layer-wise output error: Differences in normalized layers, attention layers, and feed-forward layers.
    • Gradient norm: The global gradient norm should remain stable within a reasonable range.
    • Loss curve: The trend should match the reference implementation and should not show abnormal spikes or long plateaus.

    7. Performance Tuning: From “It Runs” to “It Runs Fast”

    After adaptation, performance tuning usually focuses on four areas.

    7.1 Operator Fusion

    Combining multiple small operators into a larger operator can reduce kernel launch overhead and intermediate memory usage. Attention, normalization, and activation functions are common fusion targets.

    7.2 Computation-Communication Overlap

    By adjusting FSDP2 prefetch depth, shard granularity, and stream scheduling, communication can be made to overlap with computation as much as possible. In practice, throughput can be compared across different configurations to find the best combination for the current cluster topology.

    7.3 Memory Optimization

    In addition to recomputation, teams can also consider:

    • Offloading optimizer states
    • Using gradient accumulation to reduce peak memory usage
    • Processing activations in blocks

    Memory optimization often requires trade-offs between throughput and memory usage.

    Different parallelism combinations can lead to very different performance results. A useful baseline is tensor parallelism and expert parallelism inside a node, plus data parallelism across nodes. From there, the degree of each parallelism dimension can be adjusted while monitoring scaling efficiency.

    8. Stability Governance: Making Long-Running Training Finish Successfully

    Trillion-parameter training is expensive, so stability directly affects return on investment. A stability governance system can be built around four areas:

    • Elastic fault tolerance: Automatically remove failed nodes, regroup resources, and recover from the latest checkpoint.
    • Slow-node detection: Identify abnormal nodes that slow down overall training and isolate them promptly.
    • Metric monitoring: Establish baselines and alerts for throughput, memory usage, communication volume, temperature, and other key indicators.
    • Log tracking: Preserve logs from the entire training process for debugging and retrospective analysis.

    9. Common Issues and Practical Responses

    The following issues are common in real adaptation work:

    Symptom Possible Cause Suggested Response
    Out-of-memory error immediately after startup No sharding or inappropriate sharding strategy Check FSDP wrapping levels and confirm that the vision tower and language backbone are sharded appropriately
    Multi-device throughput is far lower than single-device throughput Poor communication overlap or mismatched topology Adjust prefetch depth and check whether parallel groups span nodes
    Abnormal gradients in the vision tower Frozen strategy does not match gradient reduction strategy Ensure frozen parameters do not participate in gradient reduction
    Loss spikes Missing gradient clipping or mixed-precision overflow Check global gradient-norm clipping and precision settings
    Checkpoint cannot be loaded Shard layout does not match current parallelism scale Use a reshardable checkpoint format

    10. Conclusion: The Capability Divide in the Trillion-Parameter Era

    Moving from “can the model run?” to “can training scale?” requires solving four major challenges: memory, communication, multimodality, and software stack.

    The value of an FSDP2 native multimodal training path is that it unifies parameter sharding, gradient synchronization, and model structural semantics at the framework level. This turns trillion-parameter training from a collection of engineering hacks into a reusable standard workflow.

    For teams, the real capability divide is not whether they own the most advanced hardware. It is whether they can coordinate hardware, software stack, frameworks, and model design into a complete methodology covering adaptation, validation, tuning, and governance.

    Teams that build this system earlier will be able to turn frontier models into usable business capabilities faster.