Skip to main content
Back to Community & Earn Hub
Q&A Questionllms +150 pt Bounty

vLLM Tensor Parallelism + NCCL Hang on Multi-GPU Kubernetes Pods: How to fix 'Watchdog caught collective operation timeout' when /dev/shm is 64MB?

@marcus_chen3 days ago 1560 views

We deployed meta-llama/Llama-3.3-70B-Instruct on a 4-GPU Kubernetes node (--tensor-parallel-size 4) using vllm/vllm-openai:latest.

The Silent Hang & Crash

Single-GPU (TP=1) models boot fine. As soon as we enable --tensor-parallel-size 4, the pod stalls during custom all-reduce initialization and dumps:

text
[rank0]:[E ProcessGroupNCCL.cpp:563] [Rank 0] Watchdog caught collective operation timeout:
WorkNCCL(SeqNum=1, OpType=ALLREDUCE, NumelIn=4194304) ran for 600000 milliseconds before timing out.

Setting NCCL_DEBUG=INFO shows ranks waiting indefinitely on shared-memory ring buffers. What Kubernetes Pod volume & NCCL environment settings are required for multi-GPU TP >= 2 vLLM pods?

1 Answers

Community Answers

@siddharth_rao Accepted Answer3 days ago

Kubernetes caps /dev/shm at 64 MB by default—and NCCL / vLLM's custom intra-node AllReduce uses /dev/shm (shm_open) to allocate multi-gigabyte shared-memory IPC ring buffers between GPU worker ranks! When 4 ranks try to allocate >64MB, NCCL deadlocks until the 10-minute watchdog kills the pod.


1. Mount a Memory-Backed emptyDir at /dev/shm (16 GiB)

Add an explicit medium: Memory volume to your Kubernetes Deployment spec:

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: vllm-70b-tp4
spec:
  template:
    spec:
      containers:
        - name: vllm
          image: vllm/vllm-openai:latest
          env:
            - name: TORCH_NCCL_ASYNC_ERROR_HANDLING
              value: "1"
            - name: NCCL_SHM_DISABLE
              value: "0"
          volumeMounts:
            - mountPath: /dev/shm
              name: dshm
          resources:
            limits:
              nvidia.com/gpu: "4"
      volumes:
        - name: dshm
          emptyDir:
            medium: Memory
            sizeLimit: 16Gi # Plenty of room for 4-GPU NCCL + PyTorch shm!

2. Check P2P / IOMMU on Non-NVLink Cloud Nodes

If your cloud VM lacks NVLink (or runs inside a virtualized PCIe ACS boundary where P2P hangs), also set NCCL_P2P_DISABLE=1 if /dev/shm alone doesn't clear the hang—forcing NCCL cleanly through host shared memory instead of stalled PCIe peer-to-peer DMA.

Have a solution or working configuration?

Sign in or create a free account to answer this question (+10 pts, +25 pts if accepted) and tag helpful AIStoreHub repositories.