LLM Inference Clusters: Domestic Compute Selection and Planning

    Inference clusters have different planning requirements from training clusters. This article outlines key considerations for selecting and sizing domestic compute for large language model serving, covering prefill and decode bottlenecks, memory bandwidth and capacity, Mixture-of-Experts communication constraints, hardware evaluation dimensions, capacity and power estimation, software stack migration risks, and a practical launch checklist.

    1. Why Inference-Side Compute Planning Needs Separate Treatment

    Training and inference place very different demands on compute. Training pursues total throughput for a single job and can tolerate longer job cycles. Inference directly serves users, so it focuses on first-token latency, output tokens per second, concurrency limits, and cost per token. When a model service reaches hundreds of thousands or millions of daily active users, the inference cluster often becomes the largest and longest-running infrastructure cost.

    Inference-side planning should therefore center on service goals. Teams need to define three things first: the target SLA, such as a first-token latency threshold; peak request volume and average input/output lengths; and the acceptable unit cost. Hardware selection must be built around these three metrics, not around the ranking of a single specification.

    2. Understanding the Two Inference Phases: Prefill and Decode

    A large model inference request is usually divided into two phases.

    The prefill phase processes the entire input prompt at once. Its compute workload grows with input length, and it is generally compute-bound. Matrix multiplication efficiency directly determines first-token latency.

    The decode phase generates output tokens one by one. For each generated token, the system must read model weights and the historical KV cache. The compute workload is relatively small, but memory traffic is high, so decode is often limited by memory bandwidth rather than peak compute.

    This means that comparing peak floating-point compute alone cannot accurately predict decode throughput. The following script uses a memory-bound model to provide a rough upper bound on decode throughput, which can help with preliminary screening before procurement or benchmarking:

    1. def decode_tps_upper_bound(
    2. mem_bw_gbs: float, # Per-card memory bandwidth in GB/s
    3. weight_gb: float, # Weight bytes read per step in GB (use activated parameters for MoE models)
    4. kv_gb_per_request: float, # KV cache bytes read per request per step in GB
    5. batch: int, # Decode batch size
    6. ) -> float:
    7. """Estimate the theoretical upper bound of output tokens per second per card. Actual values will be lower due to kernel efficiency and scheduling overhead."""
    8. bytes_per_step = weight_gb + kv_gb_per_request * batch
    9. steps_per_sec = mem_bw_gbs / bytes_per_step
    10. return steps_per_sec * batch
    11. if __name__ == "__main__":
    12. # The values below are illustrative only; replace them with measured or official specifications
    13. for batch in (8, 32, 128):
    14. tps = decode_tps_upper_bound(
    15. mem_bw_gbs=3000, weight_gb=20, kv_gb_per_request=0.05, batch=batch
    16. )
    17. print(f"batch={batch:>4} theoretical upper bound about {tps:,.0f} tokens/s")

    The script reveals a pattern: as batch size increases, weight reads are amortized across more requests and throughput rises, but KV cache reads also grow. Eventually, the system is constrained by both memory capacity and memory bandwidth. During planning, therefore, measure both bandwidth utilization and memory occupancy, and leave headroom for each.

    3. New Constraints from Mixture-of-Experts Architectures

    Mixture-of-Experts (MoE) architectures activate only part of the expert parameters during inference, so the compute workload per step is lower than that of a dense model with the same total parameter count. However, MoE also introduces three new constraints.

    1. Total weight size remains large. Although only some parameters are activated per step, all expert weights still need to reside in memory or in storage that can be retrieved quickly. Memory capacity remains a hard requirement.
    2. Expert routing creates communication. Different tokens are assigned to different experts. If experts are distributed across multiple cards or servers, all-to-all communication is required. Interconnect bandwidth and latency directly affect decode speed.
    3. Load imbalance. If some experts are called frequently, the corresponding cards become hotspots, and overall throughput is limited by the slowest card. Routing strategies and expert replica placement require dedicated tuning.

    When evaluating hardware for MoE inference, therefore, include interconnect topology and communication overhead in the assessment rather than looking only at single-card metrics.

    4. Correct Dimensions for Hardware Evaluation

    A single peak floating-point metric can easily mislead decision-making. A more complete evaluation should cover the dimensions in the table below:

    Evaluation dimension Question to ask Impact on inference
    Memory capacity Can model weights and KV cache reside in memory? Determines the minimum deployment unit and concurrency limit
    Memory bandwidth How much data can be read per unit time? Dominates decode-phase throughput
    Interconnect bandwidth and latency How efficient is communication across multiple cards? Affects tensor parallelism and expert parallelism performance
    Software stack maturity Operator coverage, compiler optimization, inference engine support Determines whether actual performance can approach theoretical values
    Energy per token Power consumption per unit of output Determines long-term operating cost
    Supply and delivery cadence Delivery batches and online dates Affects the capacity ramp plan
    Reliability and operations tooling Fault detection, isolation, and replacement processes Determines cluster availability

    For benchmarking, use a consistent methodology: the same model version, the same input/output distribution, and the same batch scheduling policy. Base conclusions on end-to-end first-token latency, output throughput, and SLA attainment. Comparing only single-operator or single-card microbenchmarks often leads to conclusions that diverge significantly from production behavior.

    5. Estimating Cluster Capacity and Power

    When planning a cluster, you can estimate capacity as follows:

    1. Estimate peak tokens-per-second demand from business volume: peak requests multiplied by average output length.
    2. Divide total demand by measured per-card throughput under the target SLA to get the baseline card count.
    3. Add redundancy headroom for failure replacement, traffic spikes, and canary releases.
    4. Derive facility power requirements from the card count and per-card power.
    1. import math
    2. def cards_needed(
    3. peak_qps: float,
    4. tokens_per_request: float,
    5. per_card_tps: float, # Measured output throughput per card under SLA
    6. headroom: float = 0.3, # Redundancy ratio
    7. ) -> int:
    8. total_tps = peak_qps * tokens_per_request
    9. return math.ceil(total_tps * (1 + headroom) / per_card_tps)
    10. def facility_power_mw(
    11. cards: int,
    12. card_power_kw: float, # Per-card power, illustrative value
    13. server_overhead: float = 1.3, # Power factor for other server components
    14. pue: float = 1.25, # Power usage effectiveness
    15. ) -> float:
    16. return cards * card_power_kw * server_overhead * pue / 1000
    17. if __name__ == "__main__":
    18. n = cards_needed(peak_qps=2000, tokens_per_request=600, per_card_tps=1500)
    19. print("Cards needed:", n)
    20. print("Estimated facility power (MW):", round(facility_power_mw(n, card_power_kw=0.7), 2))

    Large-scale deployments are usually delivered in phases rather than fully populated at once. During planning, split capacity into batches and set acceptance criteria for each batch, including performance targets, stability tests, and disaster recovery drills. When total power reaches gigawatt scale, power supply, cooling, and construction timelines themselves become critical paths and need to be scheduled in sync with hardware delivery.

    6. Software Stack Migration Risks and Mitigations

    The software stack is often the most underestimated part of hardware replacement. Common risks include:

    • Incomplete operator coverage. Some custom operators in a model may lack efficient implementations and may need to be rewritten or fall back to generic paths.
    • Differences in quantization support. Platforms vary in their support for low-precision formats, and accuracy regression after quantization requires dedicated validation.
    • Inference engine adaptation. Scheduling policies, KV cache management, and batching mechanisms may behave differently from the original platform.
    • Missing observability. If monitoring metrics do not cover the new hardware, production issues will be difficult to diagnose.

    A dual-stack parallel strategy can be used during migration: the original platform and the new platform serve traffic at the same time, with gradual cutover through canary traffic. Establish a fixed evaluation set, compare output quality item by item, and record changes in latency distribution rather than looking only at averages.

    7. Launch Checklist

    Before formal expansion, confirm each item below:

    1. Target SLA and peak traffic have been quantified and confirmed by the business side.
    2. Per-card throughput has been measured with the real model and real request distribution.
    3. Memory capacity and bandwidth utilization are both within safe thresholds.
    4. The multi-card interconnect topology has been validated for tensor parallelism or expert parallelism.
    5. Operator coverage, quantization plans, and the inference engine have completed adaptation testing.
    6. An accuracy regression evaluation set has been established with clear pass criteria.
    7. Monitoring, alerting, and fault isolation processes cover the new hardware.
    8. Power, cooling, and data center construction timelines are aligned with the delivery plan.
    9. Canary cutover and rollback plans have been rehearsed.

    8. Conclusion: The Value of Continuous Evaluation

    Planning inference infrastructure is not a one-time decision. Model structures, request patterns, and hardware supply all change, so teams should make performance baselines, cost metrics, and accuracy evaluation part of a routine process and review capacity plans regularly. Only with a quantifiable and reproducible evaluation system can teams make sound judgments among different technology paths and turn compute investment into stable service capability.