-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[AMP OP&Test] Add fp16/bf16 to clip op #52158
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
self.shape = (4, 10, 10) | ||
self.max = 0.8 | ||
self.min = 0.3 | ||
self.inputs['Max'] = np.array([0.8]).astype(self.dtype) |
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.
对于BF16这里应该初始化为fp32,然后调用convert_float_to_uint16
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.
clip kernel里已经调用了类型转换,若此处调用将出现对不齐的情况
auto max_ = max.to();
auto min_ = min.to();
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
* add fp16/bf16 to clip op * fix as reviewed * update test_clip_op.py * update test_clip_op.py
* remove op.py * [Zero-Dim] change Tensor.numpy() usage to other equivalent usage, avoid hack (#52197) * [BugFix] fix compute error in fused_dropout_add (#52261) * fix bg * add utest * add utest * [CodeStyle][UP034] remove (()) cases (#52060) * add up34 * modify var name in loop * revert changes in test_slice * Revert "modify var name in loop" This reverts commit 6d748e3. * temporarily ignore test_slice.py * add comment * empty commit, re-trigger all ci * fix inc --------- Co-authored-by: SigureMo <sigure.qaq@gmail.com> * [AMP OP&Test] add unittest for log_softmax (#52264) * Fix_Linux_[-Wterminate]warning (#52186) * [CustomOP Inplace] Automap inplace dtype and shape, prepare for vector<Tensor> output (#52214) * [CustomOP Inplace] Automap inplace dtype and shape, prepare for vector<Tensor> output * delete dtype,shape func of multi_inplace op * [CustomOP Inplace] Automap inplace dtype and shape, support vector<Tensor> output * [CustomOP Inplace] Auto-generate python API for inplace vector<Tensor> output * [AMP OP&Test] add float16 optest for reshape_op (#51678) * [AMP OP&Test] add float16 optest for reshape_op * add public_python_api * [AMP OP&Test] Add fp16/bf16 to clip op (#52158) * add fp16/bf16 to clip op * fix as reviewed * update test_clip_op.py * update test_clip_op.py * fix bug * fix code style * fix bug * fix bug --------- Co-authored-by: Zhou Wei <1183042833@qq.com> Co-authored-by: ShenLiang <1422485404@qq.com> Co-authored-by: 张春乔 <83450930+Liyulingyue@users.noreply.github.com> Co-authored-by: SigureMo <sigure.qaq@gmail.com> Co-authored-by: Ccc <52520497+juncaipeng@users.noreply.github.com> Co-authored-by: Galaxy1458 <55453380+Galaxy1458@users.noreply.github.com> Co-authored-by: HongyuJia <jiahongyu@baidu.com> Co-authored-by: zhaoyingli <86812880+zhaoyinglia@users.noreply.github.com> Co-authored-by: wuyefeilin <30919197+wuyefeilin@users.noreply.github.com>
PR types
Others
PR changes
OPs
Describe
Add fp16/bf16 to clip op