Optimizing SLO-Bounded Throughput for 8-Card MoE Inference on Domestic Accelerators
This article presents a structured approach to optimizing multi-card inference throughput for large Mixture-of-Experts (MoE) models on 8 domestic accelerators. It emphasizes moving beyond single-point parameter tuning to reproducible deployment recipes, compares a TP8/DP1 baseline with a TP2/DP4 + expert parallel configuration, and discusses communication and compilation optimizations. Practical evaluation methods under SLO constraints and risk controls are also covered, with a case-specific throughput improvement of up to 53.5% while meeting latency targets.
1. Background: Multi-Card Inference Optimization Is More Than “Getting the Model Running”
Deploying a large model in an environment with domestic accelerators begins with choosing the model, but that is only the first step. What truly affects deployment efficiency and final performance includes whether the inference engine matches the runtime image, how many accelerators are required, how the parallel strategy is configured, how batching and memory are planned, and which communication and compilation optimizations fit the actual workload. For Mixture-of-Experts (MoE) models, the problem becomes even more complex: expert placement, routing imbalance, All-to-All communication, and the degree of replica concurrency all influence end-to-end throughput.
Therefore, optimizing multi-card inference should not remain at the level of single-parameter tuning. Instead, it should form a set of searchable, comparable, and reusable deployment recipes. Around a specific model and hardware, teams can record the inference engine, image, resource requirements, parallel parameters, baseline configuration, and optimized configuration, and then compare performance under a unified SLO constraint. This way, teams can start from an existing configuration, validate it against their own hardware environment and workload, and adjust accordingly, reducing repeated trial-and-error.
2. From Single-Point Tuning to Structured Knowledge
If deployment experience stays only in personal scripts or temporary notes, it is hard to reuse within a team. A better approach is to organize deployment solutions as structured knowledge:
- Organize by model and hardware: Each recipe corresponds to a model type and an accelerator environment, recording the number of cards, memory planning, inference engine version, and image information.
- Distinguish baseline and optimized versions: The baseline recipe establishes a reproducible performance reference, while the optimized recipe records changes in parallel strategy, communication optimizations, and compilation optimizations.
- Keep performance reports: Record throughput, latency percentiles, and resource utilization under the same SLO and stress test conditions, avoiding reliance on peak values alone.
- Support configuration synchronization: In the engineering workflow, recipe configurations can be synced to the deployment pipeline, reducing inconsistencies from manual parameter adjustment.
The value of this approach is that it transforms “why a particular tuning worked” into auditable configuration differences and evaluation results. Teams can quickly judge whether an optimization is applicable to their model size, request length distribution, and concurrency pattern.
3. Optimization Case: 8-Card MoE Inference
In this case, 8 domestic accelerators were used, and the MoE model was quantized and deployed with an inference engine optimized for these accelerators. The baseline recipe used tensor parallelism 8 and data parallelism 1 (TP8, DP1). The optimized recipe changed to TP2, DP4 and additionally enabled expert parallelism. In addition, sequence-parallel communication optimization, compute graph fusion, and operator compilation optimizations were enabled. The goal was to maximize total throughput while meeting SLO constraints.
It is important to note that the specific benefits depend on model architecture, quantization precision, input/output length distribution, concurrency pressure, hardware topology, and SLO thresholds. The stated “up to 53.5% throughput improvement while meeting SLO” is a test result in this specific environment and cannot be directly extrapolated to all scenarios.
A schematic configuration is shown below:
deployment:hardware: 8 x acceleratorengine: accelerator-optimized-inference-enginemodel_type: moeparallel:tensor_parallel_size: 2data_parallel_size: 4expert_parallel: trueoptimization:sequence_parallel: truegraph_fusion: trueoperator_compile: trueslo:ttft_p95_ms: <target>tpot_p95_ms: <target>
4. Adjusting Parallel Strategy: Better Handling of Concurrent Requests
The baseline TP8, DP1 means the model weights are sharded across 8 cards, spreading the computation of a single forward pass, but only one data-parallel replica exists. For high-concurrency online inference, this configuration can bring two problems: first, the tensor-parallel communication scope is large, and intra-layer All-Reduce overhead becomes more sensitive as the number of cards increases; second, with no data-parallel replicas, the ability to concurrently process multiple requests is limited.
After switching to TP2, DP4, the system forms four data-parallel replicas, each using two cards for tensor parallelism. This can reduce the communication complexity within each replica while improving concurrent request processing through multiple replicas. For MoE models, combining expert parallelism distributes different experts across cards, adapting to the large expert parameter count and uneven routing.
However, the combination of TP/DP/EP is not universally “smaller is better” or “larger is better”. The following aspects need to be evaluated together:
- Memory and KV cache capacity: When TP is reduced, the weight shard per card may become larger. It is necessary to confirm whether weights, activations, and KV cache still fit the target batch size.
- Communication topology: TP, DP, and EP introduce different types of communication. The parallel group arrangement should match the inter-card interconnect bandwidth and topology.
- Expert load balancing: Under expert parallelism, uneven routing can cause some cards to become hot spots. Batch strategy and monitoring are needed to observe the load.
- Replica concurrency: Increasing DP can boost concurrency, but it also introduces resource competition between replicas, so it should be coordinated with request scheduling and batching parameters.
5. Communication and Compilation Optimizations: Reducing Non-Compute Overhead
Beyond parallel configuration adjustments, the case also enabled sequence-parallel communication optimization, compute graph fusion, and operator compilation. Sequence parallelism shards the sequence dimension, reducing per-card activation memory pressure in long-sequence scenarios and alleviating some communication bottlenecks when combined with tensor parallelism. Compute graph fusion reduces operator launch overhead and intermediate tensor overhead. Operator compilation generates execution plans better suited to the hardware.
These optimizations should follow the principle of “first locate the bottleneck, then enable the optimization.” During stress testing, observe compute time, communication time, scheduling overhead, and memory usage separately. If the bottleneck is mainly communication, prioritize checking the parallel group split and sequence-parallel strategy. If the bottleneck is operator launch overhead or fragmented small operators, evaluate graph fusion and operator compilation. If the bottleneck is insufficient batching, return to parallel strategy and scheduling parameters.
Also be aware of stability and precision risks introduced by optimizations. Quantized models need quality evaluation; graph fusion and operator compilation need numerical consistency checks; sequence parallelism and expert parallelism need verification under boundary request lengths and extreme routing distributions.
6. Evaluation Under SLO Constraints
A “throughput improvement” has business meaning only when SLO constraints are met. Define TTFT, TPOT, and P95/P99 latency thresholds explicitly, and compare baseline and optimized recipes under identical request length distributions, concurrency gradients, and hardware environments. A typical evaluation flow includes:
- Warm up the inference service to exclude first-time compilation and cache cold-start effects;
- Gradually increase concurrency and record the maximum throughput that still satisfies the SLO;
- Separate statistics for short, long, and mixed request distributions;
- Record GPU/memory utilization, accelerator utilization, and communication overhead;
- Run multiple rounds and report percentile data, not just a single peak.
Only when the SLO is met should the total throughput be counted, because it reflects the real service capacity. If an optimized recipe shows higher peak throughput but exceeds P99 latency, it should not be considered a valid improvement.
7. Reusable Practices and Risk Control
When reusing these experiences in other environments, keep track of configuration versions, engine versions, image versions, and evaluation reports, forming a rollback-capable deployment baseline. For MoE models, pay special attention to expert load balancing and All-to-All communication; for long-sequence workloads, focus on sequence parallelism and KV cache capacity; for high-concurrency workloads, compare TP/DP combinations with request scheduling policies.
Ultimately, the core of multi-card inference optimization is not a fixed set of parameters but an engineering methodology that ensures “configurations are reproducible, bottlenecks are locatable, and benefits are verifiable.” Through structured recipe accumulation and SLO-constrained evaluation, teams can more reliably achieve a balanced throughput‑latency trade-off on domestic accelerators.
