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

[PTen]Separate origin Kernel and add Kernel for C++ API #39002

Merged
merged 11 commits into from
Jan 21, 2022

Conversation

YuanRisheng
Copy link
Contributor

PR types

Function optimization

PR changes

Others

Describe

对Kernel分层,为C++ API添加新的注册Kernel,原始xxxKernel更改为xxxRawKernel

@paddle-bot-old
Copy link

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

zyfncg
zyfncg previously approved these changes Jan 20, 2022
@@ -22,104 +22,126 @@ limitations under the License. */

namespace pten {
Copy link
Contributor

Choose a reason for hiding this comment

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

math里面的这些kernel,raw_kernel, dev_api的顺序后面也许可以整理一下,kernel太多了找起来会有点麻烦

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

@@ -130,7 +127,6 @@
param : [x, y, -1]
Copy link
Contributor

Choose a reason for hiding this comment

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

kernel参数对齐API以后InterMeta的参数是不是也有和API保持一致的可能?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

下个pr修改

@@ -172,7 +167,7 @@
param: [x, axis, keep_dim, dtype]
kernel :
func : sum
param : [x, axis, keep_dim, false, DataType::UNDEFINED]
param : [x, axis, keep_dim]
Copy link
Contributor

Choose a reason for hiding this comment

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

这里能否使sum kernel的参数和API保持一致?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

chenwhql
chenwhql previously approved these changes Jan 20, 2022
@@ -142,24 +142,25 @@ class ElementwiseOp : public framework::OperatorWithKernel {
const framework::ExecutionContext &ctx) const override {
if (Type() == "elementwise_add") {
if (ctx.InputVar("X")->IsType<framework::LoDTensor>()) {
return framework::KernelSignature("add", {"X", "Y"}, {"axis"}, {"Out"});
return framework::KernelSignature("add_raw", {"X", "Y"}, {"axis"},
Copy link
Contributor

Choose a reason for hiding this comment

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

这里要既能找到raw也能找到非raw的吧,axis值无效的时候,直接使用非raw,raw是用来保底的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@YuanRisheng YuanRisheng dismissed stale reviews from chenwhql and zyfncg via f1f8874 January 21, 2022 02:56
@YuanRisheng YuanRisheng merged commit a0f586b into PaddlePaddle:develop Jan 21, 2022
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