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

[bug fix] fix the allreduce fused bug #34446

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

FeixLiu
Copy link
Contributor

@FeixLiu FeixLiu commented Jul 28, 2021

PR types

Bug fixes

PR changes

Others

Describe

Rewrite the logic for allreduce fuse under raw_program_optimizer.

Test performance and precision based on MOE model on 8 A100 GPUs.

Performance gain

Without fuse throughput Fuse_num = 8 throughput Performance gain
5.213 steps / sec 5.453 steps / sec +4.6%

Loss curve

Screen Shot 2021-07-28 at 2 26 41 PM

Loss diff

Screen Shot 2021-07-28 at 2 29 58 PM
max loss diff: 0.2944
min loss diff: 0.0001

How to use

strategy = paddle.distributed.fleet.DistributedStrategy()
strategy.without_graph_optimization = True
strategy.fuse_all_reduce_ops = True
# the following two flags are optional
strategy._calc_comm_same_stream = False    # use calc stream as comm stream or not, default is False
strategy.fuse_grad_size_in_num = 8         # the number of grad in one allreduce_sum op, default is 8

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@FeixLiu FeixLiu changed the title fix the allreduce fused bug, test=allcase fix the allreduce fused bug Jul 29, 2021
Copy link
Contributor

@wangxicoding wangxicoding left a comment

Choose a reason for hiding this comment

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

LGTM

@wangxicoding wangxicoding merged commit b56dbe0 into PaddlePaddle:develop Jul 29, 2021
@FeixLiu FeixLiu deleted the fix_allreduce_fuse branch July 29, 2021 08:02
@FeixLiu FeixLiu changed the title fix the allreduce fused bug [bug fix] fix the allreduce fused bug Oct 11, 2021
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