Boosting Inference Throughput by 50% on Domestic AI Accelerators: An 8-GPU Practical Guide

    This article explains how to achieve roughly a 50% increase in effective inference throughput on an 8-card domestic AI accelerator platform. It covers why raw throughput differs from throughput under SLO constraints, how to define a reproducible baseline, and a step-by-step tuning path: shifting from high tensor parallelism to multi-replica low tensor parallelism, adding expert and sequence parallelism, optimizing communication, and enabling graph mode with operator compilation. It also outlines a verification method based on throughput-latency curves and common pitfalls to avoid.

    1. Background: Why “It Runs” Does Not Mean “It Runs Cost-Effectively”

    When deploying large generative models on domestic AI accelerator platforms, teams usually solve “can it run” first. What actually determines the cost per unit of compute, however, is total throughput under service level objectives (SLOs). These are not the same thing in engineering terms: one configuration may produce stable output with very low concurrency, while another may collapse under high concurrency because time-to-first-token or time-per-output-token exceeds its limits. The core metric discussed here is therefore not peak raw throughput, but “effective throughput under constraints.”

    Constraints typically fall into three categories: time to first token (TTFT), time per output token (TPOT), and end-to-end timeout. A common mistake in practice is to saturate concurrency first and observe latency afterward, which makes measurements impossible to reproduce. A more reliable order is to fix the SLO limits first, then search for the throughput ceiling within those limits.

    Another easily overlooked variable is quantization. Weight quantization can significantly reduce memory usage and memory access pressure, but it changes the numerical behavior of operators and the space of available kernels, which in turn affects the optimal parallelization strategy. In other words, the quantization scheme and the parallelization scheme must be tuned together, not fixed independently.

    2. Defining the Baseline and the Optimization Goal

    A credible controlled experiment requires three things to be aligned at the same time: the same hardware and firmware version, the same inference engine and image, and the same model weights and quantization precision. Only when these premises match can throughput differences be attributed to configuration itself.

    The baseline should be defined as the “most plain but stable” setup: a single replica with tensor parallelism spanning all accelerators (TP = number of cards, DP = 1), with all non-essential optimization switches disabled. The advantage of this configuration is the most headroom in memory and the shortest communication path; the drawback is that concurrency capacity is limited by the batching window of a single replica.

    The optimization goal should be written in verifiable form: maximize total throughput relative to the baseline, provided TTFT and TPOT are no worse than the baseline. Here “total throughput” means the aggregated number of output tokens per second across all replicas, not the speed of a single request.

    3. Reworking the Parallel Strategy: From One Large Replica to Many Small Replicas

    Reducing TP from 8 to 2 while raising DP to 4 was the single change with the largest payoff in this tuning effort. The reasons can be understood on three levels.

    The first level is memory and the batching window. The higher the tensor parallel degree, the more collective communication is introduced at every layer, single-step compute time is fragmented by communication, and the concurrency batch that can be held is actually constrained. After lowering TP, synchronization overhead inside a replica drops, the steady-state batch size can grow, and the matrix unit utilization of the GPU/NPU gets closer to saturation.

    The second level is the granularity of failure and scheduling. Four replicas mean finer-grained request distribution and smoother tail latency; jitter in a single replica affects only a quarter of the traffic.

    The third level is how expert parallelism fits in. For models using a sparse mixture-of-experts (MoE) structure, splitting the expert dimension across multiple cards lets each card hold only a subset of experts, reducing per-card memory pressure while increasing the parallelism of expert routing. A schematic startup parameter structure is shown below (it only expresses configuration relationships, not the syntax of a specific platform):

    1. # Baseline: single replica, high tensor parallelism
    2. parallel:
    3. tensor_parallel: 8
    4. data_parallel: 1
    5. expert_parallel: 1
    6. # Optimized: multi-replica, low tensor parallelism + expert parallelism
    7. parallel:
    8. tensor_parallel: 2
    9. data_parallel: 4
    10. expert_parallel: 4
    11. slo:
    12. ttft_ms: 2000
    13. tpot_ms: 50

    It is worth stressing that TP=2/DP=4 is not universally optimal. When the model is dense, has many layers, and per-card memory is tight, TP=4/DP=2 is often more stable; when the context is extremely long, the strategy for splitting along the sequence dimension (see the next section) becomes the dominant factor.

    4. Sequence Parallelism and Communication Optimization: Amortizing Communication for Long Contexts

    In long-context scenarios, the main cost is concentrated in the communication and memory access of the attention part. The basic idea of sequence parallelism is to split the sequence dimension across multiple cards so each card processes only one segment of tokens, then fill in global information through lightweight collective communication. This flattens memory and compute pressure that would otherwise grow with the square of sequence length into something close to linear.

    Alongside sequence parallelism, communication-layer optimizations are common, including: aggregating multiple small messages into a single large one to reduce launch overhead; choosing better communication paths with topology awareness; and overlapping communication with computation so transfer time is hidden inside the operator execution window. Individually these changes yield little, but under high concurrency they noticeably improve tail latency.

    5. Graph Mode and Operator Compilation: Cutting Scheduling Overhead

    The default operator-by-operator interpreted execution of an inference framework brings substantial host-side scheduling and operator dispatch overhead, which is especially visible on domestic cards with small batches and short single-step times. Once graph capture is enabled, the whole forward pass is frozen into a graph and the host dispatches only once; adding automatic operator compilation and automatic mixed-precision selection on top can make the implementation fit the vector and matrix instructions of the hardware more closely.

    In practice, verification is recommended in two steps: enable graph mode only, and observe changes in throughput and latency; then add compilation optimizations, avoiding attribution difficulty caused by changing multiple variables at once. If precision drift appears after enabling them, check quantization calibration and operator precision policy first rather than rolling back all optimizations.

    6. Verification Method and Common Pitfalls

    Reliable verification requires a fixed input distribution. It is recommended to build three request sets: short input with short output, long input with short output, and short input with long output, representing conversational, document-summarization, and generation workloads respectively. Report TTFT, TPOT, and aggregated throughput separately for each set so averages do not hide the long tail.

    During load testing, increase concurrency step by step and record the throughput-latency curve to find the concurrency point where latency just touches the limit; the throughput at that point is the capacity that can be committed externally. There are four common pitfalls: looking only at peak throughput without SLOs; mixing different quantization precisions in the same comparison group; ignoring differences in image and driver versions; and taking measurements outside the steady-state window, counting warm-up jitter in the results.

    7. A Reusable Tuning Workflow

    1. Fix the baseline and the limits: unify hardware, engine, weights, and quantization, and write down the SLO numbers.
    2. Locate the bottleneck: first check whether memory is the constraint, then the share of communication in single-step time, and finally host scheduling overhead.
    3. Tune one variable at a time: parallel strategy → sequence parallelism → communication aggregation → graph and compilation, changing only one category each time.
    4. Joint regression: combine the best items, rerun the three request sets, and confirm nothing cancels out.
    5. Capture it as a reusable configuration: record the engine, image, resource specifications, parallel settings, and optimization switches as a template for similar models to apply directly.

    Following this path on an 8-card domestic accelerator, using low tensor parallelism with multiple replicas plus expert parallelism, sequence parallelism, and graph compilation, a public controlled experiment achieved roughly a 50% gain in effective throughput. The significance of this result lies not in the specific number but in the transferability of the method: fix the constraints first, break down the bottlenecks, then verify one item at a time and capture templates. That is the key to consistently producing inference optimization results on domestic compute.