Skip to content

Commit

Permalink
Enable DDP test
Browse files Browse the repository at this point in the history
Summary: Enables DDP test to run in sandbox envs with network restrictions by using FileStore instead of TCPStore

Differential Revision: D52802276
  • Loading branch information
sarckk authored and facebook-github-bot committed Jan 16, 2024
1 parent 431fb6c commit 0f6f42d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions torchrec/distributed/composable/tests/test_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def _run_init_parameters(cls, path: str) -> None:
else:
device: torch.device = torch.device("cpu")
backend = "gloo"
dist.init_process_group(backend=backend)
dist.init_process_group(
backend=backend,
rank=rank,
world_size=world_size,
init_method=f"file://{os.path.join(path, 'dist_rdvz')}",
)
num_float_features = 32

tables = [
Expand Down Expand Up @@ -94,7 +99,12 @@ def _run(cls, path: str) -> None:
else:
device: torch.device = torch.device("cpu")
backend = "gloo"
dist.init_process_group(backend=backend)
dist.init_process_group(
backend=backend,
rank=rank,
world_size=world_size,
init_method=f"file://{os.path.join(path, 'dist_rdvz')}",
)
num_float_features = 32

tables = [
Expand Down

0 comments on commit 0f6f42d

Please sign in to comment.