From ca03f4989acd912265d2fb01d27d2d302452c0dc Mon Sep 17 00:00:00 2001 From: chengduo Date: Fri, 24 May 2019 07:57:18 +0800 Subject: [PATCH] fix distributed launch.py (#17571) test=develop --- python/paddle/distributed/launch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/distributed/launch.py b/python/paddle/distributed/launch.py index 845ccf27451..8374faf0863 100644 --- a/python/paddle/distributed/launch.py +++ b/python/paddle/distributed/launch.py @@ -75,11 +75,11 @@ def start_procs(gpus, entrypoint, entrypoint_args, log_dir): nranks = num_nodes * gpus # ======== for dist training ======= gpu_ids = get_gpu_ids(gpus) - for i in gpu_ids: + for i in range(gpus): curr_env = {} curr_env.update(default_envs) curr_env.update({ - "FLAGS_selected_gpus": "%d" % i, + "FLAGS_selected_gpus": "%d" % gpu_ids[i], "PADDLE_TRAINER_ID": "%d" % (node_trainer_id * gpus + i), "PADDLE_CURRENT_ENDPOINT": "%s:617%d" % (current_ip, i), # nranks -- GitLab