Skip to content

Conversation

@FeixLiu
Copy link
Contributor

@FeixLiu FeixLiu commented Aug 23, 2021

PR types

Performance optimization

PR changes

Others

Describe

Sorted the grad by dtype before coalescing, can decrease the number of coalescing op.
Besides, by reducing the number of coalesce op, the number of c_allreduce_sum op can also be reduced.

All test are based on Ernie3.0, pp=dp=mp=2
fp16_allreduce=True
optimize_cast=True

Decrease in number of coalesce op

number before this opt number after this opt gain
card 0/4 48 6 -700%
card 1/5 48 6 -700%
card 2/6 120 12 -900%
card 3/7 120 12 -900%
one dp group 336 36 -833%

Loss diff

Screen Shot 2021-08-23 at 10 44 10 AM
Screen Shot 2021-08-23 at 10 44 24 AM

Performance

throughput before this opt throughput after this opt gain
39146 39232 + 0.2%

@paddle-bot-old
Copy link

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

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。 性能再给一下

Copy link
Contributor

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

看comment。

Copy link
Contributor

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

LGTM

@gongweibao gongweibao merged commit fad4b3b into PaddlePaddle:develop Aug 23, 2021
@FeixLiu FeixLiu deleted the grad_merge_fuse_optim branch August 25, 2021 02:09
FeixLiu added a commit to FeixLiu/Paddle that referenced this pull request Aug 31, 2021
wangxicoding pushed a commit that referenced this pull request Aug 31, 2021
FeixLiu added a commit to FeixLiu/Paddle that referenced this pull request Sep 2, 2021
FeixLiu added a commit to FeixLiu/Paddle that referenced this pull request Sep 3, 2021
PaddlePaddle#35116) (PaddlePaddle#35301)"

This reverts commit 2931df5.

Revert "[cherry-pick][hybrid performance] optim npu coalesce set constant (PaddlePaddle#35105) (PaddlePaddle#35302)"

This reverts commit 12260bd.

Revert "[cherry-pick][hybrid performance] optim the grad fuse for pipeline mode by sorting the grad by dtype (PaddlePaddle#35070) (PaddlePaddle#35300)"

This reverts commit e69cc21.

Revert "[cherry-pick][hybrid performance] Grad fuse for gradient merge under pipeline mode (PaddlePaddle#35004) (PaddlePaddle#35299)"

This reverts commit e931cd1.

Revert "Add flags to control whether to check Nan value of hccl_allreduce_sum. (PaddlePaddle#35093) (PaddlePaddle#35298)"

This reverts commit d4948bc.

Revert "[hybrid] Fix row parallel linear bias (PaddlePaddle#35186) (PaddlePaddle#35297)"

This reverts commit b36fb03.

Revert "[hybrid][npu] fix npu clear float status in pipeline (PaddlePaddle#35165) (PaddlePaddle#35295)"

This reverts commit 167685e.

Revert "[hybrid npu] fix npu found_finite in hybrid (PaddlePaddle#35134) (PaddlePaddle#35291)"

This reverts commit e64105f.

Revert "[cherry-pick][Hybrid Performance] Move the cast op of AMP which cast fp32 param to fp16 param to the optimizer (PaddlePaddle#34965) (PaddlePaddle#35296)"

This reverts commit 6fb58ae.

Revert "[cherry-pick] NPU use squared_l2_norm in GradientClipByGlobalNorm (PaddlePaddle#34836) (PaddlePaddle#35289)"

This reverts commit 38c27d5.
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