Bringing Up Large Model Training on Domestic GPUs: A Practical Guide

    This article walks through a real-world effort to bring up the full pre-training pipeline for a long-context, large-parameter coding model on a domestic accelerator platform, using a minimal cluster of 16 cards across two nodes and completing 400 stable training steps. It explains why a minimal viable cluster is the best starting point, how to align the software stack layer by layer, bind NICs and validate collective communication, estimate memory for parallelism strategies, handle operator gaps and precision issues, and set up observability and checkpoint resume. A fault-isolation table and layered validation methodology are included to help teams turn cluster bring-up into a repeatable engineering process.

    Bringing Up Large Model Training on Domestic GPUs: A Practical Guide

    1. Background and Why It Matters

    A notable engineering milestone has recently been reported: on a domestic accelerator platform, a minimal cluster of 16 cards across two nodes successfully ran the complete pre-training pipeline of a long-context, very large parameter-count coding model, completing 400 training steps stably.

    “Running through” here does not mean performance targets are met. It means three foundational capabilities hold at the same time: sufficient operator library coverage, convergent distributed communication, and observable training progress.

    For developers and enterprise users, this kind of validation turns “can we even train this?” from an open question into a settled one. Once the pipeline is up, tuning, scaling, and cost estimation all have a baseline to build on. Note that 400 steps is only smoke-test scale, meant to surface configuration errors, numerical anomalies, and communication deadlocks. It cannot be used to infer final model quality or throughput ceilings.

    2. Why a Minimal Viable Cluster Is the Best Starting Point

    The engineering complexity of large model training grows superlinearly with card count. The value of two nodes and 16 cards is covering most failure modes at the lowest cost:

    • Intra-node multi-card communication and inter-node communication exist simultaneously, exposing topology-awareness and NIC-selection problems;
    • The parameter scale is large enough to trigger combined tensor, pipeline, and data parallel partitioning;
    • Resource usage is small, so the time cost of rerunning after a failed round is manageable, making it suitable for configuration matrix experiments.

    Once the small-scale pipeline is stable, scaling up mainly means dealing with a rising share of communication overhead and stronger fault-tolerance requirements, not fundamental obstacles.

    3. Environment Preparation: Removing Uncertainty Up Front

    3.1 Aligning the Software Stack Layer by Layer

    Split the software stack into four layers and validate each one: driver and runtime, communication library, compute framework, and training scripts and configuration. Run a minimal test case for each layer. For example, use a collective communication self-check to verify connectivity for all-reduce and all-gather before moving to the framework layer.

    3.2 Topology and NIC Binding

    Cross-node training performance and stability depend heavily on network configuration. Key practices include: confirming the affinity between each accelerator card and its high-speed NIC to avoid traffic detours; unifying hostname resolution and port whitelists; and disabling power-saving policies that introduce uncontrolled buffering.

    1. # Example: verify collective communication connectivity before launching training
    2. # Intra-node multi-card self-check
    3. run_comm_check --ranks 8 --ops allreduce,allgather
    4. # Cross-node self-check (8 cards on each of two nodes)
    5. run_comm_check --ranks 16 --hosts node_a:8,node_b:8

    4. Parallelism Strategy and Memory Accounting

    Insufficient memory is the most common cause of large model training failures. Estimate four parts separately: parameters, gradients, optimizer states, and activations. For mixed-precision training, weights and gradients each take one copy, optimizer momentum and variance are usually kept at higher precision, and activations correlate strongly with batch size, sequence length, and the recomputation strategy.

    Common mitigations, ordered from lowest to highest cost:

    1. Enable activation recomputation, trading compute for memory;
    2. Shard optimizer states across multiple cards;
    3. Apply tensor parallelism to split single-layer matrices, noting the split dimension must divide evenly;
    4. Apply pipeline parallelism to split layers, handling bubbles and micro-batch count ratios;
    5. Offload to host memory, at the cost of a bandwidth bottleneck, as a last resort.

    The chosen parallel degrees must satisfy two constraints: each split dimension divides the corresponding structural size evenly; and the data parallel degree is consistent with the global batch size and gradient accumulation steps.

    1. # Illustrative configuration snippet
    2. parallel = dict(tp=2, pp=2, dp=4) # 2 * 2 * 4 = 16 cards
    3. micro_batch = 1
    4. grad_accum = 8
    5. seq_len = 8192
    6. recompute = True

    5. Operator Adaptation and Precision Strategy

    The first class of obstacles on domestic hardware usually comes from missing operators or semantic differences. The recommended approach is tiered fallback: first replace with equivalent operator combinations, then use the framework’s generic implementations, and only then consider custom kernels. Custom kernels must undergo numerical alignment tests covering extreme inputs, boundary shapes, and non-contiguous tensors.

    For precision, follow a “low first, then high” localization method: if the loss goes non-numerical within tens of steps, first switch to a higher precision range to reproduce, and confirm whether it is a numerical range problem or an operator implementation problem; if it runs fine at high precision, gradually relax low-precision optimizations.

    6. Stability, Observability, and Checkpoint Resume

    Whether 400 steps complete smoothly depends on whether monitoring is in place. The minimal monitoring set includes: per-card peak memory, inter-card temperature and throttling signals, share of collective communication time, per-step loss and gradient norm, and checkpoint write time.

    1. Log every 20 steps: loss / grad_norm / lr / step_time
    2. Persist every 100 steps: model shards + optimizer state + data read position
    3. Trigger on anomaly: non-numerical loss OR step_time jitter > 50% over three consecutive steps

    Checkpoint resume must save the data read position at the same time; otherwise the sample distribution shifts after recovery and the loss curve shows hard-to-explain jumps. Write checkpoints to high-throughput storage decoupled from compute nodes to avoid persistence blocking the training process.

    7. Common Failures and Isolation Order

    Symptom Priority Investigation Area
    Hangs at startup Network connectivity, ports, hostname resolution
    Out of memory Batch size, sequence length, recomputation toggle, split degrees
    Non-numerical loss Precision range, learning rate, operator numerical alignment
    Persistently low throughput NIC affinity, communication-computation overlap, persistence blocking
    Curve jumps after recovery Data position, optimizer state integrity

    8. Conclusion and Implementation Advice

    The core methodology for bringing up the pipeline is “validate in layers, relax step by step”: communication first, then a single step, then multiple consecutive steps; small scale first, then scale up; correctness first, then performance. When evaluating such a solution, enterprises can look at general cloud capability combinations, such as a container platform for elastic resources, object storage for checkpoints, and monitoring and alerting services for tracking metric anomalies, so that cluster validation becomes a repeatable engineering process rather than one-off tuning.