Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ZMQError: Address already in use (addr='tcp://127.0.0.1:5570') #7196

Closed
WMeng1 opened this issue Aug 6, 2024 · 14 comments
Closed

[Bug]: ZMQError: Address already in use (addr='tcp://127.0.0.1:5570') #7196

WMeng1 opened this issue Aug 6, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@WMeng1
Copy link

WMeng1 commented Aug 6, 2024

Your current environment

PyTorch version: 2.4.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: 10.0.0-4ubuntu1
CMake version: version 3.30.0
Libc version: glibc-2.31

Python version: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.4.0-187-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 10.1.243
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: Tesla V100-SXM2-32GB
GPU 1: Tesla V100-SXM2-32GB
GPU 2: Tesla V100-SXM2-32GB
GPU 3: Tesla V100-SXM2-32GB
GPU 4: Tesla V100-SXM2-32GB
GPU 5: Tesla V100-SXM2-32GB
GPU 6: Tesla V100-SXM2-32GB
GPU 7: Tesla V100-SXM2-32GB

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

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      46 bits physical, 48 bits virtual
CPU(s):                             64
On-line CPU(s) list:                0-63
Thread(s) per core:                 2
Core(s) per socket:                 16
Socket(s):                          2
NUMA node(s):                       2
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              85
Model name:                         Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz
Stepping:                           7
CPU MHz:                            1200.045
CPU max MHz:                        3900.0000
CPU min MHz:                        1200.0000
BogoMIPS:                           5800.00
Virtualization:                     VT-x
L1d cache:                          1 MiB
L1i cache:                          1 MiB
L2 cache:                           32 MiB
L3 cache:                           44 MiB
NUMA node0 CPU(s):                  0-15,32-47
NUMA node1 CPU(s):                  16-31,48-63
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit:        KVM: Mitigation: Split huge pages
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:             Mitigation; Enhanced IBRS
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI Vulnerable, KVM SW loop
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Mitigation; TSX disabled
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni md_clear flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] torch==2.4.0
[pip3] torchvision==0.19.0
[pip3] transformers==4.43.3
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
[conda] torch                     2.4.0                    pypi_0    pypi
[conda] torchvision               0.19.0                   pypi_0    pypi
[conda] transformers              4.43.3                   pypi_0    pypi
[conda] triton                    2.3.1                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.5.4
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    NIC0    NIC1    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV2     NV2     NV1     NV1     SYS     SYS     SYS     SYS     SYS     0-15,32-47      0               N/A
GPU1    NV2      X      NV1     NV1     SYS     NV2     SYS     SYS     SYS     SYS     0-15,32-47      0               N/A
GPU2    NV2     NV1      X      NV2     SYS     SYS     NV1     SYS     SYS     SYS     0-15,32-47      0               N/A
GPU3    NV1     NV1     NV2      X      SYS     SYS     SYS     NV2     SYS     SYS     0-15,32-47      0               N/A
GPU4    NV1     SYS     SYS     SYS      X      NV2     NV2     NV1     PIX     PIX     16-31,48-63     1               N/A
GPU5    SYS     NV2     SYS     SYS     NV2      X      NV1     NV1     PIX     PIX     16-31,48-63     1               N/A
GPU6    SYS     SYS     NV1     SYS     NV2     NV1      X      NV2     PIX     PIX     16-31,48-63     1               N/A
GPU7    SYS     SYS     SYS     NV2     NV1     NV1     NV2      X      PIX     PIX     16-31,48-63     1               N/A
NIC0    SYS     SYS     SYS     SYS     PIX     PIX     PIX     PIX      X      PIX
NIC1    SYS     SYS     SYS     SYS     PIX     PIX     PIX     PIX     PIX      X

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

NIC Legend:

  NIC0: mlx5_0
  NIC1: mlx5_1

🐛 Describe the bug

export CUDA_VISIBLE_DEVICES=1
nohup python -m vllm.entrypoints.openai.api_server \
--model /PROJECT/model/1/ \
--trust_remote_code \
--dtype half \
--host 127.0.0.1 \
--port 8000 \
--tensor-parallel-size 1 > 1_vllm.log 2>&1 &

