A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 5, 11:00 UTC
[KVConnector]: prioritize external connector over internal registry (#38301)
Signed-off-by: baoloongmao <baoloongmao@tencent.com> Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
maobaolong committed
Apr 7, 2026 at 23:03 UTC
729eb59f60866d3f7c94b0f6fed05b73eef9f7bb
1 file changed
+9
-6
vllm/distributed/kv_transfer/kv_connector/factory.py
+9
-6
@@ -107,12 +107,11 @@ class KVConnectorFactory:
107
if connector_name is None:
108
raise ValueError("Connector name is not set in KVTransferConfig")
109
compat_sig = False
110
- if connector_name in cls._registry:
111
- connector_cls = cls._registry[connector_name]()
112
- else:
113
- connector_module_path = kv_transfer_config.kv_connector_module_path
114
- if connector_module_path is None:
115
- raise ValueError(f"Unsupported connector type: {connector_name}")
110
+ connector_module_path = kv_transfer_config.kv_connector_module_path
111
+ if connector_module_path is not None and not connector_module_path:
112
+ raise ValueError("kv_connector_module_path cannot be an empty string.")
113
+ if connector_module_path:
114
+ # External module path takes priority over internal registry.
115
connector_module = importlib.import_module(connector_module_path)
116
try:
117
connector_cls = getattr(connector_module, connector_name)
@@ -128,6 +127,10 @@ class KVConnectorFactory:
127
"Please update to include kv_cache_config as the second argument.",
128
connector_cls.__name__,
129
)
130
+ elif connector_name in cls._registry:
131
+ connector_cls = cls._registry[connector_name]()
132
+ else:
133
+ raise ValueError(f"Unsupported connector type: {connector_name}")
134
return connector_cls, compat_sig
135
136
@classmethod