-
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
What should do to add MKLDNN kernel #8305
Comments
Can we move the instruction to some wiki page, link it here and close the issue? |
Your suggestion sounds nice. The related documentation is new_op_kernel_en.md. Can you move the instruction to it? |
@pzelazko-intel can you validate the instruction above and if it is actual, insert it into the file pointed by @luotao1 ? |
@jacquesqiao For MKLDNN kernels we actually derive from Does class representing MKLDNN matrix have to derive from |
It should derive from LoDTensor. The reason is that (sorry, we don't have a documentation about it now, we will add it): All the input and output of ops are LoDTensor in fact. Ops should deliver the LoD information one by one, if one of them is not LoDTensor, the delivery is broken. For examples, A->B->C, if B doesn't use LoDTensor, C would not get the LoD information. (#3717) The related code is Paddle/paddle/fluid/framework/operator.cc Lines 245 to 307 in ee88855
|
Base class that need to implement:
MKLDNNLoDTensor
derived from LoDTensor. in formal PaddlePaddle.Like MKLDNNMatrix.h for v2
MKLDNNKernelBase
derived from KernelBase. Like MKLDNNLayer.h in formal PaddlePaddle for v2Tensor transform functions used to tranform between LodTensor and MKLDNNKernel
Steps to add new kernel
Take
pool_cudnn_op
as example:pool_cudnn_op.cu.cc
PoolCUDNNOpKernel
CUDNN
If we want to add
pool_mkldnn
kernel, the step should be:pool_mkldnn_op.cc
MKLDNN
The text was updated successfully, but these errors were encountered: