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
Add CMSIS-NN SVDF kernel. #42651
Add CMSIS-NN SVDF kernel. #42651
Conversation
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 looks great - just one nitpick:
Since this is the first time we are duplicating the SVDF float code (xtensa_hifimini does not implement a floating point SVDF), do you think we can extract the contents of EvalFLoatSVDF into tensorflow/lite/kernels/internal/reference/svdf.h and share the implementation between the CMSIS-NN kernel and the reference kernel?
Let me know if this sounds reasonable to you.
Sounds good, I'll update the pull request with that change. |
I had a bit of a look at it, and there seems to already be a EvalFloatSVDF() in tensorflow/kernels/inernal/reference/svdf.h. The difference between that EvalFloatSVDF() and the one found in micro is (among other things) that the micro-version have TfLiteEvalTensor as input. Should I still copy over the EvalFloatSVDF() function from micro to that file? EDIT: On second, that won't work due to the fact that tensorflow/lite/kernels/reference/svdf.h depends on tensorflow/lite/kernels/reference/tensor_utils.h, which in turn depends on Eigen. @njeffrie do you have a preferred solution for this? |
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.
It looks like we need to do some internal clean-up for the shared SVDF code before it will work for this. Let's land this first then we can internally manage extracting the float version into a common kernel in a future change.
Sounds good! Let me know if you need anything from my end. |
Hi @jenselofsson, I am curious how you use this kernel? Is there a python implementation of svdf that converts to this tf lite op? |
@jenselofsson Can you please resolve conflicts? Thanks! |
@gbaned Done! |
This pull request adds the optimized version of the (int8) SVDF kernel in CMSIS-NN to TensorFlow Lite Micro.
The pull request to CMSIS-NN is still pending, and the CMSIS version in third_party_downloads.inc will need to be updated once that is merged.
Fixes #42650