Hardware Logic Behind LLM Training and Inference: Interconnect Tiers and Batch Sizing

    This article breaks down the hardware constraints that shape large language model training and inference, focusing on two main factors: layered interconnect bandwidth and batch size. It explains why the size of a high-speed interconnect domain caps how far mixture-of-experts (MoE) sparsity can go, why larger batches lower per-token inference cost at the price of latency, and how public pricing and throughput tiers can be used to infer internal architecture trade-offs. Readers will find a communication-volume estimation snippet, a six-step capacity planning checklist, and practical guidance on separating latency-sensitive traffic from low-cost batch lanes.

    Introduction: What a Blackboard Session Reveals About Physical Limits

    A deep technical discussion conducted as a blackboard walkthrough pulled the conversation about LLM training and inference away from “parameter count” and back to physical constraints. The speaker was a chip engineer who has long worked on accelerator architecture and compiler optimization, and his perspective was unusual: rather than reading marketing material, he worked backward from public API pricing and throughput tiers to infer the design trade-offs that must exist inside the system.

    That perspective is valuable for developers. When we discuss model capability, we usually stay at the algorithm layer. But once a model actually has to run, what determines cost, latency, and the usable scale is a set of “non-algorithmic factors”: interconnect topology, bandwidth hierarchy, and batching strategy. This article abstracts those constraints into general engineering problems and lays out a capacity planning method you can apply.

    1. Layered Interconnect: Bandwidth Gaps Decide Deployment Shape

    Interconnect in modern accelerator clusters is layered. Inside the same node or rack, there is typically a dedicated high-bandwidth, low-latency fabric; once traffic crosses that boundary, bandwidth drops sharply, commonly by a multiple of several times (the original talk used roughly 8x as an illustration). That multiple is not a detail. It is the first-principles constraint of the architecture.

    Why does it matter? Sparse structures such as mixture-of-experts (MoE) have a most natural parallelization scheme in expert parallelism: different experts sit on different devices, each token is routed to its assigned expert and the result comes back. This is a classic all-to-all communication pattern.

    • Inside the high-speed domain, all-to-all overhead can be hidden behind computation, so sparsity can be pushed aggressively.
    • Once experts cross out of the high-speed domain, a substantial share of traffic takes the slow links, and communication immediately becomes the bottleneck.

    The engineering conclusion follows: the size of a single high-speed interconnect domain effectively caps how large the expert layer can be and how high the sparsity can go. This also explains a frequently misread phenomenon: differences in progress on large-scale pretraining across teams do not necessarily come from algorithmic advantage. They may simply reflect that one team has long had a larger high-speed domain on the systems side, allowing higher sparsity while keeping inference efficient.

    Illustration: Estimating Feasibility from Communication Volume

    1. def all_to_all_feasible(tokens, hidden, experts, bw_fast, bw_slow, frac_cross):
    2. # Approximate bytes for one layer of all-to-all (ignoring compression and quantization)
    3. bytes_total = tokens * hidden * 2 # 16-bit precision as an example
    4. bytes_cross = bytes_total * frac_cross
    5. t_fast = bytes_total * (1 - frac_cross) / bw_fast
    6. t_slow = bytes_cross / bw_slow
    7. return t_fast + t_slow, frac_cross

    The point of this snippet is not precision but making the “share of cross-domain traffic” an explicit variable: once frac_cross passes a certain threshold, the cross-domain term dominates total time, and increasing sparsity further only degrades throughput.

    2. Batch Size: The Core Variable Behind Inference Pricing

    A familiar product pattern: the same coding assistant or chat product offers a “fast mode” at a multiple of the price, yet the speed gain is far smaller than the price increase. Conversely, can a “slower response” buy a “lower price”?

    It can, and the core variable is batch size. The cost structure of an inference service breaks down roughly into:

    1. Weight reads: approximately independent of batch size, a fixed cost.
    2. Compute and activations: grows roughly linearly with batch size.
    3. Memory and scheduling: affected by context length and concurrency.

    When the service is compute-bound (common in the decode phase), increasing batch size barely adds weight-read cost but amortizes that fixed overhead across more requests, so per-token cost drops significantly, at the price of queueing and higher latency. That is the fundamental reason a “cheap, slow tier” holds up on cost.

    1. cost per token ≈ (weight read cost + in-batch compute cost) / tokens in batch
    2. batch size ↑ → numerator grows slower than denominator → cost per token ↓, latency ↑

    Engineering recommendation: tier your latency sensitivity. Interactive completion goes through a small-batch, low-latency lane; bulk refactoring, bulk document generation, and offline evaluation go through a large-batch, low-cost lane. Use queues and priorities to isolate the two traffic types so large batch jobs do not inflate tail latency for interactive requests.

    3. Reverse-Engineering Architecture from Public Pricing: A General Method

    Public prices and throughput tiers actually leak a great deal of internal information. The reusable inference framework:

    • Watch how unit price changes with context length and concurrency tier; inflection points often correspond to memory or bandwidth bottlenecks.
    • Compare the price and speed ratios of “fast” versus “standard” tiers; if the price multiple far exceeds the speed multiple, cost is dominated by fixed overhead and batching policy.
    • Look at the combined ceiling of maximum context and maximum concurrency to infer the size of the high-speed domain and memory capacity.

    This method relies on no vendor internal material. It uses only observable metrics to bound estimates, which makes it a good sanity check before selection.

    4. Implementation Checklist: Six Steps for Capacity Planning

    1. Define business latency tiers (interactive / near-real-time / offline) and set a target for each.
    2. Estimate model memory footprint and weight-read overhead to determine whether you are compute-bound or bandwidth-bound.
    3. Use the communication-volume model above to estimate the communication share after parallel splitting.
    4. Given that “high-speed domain size caps sparsity,” choose model sparsity and a parallel strategy.
    5. Design two batching lanes with queue priorities and timeout-based degradation.
    6. Set up monitoring and alerting to track three curves: throughput, tail latency, and cost per token.

    Supporting layered observability is typically handled together by a logging service, metrics monitoring with alerting, and elastic scaling on a container platform; data and intermediate results can land in object storage and message queues for asynchronous decoupling and peak shaving.

    Conclusion

    Much of the engineering truth about LLMs is written into interconnect topology and batching strategy. Understanding the two main threads—bandwidth hierarchy caps sparsity, and batch size sets unit cost—is enough to ask the right questions in an architecture review. To validate this on Baidu AI Cloud, you can start with a small-scale parallel experiment on a general-purpose container platform, use monitoring and alerting to observe communication share and tail latency, then scale up gradually and let data, not intuition, drive decisions.