fix: change PP-OCRv5_server_det HPI backend priority to openvino-first#5032
Conversation
PP-OCRv5_server_det defaults to paddle_mkldnn backend when HPI is enabled on cpu_x64, which causes std::exception crashes in multi-threaded serving environments (gRPC, FastAPI workers, etc.) due to MKL-DNN thread-safety issues. This change swaps openvino before paddle_mkldnn in all cpu_x64 sections (paddle30, paddle31, paddle311). GPU sections are unaffected.
|
Thanks for your contribution! |
|
It looks like the CI jobs PaddleX-CI-MLU and PaddleX-CI-XPU were cancelled during dependency installation (Error: The operation was canceled.). |
|
PaddleX determines the priority of HPI backends according to a unified rule. In our testing environment, backends with better inference performance (i.e., higher speed) are assigned higher priority. As a result, the default backend is typically the one with the best performance, which helps maximize the acceleration effect of HPI. Although, as you mentioned, some backends such as |
Problem
PP-OCRv5_server_det defaults to
paddle_mkldnnbackend when HPI is enabled on cpu_x64,which causes
std::exceptioncrashes in multi-threaded serving environments (gRPC, FastAPIwith workers, etc.) due to MKL-DNN thread-safety issues.
Root Cause
The backend priority list in hpi_model_info_collection.json places
paddle_mkldnnbeforeopenvinoforPP-OCRv5_server_detin cpu_x64 sections.Evidence
PP-OCRv5_mobile_detalready correctly prioritizesopenvinoin thepaddle30sectionand works in the same multi-threaded setup without crashes.
Fix
Swap
openvinobeforepaddle_mkldnnforPP-OCRv5_server_detin all 3 cpu_x64 sections(paddle30, paddle31, paddle311). GPU sections are unaffected.
Reproduction
PP-OCRv5_server_det+enable_hpi=Truestd::exception