Deploying MoE LLMs on a Four-Node Cluster: Deployment, Benchmarking, and Sizing
This article provides a comprehensive guide for infrastructure engineers and operations teams on deploying Mixture-of-Experts (MoE) Large Language Models (LLMs) across a four-node computing cluster. It covers environment topology, hierarchical model deployment strategies, standardized benchmarking methodologies, scenario-based validation, fault tolerance testing, and capacity estimation formulas to help teams effectively size and deploy their private LLM infrastructure.
Deploying High-Integration MoE LLMs on a Four-Node Computing Cluster: Deployment, Benchmarking, and Sizing
1. Target Audience and Scope
This article is intended for infrastructure engineers and operations personnel responsible for deploying private Large Language Models (LLMs). The practices documented here are based on an inference cluster consisting of four high-integration computing nodes and a 400G-level switch. The target model utilizes a Mixture-of-Experts (MoE) architecture and nominally supports a million-token context window.
This guide provides deployment steps, parameter frameworks, measurement methodologies, and decision-making criteria. It does not provide directly citable performance numbers. Any metrics requiring actual testing are marked with [To be tested], and teams should fill in the results based on the criteria in Section 5. If your business requirements for concurrency, latency, or context length differ significantly from the assumptions in this article, it is recommended to recalculate the capacity formulas in Section 8 rather than directly applying the configurations herein.
This solution is not suitable for scenarios that require stable support for full-window context length in a single request, teams lacking operations capability for the data plane network, or online businesses that cannot tolerate short-term jitter following a single-node failure.
2. Environment Topology and Hardware List
The cluster consists of four nodes interconnected via a 400G-level switch and an RDMA network. Each node is equipped with one high-speed network interface card (NIC) with a port speed of 200Gbps. The management platform handles model distribution, service orchestration, version management, and AI gateway configuration.
| Item | Per Node | Total | Notes |
|---|---|---|---|
| CPU | 20-core Arm | 80-core | Subject to actual procurement specs |
| Unified Memory | 128GB LPDDR5X | 512GB | Shared between CPU and GPU; actual available capacity must exclude system usage |
| Local Storage | Check via lsblk |
Nominal 8TB NVMe | If equally distributed, approx. 2TB per node |
| NIC | 1 x 200Gbps | 4 | Verify alignment with switch port speed |
| Switch | — | 1 x 400G-level | Verify port allocation and link redundancy |
| Low-bit Compute | [Verify with vendor specs] | [To be verified] | Must specify precision (e.g., FP4), sparse or dense metric, and theoretical vs. actual values |
This article does not directly cite aggregate compute numbers. Vendor-specified low-bit sparse compute often differs significantly from dense compute and actual usable precision. Selection should be based on the original spec sheet and self-test results.
3. Software Versions and Pre-checks
Before deployment, record the versions of all components for troubleshooting and future upgrades. It is recommended to document at least the following:
- Operating system and kernel versions;
- GPU driver and CUDA versions;
- RDMA driver (e.g., OFED or vendor-specific package) version;
- Inference engine name and version;
- Model weight version identifier and checksum;
- Management platform and AI gateway versions.
Execute the following commands on each node to verify hardware and network status:
# Check GPU model and driver versionnvidia-smi --query-gpu=name,driver_version,memory.total --format=csv# Check unified memory total and availablefree -h# Check disk model and capacitylsblk -d -o NAME,SIZE,MODEL# Check RDMA device status and link rateibstat | grep -E "State|Rate"# Bandwidth test: execute on the server nodeib_write_bw -d <device_name> --report_gbits# Bandwidth test: execute on the client node, replace <server_ip> with the actual addressib_write_bw -d <device_name> --report_gbits <server_ip>
Bandwidth test results should closely match the nominal link rate. If actual values are noticeably low, inspect cables, optical modules, switch port configurations, and MTU settings before proceeding. RDMA link anomalies will directly amplify communication overhead in expert parallelism, so this step cannot be skipped.
4. Hierarchical Model Deployment
4.1 Hierarchical Strategy
The deployment adopts a two-layer strategy. The first layer splits weights by experts, with each node handling the compute and storage for a portion of the experts. The second layer places lookup data (e.g., embedding tables) on local NVMe SSDs, loading them on demand during inference to reserve unified memory for KV Cache and intermediate activations.
The trade-off is that SSD access latency is significantly higher than memory access. Whether this trade-off is acceptable depends on the trigger frequency of lookup operations in actual requests, and whether the SSD’s IOPS and bandwidth can meet peak demands. Both metrics must be collected separately during stress testing and should not be judged solely by experience.
4.2 Deployment Steps
Execute in the following order, setting clear checkpoints at each step:
- Node Registration and Health Check: Completed by the management platform to confirm all four nodes are online, with GPUs, memory, disks, and NICs functioning normally.
- Model Weight Distribution: Distribute weights to local storage on each node and verify the hash to prevent file corruption during transfer.
# Verify weight files on each nodecd /data/models/<model_directory>sha256sum -c model.sha256
- Configure Inference Engine Parameters: Set parallelism and memory limits based on the capacity estimation in Section 8.
- Start Distributed Inference Service: After startup, check the service logs on each node to ensure there are no loading errors.
- Register with AI Gateway: Write each node’s service address into the gateway’s upstream configuration and set a health check path.
- Canary Validation: Route a small amount of traffic first, confirm correct results, and gradually increase the traffic ratio.
The startup command template for the inference service is as follows. Parameter names vary by engine; refer to the official documentation of your chosen engine for actual use:
<inference_engine> serve \--model /data/models/<model_directory> \--tensor-parallel-size <tensor_parallel_degree> \--expert-parallel-size <expert_parallel_degree> \--max-model-len <max_context_length> \--gpu-memory-utilization <memory_usage_limit_to_be_determined> \--max-num-seqs <max_concurrent_sequences> \--port 8000
4.3 Key Parameter Descriptions
- Tensor Parallelism and Expert Parallelism: The product of the two typically needs to correspond to the number of nodes and devices per node. The specific values should be determined by comparing Time to First Token (TTFT) and throughput in small-scale tests to find a balanced configuration.
- Max Context Length: This value determines the KV Cache limit per request. If set too high, a few long requests will exhaust memory. It is recommended to set it based on the actual maximum business input, reserving space for output.
- Memory Usage Limit: Recommended to start with a conservative value and gradually increase it, observing for Out-of-Memory (OOM) errors or service degradation after each adjustment.
- Max Concurrent Sequences: Should be consistent with the concurrency limit calculation in Section 8.
5. Benchmarking Methods and Metrics
Before benchmarking, unify the metric definitions. Different tools define TTFT and Time Per Output Token (TPOT) differently; without prior agreement, results cannot be compared horizontally.
5.1 Metric Definitions
- Time to First Token (TTFT): Time from when a request is sent to when the first output token is received.
- Time Per Output Token (TPOT): The average generation time per token during the output phase, calculated as (total generation time minus TTFT) divided by (number of output tokens minus one).
- Throughput: The total number of output tokens generated by all requests per unit of time, measured in tokens per second.
- Percentiles: Report P50, P95, and P99. Do not only report averages, as averages mask tail latency jitter.
5.2 Workload Design
Input and output lengths should be set according to business distribution, recommended to be divided into three groups:
| Scenario | Input Length | Output Length | Benchmarking Focus |
|---|---|---|---|
| Daily Q&A | ~256-512 Tokens | ~128-512 Tokens | TTFT and request throughput |
| Document Processing | ~32K-64K Tokens | ~512-1024 Tokens | Prefill time and KV usage |
| Complex Tasks & Code | ~4K-8K Tokens | ~2K-4K Tokens | TPOT stability |
Concurrency uses stepwise ramp-up, for example, set sequentially to 1, 2, 4, 8, 16, 32, with the specific upper limit determined by the calculation in Section 8. Run each step for 10 minutes, discarding the first 2 minutes of data to eliminate warm-up effects.
Test tools can utilize community-standard inference benchmarking tools, such as built-in service stress test scripts from various engines, or general LLM performance testing tools. Regardless of the choice, specify the tool name, version, and all parameters in the report.
5.3 Result Recording Template
| Concurrency | Input Length | Throughput (Token/s) | TTFT P50/P95 (ms) | TPOT P50/P95 (ms) | Error Rate |
|---|---|---|---|---|---|
| 1 | 512 | [To be tested] | [To be tested] | [To be tested] | [To be tested] |
| 8 | 512 | [To be tested] | [To be tested] | [To be tested] | [To be tested] |
| 1 | 64K | [To be tested] | [To be tested] | [To be tested] | [To be tested] |
It is recommended to additionally record GPU utilization, memory usage, NIC transmit/receive rates, and SSD read IOPS for each node to identify which layer the bottleneck resides in.
6. Typical Scenario Validation
6.1 Daily Q&A
This scenario features short requests and high concurrency, being most sensitive to TTFT. During validation, focus on whether the P95 of TTFT under high concurrency is within the acceptable business range and whether rate limiting is effective.
Example of gateway rate limiting (values are for format illustration only and must be determined by stress testing):
routes:- name: qamax_input_tokens: 4096max_concurrency: [To_be_determined_by_stress_test]priority: high
6.2 Document Processing
This scenario includes long document summarization, multi-document comparison, and structured extraction. Long inputs require high prefill efficiency and KV memory. During operation, if a single document exceeds the model’s effective context, it should be segmented at the application layer and then summarized, rather than submitting everything at once.
A separate, lower concurrency limit can be set for this scenario in the gateway:
- name: docmax_input_tokens: 65536max_concurrency: [To_be_determined_by_stress_test]priority: normal
6.3 Complex Tasks
This scenario involves multi-step reasoning and tool calling. In end-to-end latency, the network round-trip time for tool services may account for a significant proportion. It is recommended to deploy tool services within the same network domain as the inference cluster and separately tally inference time and tool time to avoid misdiagnosing the bottleneck.
6.4 AI Programming and Agents
This scenario features long contexts, long session durations, and a propensity for long loops. It is recommended to set an independent concurrency quota for each Agent session, along with a maximum number of rounds and a maximum token budget per session, to prevent a single session from exhausting resources.
7. Fault Tolerance Testing
The goal of fault tolerance testing is to confirm the service recovery process during a single-node failure. Test steps are as follows:
- Under a stable load (e.g., moderate concurrency), manually stop the inference service on one node.
- Record the failure detection time, i.e., the time from stopping the service to the gateway removing the node.
- Record the traffic failover time, i.e., the time required for all new requests to redirect to other nodes.
- For established sessions, record the reconnection time and whether processing resumes successfully.
- Tally the number of failed requests and error types during the failure.
All these metrics must be measured and filled in, and compared against the timeout parameters configured in the management platform. If session resumption relies on upstream caching, verify whether the cache was lost on the failed node and whether it will cause duplicate generation.
8. Sizing and Capacity Estimation
8.1 Memory Estimation Formulas
The weight footprint per node can be approximated as:
Weight footprint per node ≈ Total model weight bytes ÷ Number of nodes + Framework overhead
The KV Cache footprint per token is:
KV bytes per token = 2 × Number of layers × Number of KV heads × Head dimension × Bytes per element
The maximum concurrency can be approximated as:
Max concurrency ≈ Memory available for KV Cache ÷ (Average sequence length × KV bytes per token)
These formulas assume all layers share the same structure. If the model employs mixed attention or compressed KV structures, the calculation needs to be adjusted accordingly.
