Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call ray.init() when num_workers is zero #32820

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

ArturNiederfahrenhorst
Copy link
Contributor

Actor Manager calls ray.wait() even when the list of remote_calls is empty and there is nothing to await.
This triggers a ray.init() which is unnecessary. This can be annoying for users who set num_workers=0.

The following script can be run without hitting ray.init() with these changes:

from ray.rllib.algorithms.ppo import PPO, PPOConfig

cfg = PPOConfig().environment("CartPole-v1").framework("torch").rollouts(
    num_rollout_workers=0, validate_workers_after_construction=False)

trainer = PPO(cfg)

trainer.step()

Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
@sven1977 sven1977 merged commit 2fb1bcc into ray-project:master Feb 24, 2023
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…ay-project#32820)

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
peytondmurray pushed a commit to peytondmurray/ray that referenced this pull request Mar 22, 2023
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants