| @@ -34,8 +34,8 @@ Status HostCpuEngine::Initialize(const std::map<string, string> &options) { | |||
| if (ops_kernel_store_ == nullptr) { | |||
| ops_kernel_store_ = MakeShared<HostCpuOpsKernelInfoStore>(); | |||
| if (ops_kernel_store_ == nullptr) { | |||
| GELOGE(FAILED, "[init][HostCpuEngine] Initialize failed. as malloc shared_ptr failed."); | |||
| RRPORT_INNER_ERROR("E19999", "HostCpuEngine Initialize failed. as malloc shared_ptr failed."); | |||
| GELOGE(FAILED, "[Init][HostCpuEngine] fail for new HostCpuOpsKernelInfoStore."); | |||
| RRPORT_INNER_ERROR("E19999", "HostCpuEngine Initialize failed. fail for new HostCpuOpsKernelInfoStore."); | |||
| return FAILED; | |||
| } | |||
| } | |||
| @@ -39,8 +39,9 @@ Status HostCpuOpsKernelBuilder::Initialize(const map<std::string, std::string> & | |||
| Status HostCpuOpsKernelBuilder::CalcOpRunningParam(Node &ge_node) { | |||
| OpDescPtr op_desc = ge_node.GetOpDesc(); | |||
| if (op_desc == nullptr) { | |||
| GELOGE(FAILED, "[get][opdes] OpDesc is nullptr, as input node's op desc is null."); | |||
| REPORT_INNER_ERROR("E19999", "CalcOpRunningParam failed, as input param node GetOpDesc return nullptr."); | |||
| GELOGE(FAILED, "[Check][Param:OpDesc]nullptr is invalid, node:%s.", ge_node->GetName().c_str()); | |||
| REPORT_INNER_ERROR("E19999", "OpDesc is nullptr in node:%s, check invalid when CalcOpRunningParam", | |||
| ge_node->GetName().c_str()); | |||
| return FAILED; | |||
| } | |||
| @@ -74,11 +75,10 @@ Status HostCpuOpsKernelBuilder::CalcOpRunningParam(Node &ge_node) { | |||
| GeShape output_shape = output_tensor.GetShape(); | |||
| if ((TensorUtils::CalcTensorMemSize(output_shape, format, data_type, output_mem_size) != GRAPH_SUCCESS) || | |||
| (output_mem_size < 0)) { | |||
| GELOGE(FAILED, "CalcTensorMemSize failed."); | |||
| GELOGE(FAILED, "[Calc][TensorMemSize] op[%s:%s] out[%zu] mem size failed, mem_size=%ld, format=%s, data_type=%s.", | |||
| GELOGE(FAILED, "[Calc][TensorMemSize]fail for op[%s:%s] out[%zu], mem_size=%ld, format=%s, data_type=%s.", | |||
| name.c_str(), type.c_str(), i, output_mem_size, TypeUtils::FormatToSerialString(format).c_str(), | |||
| TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||
| REPORT_CALL_ERROR("E19999", "CalcTensorMemSize failed. op[%s:%s] out[%zu] mem size failed, mem_size=%ld, format=%s, data_type=%s.", | |||
| REPORT_CALL_ERROR("E19999", "CalcTensorMemSize failed when CalcOpRunningParam. fail for op[%s:%s] out[%zu], mem_size=%ld, format=%s, data_type=%s.", | |||
| name.c_str(), type.c_str(), i, output_mem_size, TypeUtils::FormatToSerialString(format).c_str(), | |||
| TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||
| return FAILED; | |||
| @@ -89,10 +89,9 @@ Status HostCpuOpsKernelBuilder::CalcOpRunningParam(Node &ge_node) { | |||
| TensorUtils::SetSize(output_tensor, output_mem_size); | |||
| if (op_desc->UpdateOutputDesc(static_cast<uint32_t>(i), output_tensor) != GRAPH_SUCCESS) { | |||
| GELOGE(FAILED, "UpdateOutputDesc failed."); | |||
| GELOGE(FAILED, "[Update][OutputDesc] op[%s:%s] out[%zu] desc failed, format=%s, data_type=%s.", name.c_str(), type.c_str(), i, | |||
| GELOGE(FAILED, "[Update][OutputDesc] fail for op[%s:%s] out[%zu], format=%s, data_type=%s.", name.c_str(), type.c_str(), i, | |||
| TypeUtils::FormatToSerialString(format).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||
| REPORT_CALL_ERROR("E19999", "UpdateOutputDesc failed. op[%s:%s] out[%zu] desc failed, format=%s, data_type=%s.", name.c_str(), type.c_str(), i, | |||
| REPORT_CALL_ERROR("E19999", "UpdateOutputDesc failed when CalcOpRunningParam. fail for op[%s:%s] out[%zu], format=%s, data_type=%s.", name.c_str(), type.c_str(), i, | |||
| TypeUtils::FormatToSerialString(format).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||
| return FAILED; | |||
| } | |||
| @@ -68,8 +68,7 @@ Status GELib::Initialize(const map<string, string> &options) { | |||
| // Multiple initializations are not allowed | |||
| instancePtr_ = MakeShared<GELib>(); | |||
| if (instancePtr_ == nullptr) { | |||
| GELOGE(GE_CLI_INIT_FAILED, "[init][GeLib] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initialize failed, as malloc shared_ptr failed."); | |||
| GELOGE(GE_CLI_INIT_FAILED, "[Init][GeLib] failed for new GELib."); | |||
| return GE_CLI_INIT_FAILED; | |||
| } | |||
| @@ -77,15 +76,13 @@ Status GELib::Initialize(const map<string, string> &options) { | |||
| map<string, string> new_options; | |||
| Status ret = instancePtr_->SetRTSocVersion(options, new_options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "[set][RTSocVersion] failed, input options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initial failed, as SetRTSocVersion failed."); | |||
| GELOGE(ret, "[Set][RTSocVersion] failed."); | |||
| return ret; | |||
| } | |||
| ret = instancePtr_->SetAiCoreNum(new_options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "[Set][AiCoreNum] failed, input options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initial failed, as SetAiCoreNum failed."); | |||
| GELOGE(ret, "[Set][AiCoreNum] failed."); | |||
| return ret; | |||
| } | |||
| @@ -100,8 +97,7 @@ Status GELib::Initialize(const map<string, string> &options) { | |||
| GE_TIMESTAMP_START(Init); | |||
| ret = instancePtr_->InnerInitialize(new_options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "[init][GELib] failed, as options is invalid ."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initial failed, as GELib::InnerInitialize failed."); | |||
| GELOGE(ret, "[Init][GELib] failed."); | |||
| instancePtr_ = nullptr; | |||
| return ret; | |||
| } | |||
| @@ -122,8 +118,7 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initSystemStatus = SystemInitialize(options); | |||
| GE_TIMESTAMP_END(SystemInitialize, "InnerInitialize::SystemInitialize"); | |||
| if (initSystemStatus != SUCCESS) { | |||
| GELOGE(initSystemStatus, "[init][system]failed, as options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GE system initial failed, as SystemInitialize failed."); | |||
| GELOGE(initSystemStatus, "[Init][System]failed."); | |||
| RollbackInit(); | |||
| return initSystemStatus; | |||
| } | |||
| @@ -146,8 +141,7 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initOpsStatus = opsManager_.Initialize(options); | |||
| GE_TIMESTAMP_END(OpsManagerInitialize, "InnerInitialize::OpsManagerInitialize"); | |||
| if (initOpsStatus != SUCCESS) { | |||
| GELOGE(initOpsStatus, "[init][OpsKernelManager] failed, options invalid. "); | |||
| REPORT_INNER_ERROR("E19999", "GE ops manager initial failed. as call OpsKernelManager::Initialize failed. "); | |||
| GELOGE(initOpsStatus, "[Init][OpsKernelManager] failed. "); | |||
| RollbackInit(); | |||
| return initOpsStatus; | |||
| } | |||
| @@ -158,8 +152,7 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initOpsBuilderStatus = OpsKernelBuilderManager::Instance().Initialize(options); | |||
| GE_TIMESTAMP_END(OpsKernelBuilderManagerInitialize, "InnerInitialize::OpsKernelBuilderManager"); | |||
| if (initOpsBuilderStatus != SUCCESS) { | |||
| GELOGE(initOpsBuilderStatus, "[init][OpsKernelBuilderManager] failed, options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GE ops buildermanager initial failed, as call OpsKernelBuilderManager::Initialize failed."); | |||
| GELOGE(initOpsBuilderStatus, "[Init][OpsKernelBuilderManager] failed."); | |||
| RollbackInit(); | |||
| return initOpsBuilderStatus; | |||
| } | |||
| @@ -170,8 +163,7 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initSmStatus = sessionManager_.Initialize(options); | |||
| GE_TIMESTAMP_END(SessionManagerInitialize, "InnerInitialize::SessionManagerInitialize"); | |||
| if (initSmStatus != SUCCESS) { | |||
| GELOGE(initSmStatus, "[init][SessionManager] failed, options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GE session manager initial failed. as SessionManager::Initialize failed."); | |||
| GELOGE(initSmStatus, "[Init][SessionManager] failed."); | |||
| RollbackInit(); | |||
| return initSmStatus; | |||
| } | |||
| @@ -181,7 +173,7 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initHostCpuEngineStatus = HostCpuEngine::GetInstance().Initialize(); | |||
| GE_TIMESTAMP_END(HostCpuEngineInitialize, "InnerInitialize::HostCpuEngineInitialize"); | |||
| if (initHostCpuEngineStatus != SUCCESS) { | |||
| GELOGE(initHostCpuEngineStatus, "Failed to initialize HostCpuEngine"); | |||
| GELOGE(initHostCpuEngineStatus, "[Init][HostCpuEngine] failed."); | |||
| RollbackInit(); | |||
| return initHostCpuEngineStatus; | |||
| } | |||
| @@ -189,7 +181,7 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| GELOGI("Start to init Analyzer!"); | |||
| Status init_analyzer_status = ge::Analyzer::GetInstance()->Initialize(); | |||
| if (init_analyzer_status != SUCCESS) { | |||
| GELOGE(init_analyzer_status, "Failed to initialize HostCpuEngine"); | |||
| GELOGE(init_analyzer_status, "[Init][HostCpuEngine] failed."); | |||
| RollbackInit(); | |||
| return init_analyzer_status; | |||
| } | |||
| @@ -214,8 +206,7 @@ Status GELib::SystemInitialize(const map<string, string> &options) { | |||
| auto model_manager = ModelManager::GetInstance(); | |||
| GE_CHECK_NOTNULL(model_manager); | |||
| GE_IF_BOOL_EXEC(model_manager->EnableExceptionDump(options) != SUCCESS, | |||
| REPORT_INNER_ERROR("E19999", "ModelManager EnableExceptionDump failed, options invalid."); | |||
| GELOGE(FAILED, "[check][ModelManager][EnableExceptionDump] failed, options invalid."); | |||
| GELOGE(FAILED, "[Enable][ExceptionDump] failed."); | |||
| return FAILED); | |||
| // 1.`is_train_mode_` means case: train | |||
| // 2.`(!is_train_mode_) && (options_.device_id != kDefaultDeviceIdForInfer)` means case: online infer | |||
| @@ -269,9 +260,7 @@ Status GELib::SetRTSocVersion(const map<string, string> &options, map<string, st | |||
| GELOGI("SOC_VERSION is not exist in options"); | |||
| char version[kSocVersionLen] = {0}; | |||
| rtError_t rt_ret = rtGetSocVersion(version, kSocVersionLen); | |||
| GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
| REPORT_CALL_ERROR("E19999","rtGetSocVersion failed."); | |||
| GELOGE(rt_ret, "[get][SocVersion] failed."); return FAILED;) | |||
| GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, GELOGE(rt_ret, "[Get][SocVersion] failed."); return FAILED;) | |||
| GELOGI("Succeeded in getting SOC_VERSION[%s] from runtime.", version); | |||
| new_options.insert(std::make_pair(ge::SOC_VERSION, version)); | |||
| } | |||
| @@ -292,8 +281,7 @@ Status GELib::SetAiCoreNum(map<string, string> &options) { | |||
| options.emplace(std::make_pair(AICORE_NUM, std::to_string(aicore_num))); | |||
| return SUCCESS; | |||
| } | |||
| GELOGE(FAILED, "[get][AiCoreCount] failed."); | |||
| REPORT_CALL_ERROR("E19999", "rtGetAiCoreCount failed."); | |||
| GELOGE(FAILED, "[Get][AiCoreCount] failed."); | |||
| return FAILED; | |||
| } | |||
| @@ -368,7 +356,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status GELib::InitSystemWithOpt | |||
| mem_type.push_back(RT_MEMORY_P2P_DDR); | |||
| Status initMmStatus = MemManager::Instance().Initialize(mem_type); | |||
| if (initMmStatus != SUCCESS) { | |||
| GELOGE(initMmStatus, "[Init][MemManager] MemoryAllocatorManager initialize failed."); | |||
| GELOGE(initMmStatus, "[Init][MemManager] failed."); | |||
| return initMmStatus; | |||
| } | |||
| @@ -376,7 +364,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status GELib::InitSystemWithOpt | |||
| // Update CSA file | |||
| CsaInteract::GetInstance().Init(options.device_id, GetContext().TraceId()); | |||
| Status ret = CsaInteract::GetInstance().WriteJobState(JOBSTATE_RUNNING, JOBSUBSTATE_ENV_INIT); | |||
| GE_LOGE_IF(ret != SUCCESS, "[write] [job state] failed, ret:%u", ret); | |||
| GE_LOGE_IF(ret != SUCCESS, "[Write][JobState] failed, ret:%u, jobstate_running=%d,substate_env_init=%d.", | |||
| ret, JOBSTATE_RUNNING, JOBSUBSTATE_ENV_INIT); | |||
| // set device id | |||
| GELOGI("set logical device id:%u", options.device_id); | |||
| @@ -407,7 +396,7 @@ Status GELib::SystemShutdownWithOptions(const Options &options) { | |||
| // Update CSA file | |||
| Status ret = CsaInteract::GetInstance().WriteJobState(JOBSTATE_SUCCEED); | |||
| GE_LOGE_IF(ret != SUCCESS, "[write] [job state] failed, ret:%u", ret); | |||
| GE_LOGE_IF(ret != SUCCESS, "[Write][JobState] failed, ret:%u jobstate_succeed=%d.", ret, JOBSTATE_SUCCEED); | |||
| is_system_inited = false; | |||
| is_shutdown = true; | |||
| @@ -423,7 +412,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status GELib::InitSystemWithout | |||
| mem_type.push_back(RT_MEMORY_P2P_DDR); | |||
| Status initMmStatus = MemManager::Instance().Initialize(mem_type); | |||
| if (initMmStatus != SUCCESS) { | |||
| GELOGE(initMmStatus, "[Initialize][MemManager] MemoryAllocatorManager initialize failed."); | |||
| GELOGE(initMmStatus, "[Init][MemManager] failed."); | |||
| return initMmStatus; | |||
| } | |||
| GE_CHK_STATUS_RET(HostMemManager::Instance().Initialize()); | |||
| @@ -519,8 +508,8 @@ Status GELib::Finalize() { | |||
| instancePtr_ = nullptr; | |||
| init_flag_ = false; | |||
| if (final_state != SUCCESS) { | |||
| GELOGE(FAILED, "[check][state]finalization failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::Finalize finalization failed."); | |||
| GELOGE(FAILED, "[Check][State]finalization failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::Finalize finalization failed because no init before."); | |||
| return final_state; | |||
| } | |||
| GELOGI("finalization success."); | |||
| @@ -78,7 +78,7 @@ void CsaInteract::Init(int32_t dev_index, int64_t job_id) { | |||
| Status CsaInteract::WriteJobState(JobState job_state, JobSubState job_sub_state, uint32_t module_ret_errcode, | |||
| ErrorModule error_module) { | |||
| if (!is_init_) { | |||
| GELOGE(INTERNAL_ERROR, "[init][CsaInteract] obj has not init, can't WriteJobState"); | |||
| GELOGE(INTERNAL_ERROR, "[Init][CsaInteract] obj has not init, can't WriteJobState"); | |||
| REPORT_INNER_ERROR("E19999", "CsaInteracthas not init, can't WriteJobState"); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| @@ -108,8 +108,8 @@ Status CsaInteract::WriteJobState(JobState job_state, JobSubState job_sub_state, | |||
| content = content_json.dump(); | |||
| } catch (const nlohmann::json::exception &e) { | |||
| GELOGE(INTERNAL_ERROR, "[create] [json object] exception:%s job_state:%u", e.what(), job_state); | |||
| REPORT_INNER_ERROR("E19999", "create json object failed. exception:%s job_state:%u", e.what(), job_state); | |||
| GELOGE(INTERNAL_ERROR, "[Create] [JsonObject] exception:%s job_state:%u job_sub_state:%u.", e.what(), job_state,job_sub_state); | |||
| REPORT_INNER_ERROR("E19999", "Create json object failed. exception:%s job_state:%u job_sub_state:%u", e.what(), job_state,job_sub_state); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| @@ -195,37 +195,32 @@ Status CsaInteract::WriteFile(const std::string &file_name, const std::string &c | |||
| int32_t fd = mmOpen2(file_name.c_str(), flags, M_IRUSR | M_IWUSR | M_UMASK_GRPREAD); | |||
| if (fd == EN_ERROR) { | |||
| if (MakePath(file_name) != SUCCESS) { | |||
| GELOGE(INTERNAL_ERROR, "MakePath failed."); | |||
| GELOGE(INTERNAL_ERROR, "[create] [file path] errno is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[Create][File Path] errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "MakePath failed. errno is %d", errno); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| fd = mmOpen2(file_name.c_str(), flags, M_IRUSR | M_IWUSR | M_UMASK_GRPREAD); | |||
| if (fd == EN_ERROR) { | |||
| GELOGE(INTERNAL_ERROR, "mmOpen2 failed."); | |||
| GELOGE(INTERNAL_ERROR, "[open] [file] errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmOpen2 failed. errno is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[Open][File] errno is %d file_name: %s", errno, file_name.c_str()); | |||
| REPORT_CALL_ERROR("E19999", "mmOpen2 failed. errno is %d file_name: %s", errno, file_name.c_str()); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| } | |||
| mmSsize_t ret = mmWrite(fd, reinterpret_cast<void *>(const_cast<char *>(content.c_str())), content.length()); | |||
| if (ret == EN_ERROR) { | |||
| GELOGE(INTERNAL_ERROR, "mmWrite failed."); | |||
| GELOGE(INTERNAL_ERROR, "[write] [file] errno is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[Write][File] errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmWrite failed. errno is %d", errno); | |||
| ret = mmClose(fd); | |||
| if (ret == EN_ERROR) { | |||
| GELOGE(INTERNAL_ERROR, "mmClose failed."); | |||
| GELOGE(INTERNAL_ERROR, "[close] [file] error is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[Close][File] error is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmClose failed. error is %d", errno); | |||
| } | |||
| return INTERNAL_ERROR; | |||
| } | |||
| ret = mmClose(fd); | |||
| if (ret == EN_ERROR) { | |||
| GELOGE(INTERNAL_ERROR, "mmClose failed."); | |||
| GELOGE(INTERNAL_ERROR, "[close] [file] error is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[Close][File] error is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmClose failed. error is %d", errno); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| @@ -255,9 +250,8 @@ Status CsaInteract::MakePath(const std::string &file_name) { | |||
| std::string pre_path = file_path.substr(0, found + 1); | |||
| if (mmAccess(pre_path.c_str()) != EN_OK) { | |||
| if (mmMkdir(pre_path.c_str(), M_IRWXU) != EN_OK) { | |||
| GELOGE(INTERNAL_ERROR, "mmMkdir failed."); | |||
| GELOGE(INTERNAL_ERROR, "csainteract mkdir fail, errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmMkdir failed. mkdir fail, errno is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[Create][File Dir] fail, errno is %d, pri_path:%s", errno, pri_path.c_str()); | |||
| REPORT_CALL_ERROR("E19999", "mmMkdir failed. errno is %d pri_path:%s", errno, pri_path.c_str()); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| } | |||
| @@ -51,7 +51,7 @@ Status OpsKernelBuilderManager::Initialize(const map<std::string, std::string> & | |||
| plugin_manager_.reset(new (std::nothrow)PluginManager()); | |||
| GE_CHECK_NOTNULL(plugin_manager_); | |||
| GE_CHK_STATUS_RET(plugin_manager_->LoadSo(lib_paths), | |||
| "[load][libs]Failed, lib_paths=%s.", lib_paths.c_str()); | |||
| "[Load][Libs]Failed, lib_paths=%s.", lib_paths.c_str()); | |||
| } | |||
| auto &kernel_builders = OpsKernelBuilderRegistry::GetInstance().GetAll(); | |||
| @@ -62,8 +62,7 @@ Status OpsKernelBuilderManager::Initialize(const map<std::string, std::string> & | |||
| GELOGI("Initialize ops kernel util for %s", kernel_lib_name.c_str()); | |||
| GE_CHECK_NOTNULL(it.second); | |||
| GE_CHK_STATUS_RET(it.second->Initialize(options), | |||
| "[invoke][Initialize]failed, kernel lib name = %s", | |||
| kernel_lib_name.c_str()); | |||
| "[Invoke][Initialize]failed, kernel lib name = %s", kernel_lib_name.c_str()); | |||
| ops_kernel_builders_.emplace(kernel_lib_name, it.second); | |||
| } | |||
| @@ -129,21 +128,16 @@ Status OpsKernelBuilderManager::CalcOpRunningParam(Node &node) const { | |||
| const std::string &lib_name = op_desc->GetOpKernelLibName(); | |||
| auto it = ops_kernel_builders_.find(lib_name); | |||
| if (it == ops_kernel_builders_.end()) { | |||
| GELOGE(INTERNAL_ERROR, "OpKernelLibName failed."); | |||
| GELOGE(INTERNAL_ERROR,"[Check][lib_name] libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| GELOGE(INTERNAL_ERROR,"[Check][Lib_name] libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), op_desc->GetName().c_str()); | |||
| REPORT_INNER_ERROR("E19999", "CalcOpRunningParam failed, libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| lib_name.c_str(), op_desc->GetName().c_str()); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| GELOGD("To invoke CalcOpRunningParam, node = %s, lib name = %s", op_desc->GetName().c_str(), lib_name.c_str()); | |||
| GE_CHK_STATUS_RET(it->second->CalcOpRunningParam(node), | |||
| "[invoke] [CalcOpRunningParam]failed, libName = %s, node = %s", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| "[Invoke][CalcOpRunningParam]failed, libName = %s, node = %s", lib_name.c_str(), op_desc->GetName().c_str()); | |||
| GELOGD("Done invoking CalcOpRunningParam successfully"); | |||
| return SUCCESS; | |||
| } | |||
| @@ -156,22 +150,16 @@ Status OpsKernelBuilderManager::GenerateTask(const Node &node, | |||
| const std::string &lib_name = op_desc->GetOpKernelLibName(); | |||
| auto it = ops_kernel_builders_.find(lib_name); | |||
| if (it == ops_kernel_builders_.end()) { | |||
| GELOGE(INTERNAL_ERROR, "GenerateTask failed."); | |||
| GELOGE(INTERNAL_ERROR, | |||
| "[Check][lib_name] libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| REPORT_INNER_ERROR("E19999", "GenerateTask failed, libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| GELOGE(INTERNAL_ERROR, "[Check][lib_name] libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), op_desc->GetName().c_str()); | |||
| REPORT_INNER_ERROR("E19999", "GenerateTask failed, libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), op_desc->GetName().c_str()); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| GELOGD("To invoke GenerateTask, node = %s, lib name = %s", op_desc->GetName().c_str(), lib_name.c_str()); | |||
| GE_CHK_STATUS_RET(it->second->GenerateTask(node, context, tasks), | |||
| "[invoke][GenerateTask]failed, libName = %s, node = %s", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| "[Invoke][GenerateTask]failed, libName = %s, node = %s", lib_name.c_str(), op_desc->GetName().c_str()); | |||
| GELOGD("Done invoking GenerateTask successfully"); | |||
| return SUCCESS; | |||
| } | |||
| @@ -123,7 +123,7 @@ Status OpsKernelManager::Initialize(const map<string, string> &options_const) { | |||
| init_flag_ = true; | |||
| return SUCCESS; | |||
| } else { | |||
| GELOGE(ret, "[check][so file] not find any valid so file."); | |||
| GELOGE(ret, "[Check][So file] not find any valid so file."); | |||
| REPORT_INNER_ERROR("E19999", "OpsKernelManager::Initialize failed, not find any valid so file."); | |||
| return ret; | |||
| } | |||
| @@ -179,33 +179,29 @@ Status OpsKernelManager::ParsePluginOptions(const map<string, string> &options, | |||
| } else if (flag == 1) { | |||
| enable_flag = true; | |||
| } else { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "ParsePluginOptions failed."); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[check][data]option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[Check][Data]option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| REPORT_INNER_ERROR("E19999", "ParsePluginOptions failed, option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } | |||
| } catch (std::invalid_argument &) { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "ParsePluginOptions failed."); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[check][data]option_key:ge.feFlag, its value %s is invalid_argument, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[Check][Data] failed, its value %s is invalid_argument, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| REPORT_INNER_ERROR("E19999", "ParsePluginOptions failed,its value %s is invalid_argument, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| iter->second.c_str()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } catch (std::out_of_range &) { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "ParsePluginOptions failed."); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[check][data]option_key:ge.feFlag, its value %s is out of range, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[Check][Data]failed, its value %s is out of range, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| REPORT_INNER_ERROR("E19999", "ParsePluginOptions failed,its value %s is out of range, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| iter->second.c_str()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } catch (...) { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "ParsePluginOptions failed."); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[check][data]option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "[Check][Data]option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| REPORT_INNER_ERROR("E19999", "ParsePluginOptions failed,option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| plugin_name.c_str(), iter->second.c_str()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } | |||
| } else { | |||
| @@ -219,14 +215,16 @@ Status OpsKernelManager::ParsePluginOptions(const map<string, string> &options, | |||
| Status OpsKernelManager::CheckPluginPtr() const { | |||
| for (auto iter = ops_kernel_store_.begin(); iter != ops_kernel_store_.end(); ++iter) { | |||
| if (iter->second == nullptr) { | |||
| GELOGE(INTERNAL_ERROR, "[Check][PluginPtr] OpsKernelInfoStorePtr key=%s is null", iter->first.c_str()); | |||
| return FAILED; | |||
| GELOGE(INTERNAL_ERROR, "[Check][PluginPtr] OpsKernelInfoStorePtr key=%s is null", iter->first.c_str()); | |||
| REPORT_INNER_ERROR("E19999", "CheckPluginPtr OpsKernelInfoStorePtr key=%s is null", iter->first.c_str()); | |||
| return FAILED; | |||
| } | |||
| } | |||
| for (auto iter1 = graph_optimizers_.begin(); iter1 != graph_optimizers_.end(); ++iter1) { | |||
| if (iter1->second == nullptr) { | |||
| GELOGE(INTERNAL_ERROR, "[Check][PluginPtr] GraphOptimizerPtr key=%s is null", iter1->first.c_str()); | |||
| return FAILED; | |||
| GELOGE(INTERNAL_ERROR, "[Check][PluginPtr] GraphOptimizerPtr key=%s is null", iter1->first.c_str()); | |||
| REPORT_INNER_ERROR("E19999", "GraphOptimizerPtr key=%s is null", iter1->first.c_str()); | |||
| return FAILED; | |||
| } | |||
| } | |||
| return SUCCESS; | |||
| @@ -238,8 +236,9 @@ Status OpsKernelManager::InitOpKernelInfoStores(const map<string, string> &optio | |||
| GELOGI("OpKernelInfoStore name: %s.", (it.first).c_str()); | |||
| Status ret = it.second->Initialize(options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(GE_OPS_KERNEL_STORE_INIT_FAILED, "[init][opKernelLib]OpKernelInfoStore: %s initialize failed.", (it.first).c_str()); | |||
| return GE_OPS_KERNEL_STORE_INIT_FAILED; | |||
| GELOGE(GE_OPS_KERNEL_STORE_INIT_FAILED, "[init][opKernelLib]OpKernelInfoStore: %s initialize failed.", (it.first).c_str()); | |||
| REPORT_CALL_ERROR("E19999", "OpKernelInfoStore: %s initialize failed.", (it.first).c_str()); | |||
| return GE_OPS_KERNEL_STORE_INIT_FAILED; | |||
| } | |||
| } | |||
| @@ -264,7 +263,7 @@ void OpsKernelManager::InitOpsKernelInfo() { | |||
| std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
| if (instance_ptr == nullptr) { | |||
| GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[get][GELib]malloc instance_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::GetInstance failed."); | |||
| REPORT_CALL_ERROR("E19999", "GELib::GetInstance failed."); | |||
| return; | |||
| } | |||
| // sort opinfo of ops_kernel_info_ | |||
| @@ -308,8 +307,8 @@ Status OpsKernelManager::InitGraphOptimzers(const map<string, string> &options) | |||
| GE_CHK_STATUS_RET(it.second->GetAttributes(attrs)) | |||
| std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
| if (instance_ptr == nullptr) { | |||
| GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[get][GELib]malloc instance_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::GetInstance failed."); | |||
| GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Get][GELib]malloc instance_ptr failed."); | |||
| REPORT_CALL_ERROR("E19999", "GELib::GetInstance failed."); | |||
| return GE_CLI_GE_NOT_INITIALIZED; | |||
| } | |||
| if (!instance_ptr->DNNEngineManagerObj().IsEngineRegistered(attrs.engineName)) { | |||
| @@ -318,8 +317,8 @@ Status OpsKernelManager::InitGraphOptimzers(const map<string, string> &options) | |||
| } | |||
| Status ret = it.second->Initialize(options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(GE_OPS_GRAPH_OPTIMIZER_INIT_FAILED, "[init][GraphOptimzer]GraphOptimzer: %s initialize failed.", (it.first).c_str()); | |||
| REPORT_INNER_ERROR("E19999", "InitGraphOptimzers failed. %s initialize failed.", (it.first).c_str()); | |||
| GELOGE(GE_OPS_GRAPH_OPTIMIZER_INIT_FAILED, "[Init][GraphOptimzer]GraphOptimzer: %s initialize failed.", (it.first).c_str()); | |||
| REPORT_CALL_ERROR("E19999", "InitGraphOptimzers failed. %s initialize failed.", (it.first).c_str()); | |||
| return GE_OPS_GRAPH_OPTIMIZER_INIT_FAILED; | |||
| } | |||
| } | |||
| @@ -336,8 +335,8 @@ Status OpsKernelManager::Finalize() { | |||
| GELOGI("OpsKernelStore finalize, name: %s.", (iter->first).c_str()); | |||
| Status status = iter->second->Finalize(); | |||
| if (SUCCESS != status) { | |||
| GELOGE(status, "[check][status]OpsKernelStore finalize failed, name: %s.", (iter->first).c_str()); | |||
| REPORT_INNER_ERROR("E19999", "OpsKernelStore finalize failed, name: %s.", (iter->first).c_str()); | |||
| GELOGE(status, "[Check][Status]OpsKernelStore finalize failed, name: %s.", (iter->first).c_str()); | |||
| REPORT_CALL_ERROR("E19999", "OpsKernelStore finalize failed, name: %s.", (iter->first).c_str()); | |||
| return status; | |||
| } | |||
| } | |||
| @@ -345,15 +344,15 @@ Status OpsKernelManager::Finalize() { | |||
| GELOGI("GraphOptimzers finalize, name: %s.", (iter->first).c_str()); | |||
| Status status = iter->second->Finalize(); | |||
| if (status != SUCCESS) { | |||
| GELOGE(status, "[check][status]GraphOptimzers finalize failed, name: %s.", (iter->first).c_str()); | |||
| REPORT_INNER_ERROR("E19999", "GraphOptimzers finalize failed, name: %s.", (iter->first).c_str()); | |||
| GELOGE(status, "[Check][Status]GraphOptimzers finalize failed, name: %s.", (iter->first).c_str()); | |||
| REPORT_CALL_ERROR("E19999", "GraphOptimzers finalize failed, name: %s.", (iter->first).c_str()); | |||
| return status; | |||
| } | |||
| } | |||
| Status ret = FinalizeOpsKernel(); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "free ops kernel resource failed."); | |||
| GELOGE(ret, "[Free][Ops kernel resource] failed."); | |||
| return ret; | |||
| } | |||
| @@ -464,8 +463,9 @@ Status OpsKernelManager::FinalizeOpsKernel() { | |||
| GELOGI("ge invoke ops kernal finalize."); | |||
| Status ret = plugin_manager_.InvokeAll<Status>(kFinalize); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "[Finalize][check][status] invoke Fe finalize failed."); | |||
| return ret; | |||
| GELOGE(ret, "[Finalize][Check][Status] invoke Fe finalize failed."); | |||
| REPORT_CALL_ERROR("E19999", "PluginManager InvokeAll failed."); | |||
| return ret; | |||
| } | |||
| return SUCCESS; | |||