-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Discussion on integrating MKLDNN to fluid #6815
Comments
Sure. Currently we have two methods to process the layout, as you listed.
For this one,
After we get the best layout, the code of choosing best layout would also be repeated in
Then mkldnn will need to execute the conversion inside this
I prefer this one, then we do not need to register many layout in paddle level.
About the |
So, after our discussion, the last and only details difference between the design and our proposal is: auto expect_kernel_type = GetExpectedKernelType(actual_kernel_type);
auto trans = g_data_transformation_[{actual_kernel_type, expect_kernel_type}];
kernel.run(trans(inputs)); ==> auto expect_kernel_type = GetExpectedKernelType(actual_kernel_type, ctx);
auto trans = g_data_transformation_[{actual_kernel_type, expect_kernel_type}];
kernel.run(trans(inputs, ctx)); Right? |
1. Background and consensus
2. concerns on Layout as the key of OpKernelType
The essence about taking layout as the key OpKernelType is to write following codes in which part.
GetExpectedKernelType
method and convert data inTrans
method, and then chose right kernel registered in advance.Compute
method of MKLDNN kernel. The layout will be chosen and transformed inside kernel.@tensor-tang Could you give some advice on the total effort of these two choice considering integrating MKLDNN to fluid.
3. Some other related question
Some operators like dropout and batch norm will have different computation logic in train/test process. Fluid handles these logic inside the
Compute
method of operator kernel. Fluid does not takeis_test
as a key of OpKernelType currently.The text was updated successfully, but these errors were encountered: