Training Trillion-Parameter Models on a 10,000-Card Domestic AI Cluster: Lessons and Practices

    This article breaks down the real bottlenecks of trillion-parameter training on large-scale domestic accelerator clusters, where utilization is often consumed by communication, scheduling, memory capacity, and insufficient compiler optimization rather than raw card count. It explains two core capability foundations—owning the compilation stack and topology-aware communication optimization—then covers how domestic cards carry mainstream training and inference workloads, how to evaluate cost and efficiency with reproducible metrics, and a reusable checklist for observability, operator fallback, parallelism alignment, precision gating, and cost accounting.

    1. Background: The Real Bottleneck of Trillion-Parameter Training Is Not “Enough Cards”

    Over the past two years, model parameter counts have moved from the hundreds of billions to the trillions, and training clusters have scaled from thousands of cards to hundreds of thousands. A commonly misunderstood conclusion is that stacking enough accelerators will yield linear speedup. Real-world engineering shows the opposite: in ultra-large-scale clusters, compute utilization is often consumed by communication, scheduling, memory capacity, and insufficient compiler optimization.

    Breaking the problem apart, trillion-parameter training faces four main constraints:

    • Memory capacity constraint: Parameters, gradients, and optimizer states add up. Under mixed-precision training, optimizer states are usually the main source of memory usage and must be flattened through sharding and offloading.
    • Communication bandwidth constraint: Tensor parallelism produces high-frequency AllReduce/ReduceScatter within layers, pipeline parallelism introduces point-to-point communication, and data parallelism brings periodic gradient synchronization. Together they can easily saturate interconnect bandwidth.
    • Scheduling and bubble constraint: Pipeline parallelism has bubbles. When the global batch size, number of micro-batches, and pipeline depth are mismatched, the bubble ratio rises significantly.
    • Compiler and operator constraint: When a new hardware backend has incomplete operator coverage and insufficient fusion, execution degrades into launching many small operators, and the host side becomes the bottleneck.

    Domestic accelerators each have different “strengths and weaknesses” across these four constraints, which amplifies the value of hardware-software co-design: whoever controls the compiler layer, communication layer, and scheduling layer can turn nominal compute into effective throughput.

    2. Capability Foundation One: Owning the Compilation Stack

    The compilation layer is the hardest and most underestimated layer in hardware-software co-design. It determines the actual execution efficiency of the same model code on different hardware backends.

    2.1 Why the Compilation Layer Sets the Ceiling

    Deep learning frameworks usually describe models as computation graphs or operator sequences. Without mature backend compilation, three typical problems appear: uncovered operators fall back to generic implementations; missing operator fusion amplifies memory accesses; and coarse memory planning raises peak memory and shrinks the usable batch size.

    An illustrative comparison of fusion optimization (pseudocode, expressing only the optimization idea):

    1. # Without fusion: multiple memory reads/writes, multiple kernel launches
    2. y = activation(layer_norm(x))
    3. y = dropout(y)
    4. out = linear(y, W)
    5. # With fusion: intermediate results stay on-chip/in registers, single launch
    6. out = fused_norm_act_dropout_linear(x, W)

    The benefit of fusion is not “writing fewer lines of code” but the combined effect of reduced memory traffic and reduced kernel launch overhead, which is often most pronounced on memory-bound operators.

    2.2 The Engineering Value of an In-House Compilation Stack

    An in-house compilation stack makes it possible to optimize at the graph and operator level for hardware characteristics: automatic parallel strategy search, memory reuse planning, communication-computation overlap scheduling, and instruction selection for specific data types. In engineering, this layer is usually filled by acquiring or building a team with compiler and runtime capabilities, shortening the “framework–compiler–driver–hardware” chain and reducing cross-team integration overhead.

    Practical advice: build a dashboard for operator coverage and fallback rate. If the fallback ratio for a class of operators is high, prioritize completing the implementation or rewriting the model structure rather than blindly adding cards.

    3. Capability Foundation Two: Topology-Aware Communication Optimization

    3.1 Topology Awareness Is Key

    An ultra-large-scale cluster is not “fully connected with equal bandwidth.” The typical hierarchy is: high-speed intra-node interconnect, high-speed inter-node network, and a converged network across racks/floors. If the collective communication library is not topology-aware, cross-tier traffic is amplified unnecessarily.

    Gains such as “improving cluster inference efficiency by just over ten percent without adding a single card” usually come from three areas: better request scheduling and batching strategy, KV cache management and reuse, and communication path and parallel layout optimization. Together they show that a large part of efficiency improvement comes from software and topology, not hardware stacking.

    3.2 Parallel Strategy and Communication Volume Estimation

    Different parallelism dimensions have very different communication characteristics, and their magnitude can be estimated with a simplified model (illustrative):

    1. Tensor parallelism: 2 collective communications per layer, highest frequency, must be confined to the high-speed intra-node domain
    2. Pipeline parallelism: point-to-point send/receive between adjacent stages, small volume but sensitive to bubbles
    3. Data parallelism: one gradient synchronization per step, largest volume, best placed at the tier with the most abundant bandwidth

    A common mapping principle in engineering: keep tensor parallelism within a node as much as possible, allow pipeline parallelism across nodes while controlling the number of stages, and place data parallelism across racks with gradient accumulation and communication compression.

    4. Business Deployment: Domestic Cards Carrying Mainstream Training and Inference

    In real business, the majority of compute for the main model series is carried by domestic cards, and lightweight versions can run entirely on a domestic cluster at the hundreds-of-thousands-of-cards scale. Making such a migration work usually depends on four things:

    1. Operator and graph compatibility: Use an operator set that the backend has already optimized thoroughly.
    2. Precision alignment: Establish a process of layer-by-layer numerical comparison and loss curve alignment to avoid “it runs but convergence is abnormal.”
    3. Parallel strategy restructuring: Rearrange parallelism dimensions according to hardware interconnect characteristics.
    4. Observability: Uniformly collect metrics such as throughput, memory, communication wait, and host-side launch latency.

    Worth emphasizing is the traffic peak scenario: within a model release week, platform call volume can grow tenfold, testing not peak compute but elastic scheduling, cache hit rate, and degradation strategy. Continuous performance engineering inside the cluster (rolling optimization, A/B comparison, automatic rollback) can achieve several-fold end-to-end throughput improvement within two weeks—gains that usually come from a combination of batch window tuning, cache reuse, operator replacement, and concurrency tuning.

    5. Cost and Efficiency Evaluation Method

    To assess whether a domestic compute solution is “close to mainstream international solutions,” use a reproducible metric system rather than a single benchmark:

    • Effective throughput: tokens/s/card, distinguishing training from inference and prefill from decode.
    • Hardware efficiency: measured peak compute utilization (MFU-like metrics) and communication wait ratio.
    • Cost per token: including card hours, network, storage, and operations amortization.
    • Stability: mean time between failures, failure recovery time, and job restart loss.

    Illustrative evaluation script framework:

    1. metrics = {
    2. "tokens_per_sec_per_card": measure_tps(),
    3. "mfu": achieved_flops / peak_flops,
    4. "comm_wait_ratio": comm_wait_time / step_time,
    5. "cost_per_million_tokens": total_cost / total_tokens * 1e6,
    6. }
    7. report(metrics)

    6. A Reusable Deployment Checklist

    • Build observability first, then optimize: without per-step timing and communication wait data, optimization is guesswork.
    • Prioritize the compilation stack: driving the operator fallback rate low is often more cost-effective than adding cards.
    • Align topology with parallelism: confine high-frequency communication to the high-speed domain.
    • Gate on precision and convergence: establish numerical alignment and regression tests.
    • Optimize the inference side independently: evolve batching, caching, and concurrency scheduling separately from the training side.
    • Unify the cost metric: use cost per token as the single hard metric for cross-solution comparison.

    7. Conclusion

    Starting trillion-parameter model training on domestic compute is essentially a concentrated test of systems engineering capability: the compilation stack sets the efficiency ceiling, networking and topology set the communication floor, scheduling and observability determine stability, and the cost metric determines sustainability. Turning these layers into a measurable, rollback-capable, reusable engineering loop is the true meaning of “seeds sprouting.”