Benchmarking Local Deployment of Large Models on a 4-Node AI Compute Cluster

    This article explores the practical deployment of a large-scale Mixture of Experts (MoE) model on a 4-node AI compute cluster. It details the deployment architecture, model service implementation, KV Cache management, and performance benchmarking methodologies. By analyzing real-world performance metrics and tuning strategies across various application scenarios, this guide provides a comprehensive reference for enterprises considering private, scalable LLM deployment.

    Benchmarking Local Deployment of Large Models on a 4-Node AI Compute Cluster

    As Mixture of Experts (MoE) architecture and ultra-long context capabilities become critical directions for Large Language Models (LLMs), enterprise requirements for local deployment have shifted from merely “getting it to run” to running it “stably, manageably, and scalably.” Especially when target models require significant memory, long context windows, and high concurrency service capabilities, single-node solutions often face multiple constraints regarding memory capacity, network interconnectivity, and inference scheduling. Using a four-node AI compute cluster as an example, this article details the deployment architecture, model service implementation, performance benchmarking methods, and real-world scenario performance, providing a reference for similar private deployment selections.

    It should be noted that this article discusses general technical solutions and practical methodologies, without recommending any specific vendor products. The theoretical compute, memory, and storage parameters mentioned are configurations of the test environment; actual performance will vary based on model version, input/output length, concurrency strategy, network quality, and inference engine implementation.

    1. Test Objectives and Cluster Configuration

    The core objective of this test is to verify whether a four-node acceleration cluster can support the private deployment of a large-scale MoE model with ultra-long context windows, and to observe its service stability in daily Q&A, document processing, complex tasks, and programming/Agent scenarios. The test environment consists of 4 compute nodes and a 400G-class high-speed switch forming a distributed inference cluster, managed via a unified platform for model deployment, inference service orchestration, AI gateway, and monitoring alert configuration.

    The main configurations of the test environment are as follows:

    • Node count: 4 compute nodes
    • CPU: 20-core efficiency CPUs per node, 80 cores in total
    • Acceleration architecture: General-purpose GPU acceleration architecture
    • Total unified memory: 512GB high-bandwidth, low-power unified memory
    • Total theoretical compute: Up to 4 PFLOPS of low-precision sparse compute (theoretical peak)
    • Total storage: 8TB NVMe SSD
    • Network interface: Up to 200Gbps high-speed network interface per node
    • Networking: 400G-class high-speed switch, RDMA networking
    • Model format: Large-scale MoE model, supporting 1M Tokens context window
    • Model precision: FP8 and FP4 mixed precision
    • Inference service: General-purpose high-throughput inference engine supporting tensor parallelism
    • Management capabilities: Unified management platform, including AI gateway, service monitoring, and logging alerts

    The key to this configuration is not single-node peak performance, but whether the four nodes can unify their memory, compute, and bandwidth through high-speed networking and parallelization strategies. For MoE models, model weights, KV Cache, lookup data, and runtime buffers jointly consume memory resources. Therefore, the architecture design must consider both capacity and bandwidth, rather than focusing solely on theoretical compute.

    2. Deployment Architecture Design

    2.1 Switched Star Topology

    The test cluster uses a switched star topology: the 4 compute nodes are connected to a 400G-class high-speed switch, and inter-node communication occurs over an RDMA network. Compared to direct node-to-node interconnection, a switched topology offers a clear layout, simplified cabling, and ease of expansion and unified management. More importantly, in multi-node tensor parallel inference, nodes must frequently synchronize intermediate results and communication states. While the switch does not participate in model computation, it bears the critical responsibility of data forwarding.

    In this architecture, each node does not need to act as a data relay for other nodes, reducing interference on non-computational paths. For tensor parallelism, communication latency and bandwidth stability directly affect Time To First Token (TTFT) and long-sequence decoding efficiency. Therefore, deployment should focus on fundamentals like NIC queues, switch buffers, RDMA lossless configuration, and cross-node clock synchronization, rather than just looking at nominal link bandwidth.

    2.2 Unified Memory and NVMe Tiering

    The target model uses a large-scale MoE architecture, requiring significant memory space for model weights and inference operations. The test solution employs a tiering strategy coordinating unified memory with NVMe SSDs: primary model weights are distributed across compute nodes, while some lookup data and offloadable caches are placed on NVMe SSDs, thereby freeing up more unified memory for model inference and KV Cache.

    The benefit of this tiering strategy is improved capacity utilization, but the cost is the introduction of a storage access path. Therefore, practical deployment requires distinguishing between “cold data” and “hot data”: data with low access frequency and high predictability is suitable for offloading; KV Cache and expert routing data frequently involved in decoding should remain in unified memory. Otherwise, if the offload ratio is too high, SSD random read performance may become a tail latency bottleneck.

    2.3 Unified Management and Observability

    The cluster accomplishes model deployment, service publishing, AI gateway integration, and monitoring alert configuration through a unified management platform. For enterprise local deployments, management capabilities are as important as inference performance: model services require version management, inference interfaces require unified gateways for authentication and rate limiting, and node, network, memory, and storage watermarks need continuous collection.

    It is recommended to establish at least the following observability metrics:

    • Node-level: CPU utilization, unified memory watermark, NVMe read/write latency, NIC send/receive rate
    • Service-level: Request concurrency, TTFT, Time Per Output Token (TPOT), throughput, error rate
    • Network-level: RDMA retransmissions, congestion events, cross-node communication latency
    • Storage-level: Offloaded data hit rate, SSD read latency, cache swap-in/swap-out frequency
    • Business-level: P95/P99 tail latency and timeout ratio across different scenarios

    3. Model Deployment Implementation

    3.1 Parallelization Strategy Selection

    In a four-node environment, model deployment requires determining a combination of tensor parallelism, pipeline parallelism, and data parallelism. For MoE models, expert distribution and routing communication significantly impact parallel efficiency. The test uses a four-node tensor parallelism as the base strategy, splitting model weights across the 4 nodes by layer or tensor, utilizing the combined 512GB unified memory to host the model.

    A schematic configuration is shown below, representing parameter relationships rather than specific product APIs:

    1. cluster:
    2. node_count: 4
    3. interconnect: rdma_400g
    4. unified_memory_gb: 512
    5. local_nvme_tb: 8
    6. model_service:
    7. architecture: moe
    8. precision: fp8_fp4_mixed
    9. tensor_parallel_size: 4
    10. max_context_tokens: 1000000
    11. kv_cache:
    12. primary_device: unified_memory
    13. offload_device: nvme
    14. scheduling:
    15. continuous_batching: true
    16. max_concurrency: auto

    This configuration has three key points: First, the tensor parallel size matches the node count, reducing cross-node communication layers. Second, KV Cache primarily resides in unified memory, offloading only under capacity pressure according to strategy. Third, continuous batching is enabled to improve accelerator utilization under multi-request concurrency.

    3.2 Long Context and KV Cache Management

    A 1M Tokens context window is a key capability of the test model, but long contexts bring significant KV Cache pressure. In actual deployment, you cannot simply set the maximum context as the default value; you must establish tiering strategies based on business request distribution: short requests go through a low-latency channel, while long document requests enter a separate queue, preventing a few ultra-long requests from dragging up overall tail latency.

    The following practices are recommended:

    • Perform bucketed statistics on input lengths to identify the proportion of short Q&A, medium documents, and ultra-long documents.
    • Set separate concurrency limits for long context requests to prevent KV Cache from instantly filling up.
    • Enable paged cache management to reduce memory fragmentation.
    • Enable cache reuse strategies for ultra-long requests, such as prefix caching for multi-turn Q&A on the same document.
    • Monitor KV Cache hit rate and swap-out frequency, dynamically adjusting the offload threshold.

    3.3 Service Publishing and AI Gateway

    After the inference service is published via the unified management platform, the AI gateway handles external requests. The gateway layer should handle authentication, tenant isolation, rate limiting, circuit breaking, and request logging. For programming/Agent scenarios, the gateway must also support multi-turn session identification and tool-call chain traceability; otherwise, it is difficult to pinpoint whether tail latency originates from model inference, tool execution, or network waiting.

    4. Performance Benchmarking Methodology

    4.1 Benchmarking Metrics

    This test focuses on the following metrics:

    • Time To First Token (TTFT): Time from request submission to receiving the first output token.
    • Time Per Output Token (TPOT): Average generation interval per token during the decoding phase.
    • Throughput: Number of completed requests or output tokens per unit time.
    • Tail Latency: P95, P99 response times, reflecting stability under high concurrency.
    • Resource Watermarks: Unified memory, KV Cache, NVMe read/write, and network bandwidth usage.
    • Stability: Error rates, timeout rates, and memory leak signs during prolonged operation.

    4.2 Workload Model Design

    Benchmarking workloads are split by business scenarios, rather than just running single fixed-length requests. A schematic workload is as follows:

    1. workloads:
    2. - name: qa_short
    3. input_tokens: [64, 512]
    4. output_tokens: [64, 256]
    5. concurrency: [1, 4, 8]
    6. - name: doc_medium
    7. input_tokens: [4096, 32768]
    8. output_tokens: [256, 1024]
    9. concurrency: [1, 2, 4]
    10. - name: doc_long
    11. input_tokens: [65536, 262144]
    12. output_tokens: [512, 2048]
    13. concurrency: [1, 2]
    14. - name: agent_multi_turn
    15. input_tokens: [1024, 8192]
    16. output_tokens: [128, 512]
    17. concurrency: [1, 4]
    18. turns: [3, 8]

    During benchmarking, first establish a single-request baseline, then gradually increase concurrency to observe the variation curves of TTFT, TPOT, and P99. If throughput rises but P99 degrades rapidly as concurrency increases, it indicates that scheduling or KV Cache management is nearing its bottleneck; if the proportion of cross-node communication latency rises, check the tensor parallel split and network configuration.

    5. Scenario Performance Analysis

    5.1 Daily Q&A Scenarios

    Daily Q&A typically features short inputs and medium outputs, and is sensitive to TTFT. Under low concurrency, the four-node cluster provides stable service with continuous response processes. As concurrency increases, continuous batching can improve overall throughput, but the maximum batch size must be controlled to prevent long output requests from blocking short ones. It is recommended to set higher priorities for short Q&A and limit the maximum output length per request.

    5.2 Document Processing Scenarios

    Document processing involves long inputs, summarization, extraction, and Q&A, making it a critical scenario for testing unified memory and KV Cache management. The test should focus on the prefill latency when loading long documents for the first time, and the prefix reuse effect during multi-turn follow-ups. For ultra-long documents, it is recommended to perform segment indexing first and feed them to the model on demand, preventing all requests from directly filling the context window. NVMe tiering can alleviate capacity pressure, but high-frequency access caches should not linger on the SSD path.

    5.3 Complex Task Scenarios

    Complex tasks usually involve multi-step reasoning, longer outputs, and multiple context refills, with a high proportion of decoding time. In such scenarios, network communication and batching strategies affect overall stability. The test should observe whether long output requests cause continuous KV Cache growth, and whether multi-node synchronization exhibits periodic jitter. Tuning directions include setting reasonable maximum output lengths, enabling request timeouts and interrupt recovery, and using independent queues for complex tasks.

    5.4 Programming/Agent Scenarios

    Programming assistance and Agent scenarios feature multi-turn, alternating short inputs/outputs, and frequent tool calls. Model services need to be decoupled from tool execution chains to prevent tool waiting from occupying inference concurrency. For multi-turn sessions, session prefix caching should be reused; for code generation, temperature parameters and maximum output length should be controlled to reduce invalid long outputs. This scenario is sensitive to P99 tail latency, so it is recommended to set independent rate limiting and circuit breaking strategies at the gateway layer.

    6. Tuning and Selection Recommendations

    First, conduct capacity planning before performance tuning. Calculate memory requirements based on model weights, KV Cache limits, and concurrent request length distribution before deciding the offload ratio. Second, prioritize network stability. Multi-node tensor parallelism is sensitive to RDMA network quality; enable congestion monitoring and retransmission alerts. Third, long context capabilities must be paired with queue management to avoid resource contention. Fourth, the unified management platform should provide model versioning, service canary releases, gateway rate limiting, and log tracing to reduce operational complexity. Fifth, benchmarking must cover real business distributions; conclusions should not be drawn solely from fixed-length requests.

    Overall, a four-node AI compute cluster paired with 400G-class switched networking, unified memory, and NVMe tiering can provide a feasible foundation for the private deployment of large models at this scale. Its advantages lie in memory capacity, network scalability, and unified management; its challenges lie in long context KV Cache management, cross-node communication tuning, and tail latency control under real workloads. When selecting solutions, enterprises should conduct real-world benchmarking based on their own request length distribution, concurrency scale, and operational capabilities before deciding on node count, parallelization strategies, and offload ratios.