[Mooncake] Use all HCAs on multi-NIC hosts instead of GPU-indexed RNIC selection (#43799)
Signed-off-by: Dao Le <Dao007forever@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
01d8cd92dd
commit
c1d754d681
@@ -283,94 +283,6 @@ def test_get_configured_preferred_segment_rejects_empty_override():
|
||||
rdma_utils.get_configured_preferred_segment({"preferred_segment": " "})
|
||||
|
||||
|
||||
def test_get_configured_worker_rnic_prefers_explicit_device_name(monkeypatch):
|
||||
store_config = worker.MooncakeStoreConfig(
|
||||
metadata_server="",
|
||||
local_buffer_size=1,
|
||||
protocol="rdma",
|
||||
device_name="rocep139s0",
|
||||
master_server_address="",
|
||||
)
|
||||
|
||||
assert (
|
||||
rdma_utils.get_configured_worker_rnic(
|
||||
protocol=store_config.protocol,
|
||||
configured_device=store_config.device_name,
|
||||
)
|
||||
== "rocep139s0"
|
||||
)
|
||||
|
||||
|
||||
def test_get_configured_worker_rnic_selects_device_from_explicit_csv(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
rdma_utils,
|
||||
"get_current_physical_gpu_index",
|
||||
lambda: 1,
|
||||
)
|
||||
store_config = worker.MooncakeStoreConfig(
|
||||
metadata_server="",
|
||||
local_buffer_size=1,
|
||||
protocol="rdma",
|
||||
device_name="rocep139s0,rocep140s0",
|
||||
master_server_address="",
|
||||
)
|
||||
|
||||
assert (
|
||||
rdma_utils.get_configured_worker_rnic(
|
||||
protocol=store_config.protocol,
|
||||
configured_device=store_config.device_name,
|
||||
)
|
||||
== "rocep140s0"
|
||||
)
|
||||
|
||||
|
||||
def test_get_configured_worker_rnic_warns_and_returns_empty_for_rdma_with_no_device(
|
||||
caplog, monkeypatch
|
||||
):
|
||||
"""No device configured + protocol=rdma → emit a clear warning and return ""
|
||||
so the C++ side handles auto-selection. There is no Python-side fallback."""
|
||||
monkeypatch.setattr(logging.getLogger("vllm"), "propagate", True)
|
||||
with caplog.at_level(logging.WARNING):
|
||||
result = rdma_utils.get_configured_worker_rnic(
|
||||
protocol="rdma",
|
||||
configured_device="",
|
||||
)
|
||||
assert result == ""
|
||||
warnings = [r for r in caplog.records if r.levelno == logging.WARNING]
|
||||
assert any("No RDMA devices specified" in r.message for r in warnings), (
|
||||
f"expected fallback warning, got {[r.message for r in warnings]}"
|
||||
)
|
||||
|
||||
|
||||
def test_get_configured_worker_rnic_silent_for_tcp_with_no_device(caplog, monkeypatch):
|
||||
"""protocol=tcp + no device → return "" silently (no RDMA, no warning)."""
|
||||
monkeypatch.setattr(logging.getLogger("vllm"), "propagate", True)
|
||||
with caplog.at_level(logging.WARNING):
|
||||
result = rdma_utils.get_configured_worker_rnic(
|
||||
protocol="tcp",
|
||||
configured_device="",
|
||||
)
|
||||
assert result == ""
|
||||
warnings = [r for r in caplog.records if r.levelno == logging.WARNING]
|
||||
assert not any("RDMA" in r.message for r in warnings), (
|
||||
"did not expect RDMA warning for tcp protocol, got "
|
||||
f"{[r.message for r in warnings]}"
|
||||
)
|
||||
|
||||
|
||||
def test_get_configured_worker_rnic_rejects_short_explicit_csv(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
rdma_utils,
|
||||
"get_current_physical_gpu_index",
|
||||
lambda: 2,
|
||||
)
|
||||
with pytest.raises(ValueError, match="does not cover local GPU 2"):
|
||||
rdma_utils.get_configured_worker_rnic(
|
||||
protocol="rdma",
|
||||
configured_device="rocep139s0,rocep140s0",
|
||||
)
|
||||
|
||||
|
||||
class _ReplicaDesc:
|
||||
def __init__(self, tier: str):
|
||||
self.tier = tier
|
||||
|
||||
Reference in New Issue
Block a user