Support both use_calc_stream and sync_op in all_reduce#45282
Merged
gongweibao merged 1 commit intoPaddlePaddle:developfrom Aug 31, 2022
Merged
Support both use_calc_stream and sync_op in all_reduce#45282gongweibao merged 1 commit intoPaddlePaddle:developfrom
gongweibao merged 1 commit intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
8ea3053 to
877abba
Compare
gongweibao
requested changes
Aug 20, 2022
gongweibao
requested changes
Aug 20, 2022
bef166b to
be027c4
Compare
gongweibao
approved these changes
Aug 29, 2022
Contributor
There was a problem hiding this comment.
in_tensors will be modified?
Contributor
Author
There was a problem hiding this comment.
this will be modified in the following pr
liuTINA0907
approved these changes
Aug 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
APIs
Describe
In the new communication library, we designed ProcessGroup to manage different communication group. Inside each process_group has its own stream which all communications in this group will be done on this stream. For high level API, like distributed.all_reduce, we use
use_calc_streamto indicate whether this operation is sync or not. Notice that frequently add unnecessary cuda events may lead to low performance on some model. In order to achieve high performance, this pr add a new API name distributed.stream.all_reduce. This new API provideduse_calc_streamandsync_opboth.sync_op, indicate whether communication is sync or not.use_calc_stream, do communicate on calc stream, save the time of switching stream. Only work whensync_opis true.对应中文文档,PaddlePaddle/docs#5225