-
Notifications
You must be signed in to change notification settings - Fork 4
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
What is the accuracy and execution speed of the model? #1
Comments
Which model did you infer with? Are using using all the NPU cores? |
supercombo @master 341b81c0a5c5f378f749a8ba07514f48f0f9faa5. The latest model is taking me 100ms to run. Haven't had time to check the older models. Accuracy is bad, not sure if it's my implementation |
Yes, with
The latest model is 100ms too. I'm thinking use C++ rknn_api, but i'm a Java/Python developer, it's hard for me. |
I am already running using the C++ rknn_api, 10ms savings for the latest model compared to using python, not worth. I think we need to look at the underlying issue. Get the performance of each op type. I just did a quick test with the older models. v0.8.13 runs at 40ms single core, lemon pie model runs at 70ms single core, and the latest model certified herbalist model runs at 110ms single core |
Also what dev platform are you running on? OS? Are you able to do a perf_debug? |
Same as this project. https://github.com/Joshua-Riek/ubuntu-rockchip The perf log: https://gist.github.com/0312birdzhang/810b1fd40427484f7167e9bd4bf4f1cf |
Oh thank you. Looks like the reshape is taking bulk of the time moving things around from the NPU to the CPU. Maybe we can remove reshape and find a substitute for it. By the way, how are you getting the perf log? I don't quite understand how does adb work between a linux host and a linux client. |
Search
I'm using Orangepi 5, and need to flash the stock orangepi ubuntu(you can burn to sdcard), otherwise adb not works. |
After removing pow from the onnx graph and running the perf again. 34ms |
34ms is really good, we need find some solution to replace Pow. |
Agree. For now I need to run an accuracy benchmark without replacing the pow first. Do you to happen to have any? |
I'm a newbie on this, i asked on RKNN group, they said you can take a look at the rknn_matmul_api_demo, it can runs on GPU. |
Cool stuff, yeah I am already checking matmul. Need sometime to digest and understand. I can't join the qq group because my number is somehow barred. Could you also ask them if they plan to support more op types in the near future? |
Officials never make promises, I will continue to pay attention to this |
with 2.0.0b0 released, Moonrise Model perf logs:
|
With 0.9.5 model:
|
This one looks promising. Were there any difference before the 2.0.0beta update? |
Yes, Reshape use less CPU times.
|
Looking good. Have you checked the accuracy of the output? You can run the onnx version, save the output in npy, then compare with the output from the rknn's model. Take the cosine similarity of the outputs. If it's more than 0.99, its quite accurate. (At least that is what I got for the 0.9.5 model) |
I used the code from ChatGPT, result is onnx_output = ...
rknn_output = ...
mse = np.mean((onnx_output - rknn_output) ** 2)
print("Mean Squared Error:", mse) |
Looks like the MSE output is quite low, so I guess it's quite accurate. But just in case, do the consine similarity too, because it takes into account the signed error |
By the way, are you by any chance using the new 2.0.0beta rknn-toolkit2 to convert the model? I am getting an error saying the input cannot be FP16... |
Convert to fp32 first, some codes from openpilot
|
I have also tested it, but the NPU usage is very low, and it takes about 50ms to infer one frame.
The text was updated successfully, but these errors were encountered: