Skip to main content

Overview

Multi-node deployment enables SGLang to serve large models that exceed single-node GPU memory or require high throughput. This guide covers tensor parallelism, expert parallelism, and prefill-decode disaggregation across nodes.

Prerequisites

  • Multiple compute nodes with GPUs
  • High-speed interconnect (InfiniBand, RoCE, or high-bandwidth Ethernet)
  • Consistent network topology between nodes
  • Shared storage or synchronized model weights
  • NCCL 2.28.3 or later

Basic Multi-Node Setup

Two-Node Tensor Parallelism

Deploy a large model across two nodes with 8 GPUs each:

Key Parameters

SLURM Deployment

For HPC clusters with SLURM:
Submit the job:

MoE Models with Expert Parallelism

For DeepSeek-V3/R1 and other MoE models:

MoE-Specific Parameters

RDMA/InfiniBand Configuration

For optimal performance with RDMA:

Verify RDMA Setup

NCCL Environment Variables

Launch with RDMA

Prefill-Decode Disaggregation

Separate prefill and decode stages for optimal resource utilization:

Prefill Nodes

Decode Nodes

Router/Load Balancer

Kubernetes Multi-Node Deployment

See the Kubernetes deployment guide for StatefulSet and LeaderWorkerSet configurations.

Quick Example

Network Configuration

Firewall Rules

Open required ports between nodes:

Network Interface Selection

Network Topology

For optimal performance, ensure:
  1. Low latency: < 10μs for InfiniBand, < 100μs for Ethernet
  2. High bandwidth: ≥ 200 Gbps per GPU
  3. Consistent topology: Same switch for all nodes (ideal)

Performance Optimization

NCCL Tuning

Memory Configuration

CPU Affinity

Monitoring

NCCL Logs

Network Bandwidth

GPU Utilization

Troubleshooting

NCCL Initialization Failures

Symptoms:
  • “NCCL initialization failed”
  • Timeout waiting for other nodes
Solutions:

RDMA Errors

Symptoms:
  • “ibv_create_qp failed”
  • “RDMA connection refused”
Solutions:

Model Loading Issues

Symptoms:
  • Different model versions on nodes
  • Checksum mismatch
Solutions:

Out of Memory

Slow Performance

Best Practices

  1. Use InfiniBand/RoCE: Essential for multi-node at scale
  2. Enable hostNetwork: Reduces latency in containerized environments
  3. Set privileged mode: Required for RDMA device access
  4. Synchronize clocks: Use NTP to avoid timeout issues
  5. Test incrementally: Validate 2 nodes before scaling to more
  6. Monitor NCCL: Keep NCCL_DEBUG=INFO in production
  7. Use static IPs: Avoid DNS resolution delays
  8. Verify topology: Run nvidia-smi topo -m on all nodes

Example Configurations

4-Node Llama 405B (FP16)

2-Node DeepSeek-V3

Next Steps