Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
b05f5c92
Unverified
Commit
b05f5c92
authored
Sep 23, 2024
by
Russell Bryant
Committed by
GitHub
Sep 23, 2024
Browse files
[Core] Allow IPv6 in VLLM_HOST_IP with zmq (#8575)
Signed-off-by:
Russell Bryant
<
rbryant@redhat.com
>
parent
9b0e3ec9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
vllm/distributed/device_communicators/shm_broadcast.py
vllm/distributed/device_communicators/shm_broadcast.py
+6
-1
vllm/utils.py
vllm/utils.py
+9
-0
No files found.
vllm/distributed/device_communicators/shm_broadcast.py
View file @
b05f5c92
...
@@ -9,11 +9,12 @@ from unittest.mock import patch
...
@@ -9,11 +9,12 @@ from unittest.mock import patch
import
torch
import
torch
import
torch.distributed
as
dist
import
torch.distributed
as
dist
from
torch.distributed
import
ProcessGroup
from
torch.distributed
import
ProcessGroup
from
zmq
import
IPV6
# type: ignore
from
zmq
import
SUB
,
SUBSCRIBE
,
XPUB
,
XPUB_VERBOSE
,
Context
# type: ignore
from
zmq
import
SUB
,
SUBSCRIBE
,
XPUB
,
XPUB_VERBOSE
,
Context
# type: ignore
import
vllm.envs
as
envs
import
vllm.envs
as
envs
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
from
vllm.utils
import
get_ip
,
get_open_port
from
vllm.utils
import
get_ip
,
get_open_port
,
is_valid_ipv6_address
VLLM_RINGBUFFER_WARNING_INTERVAL
=
envs
.
VLLM_RINGBUFFER_WARNING_INTERVAL
VLLM_RINGBUFFER_WARNING_INTERVAL
=
envs
.
VLLM_RINGBUFFER_WARNING_INTERVAL
...
@@ -214,6 +215,8 @@ class MessageQueue:
...
@@ -214,6 +215,8 @@ class MessageQueue:
self
.
remote_socket
=
context
.
socket
(
XPUB
)
self
.
remote_socket
=
context
.
socket
(
XPUB
)
self
.
remote_socket
.
setsockopt
(
XPUB_VERBOSE
,
True
)
self
.
remote_socket
.
setsockopt
(
XPUB_VERBOSE
,
True
)
remote_subscribe_port
=
get_open_port
()
remote_subscribe_port
=
get_open_port
()
if
is_valid_ipv6_address
(
connect_ip
):
self
.
remote_socket
.
setsockopt
(
IPV6
,
1
)
socket_addr
=
f
"tcp://*:
{
remote_subscribe_port
}
"
socket_addr
=
f
"tcp://*:
{
remote_subscribe_port
}
"
self
.
remote_socket
.
bind
(
socket_addr
)
self
.
remote_socket
.
bind
(
socket_addr
)
...
@@ -274,6 +277,8 @@ class MessageQueue:
...
@@ -274,6 +277,8 @@ class MessageQueue:
self
.
remote_socket
=
context
.
socket
(
SUB
)
self
.
remote_socket
=
context
.
socket
(
SUB
)
self
.
remote_socket
.
setsockopt_string
(
SUBSCRIBE
,
""
)
self
.
remote_socket
.
setsockopt_string
(
SUBSCRIBE
,
""
)
if
is_valid_ipv6_address
(
handle
.
connect_ip
):
self
.
remote_socket
.
setsockopt
(
IPV6
,
1
)
socket_addr
=
f
"tcp://
{
handle
.
connect_ip
}
:
{
handle
.
remote_subscribe_port
}
"
socket_addr
=
f
"tcp://
{
handle
.
connect_ip
}
:
{
handle
.
remote_subscribe_port
}
"
logger
.
debug
(
"Connecting to %s"
,
socket_addr
)
logger
.
debug
(
"Connecting to %s"
,
socket_addr
)
self
.
remote_socket
.
connect
(
socket_addr
)
self
.
remote_socket
.
connect
(
socket_addr
)
...
...
vllm/utils.py
View file @
b05f5c92
...
@@ -5,6 +5,7 @@ import datetime
...
@@ -5,6 +5,7 @@ import datetime
import
enum
import
enum
import
gc
import
gc
import
inspect
import
inspect
import
ipaddress
import
os
import
os
import
random
import
random
import
socket
import
socket
...
@@ -533,6 +534,14 @@ def get_ip() -> str:
...
@@ -533,6 +534,14 @@ def get_ip() -> str:
return
"0.0.0.0"
return
"0.0.0.0"
def
is_valid_ipv6_address
(
address
:
str
)
->
bool
:
try
:
ipaddress
.
IPv6Address
(
address
)
return
True
except
ValueError
:
return
False
def
get_distributed_init_method
(
ip
:
str
,
port
:
int
)
->
str
:
def
get_distributed_init_method
(
ip
:
str
,
port
:
int
)
->
str
:
# Brackets are not permitted in ipv4 addresses,
# Brackets are not permitted in ipv4 addresses,
# see https://github.com/python/cpython/issues/103848
# see https://github.com/python/cpython/issues/103848
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment