Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions vllm/entrypoints/cli/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ def run_headless(args: argparse.Namespace):
if not envs.VLLM_USE_V1:
raise ValueError("Headless mode is only supported for V1")

if engine_args.data_parallel_rank is not None:
raise ValueError("data_parallel_rank is not applicable in "
"headless mode")
Comment on lines +122 to +124
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Raising a ValueError here prevents the program from running with an invalid configuration. This is a critical check to ensure that the headless mode is used correctly and to avoid unexpected behavior or errors during runtime. Consider adding a more descriptive error message to help users understand the issue and how to resolve it.

raise ValueError("The argument 'data_parallel_rank' is not applicable in headless mode. Please ensure it is not set when running in headless mode.")


parallel_config = vllm_config.parallel_config
local_engine_count = parallel_config.data_parallel_size_local

if local_engine_count <= 0:
raise ValueError("data_parallel_size_local must be > 0 in "
"headless mode")

if parallel_config.data_parallel_rank is not None:
raise ValueError("data_parallel_rank is not applicable in "
"headless mode")

host = parallel_config.data_parallel_master_ip
port = engine_args.data_parallel_rpc_port # add to config too
handshake_address = get_tcp_uri(host, port)
Expand Down