Results differ when doing CPU inference multiple times with MKLDNN
Created by: cryoco
System information Paddle version: 1.8.2/1.8.3 Paddle With CUDA: False OS: Ubuntu 16.04 CPU: 16 Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz Python version: 3.5.2 CUDA version: 9.0.176 cuDNN version: None.None.None Nvidia driver version: None API information: inference configuration
config.disable_gpu()
config.enable_mkldnn()
config.set_cpu_math_library_num_threads(4)
To Reproduce
- download models
- perform inference with mkldnn code to reproduce: test_ocr_mkldnn_diff.txt
This issue can be reproduced with any input. We use data with all ones here.
python3 test_ocr_mkldnn_diff.py --model_file=./ch_det_mv3_db/model --params_file=./ch_det_mv3_db/params --mkldnn
Run inference 10 times with the same model and input, and result shifts every time(only the first result is correct).
- perform inference without mkldnn
python3 test_ocr_mkldnn_diff.py --model_file=./ch_det_mv3_db/model --params_file=./ch_det_mv3_db/params