Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorflowonspark/TFSparkNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def _mapfn(iter):
cluster_spec[njob] = hosts

# update TF_CONFIG if cluster spec has a 'master' node (i.e. tf.estimator)
if 'master' in cluster_spec:
if 'master' in cluster_spec or 'chief' in cluster_spec:
tf_config = json.dumps({
'cluster': cluster_spec,
'task': {'type': job_name, 'index': task_index},
Expand Down
6 changes: 3 additions & 3 deletions tensorflowonspark/gpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def parse_gpu(gpu_str):
proposed_gpus = free_gpus[:num_gpu]
else:
# ordered by worker index
if worker_index + num_gpu > num_available:
worker_index = worker_index % num_available
proposed_gpus = free_gpus[worker_index:(worker_index + num_gpu)]
if worker_index * num_gpu + num_gpu > num_available:
worker_index = worker_index * num_gpu % num_available
proposed_gpus = free_gpus[worker_index * num_gpu:(worker_index * num_gpu + num_gpu)]
logging.info("Proposed GPUs: {}".format(proposed_gpus))

return ','.join(str(x) for x in proposed_gpus)
Expand Down