Optimizing Inference Throughput on 8-GPU Domestic AI Accelerators: A Practical Guide

    This article presents a practical approach to improving inference throughput on an 8-GPU node built with domestic AI accelerators. Starting from a baseline that uses tensor parallelism of 8 and no data parallelism, it explains how to restructure parallelism, add expert and sequence parallelism, and apply graph and operator compilation optimizations. Under a fixed SLO, the combined tuning delivers up to 53.5% higher usable throughput. It also covers a reusable deployment configuration workflow and a deployment checklist.

    1. Background: Inference Efficiency Bottlenecks on Domestic Compute

    When deploying large models on domestic (Xinchuang) compute environments, teams often focus first on simply getting the model to run. The harder engineering problems appear afterward: throughput per unit of compute stays low, tail latency fluctuates, and the same hardware can show multiples of performance difference under different configurations.

    Take an 8-GPU node with a domestic AI accelerator as an example. When running a quantized large language model with the default single-replica, large tensor-parallel configuration, computation and communication overhead are highly concentrated, concurrency is limited, and accelerator utilization stays low over time.

    It is worth clarifying that this kind of optimization does not depend on any vendor-specific feature. It is a matter of tuning the combination of three general techniques—parallel partitioning, communication topology, and compile-time optimization—on specific hardware. Using quantized model inference on an 8-GPU domestic accelerator as the sample, this article shows a viable path to improving total throughput by more than 50% while keeping the service-level objective (SLO) unchanged.

    2. The Baseline: Why the Default Configuration Falls Short

    The baseline uses tensor parallelism of 8 and data parallelism of 1, meaning a single model instance spans all eight GPUs. This configuration is simple to implement and spreads memory pressure, but it has clear drawbacks:

    • Heavy intra-instance communication: every layer performs multiple collective communications, and the inter-GPU links become the bottleneck.
    • All concurrent requests hit the same instance, batch scheduling is coarse-grained, and queueing time increases.
    • The computation graph and operators are not compiled for the hardware, so memory access and pipeline efficiency are not fully exploited.

    The conclusion is that the baseline is not a “wrong configuration” but an “untuned configuration.” The goal of optimization is not to replace hardware but to make the same hardware fit the real request distribution more closely.

    3. Breaking Down the Optimizations

    3.1 Adjusting the Parallelism Strategy: Let Multiple GPUs Handle Concurrency Better

    The core change is to move from tensor parallelism of 8 and data parallelism of 1 to tensor parallelism of 2 and data parallelism of 4. In other words, the model is partitioned more shallowly and replicated into four replicas, each handling requests independently.

    The gains come from three areas: first, the communication scope within a single replica shrinks to two GPUs, reducing the number of participants in collective communication and the synchronization wait; second, more replicas bring request-level parallelism, leaving more room for throughput to scale linearly with concurrency; third, each replica has a more independent batching window, making it easier to form appropriately sized batches within the SLO.

    Illustrative configuration (pseudocode, expressing only the parallelism relationships):

    1. # Baseline
    2. parallel:
    3. tensor_parallel_size: 8
    4. data_parallel_size: 1
    5. # Optimized
    6. parallel:
    7. tensor_parallel_size: 2
    8. data_parallel_size: 4
    9. expert_parallel: enabled

    3.2 Adding Expert Parallelism: Distribute Weights More Evenly

    For models that use a mixture-of-experts structure or are heavily sharded by layer, pure data parallelism makes every GPU carry a full copy of the weights, driving up memory and memory-access pressure. With expert parallelism, different experts are spread across different GPU groups, reducing the parameter volume each GPU holds and keeping hot data closer to the compute units. This supports larger concurrent batches under the same memory budget.

    3.3 Sequence Parallelism: Cut Redundant Computation on Long Sequences

    Sequence parallelism is a general approach to overlapping communication and computation: part of the computation and normalization along the sequence dimension is partitioned across GPUs, reducing redundant computation and activation memory usage on each GPU. In business scenarios with long contexts and highly variable input lengths, this item usually improves tail latency more noticeably than the average.

    3.4 Graph and Operator Compilation: Fully Exploit Hardware Characteristics

    The last item is compile-time optimization, including graph mode execution and operator compilation fusion. Its general value lies in reducing operator dispatch and scheduling overhead, merging memory accesses, and making the execution plan fit the accelerator’s execution pipeline more closely. This kind of optimization does not change model semantics and delivers performance gains with zero accuracy loss. It is usually best applied after the parallelism strategy is settled, to avoid interfering with parallel partitioning and making the source of gains hard to isolate.

    4. Interpreting the Results: Where the 53.5% Comes From

    Under the same SLO constraint, the optimized combination delivers up to 53.5% higher total throughput than the baseline. Three interpretation principles should be emphasized:

    1. This number is “usable throughput” measured under a fixed service-quality constraint, not an unconstrained peak, so it is closer to the real gains in production.
    2. The gains are cumulative; no single item alone explains the full improvement. The tuning order should be “parallelism first, then parallel scaling, then compilation.”
    3. The magnitude of improvement is strongly correlated with the input/output length distribution and the concurrency model, so migrating to other workloads requires recalibration.

    5. Reusing the Experience: Turn Tuning Results into Queryable Configurations

    Deploying large models in a domestic environment starts with choosing the model, but that is only the first step. How the inference engine and runtime image match, how many GPUs are needed, how parallelism is set, and which optimizations fit the current workload all determine final efficiency. A reusable practice is to organize this information into a structured “model deployment plan”: centered on a specific model and hardware, record the engine, image, resource requirements, and startup parameters, and attach the baseline version, optimized version, and corresponding reports, so the team can search and compare horizontally by model or hardware.

    In related practice at Baidu AI Cloud, this kind of capability can rely on a container platform to host inference services, object storage to hold images and configuration artifacts, and logging and monitoring/alerting systems to collect throughput and latency metrics, forming a “configure-deploy-observe-retune” loop. After deployment, the backend can automatically sync configurations from the plan directory, reducing the drift caused by manual handling.

    6. Deployment Checklist

    • Define SLO metrics: distinguish average latency from tail latency, and set the constraint before discussing throughput.
    • Keep the baseline reproducible: fix the image, parameters, and dataset, and retain the original reports.
    • Tune one variable at a time: change only one category of parameters each time and record gain attribution.
    • Watch resource watermarks: look at GPU utilization, memory usage, and communication wait at the same time.
    • Persist configurations: write validated parameters back into the plan directory to form team assets.

    In summary, throughput optimization on domestic accelerators is not guesswork but an engineering result of combining parallel partitioning, expert and sequence parallelism, and compilation optimization in the right order. Documenting and configuring the process is the key to making a 50%-level improvement sustainably reusable.