Repository navigation
Description
Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
- TensorFlow installed from (source or binary): source
- TensorFlow version (use command below): git HEAD
- Python version: 3.6.9
- Bazel version (if compiling from source): 3.7.2
- GCC/Compiler version (if compiling from source): 10.3.0
- CUDA/cuDNN version: n/a
- GPU model and memory: n/a
You can collect some of this information using our environment capture
script
You can also obtain the TensorFlow version with:
- TF 1.0:
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" - TF 2.0:
python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"
Describe the current behavior
Test fails
Describe the expected behavior
Test passes
- Do you want to contribute a PR? (yes/no): No
- Briefly describe your candidate solution(if contributing):
Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.
bazel test //tensorflow/core/kernels:requantize_op_test
Other info / logs Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.
[ RUN ] RequantizeTest.HandCraftedRequantize
tensorflow/core/framework/tensor_testutil.cc:128: Failure
Value of: IsEqual(Tx[i], Ty[i], t)
Actual: false (128 not equal to 127)
Expected: true
i = 1
[ FAILED ] RequantizeTest.HandCraftedRequantize (37 ms)
Activity
elfringham commentedon Sep 27, 2021
@cfRod @nSircombe
elfringham commentedon Sep 27, 2021
In the inline function RequantizeManyInNewRangeUsingEigen<qint32, quint8> in
tensorflow/tensorflow/core/kernels/quantization_utils.h
Line 727 in 89363b5
However on AARCH64 the requantize is done by https://github.com/google/gemmlowp and you can see in the verification code that a simple cast is done https://github.com/google/gemmlowp/blob/f9959600daa42992baace8a49544a00a743ce1b6/meta/test_transform_correctness.cc#L85 which uses truncation, no rounding. This means that a different result is obtained. In this test the intermediate value of 127.5 is truncated to 127. This fails the comparison against the expected 128 and the test fails.
elfringham commentedon Jan 7, 2022
Fixed by #53630
google-ml-butler commentedon Jan 7, 2022
Are you satisfied with the resolution of your issue?
Yes
No