Running LLM Training on 16 Domestic AI Accelerator Cards Across Two Nodes: A Practical Guide
This article walks through a complete multi-node training setup on domestic AI accelerator cards—two servers with 8 cards each, running 400 training steps continuously. It covers the five-layer architecture of distributed training, environment consistency checks, parallelism configuration, memory and batch planning, checkpointing, and a systematic troubleshooting guide for common failures.
1. Background and Goals
As large language models grow in parameter count, a single server’s memory and compute capacity often fall short. Multi-node, multi-card distributed training has become standard practice. Running such training on domestic AI accelerator platforms requires handling hardware adaptation, software stack compatibility, inter-node communication, and training stability all at once.
The practice case referenced here uses two nodes with a total of 16 accelerator cards, completing 400 consecutive training steps and validating the full workflow from environment preparation through early-stage training. This article does not involve specific vendors or model names—it focuses on general methods.
The goals are threefold:
- Outline the layered structure of multi-node training and clarify what to check at each layer;
- Provide reusable checklists and configuration examples;
- Summarize common failure symptoms, causes, and troubleshooting order.
2. Overall Architecture and the Layered View
Multi-node training can be broken into five layers. A problem at any layer can manifest as a hung training job or abnormal results, so troubleshooting should proceed layer by layer.
| Layer | Main Responsibility | Key Focus |
|---|---|---|
| Hardware | Accelerator cards, CPU, memory, storage | Driver versions, card health, temperature and power |
| System | OS, kernel parameters, container runtime | Whether both nodes have identical system configurations |
| Communication | Collective communication library, inter-node network | Bandwidth, latency, topology, MTU |
| Framework | Deep learning framework, parallelism strategy | Combination of data, tensor, and pipeline parallelism |
| Application | Model code, data pipeline, training scripts | Data loading efficiency, checkpoint strategy, logging |
This case assumes each node has 8 accelerator cards, with high-speed interconnects within a node and high-speed networking between nodes. This topology means intra-node communication is fast while inter-node communication is slower, so the parallelism strategy should minimize cross-node data transfer.
3. Environment Consistency Checks
The most common pitfall in multi-node training is environment inconsistency between nodes. A minor driver version mismatch or an extra dependency patch on one node can cause initialization failures or numerical discrepancies—and error messages rarely point directly to the cause.
Before launching training, verify the following item by item:
- Drivers, runtimes, and firmware versions are identical on both nodes;
- Python environments and dependency versions match—ideally installed from the same image or the same lock file;
- System clocks are synchronized; large time drift affects log alignment and some authentication flows;
- Shared storage is mounted at the same paths, with training data and checkpoint directories readable and writable from both nodes;
- Hostnames resolve mutually, and required ports are open in the firewall;
- Network MTU settings are consistent—otherwise large packet transfers may suffer intermittent timeouts.
The following script checks basic node information in batch; adjust the node list and checks for your environment:
#!/usr/bin/env bash# Example: batch-check whether node environments are consistentNODES=("node-01" "node-02")for node in "${NODES[@]}"; doecho "== ${node} =="ssh "${node}" 'uname -r; python3 --version; sha256sum ~/train/requirements.lock'done
The kernel version, Python version, and dependency lock file hash from the script output should be identical across all nodes. If any item differs, unify the environment before starting training.
4. Communication Topology and Parallelism Configuration
4.1 Core Concepts
In distributed training, each accelerator card corresponds to one process, called a rank. The total number of ranks is the world size. In this case, the world size is 16—2 nodes multiplied by 8 cards each.
The parallelism strategy determines which portion of the computation each rank handles. The three common approaches:
- Data parallelism: each rank holds the full model and processes different data batches; gradients are synchronized across ranks;
- Tensor parallelism: a single layer’s weight matrix is split across multiple ranks; intra-layer computation requires frequent communication, suited to intra-node high-speed interconnects;
- Pipeline parallelism: the model is split into stages by layer and assigned to different ranks; activations pass between stages, suited to cross-node deployment.
The product of the three must equal the world size: data parallel size × tensor parallel size × pipeline parallel size = total number of cards. This is the easiest constraint to get wrong during configuration.
4.2 Configuration Example
The following configuration illustrates the relationships between parameters. Field names are generic descriptions and should be adjusted to your chosen framework:
# Example configuration: generic field names, adjust to your frameworkcluster:num_nodes: 2devices_per_node: 8world_size: 16master_addr: "192.168.1.10" # Internal address of the first nodemaster_port: 29500parallel:data_parallel_size: 16tensor_parallel_size: 1pipeline_parallel_size: 1
Here, data parallelism is 16 while tensor and pipeline parallelism are both 1, satisfying 16 × 1 × 1 = 16. If you switch to tensor parallelism of 8 with data parallelism of 2, you must confirm that each layer’s weight dimensions are divisible by 8 and that intra-node communication volume remains acceptable.
4.3 Controlling Communication Overhead
Cross-node gradient synchronization is one of the main costs of multi-node training. Common optimization approaches include:
- Bucketing gradients so communication overlaps with backward computation as much as possible;
- Tuning bucket size to balance the number of communication rounds against per-round data volume;
- Placing high-frequency communication parallelism dimensions within a node where possible.
Optimal values for these parameters depend heavily on model architecture and network bandwidth. Run the pipeline with defaults first, then tune incrementally based on measured communication time.
5. Memory and Batch Planning
Training memory consists of four main parts: model parameters, gradients, optimizer states, and activations. With mixed-precision training and an adaptive optimizer, each parameter requires roughly 16 bytes for the weight copy, gradient, and optimizer states.
For a 7-billion-parameter model, parameter-related states alone require about 112 GB. If these states are sharded across 16 cards, each card carries roughly 7 GB, leaving the remaining memory for activations and temporary buffers. This estimate only illustrates the order of magnitude—actual usage depends on sequence length, batch size, and implementation details.
Global batch size is calculated as:
Global batch size = per-card micro-batch × gradient accumulation steps × data parallel size
When adjusting batch size, watch both memory usage and training stability. An oversized per-card micro-batch easily triggers out-of-memory errors, while too many accumulation steps lengthen each step. Start with a small micro-batch to confirm memory headroom, then scale up gradually.
6. Launching Training and Ensuring Stability
6.1 Startup Sequence
Multi-node training launches require coordination. The recommended sequence:
- Start the master node first and confirm it is listening on the expected port;
- Have the remaining nodes join using identical configuration and launch parameters;
- Wait until all ranks report successful initialization before observing the timing of the first training step.
If a node fails to join promptly, first check its network connectivity to the master node rather than restarting the entire job.
6.2 Health Monitoring
During training, continuously collect the following metrics:
- Temperature, power, and memory usage for each accelerator card;
- Per-step time for each rank, to spot individual slow nodes;
- Cross-node communication timeout counts and retransmissions;
- Whether training loss remains finite.
Logs should be collected centrally with rank IDs and timestamps, making it easier to align events across nodes after the fact.
6.3 Checkpoints and Resume-from-Checkpoint
Long-running training jobs must support resumption. A checkpoint should include:
- Model parameters;
- Optimizer states;
- Learning rate scheduler state;
- Random number seeds;
- The data iteration position.
Saving model parameters alone is not enough. If data order or random state differs after recovery, the loss curve will show a jump after resumption, making it hard to diagnose the root cause.
The following example code shows the basic structure of resume logic; helper functions must be implemented based on your storage backend:
def resume_start_step(ckpt_dir):"""Return the starting step for resuming training. Start from step 0 if no checkpoint exists."""latest = find_latest_complete_checkpoint(ckpt_dir) # Only return checkpoints that were fully writtenif latest is None:return 0state = load_checkpoint(latest)return state["step"] + 1
Checkpoint save frequency requires trade-offs. Short intervals increase storage write pressure; long intervals lose more training progress on failure. A common practice is to save at fixed step intervals while retaining the most recent few versions to avoid filling the disk.
7. How to Confirm the Pipeline Works
This case completed 400 training steps, but step count alone does not prove the pipeline is fully healthy. Use the following criteria:
- All ranks complete initialization, with no processes waiting indefinitely;
- Forward pass, backward pass, and gradient synchronization complete within the timeout for every step;
- Training loss stays finite, with no NaN or infinity;
- Checkpoints are written correctly and can be loaded to resume training;
- No persistent error messages appear in the logs.
This article does not dive into specific throughput or convergence metrics. These figures depend on model architecture, data, and hardware configuration—use baselines from your own environment as the reference.
8. Common Issues and Troubleshooting Order
| Symptom | Possible Cause | Troubleshooting Direction |
|---|---|---|
| Initialization hangs for a long time | Port blocked, hostname resolution failure, a node failed to join | Check connectivity, firewall, and launch parameters |
| Some ranks hit communication timeouts | Network jitter, inconsistent MTU, incorrect topology configuration | Run bandwidth and latency tests node by node |
| Loss becomes NaN | Learning rate too high, numerical overflow under mixed precision | Check learning rate, enable gradient clipping, adjust scaling strategy |
| Throughput drops noticeably | Data loading bottleneck, or a node throttling | Check data pipeline metrics and node monitoring |
| Loss jumps after resumption | Random seed or data position not restored | Verify state fields in the checkpoint |
When troubleshooting, proceed in the order of “environment, network, configuration, code.” First confirm the two nodes’ base environments match, then check networking and parallelism configuration, and only then suspect the training code itself. This avoids wasting time chasing problems in the wrong direction.
9. Summary
Multi-node training stability depends largely on two things: whether node environments are consistent, and whether the training process is observable. Turning environment checks, parallelism validation, checkpoint recovery, and log monitoring into a fixed routine ensures every launch follows a repeatable process and makes troubleshooting fast when issues arise.
