-
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
add MergedAdamKernel and test for MergedAdamKernel and fix adam caculation process in test #58982
Conversation
…ation process in test
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
import paddle | ||
|
||
# from op import Operator | ||
# from op_test_xpu import XPUOpTest |
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.
不需要的代码删掉吧。可以攒着和下一个PR一起。
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.
收到,我这周还会提一个pr,到时候顺便把这里删掉:)
|
||
// update param, moment1, moment2 | ||
for (int i = 0; i < param_num; i++) { | ||
phi::Copy(dev_ctx, *param[i], dev_ctx.GetPlace(), false, param_out[i]); |
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.
这个能优化吗?api内部inplace操作
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.
这个确实是导致mergedAdam性能不够好的问题之一,原因就是api的算子接口没有按照标准的inplace来写,而pytorch那边不希望我们更改接口,所以只能暂时这样
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 for const_cast to call xpu api
…ation process in test (PaddlePaddle#58982)
PR types
New features
PR changes
OPs
Description