Boosting LLM Throughput by 53.5% on 8 GPUs: A Practical Optimization Guide for Domestic Accelerators
This article walks through a real-world optimization effort that raised total inference throughput by up to 53.5% within SLO constraints, running a quantized MoE chat model on an 8-GPU domestic accelerator server. It explains why "it runs" does not mean "it runs cost-effectively," how to define joint SLO and throughput targets, and where the TP8 baseline breaks down under high concurrency. The core sections cover four optimization paths: switching from TP8 to TP2+DP4, adding expert parallelism, enabling sequence parallelism with communication tuning, and moving to graph mode with kernel compilation. It closes with the observed gains breakdown and a method for turning deployment settings into a reusable, searchable catalog.
1. Background: Why “It Runs” Is Not the Same as “It Runs Efficiently”
When deploying large language models on domestic compute platforms, teams usually solve the “can it run at all” problem first. But what actually determines the cost of going live is the effective request throughput per unit of time, and whether the service can consistently meet latency constraints (SLOs).
Consider a common scenario: an 8-GPU server built on a domestic accelerator card running a mid-sized, quantized MoE chat model. The typical symptoms are familiar. GPU memory is just barely sufficient, time-to-first-token is marginally within target, but as soon as concurrency rises, throughput drops. Inter-GPU communication consumes a large share of the time, and compute utilization stays persistently low.
The root cause is usually not the model itself, but how well the deployment configuration matches the hardware characteristics. This article uses “8 domestic accelerator GPUs + quantized MoE model + high-concurrency online inference” as the setting, and walks through the full process of an optimization that raised total throughput within SLO by up to 53.5%. It also lays out a reusable methodology.
2. Set the Yardstick First: Joint Constraints on SLO and Throughput
Before tuning, you must define what you are optimizing for. Looking at throughput alone leads to high-latency configurations; looking at latency alone wastes resources. The more sound engineering approach is to express the goal as a joint constraint:
- An upper bound on time-to-first-token (TTFT), for example P95 not exceeding a given number of milliseconds;
- An upper bound on time-per-output-token (TPOT);
- Maximize the number of requests completed per second (total throughput), subject to the constraints above.
An illustrative goal statement (pseudocode):
maximize total_tokens_per_secondsubject top95_ttft <= SLO_TTFTp95_tpot <= SLO_TPOTgpu_count == 8
Only when the yardstick is clearly defined can later changes such as “parallelism strategy adjustments” and “compilation optimizations” produce measurable gains, rather than tuning parameters by feel.
3. The Baseline: Bottlenecks of TP8 Single-Node Tensor Parallelism
The baseline uses the classic configuration of tensor parallelism 8 and data parallelism 1 (TP8/DP1): model weights are sharded by layer across 8 GPUs, and a single replica serves all requests.
The advantages of this configuration are simple implementation and low memory pressure. The drawbacks are amplified under high concurrency:
- Every layer’s forward pass requires cross-GPU AllReduce/AllGather. The number of communications scales with the number of layers, making inter-GPU bandwidth the primary bottleneck.
- With only one replica, requests queue up in a single place, and batch scheduling flexibility is poor.
- For MoE models, once the expert layers are sharded by tensor parallelism, the routed expert computation is coupled with communication, making them hard to optimize independently.
Conclusion: TP8 is better suited to scenarios that are “tight on memory and low on concurrency,” and is not a fit for online serving that targets high-concurrency throughput.
4. Optimization Path 1: Switch Parallelism from TP8 to TP2 + DP4
The core move is to change the parallel topology from “one big pie cut into eight slices” to “four small pies baked separately”:
- Reduce tensor parallelism to 2, which significantly lowers the communication volume within each group;
- Raise data parallelism to 4, forming 4 independent replicas so requests can be distributed across them;
- Each replica still keeps the necessary model sharding internally, keeping memory under control.
Illustrative configuration comparison:
# Baselinetensor_parallel_size = 8data_parallel_size = 1# Optimizedtensor_parallel_size = 2data_parallel_size = 4enable_expert_parallel = true
The gains come from three sources: a smaller communication domain, higher concurrency capacity from having more replicas, and the ability of the scheduler to balance load across more replicas. This step usually delivers the largest gain at the lowest risk, and is the key to “letting multiple GPUs handle concurrent requests better.”
5. Optimization Path 2: Introduce Expert Parallelism
For MoE models, expert parallelism distributes different experts across different GPUs, and tokens are routed to the GPU hosting the corresponding expert. Combined with TP/DP, it forms multi-dimensional parallelism:
- Expert computation is no longer “cut into pieces” by tensor sharding, so each expert’s computation is more regular;
- The All-to-All communication introduced by routing can be optimized and overlapped separately;
- Combined with DP replicas, experts can be sharded within a replica to balance memory and throughput.
An engineering caveat: expert parallelism introduces additional All-to-All communication, so it must be paired with a communication library and topology-aware scheduling. Otherwise the gains will be consumed by communication. For this reason it is usually enabled together with sequence parallelism and compilation optimizations.
6. Optimization Path 3: Sequence Parallelism and Communication Optimization
Under long context and high concurrency, sharding along the sequence dimension can significantly reduce per-GPU activation memory and redundant computation. With sequence parallelism enabled:
- Operators that can be split along the sequence dimension, such as LayerNorm and Dropout, execute on sequence shards;
- Activation memory drops, which supports a larger batch;
- Combined with TP, the communication pattern shifts from “one large communication per layer” to “finer-grained, overlappable small communications.”
Together with the communication optimization capabilities provided by the vendor (topology-aware collective communication, and overlapping communication with computation), the overall share of communication drops noticeably.
7. Optimization Path 4: Graph Mode and Operator Compilation Optimization
The final piece is switching from eager execution to graph mode and enabling operator compilation optimizations:
- Graph mode removes per-operator scheduling overhead and reduces host-side dispatch pressure;
- At compile time, it performs operator fusion (such as merging multiple element-wise operators), constant folding, and memory reuse;
- It generates more efficient kernels targeting the vector and matrix units of the domestic accelerator.
Illustrative switches (pseudocode, expressing semantics only):
execution_mode = "graph"enable_kernel_fusion = trueenable_memory_reuse = true
This step does not change the parallel topology, yet it can raise the effective compute of each GPU by another notch under the same concurrency. It is a common source of “pushing throughput up another level under the same SLO.”
8. Results: Up to 53.5% Higher Total Throughput Within SLO
After the combined optimizations above, in the same 8-GPU environment, with the same quantized model and the same SLO constraints, total throughput rose by up to 53.5% over the baseline. The gain breakdown is roughly: the parallelism strategy change contributed the main increment, expert parallelism and sequence parallelism contributed a medium increment, and graph and compilation optimizations contributed steady-state gains. Note that the specific numbers are strongly correlated with model structure, context length, and concurrency distribution, so in engineering practice you should re-measure against your own workload.
9. Lessons Learned: Turn the Deployment Plan into a Reusable Catalog
The value of a tuning effort lies in whether the next person can reuse it. It is worth organizing deployment experience into a “model deployment catalog,” where each entry records, for a specific model and hardware: the inference engine, the image, resource requirements, parallelism parameters, optimization switches, and both baseline and optimized configurations with their corresponding reports. Teams can search and compare configuration differences by model or by hardware, and let the deployment backend automatically sync the plans in the catalog, closing the loop of “pick a model, review the plan, deploy in one click, re-test and verify.” For teams using domestic compute, this means not having to trial-and-error from scratch every time, but starting from existing configurations and doing incremental validation.
10. Conclusion
Inference optimization on domestic compute is essentially about aligning the parallel topology, communication pattern, and execution mode with the hardware characteristics. The topology rebuild from TP8 to TP2+DP4, the introduction of expert parallelism and sequence parallelism, and the layering on of graph and compilation optimizations form a transferable path. And turning that path into a browsable, reusable deployment catalog converts a single optimization into long-term efficiency for the team.
