-
Notifications
You must be signed in to change notification settings - Fork 74.3k
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] Enable reference int8 fully connected with output shape with dimensions > 2 #54223
[TFLite] Enable reference int8 fully connected with output shape with dimensions > 2 #54223
Conversation
…o toupstream/fully_connected_dims_2
…QuantizedOutputShape3DInt8 tests
Could you add a e2e test case under the lite_v2_test.py? |
ea13c59
to
4badb5f
Compare
4badb5f
to
a8ddaaf
Compare
Hi, Thanks for review. I have added end to end test to lite_v2_test.py. Please let me know if there is anything I need to add/change. Best regards, |
@@ -34,12 +34,13 @@ inline void FullyConnected( | |||
const int32_t output_activation_min = params.quantized_activation_min; | |||
const int32_t output_activation_max = params.quantized_activation_max; | |||
TFLITE_DCHECK_GE(filter_shape.DimensionsCount(), 2); | |||
TFLITE_DCHECK_EQ(output_shape.DimensionsCount(), 2); | |||
TFLITE_DCHECK_GE(output_shape.DimensionsCount(), 1); |
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.
One more thing: shouldn't this be TFLITE_DCHECK_GE(.., 2)
?
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.
Hi,
I think this is ok, as the output shape can have 1 dimension? This is similar implementation to: 1e0716e#diff-2cb25dbe2523a0754af5b5057b800add3642578751a4083dd094b5b99ecdecb2
Best regards,
Saoirse
interpreter.allocate_tensors() | ||
output_details = interpreter.get_output_details() | ||
|
||
self.assertLen(output_details[0]['shape_signature'], 3) |
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.
could you add value comparisons between TF and TFLite models?
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 review. I have added some extra comparisons. Please let me know if any more needs to be updated.
Best regards,
Saoirse
…dims_2 PiperOrigin-RevId: 438793489
Seems auto-merge is not happening but the changes are merged into master now, so we can close this. Thank you for the PR. |
3D output shape support for Fully_Connected layer under xtensa. The fix to the reference kernels was made with tensorflow/tensorflow#54223 (and the corresponding import from TF Lite to TFLM). TFLM currently does not have a test case for this (corresponding to what was added with tensorflow/tensorflow#54223), BUG=tensorflow/tensorflow#53501
Hi,
This PR enables reference int8 support for fully connected with output shape with dimensions > 2 in TensorFlow Lite.
Relevant issue which describes this is here: #53501
This PR also contains an update to the SimpleTestQuantizedOutputShape3DInt16 to ensure that output shape with dimensions >2 is verified.
Thanks,
Saoirse