LLM Architecture: How Rack Boundaries and Batching Shape Performance and Cost

    Hardware topology and batch size help explain how large language models are designed, deployed, and priced. This article examines rack-scale communication limits, mixture-of-experts parallelism, inference batching economics, and their implications for training and cloud deployment. It provides developers and architects with a practical framework for connecting hardware constraints to model efficiency.

    Introduction: Hardware Shapes the Model

    Frontier large language models are often discussed in terms of algorithms and parameter counts. An equally important perspective starts with the hardware: physical constraints strongly influence model architecture, deployment choices, and even service pricing.

    A hardware-first analysis of training and inference leads to a recurring insight: understanding interconnect topology and batching economics helps explain why models take their current form and why progress proceeds at its current pace.

    Rather than focusing on individual products, this article examines the underlying engineering principles, giving developers and architects a clearer view of the relationship between chips and models.

    1. Rack Boundaries: An Often-Overlooked Scaling Limit

    Modern LLM inference commonly runs on clusters of accelerators. A prominent deployment pattern brings dozens of accelerators into a single rack—often discussed at the scale of 72 accelerators—and connects them through a high-speed, rack-local interconnect, or scale-up domain. In such a topology, communication between any two accelerators can take as few as two hops, with high bandwidth and low latency.

    The critical boundary lies outside the rack:

    • Within a rack, or scale-up domain: High-bandwidth all-to-all communication supports frequent, fine-grained data exchange.
    • Across racks, or scale-out networking: Available communication bandwidth can fall substantially, while additional hops increase latency. Public discussions sometimes use an approximately eightfold bandwidth gap as an illustrative figure.

    This “bandwidth cliff” constrains how large an individual model layer can become without sacrificing efficiency. It is not simply a software setting: it reflects the physical topology of the system.

    2. Mixture of Experts: Expert Parallelism Depends on Topology

    Consider a mixture-of-experts (MoE) model. An illustrative configuration might contain hundreds of experts—256 is a commonly discussed example—while activating only a subset, such as 32, for each token. This sparse activation separates total parameter count from the computation required for each inference step: the model can hold many parameters without using all of them on every token.

    A natural deployment strategy is expert parallelism, which places different experts on different accelerators. Because the router can send a token to experts on multiple devices, this creates an all-to-all communication pattern that fits well within a rack-scale interconnect.

    The difficulty appears when routing crosses rack boundaries:

    1. # Simplified illustration of MoE routing and dispatch
    2. def moe_forward(tokens, router, experts, device_of_expert):
    3. weights = router(tokens) # Compute expert weights for each token
    4. selected = topk(weights, k=32) # Sparse activation: keep only Top-K experts
    5. outputs = []
    6. for token, picks in zip(tokens, selected):
    7. for expert_id in picks:
    8. dst = device_of_expert[expert_id]
    9. # If dst is in another rack, the token uses the slower network
    10. token_on_dst = all_to_all_send(token, dst)
    11. outputs.append(experts[expert_id](token_on_dst))
    12. return aggregate(outputs)

    Once experts are distributed across two racks, a substantial share of tokens may need to traverse the slower network. The slowest communication paths can then become the bottleneck for the all-to-all exchange.

    The resulting engineering rule of thumb is that rack-scale capacity effectively limits how large an expert layer can be while preserving efficient communication. Systems with larger scale-up domains can keep all-to-all traffic on fast links across more devices, making them better suited to highly sparse MoE deployments without losing inference efficiency.

    3. Batch Size: A Central Variable in Inference Cost

    Hardware constraints also help answer a practical question: can a slower service mode offer a lower price? The key variable is batch size.

    • Processing requests serially at batch size 1 can leave much of an accelerator’s compute capacity unused, sharply increasing cost per token. Some public discussions use a roughly three-order-of-magnitude difference—about 1,000 times—as an illustrative extreme, not a universal ratio.
    • Combining requests into larger batches spreads weight-loading, memory-bandwidth, and communication overhead across more tokens, reducing unit cost.

    This is a major reason real-time, low-latency inference and offline, high-throughput processing can have very different cost structures. It also helps explain service pricing tiers.

    Inference serving therefore involves a trade-off:

    Objective Batching Strategy Trade-off
    Lowest latency Small batches with rapid responses Higher cost per token
    Lowest cost Large batches that spread overhead Longer queueing delays
    Balanced performance Dynamic batching with timeout controls Requires careful tuning

    A slower service is not inherently cheaper. Its cost advantage comes from using the additional latency allowance to assemble more efficient batches.

    4. Implications for Training

    The same hardware logic extends to training. Pretraining requires large datasets and extensive parallel execution. When the data mix or number of training steps deviates from a theoretically optimal setup, achieving comparable results can require substantially more resources. Public discussions sometimes use an approximately hundredfold increase as an illustrative magnitude.

    The broader lesson is that data quality, parallelization strategy, and hardware topology need to be designed together, rather than optimized independently.

    5. Practical Engineering Guidelines

    For developers and architects, these principles translate into four priorities:

    1. Match communication patterns to the topology. Keep frequent all-to-all exchanges within the scale-up domain where possible, and minimize cross-rack traffic.
    2. Use batching to reduce cost. When latency requirements allow it, dynamic batching and request aggregation can substantially improve efficiency.
    3. Separate serving workloads. Route low-latency online requests and offline batch jobs through distinct serving paths, each with an appropriate batching strategy.
    4. Use general-purpose cloud infrastructure effectively. Container platforms can support elastic orchestration, object storage can hold datasets, and monitoring, alerting, and logging services can expose communication and throughput bottlenecks to support on-demand scaling.

    Conclusion

    Rack-local all-to-all communication, the cross-rack bandwidth cliff, and the economics of batching form a connected chain of constraints and trade-offs:

    Hardware topology sets the practical limits, architecture works within those limits, and batching economics determines the cost of access.

    Understanding this relationship provides a useful framework for evaluating LLM architecture choices, deployment efficiency, and the cost structure of inference services.