Skip to content

The prediction accuracy of the pcpvt_base model after mkldnn is turned on is different from that of pure CPU, and the difference is greater than 0.01. #35574

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

Closed
baoachun opened this issue Sep 8, 2021 · 10 comments
Assignees
Labels
Milestone

Comments

@baoachun
Copy link
Contributor

baoachun commented Sep 8, 2021

Commit id:0be7157185138a5e92732225f56737d34fc532f8

PR: #34192

图片

@lidanqing-intel
Copy link
Contributor

lidanqing-intel commented Sep 8, 2021

@baoachun Where is this screen shot from? With this we could not reproduce. Could you please provide command? And Is this issue must be fixed for Paddle 2.2

@jczaja Please help watch this issue. Thanks

@baoachun
Copy link
Contributor Author

baoachun commented Sep 9, 2021

@lidanqing-intel @jczaja
Hi, there is the test code, https://github.com/PaddlePaddle/PaddleTest/blob/develop/inference/python_api_test/test_class_model/test_pcpvt_base.py#L64.

python3.8 -m pytest --disable-warnings -v test_pcpvt_base.py::test_mkldnn

@lidanqing-intel
Copy link
Contributor

lidanqing-intel commented Sep 9, 2021

@jczaja This is not urgent for 2.2RC

@lidanqing-intel lidanqing-intel added this to the v2.2 milestone Sep 15, 2021
@lidanqing-intel
Copy link
Contributor

lidanqing-intel commented Sep 15, 2021

@baoachun @jakpiase Baoachun updated this issue caused other 4 issues. So I revert your PR first. If you make fix PR before 17th September, please @baoachun to let him test his 5 cards first and then merge the fix PR. Thanks.
Update: This issue need to be fixed for v2.2

@lidanqing-intel
Copy link
Contributor

@jakpiase Hi, I can not revert for you, because there are too many file conflicts and I m not sure if I could remove or not. Please revert it or fix it before 17th September (which is like night 16th September Poland). Keep updating under this issue. Thanks.

@baoachun
Copy link
Contributor Author

baoachun commented Sep 15, 2021

First step:
git clone https://github.com/PaddlePaddle/PaddleClas.git
git checkout develop

Second step:
Download models and images from here: https://github.com/PaddlePaddle/PaddleClas/blob/develop/docs/en/tutorials/quick_start_recognition_en.md
图片

Problem 1:
cd PaddleClas/deploy; python python/predict_system.py -c configs/inference_product.yaml -o Global.infer_imgs=./recognition_demo_data_v1.1/test_product/daoxiangcunjinzhubing_6.jpg -o Global.use_gpu=False -o Global.use_tensorrt=False -o Global.use_fp16=False -o Global.enable_mkldnn=True

Problem 2:
cd PaddleClas/deploy; python python/predict_system.py -c configs/inference_vehicle.yaml -o Global.infer_imgs=./recognition_demo_data_v1.1/test_vehicle/audia4-102.jpeg -o Global.use_gpu=False -o Global.use_tensorrt=False -o Global.use_fp16=False -o Global.enable_mkldnn=True

Problem 3:
cd PaddleClas/deploy; python python/predict_system.py -c configs/inference_logo.yaml -o Global.infer_imgs=./recognition_demo_data_v1.1/test_logo/benz-001.jpeg -o Global.use_gpu=False -o Global.use_tensorrt=False -o Global.use_fp16=False -o Global.enable_mkldnn=True

Problem 4:
cd PaddleClas/deploy; python python/predict_cls.py -c configs/inference_cls.yaml -o Global.inference_model_dir=../inference/ShuffleNetV2 -o batch_size=1 -o Global.use_gpu=False -o Global.use_tensorrt=False -o Global.enable_mkldnn=True

Problem 5:
cd PaddleClas/deploy; python python/predict_system.py -c configs/inference_cartoon.yaml -o Global.infer_imgs=./recognition_demo_data_v1.1/test_cartoon/aisidesi-001.jpeg -o Global.use_gpu=False -o Global.use_tensorrt=False -o Global.use_fp16=False -o Global.enable_mkldnn=True

@baoachun
Copy link
Contributor Author

#35794
The same question.

@jakpiase
Copy link
Contributor

@baoachun I couldn't find a way how to download "..inference/ShuffleNetV2" model, but I have found

https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/whole_chain/ShuffleNetV2_x1_0_inference.tar

And I have ran this model. It gives same result with and without oneDNN enabled. If I have tested wrong model could you please tell me how to download the correct one?
And pcpvt_base model will be fixed by: #35781(disabling reshape and squeeze ops)

@baoachun
Copy link
Contributor Author

@jakpiase
Hi, the model that you used is correct, and the prediction result is wrong compare with CPU.
图片

@jakpiase
Copy link
Contributor

Hi, @baoachun, sorry for my mistake, you are right. These results are incorrect now, but I have checked and they will be fixed after #35781 is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants