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
0d6e187e
Unverified
Commit
0d6e187e
authored
Apr 24, 2025
by
jglaser
Committed by
GitHub
Apr 25, 2025
Browse files
Use custom address for listening socket (#15988)
Signed-off-by:
Jens Glaser
<
glaserj@ornl.gov
>
parent
9420a1fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
vllm/distributed/utils.py
vllm/distributed/utils.py
+21
-1
No files found.
vllm/distributed/utils.py
View file @
0d6e187e
...
...
@@ -7,6 +7,7 @@
import
dataclasses
import
datetime
import
pickle
import
socket
import
time
from
collections
import
deque
from
typing
import
Any
,
Deque
,
Dict
,
Optional
,
Sequence
,
Tuple
...
...
@@ -123,6 +124,10 @@ class StatelessProcessGroup:
rank
:
int
world_size
:
int
store
:
torch
.
_C
.
_distributed_c10d
.
Store
# stores a reference to the socket so that the file descriptor stays alive
socket
:
Optional
[
socket
.
socket
]
data_expiration_seconds
:
int
=
3600
# 1 hour
# dst rank -> counter
...
...
@@ -234,18 +239,33 @@ class StatelessProcessGroup:
can call `StatelessProcessGroup.create` to form a group, and then process A, B,
C, and D can call `StatelessProcessGroup.create` to form another group.
"""
# noqa
launch_server
=
rank
==
0
if
launch_server
:
# listen on the specified interface (instead of 0.0.0.0)
listen_socket
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
listen_socket
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
1
)
listen_socket
.
bind
((
host
,
port
))
listen_socket
.
listen
()
listen_fd
=
listen_socket
.
fileno
()
else
:
listen_socket
=
None
listen_fd
=
None
store
=
TCPStore
(
host_name
=
host
,
port
=
port
,
world_size
=
world_size
,
is_master
=
(
rank
==
0
)
,
is_master
=
launch_server
,
timeout
=
datetime
.
timedelta
(
seconds
=
store_timeout
),
use_libuv
=
False
,
# for now: github.com/pytorch/pytorch/pull/150215
master_listen_fd
=
listen_fd
,
)
return
StatelessProcessGroup
(
rank
=
rank
,
world_size
=
world_size
,
store
=
store
,
socket
=
listen_socket
,
data_expiration_seconds
=
data_expiration_seconds
)
...
...
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