Environment variables
The following environment variables are automatically set on all nodes in an Instant Cluster:
Each node receives a static IP address (
NODE_ADDR) on the overlay network. When a cluster is deployed, the system designates one node as the primary node by setting the PRIMARY_ADDR and PRIMARY_PORT environment variables. This simplifies working with multiprocessing libraries that require a primary node.
The following variables are equivalent:
MASTER_ADDRandPRIMARY_ADDRMASTER_PORTandPRIMARY_PORT
MASTER_* variables are available to provide compatibility with tools that expect these legacy names.
Network interfaces
Instant Clusters use dedicated high-bandwidth network interfaces for inter-node communication, separate from the management interface used for external traffic.
Instant Clusters support up to 8 high-bandwidth interfaces per node. The
PRIMARY_ADDR environment variable corresponds to ens1, which enables launching and bootstrapping distributed processes.
RDMA
Where the hardware supports it, traffic between nodes uses RDMA (InfiniBand or RoCE) instead of TCP. Runpod sets up each Pod for this: it adds the/dev/infiniband/uverbs* devices, removes the memlock limit, and sets NCCL_IB_HCA and NCCL_IB_DISABLE=0 (plus NCCL_IB_GID_INDEX on RoCE). NCCL then uses RDMA without any extra configuration. On hosts without RDMA, NCCL falls back to TCP over the ens interfaces.
GPUDirect RDMA is also enabled on the hosts, so libraries that register GPU memory directly with the verbs API, such as KV cache transfer libraries, can work. Runpod tests NCCL, not these libraries. Before relying on one, check that it can see the mlx5 devices and that NCCL_IB_HCA is set.
NCCL configuration
NCCL (NVIDIA Collective Communications Library) handles GPU-to-GPU communication in distributed training. You must configure NCCL to use the internal network interfaces.Required configuration
Set theNCCL_SOCKET_IFNAME environment variable to use the internal network:
NCCL_SOCKET_IFNAME uses all available interfaces. However, explicitly setting it to ens1 ensures NCCL uses the high-bandwidth internal network.
Debugging NCCL
To troubleshoot multi-node communication issues, enable NCCL debug logging:Troubleshooting
Connection timeouts during distributed training
Symptom: Training jobs fail with connection timeout errors between nodes. Cause: NCCL is attempting to communicate over the external network interface (eth0) instead of the internal interfaces (ens1-ens8).
Solution: Set the NCCL_SOCKET_IFNAME environment variable:
Nodes cannot find the primary node
Symptom: Worker nodes fail to connect to the primary node during initialization. Cause: ThePRIMARY_ADDR or MASTER_ADDR environment variable is not being used correctly in your distributed training script.
Solution: Verify your script uses the PRIMARY_ADDR environment variable for the rendezvous address. For PyTorch distributed training:
Inconsistent training performance
Symptom: Training speed varies significantly between runs or degrades over time. Cause: Network congestion or suboptimal NCCL configuration. Solution:- Ensure all nodes are in the same data center (Runpod handles this automatically).
- Enable NCCL debugging to identify bottlenecks:
export NCCL_DEBUG=INFO - Verify your batch sizes are appropriate for the cluster size to maintain efficient GPU utilization.