Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@puhuk
Copy link
Contributor

@puhuk puhuk commented Sep 16, 2022

Description: Modify all_reduce to take group

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added the module: distributed Distributed module label Sep 16, 2022
if group is not None:
if not isinstance(group, hvd.ProcessSet):
raise ValueError("Argument group should be list of int or ProcessSet")
hvd.init(process_sets=[group])
Copy link
Collaborator

Choose a reason for hiding this comment

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

@puhuk do you know what hvd.init(process_sets=[group]) does ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't it initialize the horovod to take process_sets with specified process set like group ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and how it works if horovod is already initialized ?

Copy link
Contributor Author

@puhuk puhuk Sep 27, 2022

Choose a reason for hiding this comment

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

It sets up the horovod backend again by calling _setup_process_sets. So it should not be called after already initialized ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

you have to check that

Copy link
Contributor Author

@puhuk puhuk Sep 27, 2022

Choose a reason for hiding this comment

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

There are two options in initializing horovod

  1. Static initialization like hvd.init(process_sets= ~~) --> In this case, when initialized, process_set can not be changed
  2. Dynamic process set like hvd.init(process_sets="dynamic") --> In this case, process set can be altered dynamically

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Looks ok, thanks @puhuk

@vfdev-5 vfdev-5 merged commit d4aa1f2 into pytorch:master Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: distributed Distributed module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants