Skip to content

Conversation

@huangxu96
Copy link
Contributor

@huangxu96 huangxu96 commented Jun 15, 2021

PR types

Bug fixes

PR changes

APIs

Describe

This PR supports gradient clip (ClipGradByGlobalNorm) when training with AMP(auto mixed precision).

Grad_clip 操作对于混合精度的tensor会出现错误,原因是因为grad_clip里,
有sum和reduce_sum等操作不支持fp16数据类型,或者不支持sum一个混合精度的tensor。
该PR支持在grad_clip(ClipGradByGlobalNorm)里分别sum fp16和fp32的tensor作为global scale。

@paddle-bot-old
Copy link

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

@huangxu96 huangxu96 force-pushed the grad_clip_float16 branch from 424fd37 to 0e38f7f Compare June 23, 2021 08:31
@paddle-bot-old
Copy link

paddle-bot-old bot commented Jul 1, 2021

Sorry to inform you that 0e38f7f's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@huangxu96 huangxu96 force-pushed the grad_clip_float16 branch 2 times, most recently from eed7fa7 to e7c8231 Compare September 2, 2021 08:16
Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiqiu zhiqiu self-requested a review September 10, 2021 06:51
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@zhhsplendid zhhsplendid merged commit 5bdca05 into PaddlePaddle:develop Sep 10, 2021
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
This PR supports gradient clip (ClipGradByGlobalNorm) when training with AMP(auto mixed precision).
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