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

[TFLM] Added optimized softmax kernel (int32 and float) for CEVA-BX1 and CEVA SP500 #47783

Merged

Conversation

yair-ehrenwald
Copy link
Contributor

Relevant github issue:#45607

@google-ml-butler google-ml-butler bot added the size:M CL Change Size: Medium label Mar 13, 2021
@google-ml-butler
Copy link

Thanks for contributing to TensorFlow Lite Micro.

To keep this process moving along, we'd like to make sure that you have completed the items on this list:

We would like to have a discussion on the Github issue first to determine the best path forward, and then proceed to the PR review.

@google-cla google-cla bot added the cla: yes label Mar 13, 2021
@yair-ehrenwald yair-ehrenwald added comp:micro Related to TensorFlow Lite Microcontrollers comp:micro:ceva labels Mar 13, 2021
@gbaned gbaned self-assigned this Mar 14, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Mar 14, 2021
@gbaned gbaned requested a review from advaitjain March 14, 2021 18:25
Copy link
Member

@advaitjain advaitjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments only.

Happy to make a PR that removes uint8 support from the reference kernel by this Friday.

#if defined(CEVA_BX1) || defined(CEVA_SP500)
extern int32_t* CEVA_TFLM_KERNELS_SCRATCH;
extern int32_t CEVA_TFLM_KERNELS_SCRATCH_SIZE_VAL;
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth putting these in a ceva_common.h or something similar to avoid repeating the same include and extern in each of the kernels?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const TfLiteEvalTensor* input,
TfLiteEvalTensor* output,
const SoftmaxParams& op_data) {
if (input->type == kTfLiteUInt8) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop uint8 support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

PR Queue automation moved this from Assigned Reviewer to Reviewer Requested Changes Mar 16, 2021
@yair-ehrenwald yair-ehrenwald added the kokoro:force-run Tests on submitted change label Mar 18, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Mar 18, 2021
Comment on lines +29 to +31
#ifdef MCPS_MEASUREMENT
#include "tensorflow/lite/micro/kernels/ceva/mcps_macros.h"
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could add these to ceva_common.h as well?

No change needed in this PR. If you think it is worthwhile then you can make the change in all the kernels in a follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have our measurement macros in all kernels, but only some of them require scratch memory, so I'll leave it as is for the time being. Eventually I think we will do some work on the whole scratch usage issue, exact size calculations per kernel etc and hopefully come up with something maintainable.

PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Mar 18, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Mar 18, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Mar 18, 2021
@advaitjain advaitjain added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process and removed ready to pull PR ready for merge process labels Mar 19, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Mar 19, 2021
@copybara-service copybara-service bot merged commit fe1dbf7 into tensorflow:master Mar 19, 2021
PR Queue automation moved this from Approved by Reviewer to Merged Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:micro Related to TensorFlow Lite Microcontrollers ready to pull PR ready for merge process size:M CL Change Size: Medium
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants