-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Support float16 when using ClipGradByGlobalNorm. #33565
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
Support float16 when using ClipGradByGlobalNorm. #33565
Conversation
|
Thanks for your contribution! |
424fd37 to
0e38f7f
Compare
|
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. |
… grad_clip_float16
eed7fa7 to
e7c8231
Compare
e7c8231 to
afdbc38
Compare
9493650 to
8797a83
Compare
ad61788 to
eb59144
Compare
zhhsplendid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
zhiqiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR supports gradient clip (ClipGradByGlobalNorm) when training with AMP(auto mixed precision).
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。