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

[Dygraph] Fix performance of pp+mp by using send/recv_calc_stream instead of send/recv #46116

Merged
merged 20 commits into from
Oct 8, 2022

Conversation

haohongxiang
Copy link
Contributor

@haohongxiang haohongxiang commented Sep 16, 2022

PR types

Bug fixes

PR changes

Others

Describe

[Dygraph] Fix performance of pp+mp by using send/recv_calc_stream instead of send/recv

Done:
1、c_identity_op反向op - c_allreduce_sum用ProcessGroupStream下的AllReduce代替,性能提升5%左右;
2、ProcessGroupStream下新增allgather_partial算子
3、PP策略下用send/recv/allgather_partial_on_calc_stream算子代替collective下的API,避免切流引起的性能损耗;性能提升1%左右。

新老动态图精度对齐:
image

@paddle-bot
Copy link

paddle-bot bot commented Sep 16, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

if use_calc_stream:
task.wait()
return None
return group.process_group.recv_on_calc_stream(tensor, src)
Copy link
Contributor

Choose a reason for hiding this comment

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

不能在这个接口里用use_calc_stream这个语义,这个参数要被改成sync_op了,这样语义就错了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

LiYuRio
LiYuRio previously approved these changes Sep 22, 2022
@FeixLiu FeixLiu merged commit 8c0529f into PaddlePaddle:develop Oct 8, 2022
haohongxiang added a commit to haohongxiang/Paddle that referenced this pull request Oct 17, 2022
fuyinno4 pushed a commit that referenced this pull request Oct 18, 2022
* [Dygraph] Fix performance of pp+mp by using send/recv_calc_stream instead of send/recv (#46116)

* [Dygraph] Fix Perf of FusedFeedForward and FusedAttention with AllReduce (#46780)

* update
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