Skip to content
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

Merged
merged 27 commits into from
Mar 2, 2021
Merged

lamb_op_xpu;test=kunlun #31012

merged 27 commits into from
Mar 2, 2021

Conversation

Gradie
Copy link
Contributor

@Gradie Gradie commented Feb 17, 2021

PR types

Breaking changes

PR changes

Ops

Describe

add lamb_op_xpu

@paddle-bot-old
Copy link

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

@paddle-bot-old
Copy link

paddle-bot-old bot commented Feb 17, 2021

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@Gradie Gradie closed this Feb 17, 2021
@Gradie Gradie reopened this Feb 17, 2021
@Gradie Gradie closed this Feb 17, 2021
@Gradie Gradie reopened this Feb 17, 2021
@Gradie Gradie closed this Feb 17, 2021
@Gradie Gradie reopened this Feb 17, 2021
@Gradie Gradie closed this Feb 17, 2021
@Gradie Gradie reopened this Feb 17, 2021
@Gradie Gradie closed this Feb 17, 2021
}
}
};
#endif
Copy link
Contributor

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");
Copy link
Contributor

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, "
Copy link
Contributor

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 "
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

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

现在这个kernel是不是支持了所有可能性?比如稀疏等等? 不支持的要先抛异常

@Gradie Gradie reopened this Feb 18, 2021
@Gradie Gradie closed this Feb 19, 2021
@Gradie Gradie reopened this Feb 19, 2021
Copy link
Contributor

@QingshuChen QingshuChen left a comment

Choose a reason for hiding this comment

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

LGTM

@Thunderbrook Thunderbrook merged commit d79fdc3 into PaddlePaddle:develop Mar 2, 2021
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