How to Calculate Per-Token Cost for LLM Inference on Thousand-GPU Clusters

    In large language model inference cost analysis, "how much hardware resource does each token consume" is a core question that is often oversimplified. This article explains how to move from a naive memory-bandwidth calculation to a rigorous per-token cost model, covering theoretical bandwidth limits, effective single-device throughput, KV Cache overhead, batching effects, parallelism and scaling efficiency, quantization trade-offs, and the infrastructure cost factors that determine real per-token cost in large GPU clusters.

    In large language model inference cost analysis, “how much hardware resource does each token require” is a core question—but one that is easily oversimplified. Many estimates start from memory bandwidth: if the model weights are roughly 140GB and an accelerator’s high-bandwidth memory offers a theoretical bandwidth of 3.35TB/s, does generating one token simply require reading the entire model once, giving us the theoretical throughput directly?

    This reasoning captures the key bottleneck of autoregressive decoding, but dividing bandwidth by model size often produces optimistic—or even arithmetically wrong—conclusions. A more rigorous analysis needs to distinguish between “theoretical ceiling,” “single-device effective throughput,” and “cluster end-to-end throughput,” while also factoring in memory capacity, KV Cache, communication, batching, and utilization.

    1. Deriving the Theoretical Per-Token Lower Bound from Weight Reads

    Take a model whose weights occupy about 140GB. With token-by-token generation, the decoding stage typically uses all or most of the model’s weights for each forward pass. If we assume that generating each token requires effectively reading the full weights from high-bandwidth memory at least once, the single-device bandwidth ceiling can be approximated as:

    1. Theoretical token throughput ≈ Memory bandwidth ÷ Model weight size

    Plugging in 3.35TB/s and 140GB:

    1. 3.35TB/s ÷ 140GB
    2. ≈ 3350GB/s ÷ 140GB
    3. ≈ 23.9 tokens/s

    So under this minimal model—where every token reads the full 140GB of weights once—the theoretical ceiling is about 24 tokens/s, not 42 tokens/s.

    There is also a unit conversion issue. Using decimal units (1TB = 1000GB) gives roughly 23.9 tokens/s; even with binary units, the result is nowhere near 42 tokens/s. Reaching 42 tokens/s would require higher effective bandwidth, or fewer than 140GB of weights actually read per token.

    However, this 24 tokens/s figure is a highly idealized bandwidth ceiling, not real serving throughput. Theoretical bandwidth is not the same as the effective bandwidth the model’s computation can sustain.

    2. Why Real Throughput Is Usually Below the Theoretical Value

    1. Memory Bandwidth Utilization Losses

    The bandwidth in hardware specifications is a peak figure measured under continuous, large-scale, regular access patterns. Real inference workloads are affected by:

    • Weight reads are not always ideal sequential accesses;
    • Synchronization and scheduling overhead exists between operators;
    • Weights may need format conversion or dequantization;
    • Pipeline gaps exist between layers;
    • Matrix computation and memory access cannot be fully overlapped;
    • Frameworks, kernels, and drivers introduce additional overhead.

    We can therefore introduce an effective bandwidth utilization coefficient:

    1. Effective token throughput
    2. ≈ Memory bandwidth × Bandwidth utilization ÷ Weight bytes read per token

    At 70% effective bandwidth utilization, estimating from weight reads alone:

    1. 3350GB/s × 70% ÷ 140GB
    2. ≈ 16.8 tokens/s

    At 50% utilization, the result is roughly 12 tokens/s. The actual numbers vary significantly with model architecture, quantization method, batch size, sequence length, and software implementation.

    2. Weight Reads Are Not the Only Memory Traffic

    The decoding stage also accesses the KV Cache, which stores the attention keys and values for previous tokens. Its footprint grows with context length, number of concurrent requests, and layer count.

    Per-token memory traffic can be roughly decomposed as:

    1. Per-token memory traffic
    2. ≈ Weight read traffic
    3. + KV Cache read traffic
    4. + Intermediate activation reads/writes
    5. + Output and temporary buffer reads/writes

    In short-context, low-concurrency scenarios, weight reads may dominate. But in long-context or high-concurrency scenarios, KV Cache access grows substantially and can become the primary bottleneck.

    This means the same model cannot be described with a single fixed “tokens per second” figure. At minimum, you should also state:

    • Input context length;
    • Output length;
    • Number of concurrent requests;
    • Whether continuous batching is used;
    • KV Cache data type;
    • Whether quantization is applied;
    • Whether the metric counts output tokens only, or total input and output tokens.

    3. How Batching Changes the Cost Structure

    In single-request, token-by-token decoding, matrix operations are small, and hardware compute units are often underutilized. As concurrency increases, the current tokens of multiple requests can be merged into a batch, improving matrix computation efficiency.

    But batching does not make the model weights disappear. It mainly brings two changes:

    First, weight reads can be amortized across multiple requests. For any single request, model weights no longer represent an entirely exclusive read cost.

    Second, compute unit utilization rises, giving the system the opportunity to shift from being “memory-bandwidth bound” to “compute bound.”

    As a result, batched system throughput can be significantly higher than single-request throughput, but per-request latency may also increase. Real services typically need to balance:

    • Time to first token;
    • Per-request generation speed;
    • Total throughput;
    • Concurrency capacity;
    • P95 or P99 latency;
    • Per-token cost.

    If the business prioritizes interactive experience, you cannot chase maximum batch size; if it prioritizes offline generation or batch processing, you can trade some latency for higher throughput.

    4. A Thousand-GPU Cluster Is Not Just Single-GPU Performance Multiplied

    When a model is deployed across a large accelerator cluster, theoretical throughput cannot simply be written as:

    1. Cluster throughput = Single-device throughput × Device count

    Both model parallelism and data parallelism introduce additional overhead.

    1. Data Parallelism

    Each device group runs the full model, with different devices handling different requests. Data parallelism scales relatively simply and suits cases where the model fits on a single device or a single device group.

    Its main problems are:

    • Model replicas consume more memory;
    • Request allocation may be unbalanced;
    • Mixing long and short requests causes devices to idle;
    • Cluster scheduling and network transfer add extra cost.

    2. Tensor Parallelism

    Matrix operations within the model are split across multiple devices. Each layer’s computation typically requires collective communication, such as aggregating partial results.

    As the parallel scale grows, communication time can approach or even exceed computation time. At that point, adding more devices may no longer improve throughput and can actually reduce efficiency.

    3. Pipeline Parallelism

    Different layers of the model are placed on different device groups. This reduces per-device memory pressure but introduces pipeline bubbles, especially with small batches or large variance in request lengths.

    Therefore, in a thousand-GPU cluster, scaling efficiency matters:

    1. Scaling efficiency
    2. = Actual cluster throughput
    3. ÷ Ideal linear-scaling throughput

    If a single device or device group delivers 24 tokens/s, 100 groups should theoretically reach 2400 tokens/s; but accounting for communication, scheduling, and load imbalance, actual throughput may be only a fraction of that. The lower the scaling efficiency, the higher the hardware cost amortized onto each token.

    5. How Per-Token Cost Should Be Calculated

    Per-token cost should not be based solely on accelerator rental pricing. It should also include servers, networking, storage, power, cooling, operations, and software resources.

    A fairly general formula is:

    1. Per-token cost
    2. = Total cost per unit time
    3. ÷ Effective output tokens per unit time

    The total cost per unit time can be further decomposed as:

    1. Total cost
    2. = Compute device cost
    3. + Network and storage cost
    4. + Data center and energy cost
    5. + Operations and software cost
    6. + Idle and redundant capacity cost

    Using hours as the unit:

    1. Per-token cost
    2. = Cluster cost per hour
    3. ÷ Effective output tokens per hour

    Pay special attention to how “effective output tokens” is defined. It should exclude:

    • Device idle time;
    • Warm-up time;
    • Request queuing time;
    • Tokens produced by failed retries;
    • Redundant capacity reserved for high availability;
    • Inefficient throughput that fails quality-of-service requirements.

    For example, suppose a cluster can theoretically generate ten million tokens per hour, but is only in effective service 70% of the time, with an average scaling efficiency of 60%. The token count that can legitimately enter the cost denominator drops significantly. In this case, the headline hardware price does not represent the true per-token cost.

    6. Quantization Reduces Weight Movement Cost, but Is Not Free

    The direct benefit of quantization is reducing weight footprint and memory bandwidth pressure. When a model is converted from a high-precision format to a lower-bit format, weight size can shrink significantly, and the data moved per token decreases accordingly.

    Ideally:

    1. Post-quantization throughput
    2. ≈ Original throughput × Original weight size ÷ Quantized weight size

    But this is only an approximation under bandwidth-bound conditions. Actual gains also depend on:

    • Whether the quantization format is well supported by the hardware;
    • Whether dequantization adds computational overhead;
    • Whether different layers use different precisions;
    • Whether accuracy loss affects business outcomes;
    • Whether the inference kernels are sufficiently optimized.

    Therefore, the goal of quantization should not simply be “shrinking the model,” but a joint evaluation of accuracy, throughput, latency, and cost.

    7. Key Variables Affecting Per-Token Cost

    For practical estimation, it is recommended to build a parameter table covering at least the following:

    Parameter Impact
    Model weight size Determines baseline memory movement
    Memory bandwidth Determines theoretical weight-read ceiling
    Bandwidth utilization Reflects actual software and hardware efficiency
    Context length Affects KV Cache access and memory footprint
    Concurrent requests Determines batching efficiency
    Parallel scale Affects communication and scaling efficiency
    Quantization precision Affects weight size, speed, and accuracy
    Device utilization Directly affects per-token cost
    Service-level requirements Affect redundancy and capacity reservation
    Token counting convention Determines whether the cost denominator is comparable

    Among these, device utilization is often the most overlooked variable. With identical hardware, average per-token cost can differ by several times between fully loaded peak hours and off-peak periods running at 20% load.

    8. Conclusion: Theoretical Bandwidth Is Only the Starting Point

    For a model of roughly 140GB with memory bandwidth at the 3.35TB/s level, the minimal model—reading the full weights once per token—yields a theoretical figure of about 24 tokens/s. This number only describes the upper bound under a bandwidth constraint; it does not directly represent real inference speed.

    A more realistic analysis path is:

    1. Theoretical bandwidth ceiling
    2. → Multiply by effective bandwidth utilization
    3. → Subtract the impact of KV Cache and intermediate data access
    4. → Factor in gains from batching
    5. → Subtract parallel communication and scheduling losses
    6. → Incorporate device utilization and infrastructure costs
    7. → Arrive at the true per-token cost

    Therefore, what is truly worth optimizing in a thousand-GPU cluster is not just the peak bandwidth of a single accelerator, but the effective token output capability of the whole system. Only by simultaneously improving memory utilization, batching efficiency, parallel scaling efficiency, and effective device uptime can theoretical low cost be converted into a sustainable per-token cost advantage in production.