vllm.utils.network_utils
¶
Classes:
-
ZmqListener–A supervisor-bound listener that a ZMQ socket can adopt.
Functions:
-
aiter_requires_tcp_store–AITER custom all-reduce requires a pure-TCP default store (its IPC
-
get_open_port–Get an open port for the vLLM process to listen on.
-
get_open_ports_list–Get a list of unique open ports.
-
make_zmq_listener–Bind and listen on a raw socket for later ZMQ adoption.
-
make_zmq_path–Make a ZMQ path from its parts.
-
make_zmq_socket–Make a ZMQ socket with the proper bind/connect semantics.
-
split_zmq_path–Split a zmq path into its parts.
-
zmq_socket_ctx–Context manager for a ZMQ socket.
ZmqListener
dataclass
¶
A supervisor-bound listener that a ZMQ socket can adopt.
Source code in vllm/utils/network_utils.py
_get_reserved_port_range()
¶
Ports reserved for the data parallel master process (empty if unset).
Source code in vllm/utils/network_utils.py
_get_zmq_socket_buffer_size()
¶
Choose the shared libzmq and inherited-listener buffer policy.
Source code in vllm/utils/network_utils.py
aiter_requires_tcp_store()
¶
AITER custom all-reduce requires a pure-TCP default store (its IPC
metadata exchange asserts on TCPStore); the file:// rendezvous yields a
FileStore and trips that assertion. Prefer the TCP rendezvous
(pre-#50999) for ROCm + AITER custom AR until AITER accepts FileStore.
Source code in vllm/utils/network_utils.py
get_open_port()
¶
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(count=5)
¶
Get a list of unique open ports.
When VLLM_PORT is set, scans upward from that port, advancing the start position after each find so every port is unique.
Source code in vllm/utils/network_utils.py
make_zmq_listener(path, socket_type)
¶
Bind and listen on a raw socket for later ZMQ adoption.
Source code in vllm/utils/network_utils.py
make_zmq_path(scheme, host, port=None)
¶
Make a ZMQ path from its parts.
Parameters:
-
(scheme¶str) –The ZMQ transport scheme (e.g. tcp, ipc, inproc).
-
(host¶str) –The host - can be an IPv4 address, IPv6 address, or hostname.
-
(port¶int | None, default:None) –Optional port number, only used for TCP sockets.
Returns:
-
str–A properly formatted ZMQ path string.
Source code in vllm/utils/network_utils.py
make_zmq_socket(ctx, path, socket_type, bind=None, identity=None, linger=None, router_handover=False, listener=None)
¶
Make a ZMQ socket with the proper bind/connect semantics.
When supplied, listener is detached and its fd moves to libzmq.
Source code in vllm/utils/network_utils.py
split_zmq_path(path)
¶
Split a zmq path into its parts.
Source code in vllm/utils/network_utils.py
zmq_socket_ctx(path, socket_type, bind=None, linger=0, identity=None, router_handover=False)
¶
Context manager for a ZMQ socket.