Skip to content

Batch allreduce ops #220

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

Merged
merged 2 commits into from
Apr 16, 2022
Merged

Batch allreduce ops #220

merged 2 commits into from
Apr 16, 2022

Conversation

cswinter
Copy link
Collaborator

@cswinter cswinter commented Apr 16, 2022

Perform a single allreduce operation over all parameters, which significantly reduces overhead and gives much better performance, especially with many data-parallel replicas. On basic tests I ran, performance matched torch DistributedDataParallel implementation.

Current implementation hits a nice sweet spot of simplicity and performance. There are more opportunities for speedups (smartly grouping parameters and running allreduce in parallel with backward pass), but exploiting these is much more involved and would probably require pulling in horovod or somesuch framework.

@@ -555,9 +555,17 @@ def init_process(xp_info: Any, backend: str = "gloo") -> None:


def gradient_allreduce(model: Any) -> None:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vwxyzjn simple change that significantly improves performance

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh nice! Good to know. I am gonna give it a try!

@cswinter cswinter enabled auto-merge (squash) April 16, 2022 18:09
@cswinter cswinter merged commit c174561 into main Apr 16, 2022
@cswinter cswinter deleted the clemens/dataparallel-perf branch April 16, 2022 18:12
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.

2 participants