Getting Large Model Training Running on Domestic AI Accelerators: A Practical Guide
This article walks through the practical steps for bringing up a complete large model training pipeline on domestic AI accelerator platforms, using a two-node, sixteen-card run of four hundred steps as an end-to-end feasibility check. It covers the prerequisites for a stable bring-up, including software and hardware version alignment, network and topology verification, and shared data and checkpoint storage. It then explains how to choose a parallelism strategy, outlines the observability and fault-tolerance design needed to finish a run, and lists common failure modes with a recommended troubleshooting order. The goal is to establish a trustworthy baseline before moving on to performance tuning and more complex parallelism.
1. Why Getting the Training Pipeline Working Matters More Than Benchmarks
When running large-scale model training on a domestic compute platform, the first goal is usually not an impressive throughput number. It is getting the training pipeline working end to end: data can be read in, the forward and backward passes compute, gradients are synchronized, the optimizer updates, checkpoints are written to disk, and exceptions are caught. Once the pipeline is working, performance tuning has a reliable baseline. If the pipeline does not work, any throughput figure is meaningless.
Running four hundred steps across two nodes and sixteen cards is essentially an end-to-end feasibility test. Four hundred steps is not a performance metric; it is a sample size large enough to surface problems. It covers initialization, several rounds of data iteration, periodic log output, checkpoint saving, and possible communication jitter. Progressing stably at this scale shows that the environment, dependencies, parallel partitioning, and fault tolerance are basically sound.
2. Prerequisites for Bringing Up the Pipeline
2.1 Software and Hardware Version Consistency
Versions of the driver, runtime, communication library, framework, and its operator library must form a closed, consistent set. In practice, the most common failures are not algorithmic; they come from version mismatches that cause missing symbols or inconsistent operator behavior. Pin the version matrix inside a container image rather than letting each machine upgrade on its own.
2.2 Network and Topology Verification
Multi-node training is extremely sensitive to the network. Confirm the NIC bandwidth, whether links are reachable, whether collective communication can be established, and the topology hierarchy between cards and between nodes. If intra-node interconnect bandwidth is significantly higher than inter-node bandwidth, the parallel strategy should minimize how often it communicates across nodes.
2.3 Data and Checkpoint Storage
Training data must be consistently visible to all nodes, typically through shared file storage or object storage combined with local caching. Checkpoints require atomic writes so that an interruption partway through does not corrupt the file.
3. Choosing a Parallelism Strategy
Large model training usually combines three types of partitioning:
- Data parallelism: partitions samples; gradients require a global reduction, and communication volume grows with parameter size.
- Tensor parallelism: partitions operators within a single layer; communication is frequent, so it belongs in the high-bandwidth domain inside a node.
- Pipeline parallelism: partitions by layer; communication volume is small but there is bubble overhead, making it suitable for cross-node deployment.
A safe initial configuration is intra-node tensor parallelism plus cross-node data parallelism. Avoid aggressive three-dimensional partitioning before the pipeline has been validated. A skeleton configuration looks like this:
# Illustrates only how the parallelism dimensions are organized; not a specific framework APIparallel_config = {"tensor_parallel_size": 4, # kept within a single node's 8 cards"pipeline_parallel_size": 1, # left off during pipeline validation"data_parallel_size": 4, # derived from 16 / (4 * 1)"micro_batch_size": 1,"gradient_accumulation": 8,}
Global batch size = micro batch size × gradient accumulation steps × data parallel size. This relationship is the first thing to check when the effective batch size does not match expectations.
4. Stability and Observability Design
Whether the pipeline can run to completion depends largely on fault-tolerance design rather than peak performance. At a minimum, four capabilities are recommended:
- Tiered logging: output initialization, per-step time, communication time, and loss values at separate levels to make binary-search diagnosis fast.
- Metrics monitoring: bring compute utilization, memory usage, and network retransmissions into the monitoring and alerting system.
- Checkpoint strategy: save to disk at fixed step intervals and keep the most recent few, so training can resume from the latest valid point.
- Exception handling: assign identifiable error codes for numerical overflow, communication timeouts, and data read failures.
A minimal validation loop in pseudocode:
for step in range(total_steps):batch = next(dataloader)loss = model(batch)loss.backward()optimizer.step()optimizer.zero_grad()if step % log_interval == 0:log(step, loss, throughput, mem_used)if step % ckpt_interval == 0:atomic_save(step) # write to a temp directory first, then atomically rename
5. Common Failures and Troubleshooting Order
- Stuck at initialization: check communication link setup and port connectivity first.
- Fine for the first few steps, then slows down: data reading is usually the bottleneck; check cache hit rate and storage bandwidth.
- Memory keeps growing: confirm whether a cache is not being released or the gradient accumulation count is wrong.
- Loss does not decrease: check the learning rate, data order, and mask and label alignment rather than rushing to change the parallelism strategy.
- Process exits at random: check system logs and hardware alerts to rule out a single bad card or node.
The troubleshooting principle is to converge from the outermost observable signal toward the kernel layer, changing one variable at a time.
6. Engineering Recommendations
When running this kind of validation on platforms such as Baidu AI Cloud, you can combine a container platform for environment delivery, shared file storage for the dataset, object storage for archiving checkpoints, and logging and monitoring services for observability. The key is to bring the environment, configuration, and data version under version management together, so that every four-hundred-step experiment is reproducible, comparable, and rollback-able.
7. Conclusion
Getting the training pipeline working is the entry ticket for domestic compute to move into production training. Establishing a trustworthy baseline with small scale, short step counts, and strong observability first, then gradually introducing more complex parallelism and larger batches, is the lowest-risk path forward.
