Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions tests/python/pytorch/graphbolt/test_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,30 @@ def test_gpu_sampling_DataLoader(
if platform == "win32"
else "tcp://127.0.0.1:12345"
)
thd.init_process_group(
init_method=init_method,
world_size=1,
rank=0,
)

from torch.torch_version import TorchVersion

if TorchVersion(torch.__version__) >= TorchVersion("2.7.0a"):
if not thd.is_mpi_available():
import warnings

warnings.warn(
"MPY backend should be available for "
"cooperative optimization"
)
return

thd.init_process_group(
backend="mpi",
init_method=init_method,
)
else:
thd.init_process_group(
init_method=init_method,
world_size=1,
rank=0,
)

N = 40
B = 4
num_layers = 2
Expand Down