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
[INTEL oneDNN][Bug Fix] Add index-validity check for min-max tensors for quantized oneDNN ops and related tests #59581
[INTEL oneDNN][Bug Fix] Add index-validity check for min-max tensors for quantized oneDNN ops and related tests #59581
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.
Thank you for the fixes! I think there might be two minor mistakes
@@ -1903,18 +1902,25 @@ class MklQuantizedConvOp | |||
if (std::is_same<Toutput, quint8>::value || | |||
std::is_same<Toutput, qint8>::value) { | |||
const float min_input = | |||
context->input(min_input_idx_).template flat<float>()(0); | |||
context->input(min_input_idx_).template scalar<float>()(0); |
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.
context->input(min_input_idx_).template scalar<float>()(0); | |
context->input(min_input_idx_).template scalar<float>()(); |
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.
Addressed
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.
Thank you again!
@penpornk Hi, I notice that there is a failure with "feedback/copybara" check but I could not access the "Details". Please let me know if there is anything I need to do. Thanks! |
Hi @gzmkl, It was failing internal Windows CPU presubmit (not sure why the github one didn't fail..)
Test command:
Example test failure log:
I'm trying to get to this by tomorrow, but it would be great if you could help debug on your side too (if you could reproduce it). Thank you! |
Hi @gzmkl, I realized that Github's Windows Bazel presubmit on this PR didn't run any Were you able to reproduce the test failure on your system? If it's helpful, the CPU we used has up to AVX2. Since it doesn't seem like some simple merging issue, but could be actual issues with the PR, I'll leave the debugging to you. If we can merge this PR by this Wednesday, I can try to cherry-pick this into TF 2.12. Otherwise, we can wait for the patch release (v2.12.1) once this PR is merged. Thank you! |
@penpornk Thank you for the inputs. Yes, some INT8 (mkl_quanttest*) does not run on Windows. TF Windows team (Mayank) and Ramesh also gave me the same feedback. I just made code change by adding back " &&defined(ENABLE_MKL)" guard in related tests and pushed the commit. |
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.
Thank you! This should work.
We should probably remove ENABLE_MKL and guard with Windows-specific term after we are done with cherry-picks. All these quantize ops should have proper tests regularly running.
149a989
into
tensorflow:master
Exactly. This has been included in our TODO list as we want to enable some of the tests on Windows along with stock TF. |
Merge pull request #59581 from Intel-tensorflow:security_fix_quantiz
r2.12 cherry-pick: [INTEL oneDNN][Bug Fix] Add index-validity check for min-max tensors for quantized oneDNN ops and related tests #59581
This is a follow-up PR of the merged PR
#59437
for all oneDNN quantization ops:
The PR adds boundary (rank) check for min-max tensors of all oneDNN quantized ops, which will prevent NPE (null-pointer exception).
With the added check, index access to an element can happen only after the "index" passes the validity check.