Skip to content

Commit 4ca72c7

Browse files
committed
Raise error when using KV sharing with KV connector
Signed-off-by: Yong Hoon Shin <[email protected]>
1 parent 9e07c36 commit 4ca72c7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

vllm/attention/layer.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,19 @@ def __init__(
5858
"""
5959
super().__init__()
6060

61-
if not envs.VLLM_USE_V1:
62-
assert kv_sharing_target_layer_name is None, NotImplementedError(
63-
"KV sharing is not supported in V0.")
64-
65-
# Verify target layer is valid for cross-layer KV sharing
6661
if kv_sharing_target_layer_name is not None:
62+
if not envs.VLLM_USE_V1:
63+
raise NotImplementedError(
64+
"Cross-layer KV sharing is not supported in V0.")
65+
66+
if has_kv_transfer_group():
67+
# TODO(sarckk): look into gaps for making cross-layer
68+
# KV sharing work with KV connectors
69+
raise NotImplementedError(
70+
"Cross-layer KV sharing is not yet compatible "
71+
"with KV connector.")
72+
73+
# Verify target layer is valid for cross-layer KV sharing
6774
from vllm.model_executor.models.utils import extract_layer_index
6875
current_layer_idx = extract_layer_index(prefix)
6976
target_layer_idx = extract_layer_index(

0 commit comments

Comments
 (0)