Designing Large-Scale Cloud Inference Systems: A Cost-Driven Architecture Breakdown

    This article analyzes the architecture of a large-scale LLM inference system from a cost-reduction perspective. It verifies publicly disclosed throughput and per-card revenue figures, explains the rationale and trade-offs of E/P/D stage separation, compares Prefill and Decode parallel strategies, details KVCache tiering and bounded replay, summarizes three scheduling mechanisms, and provides a benchmark checklist for teams evaluating or replicating similar systems.

    Designing Large-Scale Cloud Inference Systems: A Cost-Driven Architecture Breakdown

    1. Core Thesis: The Inference System Determines the Token Unit Cost

    A large model defines the boundary of its capabilities, but the final price of a token is determined by the inference system. A recently open-sourced large-scale inference framework disclosed two key numbers: a single cluster serves 155 trillion tokens per day, and under the official pricing basis, each accelerator card generates about $38 in revenue per hour.

    These two numbers represent two different things:

    • Scale: how much traffic the cluster as a whole can handle.
    • Unit economics: how much revenue a single card can generate within the same time window.

    Put together, the real problem this system solves is not “whether the model can answer,” but “whether the same cards can serve more requests at a lower unit cost.” Around this goal, the system sets three engineering objectives:

    1. Support chips from multiple vendors: mainstream general-purpose GPUs and domestic AI accelerator cards should both run, and both should be utilized as fully as possible.
    2. Organize hardware by stage: regular 8-card machines carry Prefill, while 64–128-card supernodes carry Decode.
    3. Retain KVCache for a long time: the retention window exceeds 72 hours, using a longer reuse cycle to absorb repeated Prefill computation.

    These three objectives sound like architecture slogans, but in engineering terms, each corresponds to a specific cost-reduction line. This article breaks the system down and answers three questions: What does each design save? What does it cost? If you were to replicate it, which numbers can be used as benchmarks?

    2. Sanity Check: Do the Two Public Numbers Add Up?

    Start with the simplest calculation.

    155 trillion tokens/day converted to per second:

    1. 155 × 10^12 ÷ 86,400 ≈ 1.79 × 10^9 tokens/s

    That is about 1.79 billion tokens per second. Assuming a cluster of about 7,300 cards, the per-card share is:

    1. 1.79 × 10^9 ÷ 7300 ≈ 245,700 tokens/s/card
    2. 245,700 × 3600 ≈ 8.85 × 10^8 tokens/card·hour

    One caveat must be emphasized here: 885 million tokens/card·hour is “service throughput,” not “compute throughput.”

    The difference is that service throughput includes systemic gains from cache hits, prefix reuse, and multi-request batching. The Prompt prefixes of many requests overlap heavily, and requests that hit the cache no longer recompute Prefill. This is also why the official disclosure includes an approximately 85% hit rate: the cache hit rate directly determines the multiplier gap between nominal throughput and raw compute throughput. Conversely, without the caching system, raw compute utilization per card alone could not reach this level of service throughput. In addition, the official material notes that online-scenario efficiency is about 80% of offline batch processing. This loss comes from the randomness of online request arrivals and scheduling idle time under SLO constraints, which is a reasonable cost of online serving.

    3. System Shape: Three-Stage E/P/D Separation

    3.1 Why Split Into Three Stages

    Traditional inference serving often couples Embedding (E), Prefill (P), and Decode (D) on the same set of instances. However, the resource profiles of these three stages are very different:

    • E stage: lightweight and can be compressed onto a single card.
    • Prefill stage: compute-intensive, processes a long input at once, easily saturates compute, and has relatively controllable memory usage.
    • Decode stage: memory-access-intensive, generates tokens one by one, is bottlenecked by memory bandwidth and KV Cache capacity, and naturally requires a larger aggregated memory pool.

    Only by deploying stages with different profiles on hardware pools of different specifications can each stage run at full utilization. The framework’s shape is as follows: VE uses a single card for E; Prefill uses 8-card machines; Decode uses 64–128-card supernodes. In addition, KVCache storage uses an independent distributed file system (a 3FS-like component in the architecture), decoupled from compute nodes.

    3.2 Costs

    The costs of the separated architecture are obvious:

    • Inter-stage transfer overhead: KV produced by Prefill must be migrated to Decode nodes, and cross-machine migration introduces network latency and bandwidth costs.
    • Operational complexity: the three roles scale independently, and capacity planning must be modeled separately.
    • Scheduling complexity: a request must be scheduled across three resource pools, and failure recovery and retry paths are longer.

    4. Parallel Strategy: Small EP for Prefill, Wide EP for Decode

    4.1 Rationale

    • Prefill uses small-scale expert parallelism (EP 2–8): Prefill is compute-intensive, and a single 8-card machine can already saturate compute. Excessively large parallelism instead increases communication overhead.
    • Decode uses Wide-EP (64–128): Decode is memory-access-intensive. Distributing expert weights across more cards reduces the weight memory footprint per card, frees HBM space for KV Cache, and alleviates memory-access bottlenecks through cross-card aggregated bandwidth.
    • TP/CP are not used for now: tensor parallelism requires All-Reduce at every step, resulting in high communication frequency. Context parallelism mainly serves ultra-long sequence scenarios and is inconsistent with the goals of a scheme centered on cache reuse.

    4.2 Key Numbers: The KV Capacity Calculation

    The tiered placement strategy for KVCache is the essence of the entire scheme:

    Tier Content placed Magnitude
    HBM (GPU memory) Hot data (KV of active requests) Highest priority
    Host memory SWA sliding window ≈ 1.4 MB/sequence
    Distributed file system Block KV ≈ 528 B/token

    The number 528 B/token is worth remembering: it provides an estimation baseline for KV storage cost in long-context scenarios. Assume a 100K-token session; its Block KV is about 52.8 MB. The cost of storing it in distributed storage is far lower than storing it in HBM. This is the premise that makes the “72-hour retention window” feasible.

    5. Recompute Strategy: Bounded Replay

    When part of the KV is missing, the system does not perform full recomputation. Instead, it uses Bounded Replay: replaying only the last 128 tokens is enough to recover a sufficiently recent context state. If an earlier state needs to be reconstructed precisely, 2,560 tokens must be replayed.

    The design trade-off is clear:

    • What it saves: it avoids expensive long-sequence Prefill recomputation and limits recovery cost to a constant level.
    • Cost: replay produces an approximate state, and some requests may need to accept slight context truncation.
    • Supporting constraint: SWA window data is not placed in the distributed file system. The sliding window itself covers only the most recent tokens, so persisting it has very low cost-effectiveness. When it is missing, rebuilding it directly with Bounded Replay is more economical.

    6. Scheduling Strategy: Three Complementary Mechanisms

    1. Prefill derives chunk size from the time budget: instead of using a fixed chunk, it infers the input length for each processing round from the time budget available to the current batch, so that a single chunk completes exactly within the budget and queuing and idling are reduced.
    2. Decode balances along two dimensions: request distribution considers both load and resource occupancy, avoiding distortion from a single-dimensional metric.
    3. EPLB minimizes max, not mean: the goal of expert load balancing is to reduce the busiest expert (max), not to optimize the mean. In the Decode stage, supernodes are dragged down by synchronization with the slowest expert, so mean balancing cannot eliminate long-tail blocking.

    7. Conclusion and Benchmark Checklist

    Returning to the six-sentence conclusion from the beginning:

    Dimension One-sentence conclusion
    System shape E/P/D separation + independent KV storage; single-card E, 8-card Prefill, 64–128-card supernode Decode
    Parallel strategy Small EP for Prefill, Wide EP for Decode; no TP/CP for now
    KVCache HBM for hot data, host memory for SWA windows, file system for Block KV
    Recompute Bounded replay of 128 tokens; precise reconstruction requires 2,560
    Scheduling Time-budget-derived chunks; dual-dimension balancing; minimize max, not mean
    Economics 155 trillion tokens/day, $38/card·hour, about 85% hit rate, online efficiency ≈ 80% of offline

    If you want to replicate this, the numbers worth benchmarking: about 246K tokens/s/card of service throughput, 528 B/token Block KV size, 1.4 MB/seq SWA overhead, and a cache hit rate on the order of 85%. Together, these numbers reveal an industry consensus: competition in large-model inference is shifting from “single-card optimization” to system-level competition across “cache + scheduling + hardware topology.” Whoever can absorb repeated computation with longer reuse windows and finer stage isolation can sell more tokens at lower prices on the same cards.