vllm.utils.network_utils ¶
_get_open_port ¶
_get_open_port() -> int
Source code in vllm/utils/network_utils.py
find_process_using_port ¶
Source code in vllm/utils/network_utils.py
get_distributed_init_method ¶
get_ip ¶
get_ip() -> str
Source code in vllm/utils/network_utils.py
get_loopback_ip ¶
get_loopback_ip() -> str
Source code in vllm/utils/network_utils.py
get_open_port ¶
get_open_port() -> int
Get an open port for the vLLM process to listen on. An edge case to handle, is when we run data parallel, we need to avoid ports that are potentially used by the data parallel master process. Right now we reserve 10 ports for the data parallel master process. Currently it uses 2 ports.
Source code in vllm/utils/network_utils.py
get_open_ports_list ¶
get_tcp_uri ¶
is_valid_ipv6_address ¶
join_host_port ¶
make_zmq_path ¶
Make a ZMQ path from its parts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scheme | str | The ZMQ transport scheme (e.g. tcp, ipc, inproc). | required |
host | str | The host - can be an IPv4 address, IPv6 address, or hostname. | required |
port | int | None | Optional port number, only used for TCP sockets. | None |
Returns:
Type | Description |
---|---|
str | A properly formatted ZMQ path string. |
Source code in vllm/utils/network_utils.py
make_zmq_socket ¶
make_zmq_socket(
ctx: Context | Context,
path: str,
socket_type: Any,
bind: bool | None = None,
identity: bytes | None = None,
linger: int | None = None,
) -> Socket | Socket
Make a ZMQ socket with the proper bind/connect semantics.
Source code in vllm/utils/network_utils.py
split_host_port ¶
Source code in vllm/utils/network_utils.py
split_zmq_path ¶
Split a zmq path into its parts.
Source code in vllm/utils/network_utils.py
test_loopback_bind ¶
zmq_socket_ctx ¶
zmq_socket_ctx(
path: str,
socket_type: Any,
bind: bool | None = None,
linger: int = 0,
identity: bytes | None = None,
) -> Iterator[Socket]
Context manager for a ZMQ socket