-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
Support for int16 fully_connected via CMSIS-NN -Pattern matching and RelatToTIR introduce int16 support -Added int16 variants to fully_connected tests
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 |
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 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(); |
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.
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); |
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 please also have a look at
int32_t clip_min = std::numeric_limits<int8_t>::min(); |
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 @neildhickey for addressing the comments. Congratulations on the first TVM PR 💯
Support for int16 fully_connected via CMSIS-NN
-Pattern matching and RelayToTIR introduce int16 support
-Added int16 variants to fully_connected tests