Skip to content
Closed
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
5 changes: 4 additions & 1 deletion torchx/components/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
-----------------
"""
from pathlib import Path
from typing import Optional
from typing import Dict, Optional

import torchx
import torchx.specs as specs
Expand All @@ -139,6 +139,7 @@ def ddp(
memMB: int = 1024,
h: Optional[str] = None,
j: str = "1x2",
env: Optional[Dict[str, str]] = None,
rdzv_endpoint: str = "etcd-server.default.svc.cluster.local:2379",
) -> specs.AppDef:
"""
Expand All @@ -160,6 +161,7 @@ def ddp(
memMB: cpu memory in MB per replica
h: a registered named resource (if specified takes precedence over cpu, gpu, memMB)
j: {nnodes}x{nproc_per_node}, for gpu hosts, nproc_per_node must not exceed num gpus
env: environment varibles to be passed to the run (e.g. ENV1=v1,ENV2=v2,ENV3=v3)
rdzv_endpoint: etcd server endpoint (only matters when nnodes > 1)
"""

Expand Down Expand Up @@ -199,6 +201,7 @@ def ddp(
script,
*script_args,
],
env=env or {},
)
],
)