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

Is 0.4.3 NNOM c backend slower than CMSIS-5.9.0? #182

Open
bfs18 opened this issue Mar 2, 2023 · 2 comments
Open

Is 0.4.3 NNOM c backend slower than CMSIS-5.9.0? #182

bfs18 opened this issue Mar 2, 2023 · 2 comments

Comments

@bfs18
Copy link
Contributor

bfs18 commented Mar 2, 2023

I test the mnist-simple model in rt-thread environment and run model predict for 1000 times.
using CMSIS 5.9.0 backend, it consumes 1423 ms
using NNOM 0.4.3 C backend, it consumes 1392 ms
The document says that replacing c backend with CMSIS would bring 5 times speed-up, however, the performance is similar according to my test. What's the reason? NNOM updated or I didn't set CMSIS macros correctly?

@majianjia
Copy link
Owner

Probably you havent enable CMSIS's NN acceleration, i.e. you are running CMSIS on their C backend instead of SIMD assemblys.
You may check CMSIS instruction or the note under HWC format

@bfs18
Copy link
Contributor Author

bfs18 commented Mar 4, 2023

UPDATE: When -Ofast is added, using CMSIS 5.9.0 backend, reduces to 369 ms.

Hi Jia, thanks for your advice. I add

ARM_MATH_DSP,ARM_MATH_CM7,__FPU_PRESENT=1 

using CMSIS 5.9.0 backend, reduces to 1055 ms.
I used the rt-thread qemu-vexpress-a9 bsp. Is this normal?

Probably you havent enable CMSIS's NN acceleration, i.e. you are running CMSIS on their C backend instead of SIMD assemblys. You may check CMSIS instruction or the note under HWC format

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

No branches or pull requests

2 participants