MoE LLM Deployment on a Four-Node On-Premises Cluster: Configuration and Performance Notes

    This article shares practical experience deploying a large mixture-of-experts (MoE) model on a four-node on-premises cluster. It covers memory sizing, tiered storage, tensor and expert parallelism, RoCE lossless networking, measured performance for chat, long-document, reasoning, code-generation, and agent tasks, as well as node-count guidance and operational risks.

    1. Why Enterprises Need to Run MoE Models Locally

    Mixture-of-experts (MoE) models have a large total parameter count but activate only a small subset of parameters during each inference pass. This makes compute cost more controllable, but the weight footprint is still substantial. An open-source MoE model with more than 500B total parameters still requires about 500 GB of weights even with FP8 quantization, far exceeding the memory of a single GPU or a single server.

    During inference, expert routing creates dynamic communication between nodes. Communication latency and bandwidth directly affect time to first token (TTFT) and generation speed. At the same time, data privacy and compliance requirements prevent many enterprises from sending business data to public cloud APIs. Private deployment is therefore a common choice. The challenge is how to run a large model with limited data-center space and budget while maintaining adequate speed.

    2. Hardware Configuration and Memory Capacity Estimation

    Node configuration

    This deployment uses four identical compute nodes. Each node has a 20-core ARM CPU, about 128 GB of LPDDR5X unified memory, and a 2 TB NVMe SSD. The four nodes provide a total of 80 CPU cores, 512 GB of unified memory, and 8 TB of SSD storage.

    Before purchasing, two things need to be confirmed. First, the exact GPU and CPU models and the memory bandwidth specified by the vendor. Second, the difference between unified memory and dedicated HBM. Unified memory offers larger capacity but usually lower bandwidth than HBM, which limits per-token generation speed. Unified memory is also shared with the operating system, CPU processes, and KV cache, so the amount actually available for model weights is less than the nominal capacity.

    Calculating memory capacity

    Many deployment failures happen because only model weights are counted. A complete estimate includes three parts:

    • Weights: parameter count × bits per parameter ÷ 8. A 500B-parameter model uses about 500 GB at FP8 and about 250 GB at FP4.
    • KV cache: proportional to context length and concurrency. The formula is 2 × layers × KV heads × head dimension × bytes per element × context tokens.
    • Runtime headroom: CUDA context, activations, system and framework overhead. Reserving 10% to 20% is recommended.

    Consider a hypothetical configuration: 60 layers, 8 KV heads, head dimension 128, and KV cache stored in FP16. The KV cache is about 245 KB per token, so a single 1M-token sequence alone requires about 246 GB. In a 512 GB total memory pool, if FP8 weights take about 500 GB, the remaining space can barely support one long-context request. In this case, consider FP4 weights, limiting context length, or offloading part of the cache to SSD. The claimed 1M-context capability needs to be rechecked against this calculation.

    3. Tiered Model Storage and Multi-Node Parallelism

    Tiered storage

    Shared layers such as Attention and Norm remain resident in memory. Expert weights are swapped between memory and SSD according to access frequency. The Engram lookup data mentioned in the original deployment is large, and its access pattern is suitable for on-demand reads, so it is offloaded to NVMe SSD and read through PCIe as needed.

    Compared with an all-resident deployment, this strategy reduces memory usage by about 40%. The tradeoff is that when the expert hit rate drops, swapping increases latency. MoE sparse activation reduces SSD read pressure, but the actual effect depends on the expert distribution in the input. In this test, TTFT and continuous generation rate did not degrade noticeably, but this conclusion holds only for the request distribution used in the test. If production requests have a more scattered expert distribution, the measurements should be repeated.

    SSD lifetime needs separate monitoring. Swapping is mainly read-intensive, but writes and logs still consume the TBW budget. Wear indicators should be read periodically through the SMART interface.

    Multi-node parallelism

    Because model weights exceed single-node memory, they must be split across nodes. This deployment combines tensor parallelism (TP) and expert parallelism (EP).

    Tensor parallelism splits the weights of shared layers across four nodes, and each node computes a portion. During inference, nodes synchronize the sliced activations (hidden states) through AllReduce. No gradient synchronization is performed during inference, unlike training.

    Expert parallelism places different expert groups on different nodes. After routing results are determined, tokens are sent to the nodes holding the corresponding experts, and results are collected after computation. This process is carried out through All-to-All communication.

    AllReduce is used for synchronization in tensor parallelism, while All-to-All is used for expert dispatch and collection in expert parallelism. The two types of communication differ in frequency and data volume and should be measured separately. After graph compilation and operator fusion, cross-node communication calls were reduced by about 30% in this test.

    Management plane and AI gateway

    A unified management platform handles image distribution, model version management, service start and stop, and health checks. An intelligent gateway handles request routing, load balancing, timeout retries, and streaming response forwarding.

    The gateway should handle timeout retries conservatively. Non-idempotent requests, such as tool calls that have already produced side effects, should not be retried automatically; otherwise, they may be executed twice. Once a streaming response has sent partial content to the client, a retry would duplicate content, so the client should decide whether to retry.

    The inference engine uses continuous batching and PagedAttention. The gateway dynamically adjusts batch size based on KV cache utilization on each node. It is recommended to set the following alert thresholds first and then tune them according to the workload: sustained GPU utilization above 90%, memory usage above 85%, and single-request TTFT above twice the SLA.

    4. Networking: RoCE Lossless Network Configuration

    A single 400G-class switch is used as the core, and the four nodes are connected in a star topology. Any two nodes require only one hop. The switch centrally schedules traffic, which simplifies fault isolation and future expansion.

    RoCEv2 depends on lossless Ethernet. Simply stating the benefits of RoCE is not enough to guarantee performance; the following configuration is also required:

    • PFC (priority-based flow control): enable it only on the priority queue used by RoCE to avoid affecting other traffic.
    • ECN and DCQCN: set reasonable ECN marking thresholds so congestion control slows down before queue buildup.
    • QoS: map DSCP to priority and place inference communication traffic in a dedicated queue.
    • MTU: most deployments use 9000-byte jumbo frames, and the four nodes and switch ports must be confirmed to match.

    After configuration, first use perftest tools such as ib_write_bw to measure point-to-point bandwidth and latency, then use collective communication tools such as NCCL all_reduce_perf. In the test, one-way inter-node latency was in the microsecond range, and bandwidth utilization exceeded 90%. These numbers come from a specific switch and NIC combination; they need to be retested after changing hardware.

    PFC misconfiguration can cause congestion spread or even deadlock, so every change should be validated in a test environment first.

    5. Measured Performance

    The following data comes from the same test environment, using the mixed-precision model version described above. The numbers represent results under this configuration only and do not apply to other models or hardware. Readers should remeasure using their own input length, output length, and concurrency before sizing.

    Daily Q&A

    In 100 consecutive multi-turn dialogues, average TTFT was 386 ms, and subsequent generation speed was 42.7 tokens per second, clearly faster than human reading speed. The 1M-context window allows an entire technical manual to be entered at once without chunking.

    For knowledge questions, we performed sampled comparisons but have not established a unified evaluation baseline, so no conclusion is given about advantages or disadvantages versus cloud models. All data ran on the intranet, but this does not mean the system is safe in all scenarios; access control and input/output auditing are still required.

    Long-document processing

    For an English research paper of about 30,000 words, the model was asked to read it and generate a structured summary. End-to-end time was 12.3 seconds, including 8.1 seconds for prefill and 4.2 seconds for output. Prefill time increases with input length, so long-document scenarios should prioritize optimizing this stage.

    When five document tasks were submitted simultaneously, dynamic batching brought total throughput to 3.2× that of a single task, and GPU utilization remained above 85% during the test.

    Complex reasoning and code

    For math competition problems, the reasoning steps were mostly logically complete, but no systematic accuracy statistics were collected. In code debugging scenarios, the model located a logic error in a Python function and provided a fixed version and unit test suggestions. For a traveling salesman route problem, the model produced an approximate solution within 30 seconds.

    Code generation and agent tasks

    In code generation tests, the model generated functions averaging 50 lines per attempt, with a success rate of 78%. After iterative correction based on test cases, accuracy rose to 91%. The number of iterations and the size of the test suite affect the final result and should be recorded together.

    In an agent task, the model needed to query a local SQLite database, calculate last month’s sales, and generate a chart. It autonomously called the database interface, handled missing values, generated matplotlib code, and output an image, with an average time of 25 seconds. This shows that the model can run stably on tool calls and multi-step decisions, but the number of task samples was limited.

    6. Sizing Guidance and Risk Notes

    Node-count selection

    The table below provides guidance based on quantized weight volume. The numbers do not include detailed KV cache calculations; verify them with the formula in the previous section before actual deployment.

    Quantized weight volume Suggested node count Notes
    Under 200 GB 2 nodes (~256 GB) About 56 GB headroom; long context requires separate KV cache calculation
    200 GB to 400 GB 4 nodes (~512 GB) About 410 GB usable after runtime headroom, leaving some margin
    410 GB to 1 TB 4 nodes require FP4 or SSD offload Cannot be fully loaded in memory alone; limit context or add nodes
    Over 1 TB Recalculate based on weights, KV cache, and headroom Node count depends on actual concurrency and context length

    Risk notes

    • Data security: the model and data run on the intranet, but the management platform, gateway, and monitoring interfaces still require access control. Sensitive user input should be avoided in logs.
    • Quantization accuracy: FP4 introduces precision loss. Compare FP8 and FP4 results on your own evaluation set; critical workloads can keep an FP8 version as a fallback.
    • SSD lifetime: regularly read wear indicators and estimate the replacement cycle based on TBW.
    • Single point of failure: a single switch is a single point of risk. Critical workloads should consider dual switches and link aggregation, and should keep spare equipment and configuration backups.
    • Network changes: PFC misconfiguration may cause deadlock, so changes should be validated in a test environment first.

    7. Conclusion

    A four-node deployment can run a medium-scale MoE model on an intranet, but memory, networking, and storage all limit performance and need to be calculated and measured separately. Sizing should be based on your own model size, context length, and concurrency rather than directly copying the test numbers in this article.