-
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
Move Pool OPs to phi #40208
Move Pool OPs to phi #40208
Conversation
Thanks for your contribution! |
adaptive) { // for adaptive_avg_pool2d && output_size == 1 | ||
#if defined(__HIPCC__) || defined(__NVCC__) | ||
auto stream = ctx.stream(); | ||
funcs::TensorReduceImpl<T, T, kps::AddFunctor, kps::DivideFunctor<T>>( |
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.
该函数名已经修改为func::ReduceKernel
,并且不再需要传递最后的stream
参数,辛苦修改一下。
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.
done, thx.
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.
这个benchmark脚本有吗
相关的几个API添加的Benchmark脚本都已经合入了的 |
void MaxPoolWithIndexGradInferMeta(const MetaTensor& x, | ||
const MetaTensor& mask, | ||
const MetaTensor& dout, | ||
const std::vector<int>& kernel_size, | ||
const std::vector<int>& strides, | ||
const std::vector<int>& paddings, | ||
bool global_pooling, | ||
bool adaptive, | ||
MetaTensor* dx) { | ||
dx->share_meta(x); | ||
} |
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.
[TODO] 这里实际上仅需要X的一个输入,但为了匹配kernel参数放入了大量无用参数,后面尝试下通过yaml配置避免这种写法
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.
Get
#include "paddle/phi/kernels/impl/pool_grad_kernel_impl.h" | ||
#include "paddle/phi/kernels/pool_grad_kernel.h" |
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.
这两个头文件顺序换下
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.
Done
#include "paddle/phi/kernels/impl/pool_kernel_impl.h" | ||
#include "paddle/phi/kernels/pool_kernel.h" |
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.
同上
|
||
PD_REGISTER_KERNEL( | ||
pool2d_grad, CPU, ALL_LAYOUT, phi::Pool2dGradKernel, float, double) {} | ||
PD_REGISTER_KERNEL(pool2d_grad_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.
pool2d_grad_grad 可以后面换成 pool2d_double_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.
Done
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
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 op benchmark
PR types
Function optimization
PR changes
OPs
Describe