LLM Training Adaptation on Emerging GPUs: 16-Card Link Verification Key Points

    This article explores the key verification points for large language model (LLM) training adaptation on emerging GPUs, focusing on a 16-card link validation case. It covers three levels of training adaptation, VRAM calculations for massive models, the application of FSDP2 and fine-grained expert parallelism, and metrics for assessing stability over 400 training steps. It also provides a practical code example, a verification checklist, and guidance on evaluating GPU training capabilities.

    1. Defining “Training Adaptation”

    Large model adaptation generally falls into three levels. The first is inference adaptation, meaning the model can be loaded onto the chip and generate results. The second is fine-tuning adaptation, meaning the chip can execute backpropagation and parameter updates. The third is pre-training adaptation, meaning the entire training pipeline can run stably over long periods, covering data reading, sharding scheduling, gradient synchronization, and checkpoint saving. Many reports only cover the first level; readers need to identify which level a specific conclusion corresponds to.

    The case discussed in this article falls under training link verification. The original text mentions a dual-node setup with 16 GPUs and 400 consecutive optimizer updates as evidence of stability. This proves the link can run smoothly in a short time, but it does not directly guarantee that full-scale pre-training is viable. The following sections will detail VRAM, parallel strategies, stability metrics, and engineering checklists.

    2. The VRAM Calculation

    When training a model, VRAM stores more than just weights. Taking standard mixed precision with the Adam optimizer as an example, each parameter occupies approximately 16 bytes: 2 bytes for bf16 weights, 2 bytes for bf16 gradients, 4 bytes for fp32 master weights, 4 bytes for Adam’s first-order momentum, and 4 bytes for second-order momentum. Activation values require additional space, which is not included here.

    For a model with nearly 3 trillion parameters, these states alone require:

    3×10^12 × 16 bytes = 48 TB

    If distributed evenly across 16 GPUs, each card must handle about 3 TB. This far exceeds the capacity of current single-GPU VRAM. Therefore, for 16 cards to complete the training of the full model, only two scenarios are possible: either a scaled-down configuration or subset is being trained (e.g., fewer layers or fewer experts), or some states are offloaded to CPU memory or NVMe drives. Offloading significantly reduces speed and adds data transfer overhead.

    The original text does not provide per-GPU VRAM, weight precision, offloading status, parallel sharding methods, sequence length, or global batch size. With this information missing, the 16-card result should be understood strictly as a link verification. Readers evaluating a vendor’s training capability should request these parameters.

    It is also important to note that the original text mentions “nearly 3 trillion parameters” without specifying if this refers to total or active parameters. In MoE models, each token only activates a subset of experts, meaning computation is determined by active parameters, while storage is determined by total parameters. These should be reported separately.

    3. FSDP2: Basic Concepts of Sharded Training

    Fully Sharded Data Parallel (FSDP) splits parameters, gradients, and optimizer states across multiple GPUs. During forward computation, each GPU temporarily gathers the required parameters; after computation, it releases the unneeded portions. Thus, a single GPU only needs to permanently store its own shard.

    Compared to the first-generation FSDP, FSDP2 introduces two main changes. First, it manages shards at the parameter granularity, where each parameter exists as a distributed tensor, rather than concatenating an entire module’s parameters into a large buffer. Second, its VRAM management is more flexible, allowing on-demand parameter prefetching and timely release. These changes make module-level control more direct and easier to combine with other parallel strategies.

    When using FSDP2, avoid a common error: creating the optimizer before calling the sharding function. After sharding, the parameter objects change. If the optimizer holds the old references, it cannot update the parameters correctly. The correct order is to shard the model first, then create the optimizer.

    The original text mentions that FSDP2 adapts better to size differences in multimodal inputs. This claim requires specific evidence, such as throughput and VRAM peak comparisons across different modalities. As the original text does not provide this data, no conclusion is drawn here.

    4. Fine-grained Expert Parallelism: Communication and Load are Key Metrics

    In MoE models, each token is routed to a few experts. When experts are distributed across different GPUs, tokens must be sent to the target GPU via All-to-All communication, and sent back after computation. Communication bandwidth and latency directly determine training speed.

    Fine-grained expert parallelism splits experts into smaller units, offering more flexible routing, but communication frequency increases accordingly. During evaluation, focus on the following metrics:

    • Communication bandwidth: The actual bandwidth achieved by All-to-All across different message sizes, compared with the theoretical peak.
    • Communication latency: The time taken for a single All-to-All, and its proportion to the total single-step time.
    • Load ratio: The ratio of the maximum to the average number of tokens received by each expert. The closer this ratio is to 1, the more balanced the load.
    • Drop rate: The percentage of tokens dropped due to exceeding expert capacity.

    The original text only mentions the need for high bandwidth and low latency without providing measured values. The above metrics can turn this qualitative judgment into verifiable results.

    5. 400-Step Stability: How to Evaluate

    During the early stages of training, weights change significantly, gradients are prone to exploding, and loss can easily spike. Running 400 consecutive steps without NaN or Inf indicates that the numerical pipeline is basically normal during this phase. The value of this conclusion is that it rules out obvious hardware or communication errors.

    However, 400 steps does not equal long-term stability. Pre-training often requires hundreds of thousands of steps or more. When evaluating stability, it is recommended to record at least the following information:

    1. Non-finite value count: The number of times loss or gradient norm appears as NaN or Inf, which should be 0.
    2. Gradient norm: Record the total norm before clipping. If it remains significantly higher than the clipping threshold for a long time, there may be issues with the learning rate or data.
    3. Loss spikes: A common definition is if the loss at a step exceeds 1.5 times the 50-step moving average, it is recorded as a spike. The threshold should be adjusted based on the task.
    4. Step time fluctuation: The ratio of the standard deviation to the mean of single-step time. A sudden increase in fluctuation is often caused by communication blocking or GPU thermal throttling.
    5. Interruption recovery: Stop the process midway, restore from a checkpoint, and check if the loss curve is continuous.

    Only after completing these records can you state that “under a specific configuration and within a specific phase, 400 steps ran without interruption.” This statement is valid, but it does not prove that long-term training will necessarily be stable.

    6. Corrected Training Example

    The following example corrects common issues: adding complete imports, defining a loss function, using FSDP2’s fully_shard for sharding, and completing model sharding before creating the optimizer. This is still illustrative code; actual execution requires adapting to specific model structures, data pipelines, and vendor-provided devices and communication backends.

    1. import os
    2. import torch
    3. import torch.distributed as dist
    4. from torch.distributed.device_mesh import init_device_mesh
    5. from torch.distributed.fsdp import fully_shard
    6. def setup_distributed():
    7. # For emerging GPUs, replace with the vendor-provided communication backend name
    8. dist.init_process_group(backend="nccl")
    9. local_rank = int(os.environ["LOCAL_RANK"])
    10. # Use the device name specified in vendor documentation; 'cuda' is used here as an example
    11. device = torch.device(f"cuda:{local_rank}")
    12. return device
    13. def build_sharded_model(model, world_size):
    14. mesh = init_device_mesh("cuda", (world_size,))
    15. # Assume the model contains a layers list, shard layer-by-layer to reduce peak VRAM
    16. for layer in model.layers:
    17. fully_shard(layer, mesh=mesh)
    18. fully_shard(model, mesh=mesh)
    19. return model
    20. def compute_loss(logits, labels):
    21. return torch.nn.functional.cross_entropy(
    22. logits.view(-1, logits.size(-1)), labels.view(-1)
    23. )
    24. def train(model, optimizer, dataloader, device, max_steps=400, log_every=10):
    25. model.train()
    26. data_iter = iter(dataloader)
    27. for step in range(max_steps):
    28. inputs, labels = next(data_iter)
    29. inputs, labels = inputs.to(device), labels.to(device)
    30. optimizer.zero_grad(set_to_none=True)
    31. logits = model(inputs)
    32. loss = compute_loss(logits, labels)
    33. if not torch.isfinite(loss):
    34. raise RuntimeError(f"step {step}: loss is non-finite")
    35. loss.backward()
    36. grad_norm = torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0)
    37. optimizer.step()
    38. if step % log_every == 0 and dist.get_rank() == 0:
    39. print(f"step={step} loss={loss.item():.4f} grad_norm={grad_norm.item():.4f}")

    The calling sequence is as follows: first initialize the distributed environment, then place the model on the device and complete sharding, and finally create the optimizer.

    1. device = setup_distributed()
    2. model = build_sharded_model(MyModel().to(device), dist.get_world_size())
    3. optimizer = torch.optim.AdamW(model.parameters(), lr=3e-4)
    4. train(model, optimizer, dataloader, device)

    7. 16-Card Verification Checklist

    Check Item Content to Record
    VRAM Calculation Parameter, gradient, and optimizer state usage per GPU, plus peak activation values
    Precision Data types for weights, gradients, and optimizer states respectively
    Offloading Whether CPU or NVMe offloading is used, offloaded objects, and bandwidth
    Parallel Strategy Sharding methods and group sizes for data parallelism, sharding, and expert parallelism
    Batch & Sequence Sequence length, global batch size, gradient accumulation steps
    Communication Topology, intra-node and inter-node bandwidth, All-to-All latency
    Stability Non-finite value count, gradient norm, loss spike count
    Recovery Checkpoint save interval, whether loss is continuous after recovery

    8. Common Questions

    Can 16-card verification prove that full training is viable?

    No. It can prove that under the given configuration, forward, backward, communication, and parameter updates can run continuously. Full pre-training requires evidence regarding data scale, training duration, fault recovery, and cost.

    What should be tested first before training?

    First, test single-GPU operator precision and throughput, then multi-GPU communication bandwidth, followed by running the full pipeline with a small model, and finally scale up. If this order is reversed, the root cause of failures is difficult to diagnose.

    How to judge if the training results on emerging GPUs are credible?

    Ask the vendor to provide the VRAM calculation, parallel configuration, data types, and complete logs. Without this information, the conclusion can only serve as a preliminary reference.

    9. Future Verifications Needed

    • Longer training steps, such as several thousand or more, with statistical analysis of the long-term loss curve trend.
    • Fault injection tests to verify recovery time and data consistency after node failure.
    • Precision alignment results against mainstream GPUs under the same configuration.
    • Throughput and VRAM data under different modalities and sequence lengths.