Skip to content

Eliminate array copy in NormalizeOp #40952

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

Closed
wants to merge 1 commit into from

Conversation

am15h
Copy link

@am15h am15h commented Jun 30, 2020

This minor optimization eliminates array copy in NormalizeOp and improves efficiency by getting float value by absIndex.

@google-ml-butler google-ml-butler bot added the size:XS CL Change Size: Extra Small label Jun 30, 2020
@gbaned gbaned self-assigned this Jul 1, 2020
@gbaned gbaned requested a review from xunkai55 July 1, 2020 05:10
@gbaned
Copy link
Contributor

gbaned commented Jul 1, 2020

@am15h Can you please resolve conflicts? Thanks!

@xunkai55
Copy link
Contributor

xunkai55 commented Jul 1, 2020

I had some experiments (but might be stale) that getting values pixel by pixel is even slower.

Do you have any numbers about how performance will be improved with this change?

Thanks!

@am15h
Copy link
Author

am15h commented Jul 1, 2020

@xunkai55 This optimization reduced the normalization time by more than half in the tflite flutter helper library . Does this change make it slower on Android?

@am15h Can you please resolve conflicts? Thanks!

The support library was moved to its own repo a few hours ago, I will need to open a PR there.

@xunkai55
Copy link
Contributor

xunkai55 commented Jul 1, 2020

Sorry for the code move. Indeed, let's have a PR in that repo.

If you have no testing environment, I would help run a benchmark internally. Once you have the PR please let me know.

@xunkai55 xunkai55 closed this Jul 1, 2020
@am15h
Copy link
Author

am15h commented Jul 1, 2020

If you have no testing environment, I would help run a benchmark internally. Once you have the PR please let me know.

That would be great. I have opened a new PR tensorflow/tflite-support#14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes size:XS CL Change Size: Extra Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants