-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NN_ROUND() issues in 16bit ops #1047
Comments
majianjia
added a commit
to majianjia/nnom
that referenced
this issue
Nov 20, 2020
- The local backend seems has some issue with NNOM_ROUND() ARM-software/CMSIS_5#1047
@majianjia Apologies for the delay. Would you mind making a PR for the fix? |
@felix-johnny let me remind myself what is this about. |
Great , thanks! |
majianjia
added a commit
to majianjia/CMSIS_5
that referenced
this issue
Aug 25, 2021
felix-johnny
pushed a commit
that referenced
this issue
Nov 2, 2021
close the issue as the related PR is merged. |
felix-johnny
pushed a commit
to ARM-software/CMSIS-NN
that referenced
this issue
Oct 4, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I met an issue of 16 bit NN producing bad results when I tried to use
round()
in NN calculation usingARM_NN_TRUNCATE
(undefined ARM_NN_TRUNCATE)I normally define ARM_NN_TRUNCATE but recently I want to try to use round so I undefined the macro. In 8 bit ops, it brings some accuracy improvement but in 16 bit it fails.
The 16bit ops I use is this one but other which uses NN_ROUND() have similar issues.
CMSIS_5/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15_opt.c
Line 117 in e42a76a
change
#define NN_ROUND(out_shift) ( (0x1u << out_shift) >> 1 )
to#define NN_ROUND(out_shift) ((0x1 << out_shift) >> 1 )
fixed my issue.CMSIS_5/CMSIS/NN/Include/arm_nnsupportfunctions.h
Line 652 in e42a76a
Also, it doesn't seem right when it adds to a negative number. Should the round be round down in negative number? In most ops, only add this to the bias which means it is always positive.
More information will be provided when I figure it out. Thanks.
The text was updated successfully, but these errors were encountered: