Skip to content
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

[CMSIS-NN] Support for int16 conv2d #12950

Merged
merged 3 commits into from
Oct 4, 2022
Merged

Conversation

ashutosh-arm
Copy link
Contributor

Support for int16 Conv2d via CMSIS-NN

-Pattern matching and RelayToTIR introduce int16 support
-Added new context buffer size APIs for int16 Conv2d
-Added int16 variants to integration and buffer size tests

cc @lhutton1 @Mousius @leandron @grant-arm

-Pattern matching and RelayToTIR introduce int16 support
-Added new context buffer size APIs for int16 Conv2d
-Added int16 variants to integration and buffer size tests

Change-Id: I6083ea20b9125a9700a69a93c52c07eb463618b2
Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall! I left some nitpicks (feel free to ignore) and a question below :)

python/tvm/relay/op/contrib/cmsisnn.py Outdated Show resolved Hide resolved
groups = 1
weight_format = "HWIO"
input_zero_point = input_zero_point if dtype == "int8" else 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input_zero_point is not supported by TFLM when dtype == int16. I've added a comment about it. Thanks for pointing out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see thanks! Seems like there should be a check in the partitioning for this case

tests/python/contrib/test_cmsisnn/test_conv2d.py Outdated Show resolved Hide resolved
Change-Id: I1956107ff4a52437a525aa34c746acc5e3a31631
Change-Id: I62e67fdbe2781c90e55028ff2da88789623f269a
@ashutosh-arm
Copy link
Contributor Author

Thanks @lhutton1 for the review comments. I have added a check for input_zero_point in the partitioner. Could you please take another look?

Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ashutosh-arm, LGTM!

@lhutton1 lhutton1 merged commit de6d806 into apache:main Oct 4, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
Support for int16 Conv2d via CMSIS-NN

-Pattern matching and RelayToTIR introduce int16 support
-Added new context buffer size APIs for int16 Conv2d
-Added int16 variants to integration and buffer size tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants