How to Improve LLM Inference Throughput by 53% on 8 GPUs
This article explains how to raise large language model inference throughput by up to 53.5% on an 8-GPU domestic AI accelerator server while meeting the same SLO. It covers building an SLO-based baseline, switching from TP8 to TP2 with DP4 and expert parallelism for MoE models, hiding communication costs with sequence parallelism and graph compilation, planning the memory budget under quantization, and capturing each deployment as a reusable entry. Readers will find a four-step rollout roadmap, a parallel strategy decision table, and common pitfalls to avoid.
1. Background: Why “It Runs” Is Not the Same as “It Runs Efficiently”
When teams deploy large language models on domestic (China-built) AI compute, the first question is rarely “can it do inference?” It is “is inference economical?” With identical model weights and identical accelerator cards, the number of requests served per unit of time can differ by tens of percentage points depending only on how the model is sharded across devices, which communication path is used, and which compiler options are enabled.
The original practice produced a representative result: on an 8-GPU machine built with a certain domestic AI accelerator, running inference for a quantized general-purpose LLM with a Mixture-of-Experts (MoE) architecture, total throughput improved by about 53.5% while meeting the same service level objective (SLO).
The value of that number is not the number itself, but the engineering rule it exposes: the throughput bottleneck is usually not insufficient per-card compute, but rather a parallel strategy that does not match the workload shape, communication overhead that is never hidden, and a compute graph that is not compiled against the hardware’s characteristics. This article therefore does not retell one lucky tuning session. Instead, it abstracts the process into a reusable methodology.
Note that all hardware, engines, and tools here are described neutrally: the hardware is a “domestic AI accelerator (8-GPU server)”, the software is “the domestic acceleration backend of a mainstream open-source inference engine”, and the model is “a quantized large language model with a Mixture-of-Experts (MoE) architecture”. No specific vendor or model number is bound to this text; the method itself is decoupled from the hardware.
2. Establish the Baseline First: SLO Is the Only Judge
Talking about throughput without an SLO is meaningless. In practice, fix three quantities and release only one:
- Fix the input/output length distribution (for example, 2K input tokens and 512 output tokens);
- Fix the upper bounds on time to first token (TTFT) and time per output token (TPOT);
- Fix the concurrency limit and the timeout/retry policy;
- Release only the request rate, ramp it up gradually, and record the “maximum total throughput that still meets the SLO”.
The pseudocode below illustrates the load test; real parameters must be replaced with your business distribution:
# Pseudocode: find the maximum usable throughput under SLO constraintsfor rate in candidate_rates: # candidate request ratesmetrics = run_benchmark(rate, # apply loadinput_len=2048,output_len=512,ttft_ms=800, # SLO: time to first tokentpot_ms=50) # SLO: time per output tokenif metrics.slo_violation_ratio > 0.01:break # over 1% violations means unusablebest = metrics.total_throughput # record max throughput meeting SLO
The key point: the baseline and the optimized version must use the same load-test script, the same dataset, and the same SLO thresholds. Otherwise no improvement is credible.
3. Parallel Strategy: Make All Eight Cards Actually Process Concurrency
3.1 Why Move from TP8 to TP2 x DP4
The baseline uses pure tensor parallelism (TP=8, DP=1): one model instance spans all eight cards, and every request shares the same compute and communication path. Its advantages are low memory usage and stable single-request latency. Its weakness is poor concurrency scaling: all requests queue through the same TP communication group, AllReduce/AllGather happens frequently, and inter-card synchronization becomes a serialization point.
The optimized setup changes to TP=2 and DP=4, with expert parallelism (EP) layered on to carry the MoE layers:
- TP=2: split each layer’s matrix multiplications across two cards, keeping the communication domain small and synchronization cost low;
- DP=4: run four replicas, which naturally spreads concurrent requests across four paths, so throughput grows close to linearly with the number of replicas;
- EP: shard experts across different cards so that not every card holds all experts, improving memory utilization and the parallelism of expert routing.
In one sentence: TP decides how fast a single request is, DP decides how many requests the system can accept at once, and EP decides how MoE parameters are placed. Only the combination unlocks 8-GPU throughput.
3.2 Decision Checklist
| Workload characteristic | Preferred direction | Reason |
|---|---|---|
| Long input, short output, latency-sensitive | Larger TP | Reduces single-request compute latency |
| Short input, high concurrency, offline batch jobs | Larger DP | Raises total system throughput |
| MoE architecture with many experts | Introduce EP | Distributes expert memory and routing compute |
| Limited inter-card interconnect bandwidth | Keep TP small | Reduces cross-card synchronization frequency |
4. Communication and Compilation: Hide Overhead Inside Compute
Once the parallel strategy is set, the remaining gains come from two places: sequence parallelism and graph/operator compilation.
- Sequence parallelism: for long-context scenarios, shard LayerNorm, residuals, and similar operations along the sequence dimension. This lowers per-card activation memory pressure and turns redundant per-card recomputation into shared work. The benefit is especially clear for input lengths above 2K.
- Graph mode: enable graph capture and whole-graph execution to cut host-side overhead from per-operator dispatch in the Python layer, making the MoE routing and decoding stages more stable when they consist of many small operators.
- Operator compilation and autotuning: recompile fused operators (such as attention, normalization, and quantized matrix multiplication) for the target accelerator so the kernels fit the hardware’s cache hierarchy and vector width.
The recommended order is “parallelism first, then communication, then compilation”, measuring each step separately so that changing several variables at once does not make attribution impossible:
# Illustrative: logical order of optimization switches (not real commands)parallel = {"tp": 2, "dp": 4, "ep": 4}enable_sequence_parallel = Trueenable_graph_mode = Trueenable_kernel_autotune = True # compile fused operators for the target accelerator
5. Quantization and Memory Budget: Half of Throughput Is “Fitting It All In”
Quantization is not only a precision question but also a capacity question. For an MoE model, memory is consumed mainly by three things: the routing layers and shared parameters, the expert shards, and the KV cache. Recommended order:
- Decide weight precision first (a general scheme such as W8A8 or W4A16) and compute per-card weight usage;
- Use the remaining memory to derive the KV cache ceiling, which determines the maximum concurrency batch;
- If the KV cache is insufficient, raise the number of DP replicas rather than growing the batch indefinitely, which would break the latency SLO;
- Monitor expert load imbalance: a few hot experts can keep one card under sustained heavy load, in which case adjust the EP mapping or the routing policy.
6. Turning Experience into a Reusable Scheme: The Value of a Deployment Catalog
The value of a tuning session depends on whether a second person can reproduce it. In practice, organize each deployment as a structured “deployment catalog entry” containing at least:
- Applicable model and hardware (architecture, parameter count, quantization scheme, number of accelerators);
- Inference engine and image version (so the change can be rolled back);
- Resource specs and parallel parameters (TP/DP/EP, batch size, maximum sequence length);
- Baseline configuration, optimized configuration, and the corresponding load-test report;
- Known limitations and scenarios where it does not apply.
The direct payoff: new team members do not start from zero trial and error, but follow the path “look up the catalog -> pick a baseline -> apply the optimization -> re-test locally”. It also makes it easy to compare throughput across configurations under the same SLO, building the team’s own performance knowledge base. If an organization already has model catalog capabilities, the deployment backend can sync these entries automatically, making the catalog the configuration source.
7. Rollout Roadmap and Common Pitfalls
Four-step roadmap
- Fix the baseline: single 8-GPU server, TP8/DP1, quantized model; measure maximum throughput under the SLO;
- Rework parallelism: switch to TP2 x DP4 plus EP, re-test, and confirm latency still meets the SLO;
- Communication and compilation: enable sequence parallelism, graph mode, and operator compilation, quantifying each gain separately;
- Capture for reuse: write the configuration and report into the deployment catalog and add CI-style regression load tests.
Common pitfalls
- Changing parallelism without load testing: after increasing DP, single-request latency may rise, so confirm it is still within the SLO;
- Ignoring expert hotspots: MoE load imbalance is an invisible throughput ceiling;
- Image and engine version drift: differences in compiled artifacts between versions can eat up the optimization gains;
- Unrealistic load-test data: a skewed input length distribution can invalidate the conclusions entirely.
8. Conclusion
Improving throughput on an 8-GPU domestic accelerator is essentially a coordinated design across “workload, parallelism, communication, and compilation”, not a single magic switch. With the SLO as the only judge, and by following the order “fix the baseline -> rework parallelism -> tune communication and compilation -> capture the scheme”, most teams can achieve a substantial throughput gain on the same hardware, even above 50%, and turn that experience into searchable, reproducible, regression-testable deployment assets.
