LLM Inference Optimization on Domestic AI Accelerators: 8-GPU Parallel Tuning in Practice

    Deploying large language models on domestic AI accelerators comes with challenges in engine compatibility, parallelization choices, and fragmented optimization techniques. This article presents a practical workflow: managing deployment recipes in a structured catalog, then tuning an MoE model on 8 domestic accelerators by switching from TP8+DP1 to TP2+DP4 with expert parallelism, enabling sequence-parallel communication optimization, and applying graph compilation and kernel tuning — achieving up to 53.5% throughput improvement under the same SLO constraints.

    LLM Inference Optimization on Domestic AI Accelerators: 8-GPU Parallel Tuning in Practice

    1. Background: Inference Deployment Challenges on Domestic Accelerators

    As large language models are adopted across industries, more teams are deploying inference services on domestic AI accelerators. Unlike mature ecosystems, these platforms are still evolving rapidly in inference engine adaptation, operator support, and communication library optimization. Common problems in practice include:

    • Engine and image compatibility: Different inference engine versions impose strict requirements on firmware, drivers, and compiler toolchains. Version mismatches often cause degraded performance or even failure to start.
    • Hard parallelization decisions: How many cards does the model need? How should tensor parallelism (TP), data parallelism (DP), and expert parallelism (EP) be combined? These choices directly determine the trade-off between throughput and latency.
    • Fragmented optimization techniques: Communication optimization, graph compilation, and quantization know-how are scattered across sources, with few reusable tuning records for specific hardware.

    Organizing “model + hardware + engine + parameters + performance results” into a browsable, reproducible deployment recipe is therefore essential for team efficiency.

    2. Structured Management of Deployment Recipes

    A qualified deployment recipe should record complete information for a specific “model × hardware” combination:

    Dimension Content
    Inference engine Engine type and version, matching container image
    Resource requirements Number of cards, VRAM usage, CPU/memory provisioning
    Deployment parameters Parallelization strategy, batching, quantization method
    Performance data Comparison reports between baseline and optimized configurations

    With an online catalog searchable by model or hardware, teams can quickly compare the trade-offs of different configurations. The deployment backend automatically syncs configurations from the catalog, enabling “one-click deployment.” Teams working on domestic hardware can start from existing recipes, then validate and fine-tune them against their own hardware environment and workload, instead of starting from scratch.

    3. Optimization Case: Throughput Tuning on an 8-Card Cluster

    The following example illustrates the optimization approach using a lightweight MoE-style model on 8 latest-generation domestic accelerator cards. The test uses an open-source inference engine adapted for domestic hardware, serving the quantized model.

    3.1 Adjusting the Parallelization Strategy: Better Concurrency Across Cards

    The baseline uses TP8 + DP1: all 8 cards form a single tensor-parallel group and jointly process each request. This yields low single-request latency, but every computation step requires cross-card synchronization, so communication overhead is high and throughput is limited under concurrency.

    The optimized configuration switches to TP2 + DP4 + Expert Parallelism (EP):

    • TP2 shrinks the tensor-parallel domain to 2 cards, significantly reducing the communication volume and latency of each synchronization;
    • DP4 creates 4 independent data-parallel replicas that can process more concurrent requests, naturally boosting throughput;
    • Expert parallelism distributes MoE expert weights across cards, reducing per-card VRAM pressure and improving compute utilization.

    The core idea: within acceptable latency, shrink the communication domain and expand concurrency.

    3.2 Enabling Communication Optimization: Sequence Parallelism

    Beyond the parallel configuration, enable sequence-parallel communication optimization (commonly known in the industry as techniques like FlashComm). The idea is to switch part of the tensor-dimension partitioning to sequence-dimension partitioning, fusing communication operators more tightly with compute operators. This reduces the number and volume of collective communication operations such as AllReduce, with especially clear gains in small-batch, long-sequence scenarios.

    3.3 Graph Compilation and Operator Optimization

    Domestic accelerators generally support graph-mode execution and operator compilation optimization:

    • NPU graph mode: Captures the model’s forward computation as a full graph and dispatches it at once, eliminating per-operator host scheduling overhead and reducing bubbles caused by small operators;
    • Kernel compilation optimization: Performs compile-level tuning of critical operators (attention, matrix multiplication, fused communication operators) for the hardware instruction set, improving compute-communication overlap.

    3.4 Results

    Under identical SLO constraints (e.g., caps on time-to-first-token and output latency), the optimized configuration delivers up to approximately 53.5% higher total throughput than the baseline. The gain comes from three stacked layers: the parallelization strategy unlocking concurrency, sequence parallelism cutting communication overhead, and graph compilation eliminating scheduling bubbles. Note that these gains are not simply linearly additive — joint tuning is required to reach the optimum.

    4. Best Practices

    1. Establish a reproducible baseline first: Pin the engine version, image, parameters, and benchmarking methodology so results before and after optimization are comparable.
    2. Optimize against SLOs: Throughput numbers without latency constraints are meaningless; all comparisons should be made under the same SLO.
    3. Layer optimizations incrementally: Tune the parallelization strategy first (largest gain), then add communication optimization, and finally graph/operator-level optimization, validating attribution at each layer.
    4. Document deployment recipes: Record each tuning configuration and its results in the recipe catalog so experience becomes searchable, reusable, and deployable in one click.

    5. Conclusion

    LLM inference optimization on domestic accelerators is fundamentally about finding the best balance among hardware characteristics, model architecture, and workload. Through systematic parallelization adjustments combined with communication and compilation optimizations, an 8-card cluster can achieve significant throughput gains while meeting production SLOs. We hope this methodology helps more teams efficiently deploy LLM inference services on domestic hardware platforms.