File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
distributed/kv_transfer/kv_connector Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -3524,6 +3524,10 @@ class KVTransferConfig:
3524
3524
kv_connector_extra_config : dict [str , Any ] = field (default_factory = dict )
3525
3525
"""any extra config that the connector may need."""
3526
3526
3527
+ kv_connector_module_path : Optional [str ] = None
3528
+ """The Python module path to dynamically load the KV connector from.
3529
+ Only supported in V1."""
3530
+
3527
3531
def compute_hash (self ) -> str :
3528
3532
"""
3529
3533
WARNING: Whenever a new field is added to this config,
Original file line number Diff line number Diff line change @@ -58,8 +58,17 @@ def create_connector_v1(
58
58
raise ValueError ("Attempting to initialize a V1 Connector, "
59
59
f"but found { envs .VLLM_USE_V1 = } " )
60
60
61
- connector_name = config .kv_transfer_config .kv_connector
62
- connector_cls = cls ._registry [connector_name ]()
61
+ kv_transfer_config = config .kv_transfer_config
62
+ connector_name = kv_transfer_config .kv_connector
63
+ if connector_name in cls ._registry :
64
+ connector_cls = cls ._registry [connector_name ]()
65
+ else :
66
+ connector_module_path = kv_transfer_config .kv_connector_module_path
67
+ if connector_module_path is None :
68
+ raise ValueError (
69
+ f"Unsupported connector type: { connector_name } " )
70
+ connector_module = importlib .import_module (connector_module_path )
71
+ connector_cls = getattr (connector_module , connector_name )
63
72
assert issubclass (connector_cls , KVConnectorBase_V1 )
64
73
logger .info ("Creating v1 connector with name: %s" , connector_name )
65
74
# NOTE(Kuntai): v1 connector is explicitly separated into two roles.
You can’t perform that action at this time.
0 commit comments