LLM Inference Throughput Optimization: +53.5% Throughput Under SLO on 8 Accelerators

    This article explains how to raise total LLM inference throughput while still meeting latency SLOs, based on a real optimization effort that delivered roughly 53.5% more throughput under SLO constraints on an 8-card domestic accelerator node. It walks through the full method: profiling the workload across input length, output length, arrival pattern, and SLO definition; choosing tensor, pipeline, and data parallelism; governing KV cache capacity through paged allocation, prefix reuse, quantization and offload, and safety watermarks; applying continuous batching, prefill/decode disaggregation, chunked prefill, admission control, and adaptive batch sizing; reducing stalls with operator fusion, graph execution, and communication overlap; trading controlled accuracy for throughput via weight and cache quantization; and closing the loop with a fixed baseline, stepped load tests, stability checks, and per-change attribution. The approach is hardware-agnostic and portable across inference cluster sizes.

    1. Why Total Throughput Under SLO Is the Real Metric

    In LLM inference serving, the most common mistake teams make is treating peak throughput as the optimization target. Peak throughput is usually obtained by pushing concurrency without limit, stretching input sequences, and disabling every throttling mechanism, but real production traffic cannot tolerate the resulting long-tail latency. The objective function that actually matters is the total number of requests a system can reliably complete per unit of time while satisfying first-token latency (TTFT) and per-output-token latency (TPOT) constraints.

    The reference result is representative: on an 8-card node built with a domestic accelerator, a medium-sized text generation model designed for low-latency scenarios was systematically optimized, and total throughput under SLO constraints rose by about 53.5% over the baseline. That number did not come from a single silver bullet. It is the stacked outcome of six layers: workload analysis, parallelism strategy, memory governance, scheduling, operators and communication, and numerical precision. Setting aside product-specific details, this article abstracts the work into a transferable engineering method.

    One point deserves emphasis: throughput gains and latency constraints are inherently in tension. Every optimization action should first answer three questions. Which segment of the latency budget does it change? Which scarce resources does it consume (memory, bandwidth, compute units)? Does it still hold under high concurrency?

    2. Characterize the Workload Before Optimizing

    Most tuning failures come from misjudging the workload. Start by building a four-dimensional profile:

    • Input length distribution: short Q&A, long-document summarization, and code completion differ enormously at P50/P99, and this directly determines the compute pressure of the prefill stage.
    • Output length distribution: this determines how long the decode stage runs and how much cache it occupies.
    • Arrival process: Poisson arrivals and bursty batch arrivals place completely different demands on queueing strategy.
    • SLO definition: whether it is an end-to-end TTFT attainment rate or a dual constraint that also includes TPOT; the attainment criterion must be pinned down to a specific percentile.

    Illustrative profile collection logic:

    1. # Illustrative only: collect workload characteristics to drive capacity and parallelism decisions
    2. stats = {
    3. "input_len": {"p50": 512, "p99": 4096},
    4. "output_len": {"p50": 256, "p99": 1024},
    5. "qps_peak": 18,
    6. "slo": {"ttft_ms": 800, "tpot_ms": 50},
    7. }

    With that profile in hand, you can tell whether the bottleneck sits in prefill (compute-bound) or decode (memory- and bandwidth-bound). The empirical rule: workloads with long inputs and short outputs lean toward a compute bottleneck, while workloads with short inputs and long outputs lean toward memory bandwidth and cache capacity limits. The optimization levers for the two cases are almost opposite.

    3. Parallelism: Fitting the Model onto 8 Cards

    A single 8-card node is a common inference unit size, and there are three typical ways to split the model:

    1. Tensor parallelism (TP): shards each layer’s weights across cards by dimension. Communication is frequent but each computation is highly parallel. It suits the fast intra-node interconnect and is the workhorse for low-latency scenarios.
    2. Pipeline parallelism (PP): splits by layer with little communication, but introduces pipeline bubbles and low utilization when there are not enough in-flight requests.
    3. Data/replica parallelism (DP): multiple replicas serve different requests, so throughput scales nearly linearly with replica count, but each replica needs a full copy of the weights, which is heavy on memory.

    A common mistake in practice is applying pure pipeline parallelism across the board to save memory, which leaves bubbles dominating at small and medium concurrency. A safer approach is a hybrid split: tensor parallelism carries single-layer compute inside the node, pipeline parallelism partitions layers across nodes, and data parallelism scales throughput at the replica level. Evaluate any split against three quantities at once: single-request latency, remaining memory headroom, and the share of time spent in inter-card communication.

    4. Memory and Cache Governance: Capacity Sets the Concurrency Ceiling

    KV cache occupancy during decode is proportional to the number of sequences in the batch multiplied by sequence length, making it the primary constraint on concurrency. Reusable governance measures include:

    • Paged cache management: cut the cache into fixed-size blocks allocated on demand, which sharply reduces fragmentation and brings effective memory utilization close to theoretical availability.
    • Prefix reuse: requests sharing the same system prompt or the same few-shot prefix share cache blocks, with often substantial hit rates in scenarios such as coding assistants and customer support Q&A.
    • Cache quantization and offload: reduce the numeric bit width of the cache within acceptable accuracy limits, or swap cold-request cache out to host memory, trading capacity for concurrency.
    • Reserved watermark: keep a safety margin for bursty long outputs so that allocation failures do not cause request failures at runtime, which would directly damage the SLO attainment rate.

    A practical capacity estimation approach:

    1. Usable cache total ≈ memory per card × card count − weight footprint − activations and scratch buffers − safety watermark
    2. Max concurrency ≈ usable cache total / (average sequence length × cache bytes per token)

    5. Batching and Scheduling: The Most Direct Throughput Lever

    Continuous batching is the core of modern inference engines’ throughput advantage: a request leaves as soon as it finishes and new requests are inserted immediately, avoiding the wait-and-align waste of static batches. Further directions:

    • Separate scheduling for prefill and decode: place compute-heavy prefill and memory-heavy decode in different execution channels so long inputs do not block requests already decoding, which compresses the TPOT long tail.
    • Chunked prefill: split very long inputs into chunks and interleave them with decode so both TTFT and TPOT stay controllable.
    • Priority and admission control: order requests by remaining SLO budget and schedule near-violation requests first; under overload, actively reject or degrade to protect the overall attainment rate.
    • Adaptive batch size: adjust dynamically based on real-time queue length and memory watermark instead of a fixed constant.

    Illustrative scheduling pseudocode:

    1. def schedule(queue, mem_watermark):
    2. # 1) Admission: degrade or reject requests with insufficient budget
    3. admitted = [r for r in queue if r.slo_budget > MIN_BUDGET]
    4. # 2) Chunked prefill so long inputs cannot monopolize a step
    5. for r in admitted:
    6. r.prefill_chunk = min(CHUNK, r.remaining_input)
    7. # 3) Prioritize decode progress to control TPOT
    8. batch = pick_decode_first(admitted, mem_watermark)
    9. return batch

    6. Operators and Communication: Squeezing Out the Waiting

    At the framework and operator level, the common wins are: operator fusion to cut kernel launches and round trips of intermediate tensors; choosing an efficient attention implementation matched to hardware characteristics; graph-mode execution to lower dispatch overhead; and overlapping communication with computation so the reduction cost of tensor parallelism hides behind compute. A simple test for whether this layer deserves investment is the share of non-compute wait time in the profile: if waiting dominates, prioritize overlap and fusion; if compute is already saturated, shift attention to precision and parallelism strategy.

    7. Numerical Precision and Quantization: Trading Controlled Error for Throughput

    Weight quantization (lower-bit integer or floating-point representations) reduces both memory and bandwidth pressure and is a cost-effective lever in the decode stage; cache quantization directly enlarges the concurrency ceiling. The key to adoption is building a precision-throughput curve: pick the most aggressive configuration inside the quality threshold the business accepts, and regression-test it on a fixed evaluation set so that individual tasks do not degrade noticeably.

    8. Closing the Verification Loop: Making Numbers Like 53.5% Credible

    Any improvement must be reproducible. The recommended loop:

    1. Fix the baseline: record framework version, driver and firmware, parallelism configuration, batch strategy, and quantization configuration.
    2. Stepped load testing: sweep concurrency from low to high and plot the throughput-TTFT-TPOT surface to locate the SLO knee.
    3. Stability validation: run for extended periods and watch for memory fragmentation, cache hit-rate decay, and long-tail jitter.
    4. Attribution analysis: measure the incremental gain of each optimization separately so benefits are neither masked nor double-counted.
    1. Suggested metrics dashboard:
    2. Throughput (tokens/s, req/s) | TTFT P50/P99 | TPOT P50/P99
    3. Memory usage and fragmentation rate | Cache hit rate | Average sequence length in batch | Rejection rate

    9. Conclusion

    Raising throughput by more than half under SLO constraints is fundamentally about moving the system from “it runs” to “it is measurable, attributable, and reproducible.” The path is clear: characterize the workload first, then settle the parallelism split, then govern memory and cache, then use continuous batching and disaggregated scheduling to extract concurrency, and finish with operator and communication optimization plus quantization, locking in the gains with a strict load-testing loop. In heterogeneous compute environments such as domestic accelerators, this method is decoupled from specific hardware and can be ported directly to inference clusters of different sizes, or combined with general cloud capabilities like container platforms, monitoring and alerting, and logging services to form a stable inference serving foundation.