Skip to content

Deprecate horovod in favor of torch.distributed - #171

Merged
ViktorM merged 4 commits into
Denys88:masterfrom
vwxyzjn:3rd-torch-distributed
Jun 3, 2022
Merged

ViktorM merged 4 commits into
Denys88:masterfrom
vwxyzjn:3rd-torch-distributed

Conversation

@vwxyzjn

@vwxyzjn vwxyzjn commented Jun 3, 2022 •

Copy link
Copy Markdown
Contributor

Follow up with #165 #158

We did a benchmark with isaacgymenvs and torch.distributed shows consistently better scaling performance in AllegroHand.

Notable change - I disable the stats syncing, which does not seem to be that important to average across all workers at every step.

image

You can test it out with

torchrun --standalone --nnodes=1 --nproc_per_node=2 runner.py --train --file rl_games/configs/ppo_cartpole.yaml

CC @ViktorM @markelsanz14

@Denys88

Denys88 commented Jun 3, 2022 •

Copy link
Copy Markdown
Owner

@vwxyzjn Ill take a look.
Strange but kl divergence syncing was needed to set right LR. Or you mean it is enough to calc it on the rank=0 gpu?

But overall looks awesome and much easier to use :) it takes a few hours of pain to install horovod for average person :)

@vwxyzjn

vwxyzjn commented Jun 3, 2022 •

Copy link
Copy Markdown
Contributor Author

Thank you @Denys88

Strange but kl divergence syncing was needed to set right LR. Or you mean it is enough to calc it on the rank=0 gpu?

Yes, it should be enough to call it on rank=0 GPU, al least in the case of isaacgymenvs when thousands of envs are available

Comment thread rl_games/common/a2c_common.py Outdated
should_exit_t = torch.tensor(should_exit).float()
self.hvd.broadcast_value(should_exit_t, 'should_exit')
should_exit = should_exit_t.bool().item()
# if self.multi_gpu:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found why I had this code: #95

@ViktorM
ViktorM merged commit c9575bd into Denys88:master Jun 3, 2022
@vwxyzjn vwxyzjn mentioned this pull request Jun 19, 2022
2 tasks done
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