Skip to content

Commit 958657a

Browse files
committed
Update pytorch_runtime.py to set RANK and WORLD_SIZE env vars.
1 parent aea2791 commit 958657a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ads/jobs/builders/runtimes/pytorch_runtime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ def run(self, dsc_job, **kwargs):
205205
if not envs:
206206
envs = {}
207207
# Huggingface accelerate requires machine rank
208-
envs["OCI__NODE_RANK"] = str(i)
208+
envs["RANK"] = str(i)
209+
envs["WORLD_SIZE"] = replicas
209210
if main_run:
210211
envs["MAIN_JOB_RUN_OCID"] = main_run.id
211212
name = replica_kwargs.get("display_name")

0 commit comments

Comments
 (0)