Skip to content

Commit

Permalink
Ray: fix RayExecutor to fail when num_workers=0 and num_hosts=None (#…
Browse files Browse the repository at this point in the history
…3210)

Signed-off-by: Travis Addair <tgaddair@gmail.com>
  • Loading branch information
tgaddair committed Oct 11, 2021
1 parent d5a90dc commit 0715c22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions horovod/ray/runner.py
Expand Up @@ -218,12 +218,12 @@ def __init__(
cpus_per_worker = cpus_per_slot
gpus_per_worker = gpus_per_slot

if num_workers is None and num_hosts is None:
raise ValueError("Either `num_workers` or `num_hosts` must be "
if not (num_workers or num_hosts):
raise ValueError("One of `num_workers` or `num_hosts` must be "
"set.")

if num_workers and num_hosts:
raise ValueError("Both `num_workers` and `num_hosts` cannot be "
raise ValueError("Only one of `num_workers` and `num_hosts` must be "
"set.")

if gpus_per_worker and not use_gpu:
Expand Down

0 comments on commit 0715c22

Please sign in to comment.