Skip to content
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

Changes to MklConvFwdPrimitiveFactory to support Arm Compute Library backend #47415

Closed
alenik01 opened this issue Feb 25, 2021 · 3 comments
Closed
Assignees
Labels
comp:mkl MKL related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower type:feature Feature requests

Comments

@alenik01
Copy link
Contributor

System information

  • TensorFlow version (you are using): 2.4.1
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state.
At the moment MklConvFwdPrimitiveFactory reuses already created oneDNN primitives, stored in the vector fwd_primitives, with the help of GetConvFwd function which creates a key from convolution parameters stored in MklConvFwdParams and compares this key with the keys of existing primitives. However, when oneDNN is built with Arm Compute Library (ACL, see also oneDNN build options) there is specific requirement to create a separate primitive per constant weights tensor, this is a restriction implied by ACL code design which does not allow to use primitive caching mechanism in MklConvFwdPrimitiveFactory as it is. The solution may be to add a new entry, void* filter_address, to MklConvFwdParams struct and to include the address of weights to the key in CreateKey function:

...
key_creator.AddAsKey(convFwdDims.filter_dims);
#ifdef DNNL_AARCH64_USE_ACL
key_creator.AddAsKey(convFwdDims.filter_address);
#endif
key_creator.AddAsKey(convFwdDims.bias_dims);
...

Will this change the current api? How?
The only API change is the addition of a new field to CreateKey and MklConvFwdParams in mkl_conv_ops.cc, this is related to the limitations of ACL which is designed to create a separate primitive per weights tensor.

Who will benefit with this feature?
The users who run inference regime with TensorFlow on AArch64-based machines.

Any Other info.
This Issue is raised mainly to get feedback from maintainers of the oneDNN to TensorFlow integration.

@alenik01 alenik01 added the type:feature Feature requests label Feb 25, 2021
@alenik01
Copy link
Contributor Author

Please have a look, @agramesh1

@Saduf2019 Saduf2019 added the comp:mkl MKL related issues label Feb 26, 2021
@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 26, 2021
@agramesh1
Copy link
Contributor

Please have a look, @agramesh1

Adding @gzmkl from Intel-TF team who can help.

@alenik01
Copy link
Contributor Author

Closed due to the raised PR.

cfRod added a commit to cfRod/tensorflow that referenced this issue Sep 15, 2021
… backend

Related to issue tensorflow#47415 and PR tensorflow#47775. Adding support for caching inner product primitives.
Includes patch file for oneDNN to include inner product, eltwise primitives and updates to ACL thread binding.
cfRod added a commit to cfRod/tensorflow that referenced this issue Oct 5, 2021
Related to issue tensorflow#47415 and PR tensorflow#47775. Adding support for caching matmul primitives.
Updates onednn_acl_primitives.patch to include matmul primitives.
cfRod added a commit to cfRod/tensorflow that referenced this issue Oct 7, 2021
Related to issue tensorflow#47415 and PR tensorflow#47775. Adding support for caching matmul primitives.
Updates onednn_acl_primitives.patch to include matmul primitives.
penpornk pushed a commit to penpornk/tensorflow that referenced this issue Oct 11, 2021
Related to issue tensorflow#47415 and PR tensorflow#47775. Adding support for caching matmul primitives.
Updates onednn_acl_primitives.patch to include matmul primitives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:mkl MKL related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower type:feature Feature requests
Projects
None yet
Development

No branches or pull requests

5 participants