vllm - ✅(Solved) Fix [Bug] MultiConnector bypasses the deprecated-signature shim and breaks old-style child connectors [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#40690Fetched 2026-04-24 05:52:07
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×2cross-referenced ×1referenced ×1

MultiConnector.__init__ instantiates its child connectors by calling connector_cls(...) directly, bypassing the backward-compat shim that KVConnectorFactory.create_connector / _get_connector_class_with_compat added in #27887. As a result, any legacy connector whose __init__ still has the pre-#27887 signature (self, vllm_config, role) fails with TypeError the moment it is placed inside a MultiConnector, even though the same connector works fine when used as a top-level connector (where it only produces the expected deprecated signature warning).

Error Message

Traceback:

Root Cause

#27887 added kv_cache_config as a third __init__ argument and, in factory.py, a two-step shim:

  1. _get_connector_class_with_compat probes the class with supports_kw(connector_cls, \"kv_cache_config\"), returns compat_sig=True for old-style classes, emits the deprecation warning.
  2. create_connector branches on that flag and calls either connector_cls(config, role) or connector_cls(config, role, kv_cache_config).

The same PR updated multi_connector.py to forward 3 args to children but did not route children through create_connector / the shim. The current child-instantiation line is:

```python

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

self._connectors.append(connector_cls(temp_config, role, kv_cache_config)) ```

Fix Action

Workaround

Patch the legacy connector's signature locally to accept kv_cache_config=None. This keeps LMCache-Ascend working until upstream adapters catch up with 0.11.1+.

PR fix notes

PR #40702: [Bugfix][KVConnector] Fix MultiConnector bypassing compat shim for legacy child connectors

Description (problem / solution / changelog)

What's the problem?

MultiConnector.__init__ instantiates child connectors by calling connector_cls(config, role, kv_cache_config) directly. This means any child connector that still uses the pre-#27887 two-argument __init__(self, vllm_config, role) crashes with:

TypeError: __init__() takes 3 positional arguments but 4 were given

The same connector works fine at the top level because top-level construction goes through KVConnectorFactory.create_connector, which probes for kv_cache_config support and dispatches accordingly. MultiConnector skipped that path entirely.

Fix

Replace the direct connector_cls(...) call with KVConnectorFactory.create_connector(temp_config, role, kv_cache_config) so children get the same compat detection as top-level connectors. KVConnectorFactory was already imported in multi_connector.py - no new dependencies.

Tests

Added two regression tests to test_backwards_compatibility.py:

  • test_multiconnector_old_style_child_instantiation - a legacy 2-arg connector works as a MultiConnector child (raised TypeError before this fix)
  • test_multiconnector_new_style_child_unaffected - a modern 3-arg child still receives kv_cache_config correctly

Notes

  • The extra Creating v1 connector... log line per child is expected and informational.
  • The HMA check in create_connector is a no-op here because --kv-transfer-config disables the hybrid KV cache manager automatically.

Fixes #40690

Changed files

  • tests/v1/kv_connector/unit/test_backwards_compatibility.py (modified, +92/-0)
  • vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py (modified, +28/-16)
RAW_BUFFERClick to expand / collapse

Summary

MultiConnector.__init__ instantiates its child connectors by calling connector_cls(...) directly, bypassing the backward-compat shim that KVConnectorFactory.create_connector / _get_connector_class_with_compat added in #27887. As a result, any legacy connector whose __init__ still has the pre-#27887 signature (self, vllm_config, role) fails with TypeError the moment it is placed inside a MultiConnector, even though the same connector works fine when used as a top-level connector (where it only produces the expected deprecated signature warning).

Environment

  • vLLM: 0.18.0 (also reproduced against current main, commit bf45e6d0a)
  • Reproducing connector: LMCacheAscendConnectorV1Dynamic from LMCache-Ascend (tracks vLLM ≤ 0.11.0, still uses the 2-arg signature)

Repro

--kv-transfer-config with a MultiConnector that wraps a legacy 2-arg connector:

```json { "kv_connector": "MultiConnector", "kv_role": "kv_producer", "engine_id": "0", "kv_connector_extra_config": { "connectors": [ {"kv_connector": "LMCacheAscendConnectorV1Dynamic", "kv_role": "kv_both", "kv_connector_module_path": "lmcache_ascend.integration.vllm.lmcache_ascend_connector_v1", "kv_connector_extra_config": {"lmcache_rpc_port": "lmcache_p"}}, {"kv_connector": "MooncakeConnectorV1", "kv_role": "kv_producer", "kv_port": "30000"} ] } } ```

Traceback:

``` File ".../vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py", line 166, in init self._connectors.append(connector_cls(temp_config, role, kv_cache_config)) TypeError: LMCacheAscendConnectorV1Dynamic.init() takes 3 positional arguments but 4 were given ```

Right before the TypeError, the factory-level shim does log the expected deprecation warning for the same class:

``` WARNING factory.py:126 Connector LMCacheAscendConnectorV1Dynamic uses deprecated signature with 2 required arguments. Please update to include kv_cache_config as the second argument. ```

So the compat machinery exists and fires correctly at the factory level; MultiConnector just does not use it.

Root cause

#27887 added kv_cache_config as a third __init__ argument and, in factory.py, a two-step shim:

  1. _get_connector_class_with_compat probes the class with supports_kw(connector_cls, \"kv_cache_config\"), returns compat_sig=True for old-style classes, emits the deprecation warning.
  2. create_connector branches on that flag and calls either connector_cls(config, role) or connector_cls(config, role, kv_cache_config).

The same PR updated multi_connector.py to forward 3 args to children but did not route children through create_connector / the shim. The current child-instantiation line is:

```python

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

self._connectors.append(connector_cls(temp_config, role, kv_cache_config)) ```

Proposed fix

Route child-connector construction through KVConnectorFactory.create_connector so the shim applies uniformly:

```python from vllm.distributed.kv_transfer.kv_connector.factory import KVConnectorFactory

instead of: connector_cls(temp_config, role, kv_cache_config)

self._connectors.append( KVConnectorFactory.create_connector(temp_config, role, kv_cache_config) ) ```

This has two side effects to consider, both benign in practice:

  • an extra Creating v1 connector ... log line per child (informational);
  • the hma_enabled check inside create_connector will run, but when --kv-transfer-config is set vLLM already disables the hybrid KV cache manager, so the check does not fire.

Happy to send a PR if the direction is acceptable.

Workaround

Patch the legacy connector's signature locally to accept kv_cache_config=None. This keeps LMCache-Ascend working until upstream adapters catch up with 0.11.1+.

extent analysis

TL;DR

The most likely fix is to route child-connector construction through KVConnectorFactory.create_connector to apply the backward-compat shim uniformly.

Guidance

  • Identify the MultiConnector class and update its __init__ method to use KVConnectorFactory.create_connector for instantiating child connectors.
  • Verify that the KVConnectorFactory.create_connector method is correctly handling the legacy connector's signature by checking for the deprecation warning.
  • Consider patching the legacy connector's signature locally to accept kv_cache_config=None as a temporary workaround.
  • Review the KVConnectorFactory.create_connector method to ensure it is correctly branching on the compat_sig flag to call the child connector with the correct arguments.

Example

from vllm.distributed.kv_transfer.kv_connector.factory import KVConnectorFactory

# instead of: connector_cls(temp_config, role, kv_cache_config)
self._connectors.append(
    KVConnectorFactory.create_connector(temp_config, role, kv_cache_config)
)

Notes

This fix assumes that the KVConnectorFactory.create_connector method is correctly implemented and handles the legacy connector's signature. Additionally, this fix may introduce extra log lines and checks, but they are benign in practice.

Recommendation

Apply the proposed fix by routing child-connector construction through KVConnectorFactory.create_connector. This ensures that the backward-compat shim is applied uniformly and fixes the TypeError issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING