-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
lamb_op_xpu;test=kunlun #31012
lamb_op_xpu;test=kunlun #31012
Conversation
Thanks for your contribution! |
✅ This PR's description meets the template requirements! |
} | ||
} | ||
}; | ||
#endif |
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.
整个文件都可以放在ifdef PADDLE_WITH_XPU中,没必要分两个。
T beta2 = static_cast<T>(ctx.Attr<float>("beta2")); | ||
auto& param = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Param"), "Input", | ||
"Param", "Lamb"); | ||
// auto* grad_var = ctx.InputVar("Grad"); |
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.
没用的注释删除了
PADDLE_ENFORCE_EQ( | ||
r, xpu::Error_t::SUCCESS, | ||
platform::errors::InvalidArgument( | ||
"XPU kernel error of RmspropOp, error message: INVALID_PARAM, " |
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.
报错信息应该是LambOP
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS, | ||
platform::errors::Unavailable( | ||
"XPU kernel error of RmspropOp, error message: " | ||
"RUNTIME_ERROR, please check whether Baidu " |
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.
同上
"Output", "Beta2PowOut", "Lamb"); | ||
auto& dev_ctx = ctx.template device_context<DeviceContext>(); | ||
|
||
int r = xpu::lamb( |
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.
现在这个kernel是不是支持了所有可能性?比如稀疏等等? 不支持的要先抛异常
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
PR types
Breaking changes
PR changes
Ops
Describe
add lamb_op_xpu