File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 122
122
-----------------
123
123
"""
124
124
from pathlib import Path
125
- from typing import Optional
125
+ from typing import Dict , Optional
126
126
127
127
import torchx
128
128
import torchx .specs as specs
@@ -139,6 +139,7 @@ def ddp(
139
139
memMB : int = 1024 ,
140
140
h : Optional [str ] = None ,
141
141
j : str = "1x2" ,
142
+ env : Optional [Dict [str , str ]] = None ,
142
143
rdzv_endpoint : str = "etcd-server.default.svc.cluster.local:2379" ,
143
144
) -> specs .AppDef :
144
145
"""
@@ -160,6 +161,7 @@ def ddp(
160
161
memMB: cpu memory in MB per replica
161
162
h: a registered named resource (if specified takes precedence over cpu, gpu, memMB)
162
163
j: {nnodes}x{nproc_per_node}, for gpu hosts, nproc_per_node must not exceed num gpus
164
+ env: environment varibles to be passed to the run (e.g. ENV1=v1,ENV2=v2,ENV3=v3)
163
165
rdzv_endpoint: etcd server endpoint (only matters when nnodes > 1)
164
166
"""
165
167
@@ -199,6 +201,7 @@ def ddp(
199
201
script ,
200
202
* script_args ,
201
203
],
204
+ env = env or {},
202
205
)
203
206
],
204
207
)
You can’t perform that action at this time.
0 commit comments