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
e44d8ce8
Unverified
Commit
e44d8ce8
authored
May 22, 2025
by
lkchen
Committed by
GitHub
May 23, 2025
Browse files
[Bugfix] Set `KVTransferConfig.engine_id` in post_init (#18576)
Signed-off-by:
Linkun Chen
<
github@lkchen.net
>
parent
93ecb813
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
tests/v1/kv_connector/unit/test_multi_connector.py
tests/v1/kv_connector/unit/test_multi_connector.py
+8
-0
vllm/config.py
vllm/config.py
+4
-1
vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py
...distributed/kv_transfer/kv_connector/v1/nixl_connector.py
+1
-0
No files found.
tests/v1/kv_connector/unit/test_multi_connector.py
View file @
e44d8ce8
...
...
@@ -239,3 +239,11 @@ def get_connector_events() -> dict[str, list[str]]:
print
(
f
"[ERROR] Could not read connector events for
{
name
}
:
{
e
}
"
)
return
connector_events
def
test_engine_id_conflict
():
configs
=
[
KVTransferConfig
()
for
_
in
range
(
2
)]
ids
=
[
config
.
engine_id
for
config
in
configs
]
assert
ids
[
0
]
!=
ids
[
1
],
(
"Engine IDs should be different for different configs. "
f
"Got
{
ids
}
"
)
vllm/config.py
View file @
e44d8ce8
...
...
@@ -3495,7 +3495,7 @@ class KVTransferConfig:
"""The KV connector for vLLM to transmit KV caches between vLLM instances.
"""
engine_id
:
str
=
str
(
uuid
.
uuid4
())
engine_id
:
Optional
[
str
]
=
None
"""The engine id for KV transfers."""
kv_buffer_device
:
Optional
[
str
]
=
"cuda"
...
...
@@ -3552,6 +3552,9 @@ class KVTransferConfig:
return
hash_str
def
__post_init__
(
self
)
->
None
:
if
self
.
engine_id
is
None
:
self
.
engine_id
=
str
(
uuid
.
uuid4
())
if
self
.
kv_role
is
not
None
and
self
.
kv_role
not
in
get_args
(
KVRole
):
raise
ValueError
(
f
"Unsupported kv_role:
{
self
.
kv_role
}
. "
f
"Supported roles are
{
get_args
(
KVRole
)
}
"
)
...
...
vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py
View file @
e44d8ce8
...
...
@@ -537,6 +537,7 @@ class NixlConnectorWorker:
def
add_remote_agent
(
self
,
nixl_agent_meta
:
NixlAgentMetadata
):
engine_id
=
nixl_agent_meta
.
engine_id
assert
engine_id
!=
self
.
engine_id
,
"Conflict engine id found!"
if
engine_id
in
self
.
_remote_agents
:
return
...
...
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