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: Add int4 kernel support to conv2d, depthwise and fully connected #2314

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

mansnils
Copy link
Contributor

BUG=CMSIS-NN has support for int4 packed weights, hence updating "glue" in TFLM

Co-authored-by: Adrian Lundell [email protected], Ryan O'Shea [email protected] and Måns Nilsson [email protected]

…ected

Change-Id: I9a5775b709d6dc073c5ee045a884d34896bc4205
@mansnils mansnils requested a review from a team as a code owner November 14, 2023 20:27
@TFLM-bot TFLM-bot removed the ci:run label Nov 14, 2023
@rascani
Copy link
Contributor

rascani commented Nov 14, 2023

@mbernico

@rascani rascani added the ci:run label Nov 14, 2023
@TFLM-bot TFLM-bot removed the ci:run label Nov 14, 2023
@@ -168,6 +159,104 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
return kTfLiteOk;
}

TfLiteStatus EvalQuantizedPerChannelInt4(
Copy link
Contributor

Choose a reason for hiding this comment

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

This function shares most of its contents with EvalQuantizedPerChannel. You may want to consider refactoring so all the structure init is shared code, with just the arm_convolve_wrapper call being different. We have other kernels where we've done this with templates, but you could also do this with init function(s) for the various param structs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment, that's a good point. We shall do this.

@mergify mergify bot merged commit 5beca7c into tensorflow:main Nov 14, 2023
88 checks passed
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.

4 participants