-
Notifications
You must be signed in to change notification settings - Fork 74k
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
[TFLite] Fix potential overflow in 64-bit MultiplyByQuantizedMultiplier function #42134
[TFLite] Fix potential overflow in 64-bit MultiplyByQuantizedMultiplier function #42134
Conversation
Hi @suharshs, could you take a look to the PR? Thanks. |
@jianlijianli, @daverim Can you please take a look on this PR ? Thanks! |
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.
Thanks for this change! Looks good. I looked around for the right spot for a test. It looks like it the test should go in tensorflow/lite/kernels/internal/quantization_util_test.cc (it already includes this common.h). We should have more tests for this function, so it would be good to start with at least one. Thanks!
Thank you, I hesitated as there was no existing tests for any of the |
@talumbau I added some tests for the int32 and int64 versions of the I had to modify a bit the BUILD file to link |
Hi Thibaut, I looked at the Windows Bazel GPU CI build failure, as well as the Intel oneDNN build failure. They look spurious to me and not related to this change. Can you attempt to rebase and invoke the submit process again? I believe that change in 0cead48 should be good. |
…d_multiplier_overflow
I merged the latest changes, thanks. |
Looks like there are some builds with additional warnings
Can you fix please? |
Thank you, I fixed the warning. Is there a reason to not enable these warnings and |
That's a good idea. I have filed this issue internally. Thanks for your patience. |
Looks like the Github CI needs significant improvement. I see a failure with this command:
it fails on the assert here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/internal/common.h#L179 Can you reproduce? |
…ltiplier as they are not supported
Thank you, the 64-bit I removed the tests with negative multipliers for the 64-bit version but left them for the 32-bit version as some kernels use negative multipliers (notably the SUB operator to reuse the ADD kernel). |
Hi,
This PR fixes potential overflows than can happen in the 64-bit version of
MultiplyByQuantizedMultiplier
.Overflow example:
Output:
Thanks,
Thibaut