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
dynamo
Commits
51e2c8cb
Unverified
Commit
51e2c8cb
authored
Jun 02, 2025
by
ptarasiewiczNV
Committed by
GitHub
Jun 02, 2025
Browse files
fix: Properly set VLLM_NIXL_SIDE_CHANNEL_HOST in multi-node (#1327)
parent
3ef77619
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
examples/vllm_v1/components/worker.py
examples/vllm_v1/components/worker.py
+9
-2
No files found.
examples/vllm_v1/components/worker.py
View file @
51e2c8cb
...
@@ -40,7 +40,7 @@ class VllmBaseWorker:
...
@@ -40,7 +40,7 @@ class VllmBaseWorker:
signal
.
signal
(
signal
.
SIGTERM
,
self
.
shutdown_vllm_engine
)
signal
.
signal
(
signal
.
SIGTERM
,
self
.
shutdown_vllm_engine
)
signal
.
signal
(
signal
.
SIGINT
,
self
.
shutdown_vllm_engine
)
signal
.
signal
(
signal
.
SIGINT
,
self
.
shutdown_vllm_engine
)
self
.
set_side_channel_port
()
self
.
set_side_channel_
host_and_
port
()
async
def
async_init
(
self
):
async
def
async_init
(
self
):
self
.
_engine_context
=
build_async_engine_client_from_engine_args
(
self
.
_engine_context
=
build_async_engine_client_from_engine_args
(
...
@@ -74,6 +74,7 @@ class VllmBaseWorker:
...
@@ -74,6 +74,7 @@ class VllmBaseWorker:
)
)
async
for
response
in
gen
:
async
for
response
in
gen
:
logger
.
debug
(
f
"Response kv_transfer_params:
{
response
.
kv_transfer_params
}
"
)
yield
MyRequestOutput
(
yield
MyRequestOutput
(
request_id
=
response
.
request_id
,
request_id
=
response
.
request_id
,
prompt
=
response
.
prompt
,
prompt
=
response
.
prompt
,
...
@@ -85,14 +86,20 @@ class VllmBaseWorker:
...
@@ -85,14 +86,20 @@ class VllmBaseWorker:
kv_transfer_params
=
response
.
kv_transfer_params
,
kv_transfer_params
=
response
.
kv_transfer_params
,
).
model_dump_json
()
).
model_dump_json
()
def
set_side_channel_port
(
self
,
port
:
Optional
[
int
]
=
None
):
def
set_side_channel_host_and_port
(
self
,
hostname
:
Optional
[
str
]
=
None
,
port
:
Optional
[
int
]
=
None
):
"""vLLM V1 NixlConnector creates a side channel to exchange metadata with other NIXL connectors.
"""vLLM V1 NixlConnector creates a side channel to exchange metadata with other NIXL connectors.
This sets the port number for the side channel.
This sets the port number for the side channel.
"""
"""
if
hostname
is
None
:
hostname
=
socket
.
gethostname
()
if
port
is
None
:
if
port
is
None
:
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
s
:
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
s
:
s
.
bind
((
""
,
0
))
# Bind to a free port provided by the host.
s
.
bind
((
""
,
0
))
# Bind to a free port provided by the host.
port
=
s
.
getsockname
()[
1
]
# Get the port number assigned.
port
=
s
.
getsockname
()[
1
]
# Get the port number assigned.
logger
.
debug
(
"Setting VLLM_NIXL_SIDE_CHANNEL_HOST to %s"
,
hostname
)
os
.
environ
[
"VLLM_NIXL_SIDE_CHANNEL_HOST"
]
=
hostname
logger
.
debug
(
"Setting VLLM_NIXL_SIDE_CHANNEL_PORT to %s"
,
port
)
logger
.
debug
(
"Setting VLLM_NIXL_SIDE_CHANNEL_PORT to %s"
,
port
)
os
.
environ
[
"VLLM_NIXL_SIDE_CHANNEL_PORT"
]
=
str
(
port
)
os
.
environ
[
"VLLM_NIXL_SIDE_CHANNEL_PORT"
]
=
str
(
port
)
...
...
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