Skip to content

Commit

Permalink
AISC launcher fixes (microsoft#3637)
Browse files Browse the repository at this point in the history
* tmp remove launcher args

* add exclude list for env variables on aisc

* add comment
  • Loading branch information
jeffra committed May 30, 2023
1 parent d755b9d commit 49a7354
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion deepspeed/launcher/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
DEEPSPEED_ENVIRONMENT_PATHS = [os.path.expanduser("~"), '.']
PDSH_MAX_FAN_OUT = 1024

# On AISC compute, each node sets environment variables independently, want to prevent
# exporting rank-0 env variables in case of heterogeneous compute.
EXCLUDE_ENVS = {'AISC_JOB_NAME': ['NCCL_IB_HCA', 'UCX_NET_DEVICES']}


def parse_args(args=None):
parser = argparse.ArgumentParser(description="DeepSpeed runner to help launch distributed "
Expand Down Expand Up @@ -523,10 +527,17 @@ def main(args=None):
else:
env['PYTHONPATH'] = curr_path

excluded_vars = []
for exclude_key, var_list in EXCLUDE_ENVS.items():
if exclude_key in env.keys():
# key exists in launcher env -> var list should be used
excluded_vars += var_list

exports = ""
for var in env.keys():
if any([var.startswith(name) for name in EXPORT_ENVS]):
runner.add_export(var, env[var])
if not any([var == name for name in excluded_vars]):
runner.add_export(var, env[var])

for environ_path in DEEPSPEED_ENVIRONMENT_PATHS:
environ_file = os.path.join(environ_path, DEEPSPEED_ENVIRONMENT_NAME)
Expand Down

0 comments on commit 49a7354

Please sign in to comment.