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 in fully connected layer #13484

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

neildhickey
Copy link
Contributor

Support for int16 fully_connected via CMSIS-NN

-Pattern matching and RelayToTIR introduce int16 support
-Added int16 variants to fully_connected tests

Support for int16 fully_connected via CMSIS-NN

-Pattern matching and RelatToTIR introduce int16 support
-Added int16 variants to fully_connected tests
@tvm-bot
Copy link
Collaborator

tvm-bot commented Nov 24, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

Copy link
Contributor

@ashutosh-arm ashutosh-arm left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @neildhickey :) Looks great overall. Just a nit and a request.

@@ -309,6 +309,12 @@ class RelayToTIRVisitor : public MixedModeMutator {
fc_call = requantize_input;
}

int32_t dtype_bits = fc_call->args[0]->type_as<TensorTypeNode>()->dtype.bits();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: a comment maybe?

@@ -341,8 +347,8 @@ class RelayToTIRVisitor : public MixedModeMutator {
clip_min = clip_attrs->a_min;
clip_max = clip_attrs->a_max;
} else {
clip_min = -128;
clip_max = 127;
clip_min = -static_cast<int>(1 << dtype_bits);
Copy link
Contributor

@ashutosh-arm ashutosh-arm Nov 24, 2022

Choose a reason for hiding this comment

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

Could you please also have a look at

int32_t clip_min = std::numeric_limits<int8_t>::min();
. Looks incorrect there in the Conv2D implementation.

@ashutosh-arm
Copy link
Contributor

cc @lhutton1 @NicolaLancellotti

Copy link
Contributor

@ashutosh-arm ashutosh-arm left a comment

Choose a reason for hiding this comment

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

Thanks @neildhickey for addressing the comments. Congratulations on the first TVM PR 💯

@ashutosh-arm ashutosh-arm merged commit f5a102c into apache:main Nov 25, 2022
@neildhickey neildhickey deleted the int16_fully_connected branch March 7, 2023 16:08
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.

None yet

3 participants