Boosting Throughput by 53.5% on 8 Domestic AI Accelerators: A Practical Tuning Guide

    This article walks through a real-world optimization case for deploying a quantized large MoE model on eight domestic AI accelerators. It explains why the baseline TP8/DP1 configuration underutilizes the hardware, then breaks down a four-layer optimization path covering parallel strategy changes, sequence parallelism, graph-mode compilation, and SLO-based validation. The goal is to show how a successful tuning effort can be turned into a reusable deployment plan rather than isolated personal notes.

    1. Background: Deployment Experience Is the Real Bottleneck

    Deploying a large language model in a domestic computing environment starts with choosing the model, but that is only the first step. What really determines whether a project ships on schedule is a chain of engineering decisions: matching the inference engine to the base image, estimating how many accelerators the model actually needs, deciding how to split tensor parallelism and data parallelism, and identifying which optimizations genuinely fit the workload. A wrong call at any point translates directly into a longer deployment cycle or insufficient output per unit of compute.

    Consider a scenario that has drawn considerable attention recently: deploying a quantized large-parameter MoE model on eight of the latest domestic AI accelerators. The baseline uses pure tensor parallelism (TP8, DP1). After restructuring the parallel strategy and applying compiler-level optimizations, end-to-end total throughput improved by up to about 53.5% while meeting the same service level objective (SLO). The significance of this number is not a higher benchmark score. It means that, on the same hardware and under the same latency constraints, the system can handle significantly more concurrent requests, and the compute cost per request drops accordingly.

    This article strips away product-specific details and focuses only on transferable methods: how to turn a successful tuning session into a deployment plan that a team can reference repeatedly.

    2. Why the Baseline Often Fails to Saturate the Hardware

    The intuition behind TP8/DP1 is to spread the model across eight cards so that per-card memory pressure is minimized. Under real inference workloads, however, this mode has three structural problems.

    First, excessive parallelism inflates the share of communication. Tensor parallelism inserts collective communication into the forward and backward computation of every layer. The more cards involved, the denser the synchronization points, and the more easily communication time masks the gains from computation, especially when operators are not efficiently fused.

    Second, concurrency capacity is decoupled from the card count. DP1 means there is only one schedulable replica. Request queuing and batch scheduling are concentrated in a single execution stream, so the throughput ceiling is limited by the batch-building efficiency of that single replica. The combined compute of eight cards cannot be converted into higher concurrency.

    Third, the natural structure of expert parallelism is ignored. For MoE models, expert distribution is inherently partitionable. If you still apply pure tensor splitting as with a dense model, the locality of routing and expert computation goes unused, and memory access and scheduling overhead stay high.

    The first principle of tuning, therefore, is not to enable more optimization flags. It is to align the parallel topology with the workload characteristics first.

    3. Breaking Down the Optimization Path: Four Layers Working Together

    3.1 Adjusting the Parallel Strategy: Let Multiple Cards Share the Concurrency

    The core change is moving from TP8/DP1 to TP2/DP4 and adding expert parallelism. After the change, the eight cards are organized into four data-parallel replicas, each with only two-card tensor splitting internally. The gains come from three sources: the communication domain within each replica shrinks, reducing synchronization overhead; more replicas spread requests across multiple execution streams, improving batching and queuing efficiency; and expert parallelism places different experts on different cards, so post-routing computation happens closer to where the data resides.

    A schematic configuration comparison (structure only, not product-specific parameters):

    1. # Baseline: single replica, high tensor parallelism
    2. parallel:
    3. tensor_parallel_size: 8
    4. data_parallel_size: 1
    5. # Optimized: multiple replicas, low tensor parallelism + expert parallelism
    6. parallel:
    7. tensor_parallel_size: 2
    8. data_parallel_size: 4
    9. expert_parallel: enabled

    Note that TP2/DP4 is not universally optimal. It holds only when a single card has enough memory after quantization to hold the weights and cache required by one replica. If memory is tight, you need to fall back to a higher tensor parallelism degree or adopt more aggressive quantization and cache reuse strategies.

    3.2 Sequence Parallelism and Communication Optimization: Cutting Redundant Compute and Transfer

    Once the parallel topology is fixed, the second layer of gains comes from splitting along the sequence dimension and optimizing communication paths. Sequence parallelism distributes computation such as attention and normalization across multiple cards in the group along the sequence direction, lowering the peak activation memory per card and allowing a larger usable batch size. Combined with operator fusion in the communication layer and topology-aware scheduling, the actual time spent on collective communication is compressed further. The value of this layer is that it amplifies the first layer: the larger the batch, the more sensitive throughput becomes to memory and communication.

    3.3 Graph Mode and Operator Compilation: Exploiting Hardware Characteristics

    The third layer is compilation and execution. Enabling graph mode lets the framework convert dynamic execution into a static graph, reducing scheduling and dispatch overhead. Operator compilation optimizations for domestic accelerators generate execution plans that fit the hardware more closely for hot operators, cutting redundant memory access and instructions. In practice, this layer often delivers stability gains: narrower latency jitter and fewer long-tail requests, which allows more aggressive batching under the same SLO.

    3.4 SLO-Anchored Validation

    Optimization must be constrained, otherwise a throughput gain may simply be latency sacrificed. The recommended validation process is:

    1. Define the SLO metrics (such as percentile values for time to first token and end-to-end latency) and the load-test input distribution;
    2. Fix the input length distribution and concurrency gradient, recording throughput and latency percentiles at each step;
    3. Use the throughput at the “maximum concurrency that meets the SLO” as the sole comparison metric;
    4. Run a separate ablation for each optimization to confirm where the gain comes from and avoid mutual masking.

    4. Turning Tuning Experience into a Reusable Deployment Plan

    A successful tuning effort loses value quickly if it stays in personal notes. A more engineering-oriented approach is to organize it as a structured model deployment plan: for a specific model and hardware, record the inference engine and image pairing, resource requirements (card count, memory, network), parallel and optimization parameters, and keep both baseline and optimized versions with their reports, so others can search, compare, and reuse them by model or hardware.

    In related work at Baidu AI Cloud, this capability is abstracted into a browsable model catalog linked with a deployment backend: plans in the catalog are automatically synchronized to the deployment backend and used directly to instantiate deployments, reducing the gap between documentation and execution. For teams using domestic compute, this means starting from an existing configuration and running incremental validation against their own hardware and workload, instead of trial and error from scratch.

    5. Conclusion and Action Recommendations

    The 53.5% throughput gain in an eight-card environment is not the credit of any single switch. It is the result of four layers working together: parallel topology, communication and sequence splitting, compilation and execution, and SLO validation. Recommendations for teams:

    • Diagnose the baseline bottleneck first, and determine whether it is communication-bound, concurrency-bound, or memory-bound;
    • Adjust the parallel topology first, then layer on sequence parallelism and compilation optimizations;
    • Use ablation experiments to confirm each gain and form explainable conclusions;
    • Archive configurations, images, parameters, and reports together as a reusable plan connected to an automated deployment pipeline.

    Following this path, model inference performance optimization on domestic compute can shift from the experience of a few individual experts to an engineering asset the whole team can inherit.