Scaling and Iterating Large-Model Compute Infrastructure

    A practical guide to planning large-model training infrastructure, covering compute capacity estimation, parallelism, networking, storage, checkpointing, and the relationship between infrastructure efficiency and model iteration speed.

    1. Background: Compute Capacity Sets the Iteration Pace

    The iteration speed of large-model development depends heavily on how much effective compute a training cluster can deliver. Model size, training data volume, and the number of training steps together determine the total computational workload. Actual cluster throughput is affected by hardware peak performance, communication efficiency, failure frequency, and scheduling policies. Even when two teams use the same model architecture, a twofold difference in infrastructure utilization can mean a training cycle that takes several additional weeks for one team.

    Infrastructure planning should therefore focus not only on how many accelerators have been purchased, but also on how to deliver a stable amount of effective training work per unit of time. The following sections discuss capacity estimation, parallelism, networking and storage, reliability, scheduling, and coordination with model iteration.

    2. Capacity Estimation: Work Backward from the Training Target

    The first step in planning is to estimate the total computational workload. For a dense Transformer architecture, a commonly used approximation is:

    1. Total training compute ≈ 6 × parameter count × number of training tokens

    The coefficient 6 is based on an estimate of the floating-point operations required for forward and backward propagation. For example, training a 70-billion-parameter model on 1.4 trillion tokens requires approximately 5.88 × 10²³ FLOPs.

    Effective compute is the product of peak compute and model FLOPs utilization (MFU). MFU is affected by communication overhead, memory bandwidth, and operator efficiency, and is typically well below the theoretical peak. Assuming 300 TFLOPS of effective compute per accelerator and a cluster with 1,024 accelerators, the cluster provides approximately 3.07 × 10¹⁷ FLOP/s, resulting in a theoretical training time of about 22 days. Actual scheduling must also account for evaluation, rollback, and data-loading overhead, so additional capacity should be reserved. These figures are illustrative assumptions rather than measurements from a specific hardware product.

    The estimation logic can be expressed as a simple function, making it easier to adjust parameters during design reviews:

    1. def estimate_training_days(params, tokens, n_accel, eff_tflops):
    2. total_flops = 6 * params * tokens
    3. cluster_flops_per_s = n_accel * eff_tflops * 1e12
    4. seconds = total_flops / cluster_flops_per_s
    5. return seconds / 86400
    6. # 70 billion parameters, 1.4 trillion tokens, 1,024 accelerators,
    7. # and 300 TFLOPS of effective compute per accelerator
    8. print(round(estimate_training_days(7e10, 1.4e12, 1024, 300), 1)) # Approximately 22.2 days

    3. Networking and Storage: Communication Efficiency Sets the Scaling Limit

    Large-scale training relies on collective communication. Multiple accelerators within a node are connected through high-bandwidth interconnects, while nodes communicate over a high-speed network. The network design should satisfy two requirements: communication bandwidth must remain predictable as the cluster grows, and latency and congestion between any two nodes must remain controllable.

    Common design practices include:

    • Hierarchical design: Keep high-frequency tensor-parallel communication within a high-bandwidth domain inside the node.
    • Multi-level switching: Use low-oversubscription or non-blocking topologies to reduce congestion across racks.
    • Topology-aware placement: Assign jobs to contiguous racks or switching domains to reduce the proportion of cross-domain communication.

    Storage typically involves two major types of I/O. The first is reading training data, which requires multi-level caching and prefetching to prevent accelerators from waiting for data. The second is writing checkpoints, which requires sufficient write bandwidth. If saving a training state takes too long, it directly reduces training time. Checkpoints should be written in parallel across shards, and recovery should also load those shards in parallel.

    4. Parallelism: Distributing the Model Across the Cluster

    When a large model cannot fit into the memory of a single accelerator, its parameters, activations, and computation must be distributed across multiple accelerators. Common parallelism strategies include:

    Parallelism strategy Partitioned object Primary communication Typical use case
    Data parallelism Training samples Gradient synchronization (all-reduce) A full model fits on one accelerator or within one node
    Tensor parallelism Matrix operations within layers Frequent intra-layer all-reduce operations High-bandwidth domains within a node
    Pipeline parallelism Model layers Point-to-point activation transfer between adjacent stages Models spanning multiple nodes or containing many layers
    Sequence parallelism Sequence dimension Aggregation communication related to attention Long-context workloads

    The core principle is to place the most communication-intensive strategy within the highest-bandwidth domain. The following configuration illustrates this principle:

    1. parallel_config = {
    2. "tensor_parallel": 8, # Matches the number of accelerators per node
    3. # and uses high-bandwidth intra-node links
    4. "pipeline_parallel": 4, # Partitions layers across nodes
    5. "data_parallel": 32, # 8 × 4 × 32 = 1,024, matching the total accelerator count
    6. "micro_batch_size": 2,
    7. "grad_accumulation_steps": 16,
    8. }
    9. world_size = (parallel_config["tensor_parallel"]
    10. * parallel_config["pipeline_parallel"]
    11. * parallel_config["data_parallel"])
    12. global_batch = (parallel_config["micro_batch_size"]
    13. * parallel_config["data_parallel"]
    14. * parallel_config["grad_accumulation_steps"])
    15. assert world_size == 1024
    16. print(global_batch) # 1,024 sequences

    After completing the configuration, run short stress tests to measure the actual communication ratio for each parallelism dimension. If communication takes more time than computation, first adjust how the parallelism dimensions are partitioned rather than simply adding more accelerators.

    5. Reliability: Failures Are Normal at Scale

    As a cluster grows, failures become more likely. Assuming independent node failures, the failure rate of the cluster is approximately the sum of the failure rates of its individual nodes. As the number of nodes increases, the cluster’s mean time between failures (MTBF) therefore decreases significantly. Without a robust fault-tolerance mechanism, a long-running training job may be interrupted repeatedly.

    Checkpoint intervals must balance two types of overhead. If checkpoints are too frequent, writing them consumes too much training time. If they are too far apart, more training progress must be rolled back after a failure. A first-order approximation based on the Young/Daly formula gives the optimal interval:

    1. Optimal checkpoint interval τ ≈ √(2 × C × M)

    Here, C is the time required to write one checkpoint and M is the cluster MTBF. If C is 5 minutes and M is 4 hours, then:

    1. τ ≈ √(2 × 300 × 14400