Practical Guide to Enabling Large Model Training on Domestic GPUs

    This article walks through the practical process of enabling a complete large model training pipeline on domestic GPU accelerators. It explains why establishing a working pipeline is harder than achieving raw speed, outlines four pre-adaptation checks covering operator coverage, numerical precision, communication topology, and observability, and presents a recommended parallel strategy with sample configuration for small-scale validation. It also lists common failure patterns with a systematic troubleshooting order, defines a quantifiable acceptance checklist for a 400-step short validation run, and suggests reusable assets to retain after the pipeline is working.

    1. Background: Why Getting the Pipeline Working Is Harder Than Going Fast

    When migrating a large model pretraining workload to domestic accelerator cards, the first obstacle a team hits is usually not insufficient compute, but a broken pipeline. The pipeline here refers to the full closed loop: data loading, tokenization, forward computation, backward propagation, gradient reduction, optimizer update, and checkpoint saving. If any single stage is missing an operator, produces inconsistent precision, or times out during communication, training will stall within a few dozen steps.

    For this reason, the industry commonly adopts a “short validation run” strategy: first complete a fixed number of steps (for example, 400 steps) on a small configuration such as two nodes with 16 cards, confirm that the loss curve decreases monotonically, gradient norms remain stable, and throughput is reproducible, and only then scale up to multiple nodes and cards. The value of a short validation run is that it surfaces problems at a low-cost stage.

    2. Four Checks Before Adaptation

    1. Operator coverage: List every operator the model uses, and mark which ones have native implementations, which need to be replaced with combinations, and which must be custom-built. Attention, normalization, and positional encoding operators are usually where the gaps concentrate.
    2. Numerical precision strategy: Define which computations must keep high-precision accumulation and which can use low-precision acceleration. Reduction operations are best kept in high-precision accumulation to avoid large values swallowing small ones.
    3. Communication topology: Confirm the inter-card interconnect bandwidth and cross-node network capability, then decide to place tensor parallelism inside a node and pipeline parallelism across nodes.
    4. Observability: Logging, metrics, and alerting capabilities should be integrated in advance; otherwise fault localization is guesswork.

    3. Parallel Strategy and Configuration

    For the small-scale validation stage, the recommended combination is “intra-node tensor parallelism + inter-node data parallelism,” which reduces the frequency of cross-node communication. An illustrative configuration is shown below (structure only, not a specific API):

    1. # Parallel dimensions (illustrative)
    2. parallel = {
    3. "tensor_parallel_size": 8, # split single-layer weights across cards in a node
    4. "pipeline_parallel_size": 1, # keep pipeline off at the small scale
    5. "data_parallel_size": 2, # replicate across nodes, all-reduce gradients
    6. }
    7. # Key runtime parameters
    8. runtime = {
    9. "micro_batch_size": 1,
    10. "gradient_accumulation": 16, # trade accumulation for an equivalent large batch
    11. "grad_reduce_dtype": "fp32", # high-precision accumulation for reduction
    12. "checkpoint_interval": 50, # save periodically for easier rollback
    13. }

    The key points: use gradient accumulation to reach the target effective batch size first, instead of increasing the per-card batch size right away and triggering out-of-memory errors; and keep the checkpoint interval shorter than the mean time between failures.

    4. Common Failures and Troubleshooting Order

    • Loss is normal for the first few steps, then spikes: suspect reduction precision and the gradient clipping threshold first.
    • Throughput keeps fluctuating: check whether data loading is the bottleneck; adding prefetching and local caching can help.
    • All processes hang at a certain step: usually a collective communication mismatch; verify that every rank makes the same number of calls.
    • Memory grows slowly: typically unreleased cache or an evaluation-phase graph that is not reclaimed.

    The recommended troubleshooting path is progressive: single card first, then two-card communication, then multiple cards in one node, then cross-node. Set a clear pass criterion at each level.

    5. Acceptance Checklist

    The pass criteria for a 400-step short validation run can be quantified: loss decreases monotonically with no abnormal spikes; gradient norms stay within a stable range; throughput deviation across two consecutive runs is within an acceptable range; after restoring from the latest checkpoint, loss aligns with the level before the interruption; and there are no silent precision errors throughout. Only when all five are met is it safe to scale up.

    6. Further Recommendations

    Once the pipeline is working, retain three types of assets: a list of operator gaps with workarounds, a mapping table of failure symptoms to localization paths, and reusable launch and monitoring templates. If a container platform hosts the training workload, version the image, dependencies, and configuration together, and use object storage for checkpoints plus logging and monitoring services to track runtime status, keeping reproduction and migration costs under control.