onnxruntime
f20df72d - [CANN] Fix the ACL_ERROR_REPEAT_INITIALIZE error that occurs when coexisting… (#26193)

Commit
54 days ago
[CANN] Fix the ACL_ERROR_REPEAT_INITIALIZE error that occurs when coexisting… (#26193) ### Description This PR fixes the ACL_ERROR_REPEAT_INITIALIZE error that occurs when onnxruntime-cann coexists with torch_npu, which causes the CANN provider to fail to initialize and fall back to CPU for inference. ### Error log ``` 2025-08-30 03:30:44.189484484 [E:onnxruntime:Default, provider_bridge_ort.cc:2279 TryGetProviderInfo_CANN] ~/code/onnxruntime/onnxruntime/core/providers/cann/cann_call.cc:143 bool onnxruntime::CannCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = int; bool THRW = true] ~/code/onnxruntime/onnxruntime/core/providers/cann/cann_call.cc:137 bool onnxruntime::CannCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*) [with ERRTYPE = int; bool THRW = true] CANN failure 100002: ACL_ERROR_REPEAT_INITIALIZE ; NPU=0 ; hostname=coder-6a95445b-e353-4b0b-970b-41797b02ca23-566969c97-xlf2s ; expr=aclInit(nullptr); *************** EP Error *************** EP Error /home/dou/code/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:1231 std::shared_ptr<onnxruntime::IExecutionProviderFactory> onnxruntime::python::CreateExecutionProviderFactoryInstance(const onnxruntime::SessionOptions&, const string&, const ProviderOptionsMap&) create CANN ExecutionProvider fail when using [('CANNExecutionProvider', {'device_id': 0, 'arena_extend_strategy': 'kNextPowerOfTwo', 'npu_mem_limit': 4294967296, 'enable_cann_graph': True}), 'CPUExecutionProvider'] Falling back to ['CPUExecutionProvider'] and retrying. **************************************** ================= before run [array([[ -8.8664875, -7.903085 , -6.529765 , -6.0811057, -4.148506 , -6.4790154, -5.8431354, -8.300879 , -6.77909 , -8.013498 , -8.759175 , -7.237462 , -6.890937 , -8.367442 , -7.565303 , ```
Author
Parents
Loading