2024-06-11 10:53:59 -07:00
|
|
|
import os
|
|
|
|
|
|
|
|
import torch
|
|
|
|
|
2024-07-09 18:49:11 -07:00
|
|
|
from vllm.distributed.parallel_state import in_the_same_node_as
|
2024-06-11 10:53:59 -07:00
|
|
|
|
|
|
|
torch.distributed.init_process_group(backend="gloo")
|
2024-07-09 18:49:11 -07:00
|
|
|
test_result = all(
|
|
|
|
in_the_same_node_as(torch.distributed.group.WORLD, source_rank=0))
|
2024-06-11 10:53:59 -07:00
|
|
|
|
|
|
|
expected = os.environ.get("VLLM_TEST_SAME_HOST", "1") == "1"
|
|
|
|
assert test_result == expected, f"Expected {expected}, got {test_result}"
|