zhy520xp / mace-makefile-project

makefile 交叉编译 libmace.a,并能在嵌入式端调用GPU来跑深度学习模型
96 stars 18 forks source link

在RK3399上测试GPU和CPU 结果不一致 #13

Closed Casual2017 closed 6 years ago

Casual2017 commented 6 years ago

pi@NanoPC-T4:~/Mace/mace-makefile-project-master/unit_test_gpu$ ./demo W ../mace/core/runtime/opencl/opencl_runtime.cc:40] Set GPU configurations, gpu_perf_hint: 3, gpu_priority_hint: 3 =====>>>>>start to CreateMaceEngineFromProto I ../mace/core/mace.cc:337] Create MaceEngine from model pb I ../mace/core/mace.cc:135] Initializing MaceEngine W ../mace/core/runtime/opencl/opencl_wrapper.cc:283] Loading OpenCL from ./opencl_library/libOpenCL.so W ../mace/core/runtime/opencl/opencl_runtime.cc:356] Using device: Mali-T860 I ../mace/utils/tuner.h:129] There is no tuned parameters. W ../mace/core/runtime/opencl/opencl_runtime.cc:428] There is no precompiled OpenCL binary in all OpenCL binary paths =====>>>>>end to CreateMaceEngineFromProto =====>>>>>Warm up Run Model spend time:1021 ms =====>>>>>Normal Run Model spend time:123 ms 0.746094 ,0.128662 , I ../mace/core/mace.cc:194] Destroying MaceEngine

Casual2017 commented 6 years ago

pi@NanoPC-T4:~/Mace/mace-makefile-project-master/unit_test_cpu$ ./demo =====>>>>>start to CreateMaceEngineFromProto I ../mace/core/mace.cc:337] Create MaceEngine from model pb I ../mace/core/mace.cc:135] Initializing MaceEngine =====>>>>>end to CreateMaceEngineFromProto =====>>>>>Warm up Run Model spend time:265 ms =====>>>>>Normal Run Model spend time:216 ms 0.742202 ,0.134290 , I ../mace/core/mace.cc:194] Destroying MaceEngine

zhy520xp commented 6 years ago

你要搞清楚一点,你在把你的模型转换成mace gpu模型的时候,是f32还是f16.我这里提供的的gpu的模型是f16的,所以在gpu上的结果与cpu的结果是一些精度差异的。如果你想要gpu的结果和cpu的结果一致的话,请在转GPU模型的时候,选择f32