ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

Multiple vllm server not supported

Open mccatec opened this issue 11 months ago • 1 comments

Describe the bug What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图) I want to launch two gkd training jobs on a single node (both using vLLM server mode). For the job that starts first, swift rollout & swift rlhf work fine, but the job that starts later reports an “address already in use” error.

later swift rollout cmd: CUDA_VISIBLE_DEVICES=0 nohup swift rollout --model Qwen/Qwen3-0.6B/ --template qwen3_nothinking --response_prefix '\n\n\n\n' --vllm_max_model_len 20000 --max_new_tokens 4096 --vllm_gpu_memory_utilization 0.2 --port 8001

error log: (EngineCore_DP0 pid=1558904) INFO 12-03 10:27:30 [gpu_model_runner.py:3480] Graph capturing finished in 7 secs, took 0.66 GiB (EngineCore_DP0 pid=1558904) INFO 12-03 10:27:30 [core.py:210] init engine (profile, create kv cache, warmup model) took 15.98 seconds INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit) INFO: 127.0.0.1:59628 - "GET /health/ HTTP/1.1" 200 OK INFO: 127.0.0.1:59632 - "POST /close_communicator/ HTTP/1.1" 200 OK INFO: 127.0.0.1:59632 - "GET /get_world_size/ HTTP/1.1" 200 OK INFO: 127.0.0.1:59632 - "POST /init_communicator/ HTTP/1.1" 200 OK (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] Invocation of collective_rpc method failed (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] Traceback (most recent call last): (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 777, in _handle_client_request (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] result = method(*self._convert_msgspec_args(method, args)) (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 416, in collective_rpc (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] return self.model_executor.collective_rpc(method, timeout, args, (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/executor/uniproc_executor.py", line 83, in collective_rpc (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] return [run_method(self.driver_worker, method, args, kwargs)] (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/utils/init.py", line 3122, in run_method (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] return func(*args, **kwargs) (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/trl/scripts/vllm_serve.py", line 121, in init_communicator (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] pg = StatelessProcessGroup.create(host=host, port=port, rank=rank, world_size=world_size) (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/distributed/utils.py", line 397, in create (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] listen_socket.bind((host, port)) (EngineCore_DP0 pid=1558904) ERROR 12-03 10:29:14 [core.py:780] OSError: [Errno 98] Address already in use [ERROR:swift] Method execution failed: collective_rpc Traceback (most recent call last): File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/swift/llm/infer/rollout.py", line 214, in llm_worker result = method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/v1/engine/llm_engine.py", line 362, in collective_rpc return self.engine_core.collective_rpc(method, timeout, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 749, in collective_rpc return self.call_utility("collective_rpc", method, timeout, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/xx/conda/envs/codelab/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 697, in call_utility return future.result() ^^^^^^^^^^^^^^^ File "/home/xx/conda/envs/codelab/lib/python3.12/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/home/xx/conda/envs/codelab/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception Exception: Call to collective_rpc method failed: [Errno 98] Address already in use

Your hardware and system info Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等) CUDA: 12.8 system: Ubuntu 22.04 GPU: 8xH20 torch: 2.8.0+cu128

Additional context Add any other context about the problem here(在这里补充其他信息)

mccatec avatar Dec 03 '25 03:12 mccatec

--vllm_server_group_port https://github.com/modelscope/ms-swift/pull/6876

hjh0119 avatar Dec 03 '25 14:12 hjh0119