[BugFix] Eliminate distributed test port race by switching to file:// rendezvous (#6468)
Signed-off-by: Nick Cao <ncao@redhat.com>
This commit is contained in:
1 parent
3ad64c6a12
commit
b2c9376539
11 files changed
+117
-237
No files matched your search
@@ -1,3 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
"""Server/client/runner runtime primitives for tests."""
|
||||
|
||||
import asyncio
|
||||
@@ -178,6 +181,17 @@ def get_open_port(host: str = "127.0.0.1", *, max_attempts: int = 128) -> int:
|
||||
) from last_exc
|
||||
|
||||
|
||||
def get_distributed_init_method() -> str:
|
||||
"""Return a fresh ``file://`` init_method for ``torch.distributed`` process groups.
|
||||
|
||||
Rendezvous happens through a filesystem path instead of a pre-agreed TCP port,
|
||||
so there's no bind-time race to retry around: the path is unique per call and
|
||||
the real rank-0 process is the only one that ever creates it.
|
||||
"""
|
||||
with tempfile.NamedTemporaryFile(prefix="torch_dist_init_") as f:
|
||||
return f"file://{f.name}"
|
||||
|
||||
|
||||
def dummy_messages_from_mix_data(
|
||||
system_prompt: dict[str, Any] = None,
|
||||
video_data_url: Any = None,
|
||||
|
||||
Reference in new issue
Block a user