Multi-Node Deployment
Multi-node deployment enables very large models (for example, Llama 3.1 405B or DeepSeek R1) to run across multiple physical nodes when a single node’s GPU capacity is insufficient.
NIM LLM and VLM uses Ray for cluster formation and either vLLM or SGLang for distributed model execution across the cluster. The backend is selected automatically based on the NIM image.
Multi-node deployment splits model weights across nodes using two parallelism strategies:
- Pipeline Parallelism (PP): Splits model stages across nodes. Example: PP=2 across 2 nodes.
- Tensor Parallelism (TP): Splits model layers across GPUs. Example: TP=8 across 8 GPUs.
The most common configuration sets the tensor-parallel size to the number of GPUs per node and the pipeline-parallel size to the number of nodes.
For example, use the following settings for Llama 3.1 405B across two nodes with eight GPUs each:
- TP = 8 (8 GPUs per node)
- PP = 2 (2 nodes)
- Total GPUs = 16
In some cases, multi-node tensor parallelism is used instead, where a single tensor-parallel group spans multiple physical nodes:
- TP = 16
- PP = 1
- Node A: 8 GPUs, Node B: 8 GPUs
- One TP group spans 2 nodes with 16 GPUs total
Multi-node TP requires continuous cross-node GPU communication. Performance depends on network bandwidth, latency, and Remote Direct Memory Access (RDMA) availability.
Known Limitations
Multi-node Ray workers cannot use the NIM JSON log formatter.
Disable structured (JSON) logging for multi-node deployments. Set model.jsonLogging=false in Helm values. The NIM JSON log formatter is not importable inside the inference engine’s Ray worker processes and causes worker initialization to fail.
Architecture
NIM multi-node deployments follow a leader/worker model. The same NIM container image is used for both leader and worker pods; the role is determined by the command injected at deployment time. The backend (vLLM or SGLang) is selected from the image at startup:
- vLLM path: the leader pod starts a Ray head node, downloads the model, and launches the vLLM inference server with
--distributed-executor-backend ray. vLLM spawns execution actors on worker nodes for model parallelism. - SGLang path: the leader pod starts a Ray head node, downloads the model, and launches SGLang with
--use-ray --nnodes <N>. SGLang derives per-node rank and the distributed init address from the Ray placement group. The number of nodes is taken from theNIM_NUM_COMPUTE_NODESenvironment variable (populated automatically by the Helm chart frommultiNode.workers + 1).
In both cases, worker pods join the Ray cluster and provide GPU resources.
The following diagram shows this architecture:
Prerequisites
Before you deploy NIM in multi-node mode, complete the following prerequisites:
-
Provision a Kubernetes cluster with GPU nodes, where each node has the same number and type of GPUs.
-
Install the LeaderWorkerSet CRD on the cluster. LeaderWorkerSet is a Kubernetes-native mechanism for managing leader/worker pod groups:
-
Provide shared storage (recommended): a PVC with
ReadWriteManyaccess mode,hostPath, or NFS, so the leader downloads the model once and shares it with workers. -
Provide high-speed networking (recommended): InfiniBand or RDMA over Converged Ethernet (RoCE) for optimal NCCL performance in multi-node configurations.
-
Confirm sufficient GPU resources across all nodes to satisfy the TP × PP requirement.
-
Store an NGC API key as a Kubernetes secret:
Deploy with Helm
The NIM LLM and VLM Helm chart natively supports multi-node deployments using LeaderWorkerSet. Use the following sections to install a minimal chart, review the multi-node Helm values, and choose a model profile.
Minimal Configuration
To deploy a minimal multi-node Helm example, complete the following steps:
-
Create a
values.yamlfile for your multi-node deployment: -
Install the chart:
Helm Values Reference
Use the following Helm values to configure multi-node deployment behavior, model profile selection, and Ray communication settings.
Profile Selection
You must specify how the model profile is selected. Choose one of these approaches:
Option A: TP/PP Values (Recommended)
Option B: Explicit Profile
Set multiNode.tensorParallelSize and multiNode.pipelineParallelSize directly. The Helm chart injects NIM_TENSOR_PARALLEL_SIZE and NIM_PIPELINE_PARALLEL_SIZE environment variables, and the correct profile is selected automatically.
Multi-node deployment requires either tensorParallelSize/pipelineParallelSize (both >0) or model.profile to be set. The Helm chart will fail to render if neither is provided.
Configure Model Storage
The leader and all worker nodes must have access to the model weights at the same filesystem path. There are two supported approaches:
Shared Storage (Recommended)
Use a PVC with ReadWriteMany access mode or NFS. With shared storage:
- The leader downloads the model once to the shared volume.
- Workers detect the cached model blobs in shared storage and materialize a local workspace at
/tmp/nim_workspacewithout a network download.
The Helm chart supports two shared storage backends:
- PVC with
existingClaim: Pre-create aReadWriteManyPVC. The PVC surviveshelm uninstall, so the model cache persists across deployments and subsequent installs skip the download. - NFS direct mount: Set
nfs.enabled=truewithnfs.serverandnfs.path. Same persistence behavior as PVC.
The following example shows a PVC-based configuration:
If persistence is enabled, accessMode must be ReadWriteMany. A ReadWriteOnce PVC cannot be mounted on multiple nodes.
Independent Downloads
If shared storage is not available, each node downloads the model independently to local storage (emptyDir). This works but is not recommended because it wastes time and network bandwidth.
Model-free NIM deployments (using model.modelPath) support both shared and independent storage. However, shared storage is strongly recommended for multi-node deployments.
Deploy with the NIM Operator
The NIM Operator provides a fully automated deployment experience for multi-node NIM. The operator manages the NIMService custom resource and automatically:
- Generates leader and worker pod specifications
- Injects the appropriate Ray startup commands
- Handles PVC setup through
NIMCache - Manages probes, networking, and secrets
Refer to the NIM Operator Deployment documentation for full details on deploying with the NIM Operator.
Review Multi-Node Examples
Use the following examples to configure common multi-node deployments with different tensor and pipeline parallelism settings.
Llama 3.1 405B on 2 Nodes (TP=8, PP=2)
Two nodes, each with 8 GPUs. The model is split across 16 GPUs total.
Multi-Node Tensor Parallelism (TP=16, PP=1)
Two nodes, each with 8 GPUs. A single TP group spans both nodes.
Multi-node TP requires high-bandwidth, low-latency interconnect (for example, InfiniBand with RDMA) for acceptable performance.
Model-Free Multi-Node Deployment
Deploy a model from Hugging Face across multiple nodes using model-free NIM:
Troubleshoot Multi-Node Deployments
Use the following checks when leader or worker pods fail to form a Ray cluster, download a model, or schedule GPUs.
Workers Cannot Join the Ray Cluster
Use the following checks if workers cannot join the Ray cluster:
-
Verify that the Ray port (default
6379) is accessible between pods. Check network policies. -
Ensure that
LWS_LEADER_ADDRESSis being injected correctly by the LeaderWorkerSet controller. -
Check worker logs for Ray connection errors:
Model Download Failures
Use the following checks if model downloads fail:
- Confirm that
NGC_API_KEYis set correctly in the referenced secret. - If using shared storage, verify the PVC is bound and has
ReadWriteManyaccess mode. - Check that the storage class supports the required access mode.
NCCL Communication Errors
Use the following checks if NCCL communication errors occur:
-
For multi-node TP, ensure high-speed interconnect (InfiniBand/RoCE) is available and configured.
-
Verify that NCCL environment variables are set appropriately for your network topology. You can pass these via
envinvalues.yaml:
Pod Scheduling Issues
Use the following checks if pods cannot be scheduled:
- Verify that each node has the required GPU resources available.
- Check that
nodeSelector,affinity, ortolerationsare configured correctly for GPU nodes. - Confirm that
nvidia.com/gpuresource requests match the available GPUs per node.
Next Steps
Continue with operator-managed multi-node, profile selection, or single-node Helm:
- NIM Operator Deployment — Automated multi-node NIMService deployments
- Model Profiles and Selection — Profile names for TP and PP
- Helm and Kubernetes — Single-node Helm values and probes