[Bugfix][NIXL] Include transfer mode (push/pull) in the compatibility hash (#50620)

Signed-off-by: Tzu-Ling <tzulingk@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tzu-Ling Kan
2026-08-14 12:11:22 +08:00
committed by GitHub
co-authored by Claude Opus 4.8
parent c05d75aaa9
commit 653cc6faca
8 changed files with 76 additions and 3 deletions
@@ -433,6 +433,9 @@ def test_kv_transfer_handshake(dist_init):
)
)
assert delay
# Pull connector advertises its transfer mode in kv_transfer_params so
# an external router can distinguish it from a push producer.
assert kv_connector_metadata["transfer_mode"] == "pull"
# Decode connector will be able to create handshake with the prefill connector.
decode_connector = NixlConnector(
@@ -2906,6 +2909,42 @@ def test_speculative_attention_backend_not_in_compatibility_hash():
assert local_hash == remote_hash
@pytest.mark.skip_global_cleanup
def test_transfer_mode_changes_compatibility_hash():
# push (WRITE) and pull (READ) connectors use incompatible transfer
# protocols, so their compatibility hashes must differ; identical modes
# must match. The default mode is pull.
config = create_vllm_config()
pull_hash = compute_nixl_compatibility_hash(
config, "FLASH_ATTN", False, transfer_mode="pull"
)
push_hash = compute_nixl_compatibility_hash(
config, "FLASH_ATTN", False, transfer_mode="push"
)
assert pull_hash != push_hash
assert pull_hash == compute_nixl_compatibility_hash(
config, "FLASH_ATTN", False, transfer_mode="pull"
)
assert compute_nixl_compatibility_hash(config, "FLASH_ATTN", False) == pull_hash
@pytest.mark.skip_global_cleanup
def test_scheduler_advertises_transfer_mode():
# Each scheduler advertises its transfer mode in kv_transfer_params so an
# external router can route pull (READ) vs push (WRITE) producers.
from vllm.distributed.kv_transfer.kv_connector.v1.nixl.pull_scheduler import (
NixlPullConnectorScheduler,
)
from vllm.distributed.kv_transfer.kv_connector.v1.nixl.push_scheduler import (
NixlPushConnectorScheduler,
)
assert NixlPullConnectorScheduler._TRANSFER_MODE == "pull"
assert NixlPushConnectorScheduler._TRANSFER_MODE == "push"
@pytest.mark.parametrize(
"mismatch_type,config_overrides,version_override,should_fail,enforce_handshake_compat",
[