Deploying a 2.8 Trillion Parameter MoE Model on Two Domestic NPU Servers

    This article documents the complete process of deploying a native multimodal MoE model with 2.8 trillion total parameters and approximately 104B activated parameters per pass on two domestic NPU servers. The model supports a context length of up to 1M tokens. It covers quantization strategies, hardware and network topology, cluster management, weight distribution, inference instance deployment, and stress testing, providing actionable steps for distributed deployment.

    This article records the complete process of deploying a native multimodal MoE model with a total of 2.8 trillion parameters and approximately 104B activated parameters per pass on two domestic NPU servers. The model supports a context length of up to 1M tokens. The article details the quantization strategy, hardware and network setup, cluster management, weight distribution, inference instance deployment, and stress testing, providing step-by-step instructions for reference.

    I. Model Scale and Quantization Strategy

    The MoE (Mixture of Experts) architecture only activates a portion of the experts at a time. The computation per token is comparable to a ten-billion parameter model, meaning the inference compute consumption is significantly lower than that of a dense model with the same total parameter count. However, the total parameter count dictates the storage space required for the weights. Even though only 104B parameters are activated per pass, the entire 2.8 trillion parameter weight set must reside in VRAM or accessible storage.

    This solution adopts the W4A8 quantization strategy, where weights use 4-bit precision and activations use 8-bit precision. After quantization, the weight file is approximately 1.47TB. This volume still exceeds the available VRAM of a single server, making distributed deployment necessary. Quantization also introduces precision loss, so an accuracy comparison should be performed on target tasks before going live. This test was not covered in this article.

    II. Hardware Configuration and Network Topology

    The environment consists of two domestic NPU servers, each containing 16 compute dies, with each die equipped with 64 GiB of VRAM. The two servers total 32 dies, aggregating 2048 GiB of VRAM. This capacity is sufficient to hold the 1.47TB weights, but framework runtime overhead, KV Cache, and VRAM fragmentation will also consume space. The actual remaining VRAM needs to be measured after deployment.

    The network topology determines whether the parallel strategy is feasible. Dies within the same node communicate via high-speed interconnects like HCCS, which offer high bandwidth and low latency, making them suitable for frequent tensor parallel (TP) communication. Cross-node pipeline parallel (PP) only passes activation values at stage boundaries, resulting in less communication volume, but still has strict requirements for latency and bandwidth. Cross-node links should utilize high-speed networks such as RDMA, RoCE, or InfiniBand. NIC models, switch configurations, and single-link bandwidth and latency should be recorded in the deployment notes: [To be supplemented: cross-node NIC model, single-link bandwidth and latency, switch configuration].

    The parallel strategy uses a combination of TP16 and PP2. The 16 dies within a single node form a tensor parallel group, and the two machines are divided into two pipeline stages, resulting in an overall World Size of 32. Tensor parallelism requires collective communication for every layer, so it is placed on the high-bandwidth intra-node links. Pipeline parallelism only passes intermediate results between the two machines, reducing cross-node bandwidth pressure.

    III. Unified Management and Scheduling for Multi-Node NPUs

    Manually configuring the drivers, runtime, network, and storage for multiple machines is error-prone and incurs high maintenance costs. This solution uses a cloud-native heterogeneous compute scheduling platform to manage nodes uniformly. The platform consists of an Agent and a Server. The Agent is a static single-binary program that runs on compute nodes and actively establishes a reverse connection to the Server. Control commands, monitoring data, logs, and inference traffic share the same encrypted connection. Since the connection is initiated by the node, the target machine does not need to open inbound ports, reducing configuration efforts in complex network environments. However, this approach must still be reviewed under existing security policies.

    The integration process for domestic NPUs is identical to that of GPUs. After generating the installation command in the console and executing it on the target machine, the Agent automatically detects NPU, NIC, and storage information and reports it.

    Multi-node deployment also requires network topology information. In the platform’s network configuration module, the administrator adds the cross-node high-speed network links of the two nodes into the same “parameter network.” The platform then performs inter-card connectivity checks and prioritizes node combinations within the same topology that possess high-bandwidth interconnect capabilities during scheduling.

    IV. Weight Distribution

    Downloading the 1.47TB weights from the public internet on each machine is time-consuming and consumes significant egress bandwidth. In this solution, the weights were first downloaded from the open-source model community to the first node, with a measured speed of approximately 50 to 57 MB/s. Converting this using decimal units, downloading to a single machine takes about 7 to 8 hours. Subsequently, the platform’s direct node-to-node transfer feature was used to copy the weights from the first node to the second. The direct transfer utilizes the internal high-speed network, achieving a measured speed of about 490 MB/s, reducing the copy time to roughly 50 minutes.

    These speed figures are derived from this specific environment. File size, network link, concurrent thread count, and measurement tools can all affect the results. [To be supplemented: number of threads during speed testing, measurement tool, and measurement time]

    Direct node transfer is suitable for scenarios with a small number of nodes where weights only need to be distributed once. When dealing with a larger number of nodes or requiring frequent deployment of different instances, weights can be placed in object storage, and nodes can pull them concurrently via a distributed cache. This approach facilitates reuse and management but increases storage costs and introduces a dependency on storage services. The choice between the two methods should be based on cluster scale and operational conditions.

    V. Launching the Inference Instance

    Once the environment is ready, distributed instances are launched via the platform’s inference template. The image in the template uses the domestic NPU-adapted version of an open-source inference engine, and the image’s sha256 digest is pinned to prevent compatibility issues after upstream image updates. The inference engine version, quantization tool version, parallel parameters, environment variables, startup commands, service ports, and health check paths should all be documented in the template for reproducibility. [To be supplemented: image digest, engine version, quantization tool version, startup command, and key environment variables]

    Based on the template, the platform schedules the two nodes and launches an inference instance involving 32 dies using the TP16 x PP2 configuration.

    VI. Functional Verification and Stress Testing