Skip to content
Snippets Groups Projects
Unverified Commit a1b6cfc5 authored by daquexian's avatar daquexian Committed by GitHub
Browse files

update HasAllMultiClientEnvVars() (#5459)


Signed-off-by: default avatardaquexian <daquexian566@gmail.com>

Co-authored-by: default avataroneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
parent 9f785031
No related branches found
No related tags found
No related merge requests found
......@@ -394,13 +394,12 @@ def GetEnvDefaultParallelConf(device_tag):
def HasAllMultiClientEnvVars():
return (
os.getenv("MASTER_ADDR")
and os.getenv("MASTER_PORT")
and os.getenv("WORLD_SIZE")
and os.getenv("RANK")
and os.getenv("LOCAL_RANK")
)
env_var_names = ["MASTER_ADDR", "MASTER_PORT", "WORLD_SIZE", "RANK", "LOCAL_RANK"]
has_all_env_vars = all([os.getenv(x) for x in env_var_names])
if not has_all_env_vars:
has_at_least_one_env_var = any([os.getenv(x) for x in env_var_names])
assert not has_at_least_one_env_var
return has_all_env_vars
def _UpdateDefaultEnvProtoByMultiClientEnvVars(env_proto):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment