Skip to content

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
#include "paddle/pten/infermeta/unary.h"
#include "paddle/pten/kernels/empty_kernel.h"

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.

好的

output : Tensor
infer_meta :
func : ElementwiseInferMeta
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修改

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
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

3 participants