File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ def _mapfn(iter):
275275 cluster_spec [njob ] = hosts
276276
277277 # update TF_CONFIG if cluster spec has a 'master' node (i.e. tf.estimator)
278- if 'master' in cluster_spec :
278+ if 'master' in cluster_spec or 'chief' in cluster_spec :
279279 tf_config = json .dumps ({
280280 'cluster' : cluster_spec ,
281281 'task' : {'type' : job_name , 'index' : task_index },
Original file line number Diff line number Diff line change @@ -96,9 +96,9 @@ def parse_gpu(gpu_str):
9696 proposed_gpus = free_gpus [:num_gpu ]
9797 else :
9898 # ordered by worker index
99- if worker_index + num_gpu > num_available :
100- worker_index = worker_index % num_available
101- proposed_gpus = free_gpus [worker_index :(worker_index + num_gpu )]
99+ if worker_index * num_gpu + num_gpu > num_available :
100+ worker_index = worker_index * num_gpu % num_available
101+ proposed_gpus = free_gpus [worker_index * num_gpu :(worker_index * num_gpu + num_gpu )]
102102 logging .info ("Proposed GPUs: {}" .format (proposed_gpus ))
103103
104104 return ',' .join (str (x ) for x in proposed_gpus )
You can’t perform that action at this time.
0 commit comments