Practical Guide to Running Large Model Training on Domestic GPUs

    This article walks through the engineering practices required to bring up a complete large model pre-training pipeline on domestic accelerator cards. Based on a validation run of 400 training steps across 16 cards on two servers, it covers environment consistency checks, parallel strategy trade-offs between memory and communication, operator coverage and numerical alignment, observability and checkpointing, and a practical troubleshooting order for common failures.

    1. Background and Problem Definition

    As large model development moves into the engineering stage, training workloads no longer depend on a single hardware platform. For many teams, a mandatory question is how to run a complete pre-training pipeline end to end on domestic accelerator cards. “Running the pipeline” does not mean simply launching a process. It means closing the loop across data loading, forward computation, backward propagation, gradient synchronization, optimizer updates, and checkpoint saving and restoration, while keeping numerical stability and usable throughput in a multi-node, multi-card environment.

    A typical validation case recently reported in the industry: on a domestic accelerator card platform, two servers with 16 cards in total completed 400 training steps of a large parameter-scale model. The number looks small, but the engineering implication is clear. It shows that the driver, communication library, framework adaptation layer, operator implementations, and training scripts have formed a reproducible closed loop. This article uses that case as a thread and abstracts a general methodology from it.

    2. Environment Preparation: Eliminate Uncertainty Up Front

    Most pipeline failures originate at the environment layer. It is recommended to confirm the following items one by one, in order:

    1. Driver and firmware version consistency. In multi-node setups, a driver version difference on any single node can cause communication initialization failures or inconsistent operator behavior.
    2. Communication library and NIC configuration. Confirm that the high-speed interconnect links are correctly detected, and that port binding, timeout thresholds, and retry counts are unified.
    3. Framework and adaptation layer version pinning. Use fixed version numbers rather than floating tags to avoid incompatible changes introduced by automatic upgrades.
    4. Dependency integrity verification. Compare checksums to ensure that the installed content is identical on every node.

    The environment self-check logic can be sketched as follows:

    1. import os, subprocess, hashlib
    2. def node_fingerprint():
    3. info = {
    4. "host": os.uname().nodename,
    5. "driver": subprocess.getoutput("device-query --version"),
    6. "env_hash": hashlib.md5(
    7. os.environ.get("FRAMEWORK_VERSION", "").encode()
    8. ).hexdigest()[:8],
    9. }
    10. return info
    11. # Run on all nodes, then aggregate and compare; abort launch on any mismatch
    12. print(node_fingerprint())

    The value of this step is that it turns “intermittent hangs” into “deterministic blocking before launch”, greatly reducing troubleshooting cost.

    3. Parallel Strategy: Rebalancing Memory and Communication

    Two nodes with 16 cards is a typical small-scale multi-node training setup, and the core tension is the balance between memory capacity and communication overhead. Three common combinations exist:

    • Data parallelism: each card holds a full model replica, and gradients are synchronized via all-reduce. Simple to implement, but memory pressure is high.
    • Tensor parallelism: a single layer’s matrices are split across cards, with frequent communication, usually confined within one node to leverage high-bandwidth interconnect.
    • Pipeline parallelism: layers are split across devices, with micro-batch scheduling to improve utilization, and bubble overhead must be handled.

    A relatively safe practice is “intra-node tensor parallelism plus inter-node data parallelism”, keeping high-frequency communication inside the node and leaving only gradient synchronization to cross-node traffic. If memory is still tight, activation recomputation can be layered on top, trading compute for space:

    1. # Pseudocode: combining activation recomputation with gradient accumulation
    2. for step, batch in enumerate(loader):
    3. with recompute_context():
    4. loss = model(batch) / accum_steps
    5. loss.backward()
    6. if (step + 1) % accum_steps == 0:
    7. optimizer.step()
    8. optimizer.zero_grad()

    Note that gradient accumulation changes the effective batch size, so the learning rate and warmup steps must be adjusted accordingly; otherwise the convergence curve within 400 steps will show noticeable fluctuation.

    4. Operator Compatibility and Numerical Consistency

    The most common obstacles on domestic platforms are missing operators or precision differences. Three principles apply:

    First, build an operator coverage list. Enumerate every category of operator used in the model, annotate support status and precision mode, and fill gaps with equivalent combinations first, rather than falling back directly to host memory computation.

    Second, fix the sources of randomness. Under multi-card parallelism, data sampling order, initialization seeds, and dropout masks must be reproducible; otherwise loss curves cannot be compared.

    Third, run small-scale alignment verification. Start with a very small model and a very small batch, compare first-step loss and gradient norms between a reference platform and the domestic platform, and scale up only after the magnitudes match. This step exposes most numerical problems in advance.

    5. Stability and Observability

    400 steps is only a starting point; long-running training requires a complete observability system. At minimum, collect per-card memory usage, compute utilization, interconnect bandwidth, per-step time distribution, loss and gradient norms, and abnormal node exit codes. Feed all metrics into a unified logging service and monitoring/alerting system, and set percentile thresholds rather than averages so that long-tail jitter is not smoothed away.

    Checkpoint strategy is equally critical. Save asynchronously to object storage at fixed step intervals, keeping the most recent few plus one at each key milestone, and periodically rehearse the “save-interrupt-restore” flow to confirm that optimizer state and the learning rate scheduler are restored together.

    6. Common Failures and Troubleshooting Order

    Symptom Priority Investigation Area
    Hangs immediately at launch Communication initialization, port connectivity, timeout configuration
    Abnormal first-step loss Data preprocessing, label alignment, initialization seed
    Throughput drops sharply mid-run Thermal throttling, slow nodes, log synchronization blocking
    Curve shifts after restoration Checkpoint integrity, data cursor position

    When troubleshooting, follow a three-level progression of “single card, single node multi-card, multi-node”: rule out single-point problems first, then validate collective communication. This can significantly shorten mean time to repair.

    7. Conclusion

    With diverse compute resources coexisting, the key to running a large model training pipeline is not any single capability, but the coordination of four things: version consistency, parallel strategy, operator coverage, and observability. The significance of completing 400 steps on two nodes with 16 cards is that it provides a reproducible, diagnosable, and scalable engineering baseline. Only by scaling up and extending step counts on top of this baseline can a team turn a one-off validation into stable production capability.