XiaoMi / mobile-ai-bench

Benchmarking Neural Network Inference on Mobile Devices
Apache License 2.0
363 stars 58 forks source link

如何理解最后benchmark各项的结果呢 #35

Closed WangFengtu1996 closed 4 years ago

WangFengtu1996 commented 4 years ago

你好,

  1. 如何理解 Prepare Time 么, 代表第一次加载模型所需要的时间么
  2. 那么各个框架下对应的时间单位是ms么 ,还是对应的是FPS呢
  3. Run Time Average 代表, 推理一张图片所需要的时间么
  4. ('SNPE', 'MobileNetV1', 'CPU', 'Float') ('SNPE', 'MobileNetV1', 'GPU', 'Float') ('SNPE', 'MobileNetV2', 'CPU', 'Float') ('SNPE', 'MobileNetV2', 'GPU', 'Float') ('SNPE', 'InceptionV3', 'CPU', 'Float') ('SNPE', 'InceptionV3', 'GPU', 'Float') ('SNPE', 'InceptionV3', 'DSP', 'Quantized') Elapse time: 2.140218 minutes. 将最后的结果按ms单位 求和,以与上面的算出的数值出入过大?

`Prepare Time (see FAQ section in README for more explanations)

+---------------+-----------+-----------+--------+-------------+--------+----------+----------+----------+---------+------+ | model_name | quantize | product | soc | abi | device | MACE | SNPE | TFLITE | NCNN | HIAI | +---------------+-----------+-----------+--------+-------------+--------+----------+----------+----------+---------+------+ | InceptionV3 | Float | Mi Note 3 | sdm660 | arm64-v8a | CPU | 511.42 | 526.721 | 1.572 | 233.964 | | | InceptionV3 | Float | Mi Note 3 | sdm660 | arm64-v8a | GPU | 444.626 | 2138.165 | 7957.576 | | | | InceptionV3 | Float | Mi Note 3 | sdm660 | armeabi-v7a | CPU | 547.094 | 534.047 | 1.406 | 195.117 | | | InceptionV3 | Float | Mi Note 3 | sdm660 | armeabi-v7a | GPU | 476.769 | 2287.24 | 7573.171 | | |`

十分感谢答复

lu229 commented 4 years ago

@TUT-jiayou ,各项回复如下: 1, Prepare Time用于加载模型和做一些正式Run之前的准备工作,在程序里只会被调用一次(Run会被调用多次)。 2,单位是ms 3,Run Time Average 代表该模型、该框架下平均的一次推理时间 4,这个问题没明白您的意思?烦请详述一下或举个例子

WangFengtu1996 commented 4 years ago

首先,十分感谢

  1. 这是我在log找到最后结果 ` Run Time Average (See FAQ section in README for more explanations)

    +---------------+-----------+--------------+--------+-------------+--------+---------+---------+---------+----------+------+ | model_name | quantize | product | soc | abi | device | MACE | SNPE | TFLITE | NCNN | HIAI | +---------------+-----------+--------------+--------+-------------+--------+---------+---------+---------+----------+------+ | InceptionV3 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 360.608 | 535.76 | 283.497 | 975.207 | | | InceptionV3 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | GPU | 90.401 | 86.68 | 154.777 | | | | InceptionV3 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 436.955 | 500.642 | 349.156 | 1010.869 | | | InceptionV3 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | GPU | 90.471 | 87.407 | 155.162 | | | | InceptionV3 | Quantized | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 117.688 | | 131.575 | | | | InceptionV3 | Quantized | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 174.257 | | 150.809 | | | | MobileNetV1 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 23.992 | 292.47 | 43.122 | 21.569 | | | MobileNetV1 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | GPU | 9.966 | 11.341 | 14.502 | | | | MobileNetV1 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 29.818 | 298.257 | 51.716 | 25.657 | | | MobileNetV1 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | GPU | 10.138 | 11.454 | 14.79 | | | | MobileNetV1 | Quantized | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 13.712 | | 14.012 | | | | MobileNetV1 | Quantized | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 16.982 | | 16.62 | | | | MobileNetV2 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 19.517 | 323.431 | 41.313 | 18.53 | | | MobileNetV2 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | GPU | 7.745 | 9.225 | 12.79 | | | | MobileNetV2 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 24.058 | 328.035 | 45.982 | 19.209 | | | MobileNetV2 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | GPU | 7.941 | 9.299 | 13.064 | | | | MobileNetV2 | Quantized | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 11.619 | | 12.668 | | | | MobileNetV2 | Quantized | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 15.315 | | 15.571 | | | | SqueezeNetV11 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | CPU | 19.261 | | | 17.718 | | | SqueezeNetV11 | Float | POCOPHONE F1 | sdm845 | arm64-v8a | GPU | 7.612 | | | | | | SqueezeNetV11 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | CPU | 23.366 | | | 19.303 | | | SqueezeNetV11 | Float | POCOPHONE F1 | sdm845 | armeabi-v7a | GPU | 7.801 | | | | | +---------------+-----------+--------------+--------+-------------+--------+---------+---------+---------+----------+------+ `

2,我在上面的部分找到了一些有关的数据 Run on device: 8275a4, POCOPHONE F1, sdm845 ('TFLITE', 'MobileNetV1', 'CPU', 'Float') ('TFLITE', 'MobileNetV1', 'GPU', 'Float') ('TFLITE', 'MobileNetV2', 'CPU', 'Float') ('TFLITE', 'MobileNetV2', 'GPU', 'Float') ('TFLITE', 'InceptionV3', 'CPU', 'Float') ('TFLITE', 'InceptionV3', 'GPU', 'Float') ('TFLITE', 'MobileNetV1', 'CPU', 'Quantized') ('TFLITE', 'MobileNetV2', 'CPU', 'Quantized') ('TFLITE', 'InceptionV3', 'CPU', 'Quantized') Elapse time: 2.160257 minutes. ABI armeabi-v7a

  1. 我算出来的结果为812.87, 可以与2 的结果 出入比较大, 我同时也算过另外一组数据,同样,出入也比较大,所以,对于这些数据如何计算,我表示很好奇。

多谢。

lu229 commented 4 years ago

@TUT-jiayou ,还是不明白你的意思,你说的2的结果是什么?是指2.160257 minutes?你的结果812.87是怎么算出来的?哪两个数据出入比较大?

WangFengtu1996 commented 4 years ago

对于2的结果指的就是2.160257 minutes,812.87 是将Run Time Average 中对应的项求和,然后就是812.87ms 与 2.160257 minutes 结果出入很大。

lu229 commented 4 years ago

@TUT-jiayou 这个不一样,不能放在一起比较。 列表中的时间,是运行多次Run之后得到的平均时间,2.160257是指跑完一轮测试的总时间,包括init、prepare、多次Run的时间。

WangFengtu1996 commented 4 years ago

嗯嗯,多谢。