Skip to content

[Bug]: crash on startup with TP>1 on H100 nodes: AttributeError in ShmRingBuffer.shared_memory #24580

@sanderland

Description

@sanderland

Your current environment

The output of python collect_env.py

==============================
System Info

OS : Ubuntu 22.04.5 LTS (x86_64)
GCC version : (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version : Could not collect
CMake version : version 3.22.1
Libc version : glibc-2.35

==============================
PyTorch Info

PyTorch version : 2.7.1+cu126
Is debug build : False
CUDA used to build PyTorch : 12.6
ROCM used to build PyTorch : N/A

==============================
Python Environment

Python version : 3.11.13 (main, Aug 28 2025, 17:07:15) [Clang 20.1.4 ] (64-bit runtime)
Python platform : Linux-6.8.0-1033-aws-x86_64-with-glibc2.35

==============================
CUDA / GPU Info

Is CUDA available : True
CUDA runtime version : 12.8.93
CUDA_MODULE_LOADING set to : LAZY
GPU models and configuration :
GPU 0: NVIDIA H100 80GB HBM3
GPU 1: NVIDIA H100 80GB HBM3
GPU 2: NVIDIA H100 80GB HBM3
GPU 3: NVIDIA H100 80GB HBM3
GPU 4: NVIDIA H100 80GB HBM3
GPU 5: NVIDIA H100 80GB HBM3
GPU 6: NVIDIA H100 80GB HBM3
GPU 7: NVIDIA H100 80GB HBM3

Nvidia driver version : 570.172.08
cuDNN version : Could not collect
HIP runtime version : N/A
MIOpen runtime version : N/A
Is XNNPACK available : True

==============================
CPU Info

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 96
On-line CPU(s) list: 0-95
Vendor ID: AuthenticAMD
Model name: AMD EPYC 7R13 Processor
CPU family: 25
Model: 1
Thread(s) per core: 1
Core(s) per socket: 48
Socket(s): 2
Stepping: 1
BogoMIPS: 5300.00
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr rdpru wbnoinvd arat npt nrip_save vaes vpclmulqdq rdpid
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 3 MiB (96 instances)
L1i cache: 3 MiB (96 instances)
L2 cache: 48 MiB (96 instances)
L3 cache: 384 MiB (12 instances)
NUMA node(s): 2
NUMA node0 CPU(s): 0-47
NUMA node1 CPU(s): 48-95
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Mitigation; Safe RET
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

==============================
Versions of relevant libraries

[pip3] flashinfer-python==0.3.1
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.6.4.1
[pip3] nvidia-cuda-cupti-cu12==12.6.80
[pip3] nvidia-cuda-nvrtc-cu12==12.6.77
[pip3] nvidia-cuda-runtime-cu12==12.6.77
[pip3] nvidia-cudnn-cu12==9.5.1.17
[pip3] nvidia-cudnn-frontend==1.14.1
[pip3] nvidia-cufft-cu12==11.3.0.4
[pip3] nvidia-cufile-cu12==1.11.1.6
[pip3] nvidia-curand-cu12==10.3.7.77
[pip3] nvidia-cusolver-cu12==11.7.1.2
[pip3] nvidia-cusparse-cu12==12.5.4.2
[pip3] nvidia-cusparselt-cu12==0.6.3
[pip3] nvidia-ml-py==12.575.51
[pip3] nvidia-nccl-cu12==2.26.2
[pip3] nvidia-nvjitlink-cu12==12.6.85
[pip3] nvidia-nvtx-cu12==12.6.77
[pip3] pynvml==12.0.0
[pip3] pyzmq==27.0.2
[pip3] torch==2.7.1
[pip3] torchaudio==2.7.1
[pip3] torchvision==0.22.1
[pip3] transformers==4.56.1
[pip3] triton==3.3.1
[conda] Could not collect

==============================
vLLM Info

ROCM Version : Could not collect
vLLM Version : 0.10.1.1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled
GPU Topology:
�[4mGPU0 GPU1 GPU2 GPU3 GPU4 GPU5 GPU6 GPU7 CPU Affinity NUMA Affinity GPU NUMA ID�[0m
GPU0 X NV18 NV18 NV18 NV18 NV18 NV18 NV18 0-15 0 N/A
GPU1 NV18 X NV18 NV18 NV18 NV18 NV18 NV18 0-15 0 N/A
GPU2 NV18 NV18 X NV18 NV18 NV18 NV18 NV18 0-15 0 N/A
GPU3 NV18 NV18 NV18 X NV18 NV18 NV18 NV18 0-15 0 N/A
GPU4 NV18 NV18 NV18 NV18 X NV18 NV18 NV18 48-63 1 N/A
GPU5 NV18 NV18 NV18 NV18 NV18 X NV18 NV18 48-63 1 N/A
GPU6 NV18 NV18 NV18 NV18 NV18 NV18 X NV18 48-63 1 N/A
GPU7 NV18 NV18 NV18 NV18 NV18 NV18 NV18 X 48-63 1 N/A

Legend:

X = Self
SYS = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
PHB = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
PXB = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
PIX = Connection traversing at most a single PCIe bridge
NV# = Connection traversing a bonded set of # NVLinks

==============================
Environment Variables

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib:/usr/local/cuda-12.8/lib64:/usr/local/cuda-12.8:/usr/local/cuda-12.8/targets/x86_64-linux/lib/:/usr/local/cuda-12.8/extras/CUPTI/lib64:/opt/amazon/efa/lib:/opt/amazon/openmpi/lib:/opt/amazon/ofi-nccl/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:/usr/local/cuda-12.8/lib:/usr/local/cuda-12.8/lib64:/usr/local/cuda-12.8:/usr/local/cuda-12.8/targets/x86_64-linux/lib/:/usr/local/cuda-12.8/extras/CUPTI/lib64:/opt/amazon/efa/lib:/opt/amazon/openmpi/lib:/opt/amazon/ofi-nccl/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:/usr/local/cuda-12.8/lib:/usr/local/cuda-12.8/lib64:/usr/local/cuda-12.8:/usr/local/cuda-12.8/targets/x86_64-linux/lib/:/usr/local/cuda-12.8/extras/CUPTI/lib64:/opt/amazon/efa/lib:/opt/amazon/openmpi/lib:/opt/amazon/ofi-nccl/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:/usr/local/cuda-12.8/lib:/usr/local/cuda-12.8/lib64:/usr/local/cuda-12.8:/usr/local/cuda-12.8/targets/x86_64-linux/lib/:/usr/local/cuda-12.8/extras/CUPTI/lib64:/opt/amazon/efa/lib:/opt/amazon/openmpi/lib:/opt/amazon/ofi-nccl/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib
NCCL_CUMEM_ENABLE=0
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

🐛 Describe the bug

When running vLLM with tensor-parallel size > 1 on nodes with multiple H100s, some models reliably crash during engine startup with:

AttributeError: 'ShmRingBuffer' object has no attribute 'shared_memory'

This appears to stem from the multiprocessing message-queue broadcaster using POSIX shared memory. Logs show reader workers failing to attach to the shared memory segment created by the writer; later the reader crashes while accessing self.shared_memory.

Affected models

  • Consistent repro: zai-org/GLM-4.5-Air (BF16) with --tensor-parallel-size 8
  • Also seen previously: Qwen/QwQ-32B with --tensor-parallel-size 4

Minimal repro (GLM-4.5-Air BF16)

  • Slurm command (debug partition, 8 GPUs):
srun --partition=debug --nodes=1 --ntasks=1 --gres=gpu:8 --cpus-per-task=16 --mem=128G --time=40 \
  bash -lc 'cd /fsx/sander/project; \
    PORT=$(shuf -i 20000-29999 -n1); \
    timeout 1200 uv run vllm serve zai-org/GLM-4.5-Air \
      --port $PORT \
      --tensor-parallel-size 8 \
      --max-model-len 65536 \
      --gpu-memory-utilization 0.9 \
      --reasoning-parser glm45 \
      --tool-call-parser glm45 \
      --enable-auto-tool-choice \
      --max-num-batched-tokens 32768'

Result: crash during engine initialization with SHM error.

  File ".../vllm/distributed/device_communicators/shm_broadcast.py", line 507, in dequeue
    with self.acquire_read(timeout, cancel) as buf:
  File ".../contextlib.py", line 137, in __enter__
    return next(self.gen)
  File ".../vllm/distributed/device_communicators/shm_broadcast.py", line 438, in acquire_read
    with self.buffer.get_metadata(self.current_idx) as metadata_buffer:
  File ".../contextlib.py", line 137, in __enter__
    return next(self.gen)
  File ".../vllm/distributed/device_communicators/shm_broadcast.py", line 192, in get_metadata
    with memoryview(self.shared_memory.buf[start:end]) as buf:
AttributeError: 'ShmRingBuffer' object has no attribute 'shared_memory'

Accompanying resource tracker messages indicating missing SHM segments:

resource_tracker: '/psm_06b11115': [Errno 2] No such file or directory
resource_tracker: '/psm_96d4380e': [Errno 2] No such file or directory
resource_tracker: '/psm_c8893ede': [Errno 2] No such file or directory
...

Suspected cause

Race or env-specific failure in creating/propagating the POSIX SHM name across TP worker processes on H100 nodes. The code suppresses FileNotFoundError when deserializing a buffer in a different-node case, leading to a partially initialized ShmRingBuffer instance without shared_memory, which later triggers the AttributeError.

Questions

  • Any recommended workarounds?
  • Could ShmRingBuffer fail fast with a helpful error message instead?

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions