-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[PHI] migrating Squeeze2 and reshape2 #46331
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
Conversation
also add xshape version to kernel
你的PR提交成功,感谢你对开源项目的贡献! |
by explicitly specifying template args to call to ReshapeKernel in ReshapeWithXShape
This comment was marked as resolved.
This comment was marked as resolved.
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
@@ -104,21 +104,16 @@ class ReshapeMKLDNNKernel : public framework::OpKernel<T> { | |||
} | |||
|
|||
void InferInOutShape(const framework::ExecutionContext& ctx, | |||
|
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.
remove empty line
capacity)); | ||
} | ||
} | ||
return make_ddim(output_shape); |
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.
This method is already implemented in paddle/phi/infermeta/unary.cc. Maybe it's better to import header and call that implementation instead of copying it here?
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.
This method is not exported in header (unary.h) so it's invisible.
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.
The CI-coverage is not successful. Please check if the ReshapeKernel
and SqueezeKernel
are called. Check these unittests:test_reshape_mkldnn_op
and test_squeeze2_mkldnn_op
with Paddle that is not compiled with cuda. If they are called, I will mark this ci as successful. Otherwise, I will help you to find the reason why they are not called.
When I run the test test_reshape_mkldnn_op I have 4 errors on my branch and on develop the same. The errors regard bfloat on plain CPU library. They say something about missing shape variable. |
@YuanRisheng I would also like to register this kernel only for float and bfloat but I didn't know how, this macro seems to ignore dtype. |
Well, I find out the truth of the bug:#35781. The mkldnn kernel of I suggest the first option, because these two kernels are not used at all now and it is simple. @sfraczek |
Thank you. We will try to fix it first and delay the migration. |
waiting for #48359 |
PR types
Function optimization
PR changes
OPs
Describe
Migration of reshape2 and squeeze2 from fluid to phi.