ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

在intel CPU上测试速度与mnn差距有点大

Open ppl21847 opened this issue 2 years ago • 3 comments

error log | 日志或报错信息 | ログ

image 测试ncnn比mnn慢的有点多。

context | 编译/运行环境 | バックグラウンド

编译环境: $ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 1 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz $ cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l 1 $ cat /proc/cpuinfo |grep "processor"|wc -l 1 $ cat /proc/cpuinfo |grep "cores"|uniq cpu cores : 1 运行环境: $ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 48 Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz $ cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l 2 $ cat /proc/cpuinfo |grep "processor"|wc -l 48 $ cat /proc/cpuinfo |grep "cores"|uniq cpu cores : 12

how to reproduce | 复现步骤 | 再現方法

1.编译ncnn cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_BENCHMARK=ON -DNCNN_VULKAN=OFF -DNCNN_COVERAGE=ON -DNCNN_BUILD_EXAMPLES=OFF .. make -j$(nproc) 2.用onnx2ncnn工具将onnx模型转ncnn模型 3.用benchncnn测试转模型得到的param

more | 其他 | その他

3,384,384 param文件 链接:https://pan.baidu.com/s/1Tl1hVehhVu7VuQCURgZfpg 提取码:o8qk

ppl21847 avatar Jul 13 '22 03:07 ppl21847

编译参数不应该开启 NCNN_BENCHMARK 和 NCNN_COVERAGE,这两个是调试用的,会输出大量调试信息和文件,影响速度 cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_BENCHMARK=OFF -DNCNN_VULKAN=OFF -DNCNN_COVERAGE=OFF -DNCNN_BUILD_EXAMPLES=OFF ..

nihui avatar Jul 13 '22 03:07 nihui

编译参数不应该开启 NCNN_BENCHMARK 和 NCNN_COVERAGE,这两个是调试用的,会输出大量调试信息和文件,影响速度 cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_BENCHMARK=OFF -DNCNN_VULKAN=OFF -DNCNN_COVERAGE=OFF -DNCNN_BUILD_EXAMPLES=OFF ..

按上面设置后,还是慢 image 初始化参数如下: image

ppl21847 avatar Jul 13 '22 10:07 ppl21847

楼主你可以多提点优化pr把它弄快点

wzyforgit avatar Jul 14 '22 00:07 wzyforgit

大佬,是否能再提供下模型呢,貌似过期了。。

Yoh-Z avatar Dec 12 '22 15:12 Yoh-Z

最新版本优化了许多 intel cpu 的性能,欢迎尝试,如有问题,可以 reopen issue 继续交流~~

nihui avatar Nov 09 '23 09:11 nihui