Skip to content

Commit d484c82

Browse files
mgoinnjhill
authored andcommitted
Make sure we pop requests from connector dict
Signed-off-by: mgoin <[email protected]>
1 parent 0937419 commit d484c82

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, vllm_config: "VllmConfig", role: KVConnectorRole):
3838
temp_config.kv_transfer_config = KVTransferConfig(**ktc)
3939
self._connectors.append(
4040
KVConnectorFactory.create_connector_v1(temp_config, role))
41-
41+
4242
# A mapping from request id to the connector that is assigned to it.
4343
self._requests_to_connector: dict[str, KVConnectorBase_V1] = {}
4444

@@ -93,14 +93,13 @@ def get_num_new_matched_tokens(
9393
return toks
9494
return 0
9595

96-
9796
def update_state_after_alloc(self, request: "Request",
9897
num_external_tokens: int):
9998
# If the request is not assigned to any connector, we do nothing.
10099
if request.req_id not in self._requests_to_connector:
101100
return
102101
# We assume that the request is assigned to only one connector.
103-
c = self._requests_to_connector[request.req_id]
102+
c = self._requests_to_connector.pop(request.req_id)
104103
c.update_state_after_alloc(request, num_external_tokens)
105104

106105
def build_connector_meta(

0 commit comments

Comments
 (0)