sleep 10
export CUDA_VISIBLE_DEVICES=3
nohup python -m vllm.entrypoints.openai.api_server \
--model /PROJECT/model/2/ \
--trust_remote_code \
--dtype half \
--host 127.0.0.1 \
--port 8003 \
--tensor-parallel-size 1 > 2_vllm.log 2>&1 &

when I bash xxx.sh like this, the first server start successful. But the second will break and error message is:

Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/vllm/entrypoints/openai/rpc/server.py", line 217, in run_rpc_server
    server = AsyncEngineRPCServer(async_engine_args, usage_context, port)
  File "/usr/local/lib/python3.10/dist-packages/vllm/entrypoints/openai/rpc/server.py", line 35, in __init__
    self.socket.bind(f"tcp://127.0.0.1:{port}")
  File "/usr/local/lib/python3.10/dist-packages/zmq/sugar/socket.py", line 311, in bind
    super().bind(addr)
  File "_zmq.py", line 917, in zmq.backend.cython._zmq.Socket.bind
  File "_zmq.py", line 179, in zmq.backend.cython._zmq._check_rc
zmq.error.ZMQError: Address already in use (addr='tcp://127.0.0.1:5570')

I'm not sure where the problem is, maybe at line 110 here? vllm/entrypoints/openai/rpc/server.py line:110
port = get_open_port(envs.VLLM_RPC_PORT)?

@WMeng1 WMeng1 added the bug Something isn't working label Aug 6, 2024
@robertgshaw2-neuralmagic
Copy link
Collaborator

So you have two versions of vllm running on the same machine?

@robertgshaw2-neuralmagic
Copy link
Collaborator

I will look into this

@robertgshaw2-neuralmagic
Copy link
Collaborator

In the meantime, you can fall back to the old front end by running with --disable-frontend-multiprocessing

@ccdv-ai
Copy link

ccdv-ai commented Aug 6, 2024

Got the same problem, came with ZMQ integration.

@robertgshaw2-neuralmagic
Copy link
Collaborator

@ccdv-ai can you share any additional information about your setup?

Also - does --disable-frontend-multiprocessing solve your issue for now?

@ccdv-ai
Copy link

ccdv-ai commented Aug 6, 2024

tested with v5.4.0, 4 x L40

python -u -m vllm.entrypoints.openai.api_server \
    --host 0.0.0.0 \
    --model models/Mistral-Large-Instruct-2407-AWQ \
    --dtype "auto" \
    --port 8000 \
    --seed 123 \
    --max-model-len 32768 \
    --gpu-memory-utilization 0.90 \
    --tensor-parallel-size 4 \
    --max-num-seqs 32 \
    --use-v2-block-manager \
    --max-log-len 20 \
    --enforce-eager \
    --served-model-name mistral

Have to change the port each time I kill the vllm server because the port isn't released.
Can't test the --disable-frontend-multiprocessing command right now but pretty sure it came with #6883 .
I built the package from source 1 week ago and it was working.

Also got a ZMQError: Too many open files error once, will probably open another issue.

No problem with v5.3.post1

@robertgshaw2-neuralmagic
Copy link
Collaborator

@ccdv-ai are you setting any environment variables? I have been unable to reproduce your issue so far

@robertgshaw2-neuralmagic
Copy link
Collaborator

Specifically, did you set VLLM_PORT or VLLM_RPC_PORT?

@robertgshaw2-neuralmagic
Copy link
Collaborator

robertgshaw2-neuralmagic commented Aug 6, 2024

This will resolve any issues associated with setting VLLM_PORT -> #7205

@robertgshaw2-neuralmagic
Copy link
Collaborator

@WMeng1 I have reproduced your report. Working on a fix.

@youkaichao
Copy link
Member

fixed by #7205

@robertgshaw2-neuralmagic
Copy link
Collaborator

Needs #7222 to land.

@robertgshaw2-neuralmagic
Copy link
Collaborator

Closing because #7222 landed

@hovhannescognaize
Copy link

Hi guys, is this fix already in dockerhub?
I am still getting this error using https://hub.docker.com/layers/vllm/vllm-openai/v0.5.4/images/sha256-7ab0cf7b287876cec65752a1b7ac99790ecd2a609da80c4d1dd1fbeaf987abf6?context=explore image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants