| @@ -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, "Make HostCpuOpsKernelInfoStore failed."); | |||
| RRPORT_INNER_ERROR("E19999", "Initialize FAILED. Make HostCpuOpsKernelInfoStore failed."); | |||
| GELOGE(FAILED, "[init][HostCpuEngine] Initialize failed. as malloc shared_ptr failed."); | |||
| RRPORT_INNER_ERROR("E19999", "HostCpuEngine Initialize failed. as malloc shared_ptr failed."); | |||
| return FAILED; | |||
| } | |||
| } | |||
| @@ -39,7 +39,8 @@ 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, "CalcOpRunningParam failed, as op desc is null"); | |||
| 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."); | |||
| return FAILED; | |||
| } | |||
| @@ -74,7 +75,7 @@ Status HostCpuOpsKernelBuilder::CalcOpRunningParam(Node &ge_node) { | |||
| if ((TensorUtils::CalcTensorMemSize(output_shape, format, data_type, output_mem_size) != GRAPH_SUCCESS) || | |||
| (output_mem_size < 0)) { | |||
| GELOGE(FAILED, "CalcTensorMemSize failed."); | |||
| GELOGE(FAILED, "Calc op[%s:%s] out[%zu] mem size failed, mem_size=%ld, format=%s, data_type=%s.", | |||
| GELOGE(FAILED, "[Calc][TensorMemSize] op[%s:%s] out[%zu] mem size failed, 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.", | |||
| @@ -89,7 +90,7 @@ 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 op[%s:%s] out[%zu] desc failed, format=%s, data_type=%s.", name.c_str(), type.c_str(), i, | |||
| GELOGE(FAILED, "[Update][OutputDesc] op[%s:%s] out[%zu] desc failed, 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, | |||
| TypeUtils::FormatToSerialString(format).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||
| @@ -68,7 +68,8 @@ Status GELib::Initialize(const map<string, string> &options) { | |||
| // Multiple initializations are not allowed | |||
| instancePtr_ = MakeShared<GELib>(); | |||
| if (instancePtr_ == nullptr) { | |||
| GELOGE(GE_CLI_INIT_FAILED, "GeLib initialize failed, malloc shared_ptr failed."); | |||
| 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."); | |||
| return GE_CLI_INIT_FAILED; | |||
| } | |||
| @@ -76,13 +77,15 @@ 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, "GeLib initial failed."); | |||
| GELOGE(ret, "[set][RTSocVersion] failed, input options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initial failed, as SetRTSocVersion failed."); | |||
| return ret; | |||
| } | |||
| ret = instancePtr_->SetAiCoreNum(new_options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "GeLib initial: SetAiCoreNum failed."); | |||
| GELOGE(ret, "[Set][AiCoreNum] failed, input options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initial failed, as SetAiCoreNum failed."); | |||
| return ret; | |||
| } | |||
| @@ -97,7 +100,8 @@ Status GELib::Initialize(const map<string, string> &options) { | |||
| GE_TIMESTAMP_START(Init); | |||
| ret = instancePtr_->InnerInitialize(new_options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "GeLib initial failed."); | |||
| GELOGE(ret, "[init][GELib] failed, as options is invalid ."); | |||
| REPORT_INNER_ERROR("E19999", "GeLib initial failed, as GELib::InnerInitialize failed."); | |||
| instancePtr_ = nullptr; | |||
| return ret; | |||
| } | |||
| @@ -118,7 +122,8 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initSystemStatus = SystemInitialize(options); | |||
| GE_TIMESTAMP_END(SystemInitialize, "InnerInitialize::SystemInitialize"); | |||
| if (initSystemStatus != SUCCESS) { | |||
| GELOGE(initSystemStatus, "GE system initial failed."); | |||
| GELOGE(initSystemStatus, "[init][system]failed, as options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GE system initial failed, as SystemInitialize failed."); | |||
| RollbackInit(); | |||
| return initSystemStatus; | |||
| } | |||
| @@ -129,7 +134,8 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initEmStatus = engineManager_.Initialize(options); | |||
| GE_TIMESTAMP_END(EngineInitialize, "InnerInitialize::EngineInitialize"); | |||
| if (initEmStatus != SUCCESS) { | |||
| GELOGE(initEmStatus, "GE engine manager initial failed."); | |||
| GELOGE(initEmStatus, "[init][enginemanager] failed, options invalid. "); | |||
| REPORT_INNER_ERROR("E19999", "GE engine manager initial failed, as call DNNEngineManager::Initialize failed. "); | |||
| RollbackInit(); | |||
| return initEmStatus; | |||
| } | |||
| @@ -140,7 +146,8 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initOpsStatus = opsManager_.Initialize(options); | |||
| GE_TIMESTAMP_END(OpsManagerInitialize, "InnerInitialize::OpsManagerInitialize"); | |||
| if (initOpsStatus != SUCCESS) { | |||
| GELOGE(initOpsStatus, "GE ops manager initial failed."); | |||
| GELOGE(initOpsStatus, "[init][OpsKernelManager] failed, options invalid. "); | |||
| REPORT_INNER_ERROR("E19999", "GE ops manager initial failed. as call OpsKernelManager::Initialize failed. "); | |||
| RollbackInit(); | |||
| return initOpsStatus; | |||
| } | |||
| @@ -151,7 +158,8 @@ 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, "GE ops builder manager initial failed."); | |||
| GELOGE(initOpsBuilderStatus, "[init][OpsKernelBuilderManager] failed, options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GE ops buildermanager initial failed, as call OpsKernelBuilderManager::Initialize failed."); | |||
| RollbackInit(); | |||
| return initOpsBuilderStatus; | |||
| } | |||
| @@ -162,7 +170,8 @@ Status GELib::InnerInitialize(const map<string, string> &options) { | |||
| Status initSmStatus = sessionManager_.Initialize(options); | |||
| GE_TIMESTAMP_END(SessionManagerInitialize, "InnerInitialize::SessionManagerInitialize"); | |||
| if (initSmStatus != SUCCESS) { | |||
| GELOGE(initSmStatus, "GE session manager initial failed."); | |||
| GELOGE(initSmStatus, "[init][SessionManager] failed, options invalid."); | |||
| REPORT_INNER_ERROR("E19999", "GE session manager initial failed. as SessionManager::Initialize failed."); | |||
| RollbackInit(); | |||
| return initSmStatus; | |||
| } | |||
| @@ -205,7 +214,8 @@ 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, | |||
| GELOGE(FAILED, "Enable exception dump failed"); | |||
| REPORT_INNER_ERROR("E19999", "ModelManager EnableExceptionDump failed, options invalid."); | |||
| GELOGE(FAILED, "[check][ModelManager][EnableExceptionDump] failed, options invalid."); | |||
| return FAILED); | |||
| // 1.`is_train_mode_` means case: train | |||
| // 2.`(!is_train_mode_) && (options_.device_id != kDefaultDeviceIdForInfer)` means case: online infer | |||
| @@ -259,7 +269,9 @@ 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, GELOGE(rt_ret, "rtGetSocVersion failed"); return FAILED;) | |||
| GE_IF_BOOL_EXEC(rt_ret != RT_ERROR_NONE, | |||
| REPORT_CALL_ERROR("E19999","rtGetSocVersion failed."); | |||
| 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)); | |||
| } | |||
| @@ -280,7 +292,8 @@ Status GELib::SetAiCoreNum(map<string, string> &options) { | |||
| options.emplace(std::make_pair(AICORE_NUM, std::to_string(aicore_num))); | |||
| return SUCCESS; | |||
| } | |||
| GELOGE(FAILED, "rtGetAiCoreCount failed."); | |||
| GELOGE(FAILED, "[get][AiCoreCount] failed."); | |||
| REPORT_CALL_ERROR("E19999", "rtGetAiCoreCount failed."); | |||
| return FAILED; | |||
| } | |||
| @@ -355,7 +368,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, "[Initialize] MemoryAllocatorManager initialize failed."); | |||
| GELOGE(initMmStatus, "[Init][MemManager] MemoryAllocatorManager initialize failed."); | |||
| return initMmStatus; | |||
| } | |||
| @@ -363,7 +376,7 @@ 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] [job state] failed, ret:%u", ret); | |||
| // set device id | |||
| GELOGI("set logical device id:%u", options.device_id); | |||
| @@ -394,7 +407,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] [job state] failed, ret:%u", ret); | |||
| is_system_inited = false; | |||
| is_shutdown = true; | |||
| @@ -410,7 +423,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] MemoryAllocatorManager initialize failed."); | |||
| GELOGE(initMmStatus, "[Initialize][MemManager] MemoryAllocatorManager initialize failed."); | |||
| return initMmStatus; | |||
| } | |||
| GE_CHK_STATUS_RET(HostMemManager::Instance().Initialize()); | |||
| @@ -506,7 +519,8 @@ Status GELib::Finalize() { | |||
| instancePtr_ = nullptr; | |||
| init_flag_ = false; | |||
| if (final_state != SUCCESS) { | |||
| GELOGE(FAILED, "finalization failed."); | |||
| GELOGE(FAILED, "[check][state]finalization failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::Finalize finalization failed."); | |||
| return final_state; | |||
| } | |||
| GELOGI("finalization success."); | |||
| @@ -78,8 +78,8 @@ 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, "CsaInteract has not init, can't WriteJobState"); | |||
| REPORT_INNER_ERROR("E19999", "CsaInteract 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; | |||
| } | |||
| if ((curr_state_ == JOBSTATE_FAILED) || (curr_state_ == JOBSTATE_KILLED)) { | |||
| @@ -108,9 +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, "construct json object failed."); | |||
| GELOGE(INTERNAL_ERROR, "build jobstate content json string failed, exception:%s job_state:%u", e.what(), job_state); | |||
| REPORT_INNER_ERROR("E19999", "construct json object failed. exception:%s job_state:%u", e.what(), job_state); | |||
| 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); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| @@ -171,8 +170,8 @@ void CsaInteract::WriteInternalErrorCode() { | |||
| /// | |||
| Status CsaInteract::WriteHcomDetection(const std::string &content) { | |||
| if (!is_init_) { | |||
| GELOGE(INTERNAL_ERROR, "CsaInteract has not init, can't WriteJobState"); | |||
| REPORT_INNER_ERROR("E19999", "WriteHcomDetection failed. CsaInteract 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; | |||
| } | |||
| @@ -197,15 +196,15 @@ Status CsaInteract::WriteFile(const std::string &file_name, const std::string &c | |||
| if (fd == EN_ERROR) { | |||
| if (MakePath(file_name) != SUCCESS) { | |||
| GELOGE(INTERNAL_ERROR, "MakePath failed."); | |||
| GELOGE(INTERNAL_ERROR, "csainteract create file path fail, errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "MakePath failed. create file path fail, 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 fail, errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmOpen2 failed. open file fail, errno is %d", errno); | |||
| GELOGE(INTERNAL_ERROR, "[open] [file] errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmOpen2 failed. errno is %d", errno); | |||
| return INTERNAL_ERROR; | |||
| } | |||
| } | |||
| @@ -213,21 +212,21 @@ Status CsaInteract::WriteFile(const std::string &file_name, const std::string &c | |||
| 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 fail, errno is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmWrite failed. write file fail, 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 fail, error is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmClose failed. close file fail, 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 fail, error is %d", errno); | |||
| REPORT_CALL_ERROR("E19999", "mmClose failed. close file fail, 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; | |||
| } | |||
| @@ -50,7 +50,8 @@ Status OpsKernelBuilderManager::Initialize(const map<std::string, std::string> & | |||
| GE_CHK_STATUS_RET_NOLOG(GetLibPaths(options, lib_paths)); | |||
| plugin_manager_.reset(new (std::nothrow)PluginManager()); | |||
| GE_CHECK_NOTNULL(plugin_manager_); | |||
| GE_CHK_STATUS_RET(plugin_manager_->LoadSo(lib_paths), "Failed to load libs"); | |||
| GE_CHK_STATUS_RET(plugin_manager_->LoadSo(lib_paths), | |||
| "[load][libs]Failed, lib_paths=%s.", lib_paths.c_str()); | |||
| } | |||
| auto &kernel_builders = OpsKernelBuilderRegistry::GetInstance().GetAll(); | |||
| @@ -61,7 +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), | |||
| "Failed to invoke Initialize, kernel lib name = %s", | |||
| "[invoke][Initialize]failed, kernel lib name = %s", | |||
| kernel_lib_name.c_str()); | |||
| ops_kernel_builders_.emplace(kernel_lib_name, it.second); | |||
| @@ -128,8 +129,11 @@ 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, | |||
| "Failed to get OpKernelStore. libName = %s, node = %s", | |||
| 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()); | |||
| REPORT_INNER_ERROR("E19999", "CalcOpRunningParam failed, libName = %s, node = %s not exist.", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| return INTERNAL_ERROR; | |||
| @@ -137,7 +141,7 @@ Status OpsKernelBuilderManager::CalcOpRunningParam(Node &node) const { | |||
| 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), | |||
| "Failed to invoke CalcOpRunningParam, libName = %s, node = %s", | |||
| "[invoke] [CalcOpRunningParam]failed, libName = %s, node = %s", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| GELOGD("Done invoking CalcOpRunningParam successfully"); | |||
| @@ -152,8 +156,12 @@ 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, | |||
| "Failed to get OpKernelStore. libName = %s, node = %s", | |||
| "[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; | |||
| @@ -161,7 +169,7 @@ Status OpsKernelBuilderManager::GenerateTask(const Node &node, | |||
| 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), | |||
| "Failed to invoke GenerateTask, libName = %s, node = %s", | |||
| "[invoke][GenerateTask]failed, libName = %s, node = %s", | |||
| lib_name.c_str(), | |||
| op_desc->GetName().c_str()); | |||
| GELOGD("Done invoking GenerateTask successfully"); | |||
| @@ -56,7 +56,8 @@ Status OpsKernelManager::Initialize(const map<string, string> &options_const) { | |||
| std::map<string, string> options(options_const); | |||
| Status ret = InitPluginOptions(options); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "[OpsKernelManager] [Initialize] parse pluginFlag from ge options failed."); | |||
| GELOGE(ret, "[Init][PluginOptions] parse pluginFlag from ge options failed."); | |||
| REPORT_CALL_ERROR("E19999", "InitPluginOptions failed, options invalid."); | |||
| return ret; | |||
| } | |||
| @@ -85,7 +86,8 @@ Status OpsKernelManager::Initialize(const map<string, string> &options_const) { | |||
| initialize_ = options; | |||
| Status rst0 = plugin_manager_.InvokeAll<map<string, string> &, Status>(kInitialize, initialize_); | |||
| if (rst0 == FAILED) { | |||
| GELOGE(GE_OPS_GET_NO_VALID_SO, "There is invalid so about OpsKernelInfoStore."); | |||
| GELOGE(GE_OPS_GET_NO_VALID_SO, "[invoke][opskernelinfo]PluginManager InvokeAll failed."); | |||
| REPORT_INNER_ERROR("E19999", "PluginManager InvokeAll failed."); | |||
| return GE_OPS_GET_NO_VALID_SO; | |||
| } | |||
| Status rst1 = | |||
| @@ -114,13 +116,15 @@ Status OpsKernelManager::Initialize(const map<string, string> &options_const) { | |||
| } | |||
| ret = InitGraphOptimizerPriority(); | |||
| if ((ret != SUCCESS)) { | |||
| GELOGE(ret, "Init graph optimizer priority failed."); | |||
| GELOGE(ret, "[Init][GraphOptimizerPriority] failed."); | |||
| REPORT_CALL_ERROR("E19999", "GraphOptimizerPriority failed."); | |||
| return ret; | |||
| } | |||
| init_flag_ = true; | |||
| return SUCCESS; | |||
| } else { | |||
| GELOGE(ret, "Failed to 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; | |||
| } | |||
| } | |||
| @@ -175,20 +179,32 @@ Status OpsKernelManager::ParsePluginOptions(const map<string, string> &options, | |||
| } else if (flag == 1) { | |||
| enable_flag = true; | |||
| } else { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| 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()); | |||
| 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()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } | |||
| } catch (std::invalid_argument &) { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "option_key:ge.feFlag, its value %s is invalid_argument, it must be 0 or 1.", | |||
| 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()); | |||
| REPORT_INNER_ERROR("E19999", "ParsePluginOptions failed,its value %s is invalid_argument, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } catch (std::out_of_range &) { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "option_key:ge.feFlag, its value %s is out of range, it must be 0 or 1.", | |||
| 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()); | |||
| REPORT_INNER_ERROR("E19999", "ParsePluginOptions failed,its value %s is out of range, it must be 0 or 1.", | |||
| iter->second.c_str()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } catch (...) { | |||
| GELOGE(GE_GRAPH_OPTIONS_INVALID, "option_key:%s, its value %s is invalid, it must be 0 or 1.", | |||
| 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()); | |||
| 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()); | |||
| return GE_GRAPH_OPTIONS_INVALID; | |||
| } | |||
| @@ -203,13 +219,13 @@ 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, "CheckPluginPtr OpsKernelInfoStorePtr is null"); | |||
| GELOGE(INTERNAL_ERROR, "[Check][PluginPtr] 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, "CheckPluginPtr GraphOptimizerPtr is null"); | |||
| GELOGE(INTERNAL_ERROR, "[Check][PluginPtr] GraphOptimizerPtr key=%s is null", iter1->first.c_str()); | |||
| return FAILED; | |||
| } | |||
| } | |||
| @@ -222,7 +238,7 @@ 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, "OpKernelInfoStore: %s initialize failed.", (it.first).c_str()); | |||
| GELOGE(GE_OPS_KERNEL_STORE_INIT_FAILED, "[init][opKernelLib]OpKernelInfoStore: %s initialize failed.", (it.first).c_str()); | |||
| return GE_OPS_KERNEL_STORE_INIT_FAILED; | |||
| } | |||
| } | |||
| @@ -247,7 +263,8 @@ void OpsKernelManager::InitOpsKernelInfo() { | |||
| } | |||
| std::shared_ptr<GELib> instance_ptr = ge::GELib::GetInstance(); | |||
| if (instance_ptr == nullptr) { | |||
| GELOGE(GE_CLI_GE_NOT_INITIALIZED, "InitOpsKernelInfo failed."); | |||
| GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[get][GELib]malloc instance_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::GetInstance failed."); | |||
| return; | |||
| } | |||
| // sort opinfo of ops_kernel_info_ | |||
| @@ -291,7 +308,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, "InitGraphOptimzers failed."); | |||
| GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[get][GELib]malloc instance_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "GELib::GetInstance failed."); | |||
| return GE_CLI_GE_NOT_INITIALIZED; | |||
| } | |||
| if (!instance_ptr->DNNEngineManagerObj().IsEngineRegistered(attrs.engineName)) { | |||
| @@ -300,7 +318,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, "GraphOptimzer: %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_INNER_ERROR("E19999", "InitGraphOptimzers failed. %s initialize failed.", (it.first).c_str()); | |||
| return GE_OPS_GRAPH_OPTIMIZER_INIT_FAILED; | |||
| } | |||
| } | |||
| @@ -317,7 +336,8 @@ Status OpsKernelManager::Finalize() { | |||
| GELOGI("OpsKernelStore finalize, name: %s.", (iter->first).c_str()); | |||
| Status status = iter->second->Finalize(); | |||
| if (SUCCESS != status) { | |||
| GELOGE(status, "OpsKernelStore finalize failed, name: %s.", (iter->first).c_str()); | |||
| 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()); | |||
| return status; | |||
| } | |||
| } | |||
| @@ -325,7 +345,8 @@ Status OpsKernelManager::Finalize() { | |||
| GELOGI("GraphOptimzers finalize, name: %s.", (iter->first).c_str()); | |||
| Status status = iter->second->Finalize(); | |||
| if (status != SUCCESS) { | |||
| GELOGE(status, "GraphOptimzers finalize failed, name: %s.", (iter->first).c_str()); | |||
| 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()); | |||
| return status; | |||
| } | |||
| } | |||
| @@ -443,7 +464,7 @@ Status OpsKernelManager::FinalizeOpsKernel() { | |||
| GELOGI("ge invoke ops kernal finalize."); | |||
| Status ret = plugin_manager_.InvokeAll<Status>(kFinalize); | |||
| if (ret != SUCCESS) { | |||
| GELOGE(ret, "[Finalize] invoke Fe finalize failed."); | |||
| GELOGE(ret, "[Finalize][check][status] invoke Fe finalize failed."); | |||
| return ret; | |||
| } | |||
| @@ -29,8 +29,8 @@ std::unique_ptr<std::map<std::string, DNNEnginePtr>> EngineManager::engine_map_; | |||
| Status EngineManager::RegisterEngine(const std::string &engine_name, DNNEnginePtr engine_ptr) { | |||
| if (engine_ptr == nullptr) { | |||
| GELOGE(FAILED, "RegisterEngine failed. as input param engine_ptr is nullptr"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterEngine failed. as input param engine_ptr is nullptr"); | |||
| GELOGE(FAILED, "[Register][Engine] failed, as input engine_ptr is nullptr"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterEngine failed, as input engine_ptr is nullptr"); | |||
| return FAILED; | |||
| } | |||
| @@ -65,8 +65,8 @@ void RegisterAiCoreEngine() { | |||
| DNNEngineAttribute attr_aicore = {ai_core, mem_type_aicore, COST_0, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr aicore_engine_ptr = MakeShared<AICoreDNNEngine>(attr_aicore); | |||
| if (aicore_engine_ptr == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterAiCoreEngine failed. as make aiCoreEnginePtr failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterAiCoreEngine failed. as make aiCoreEnginePtr failed"); | |||
| GELOGE(ge::FAILED, "[Register][AiCoreEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterAiCoreEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(ai_core, aicore_engine_ptr) != SUCCESS) { | |||
| @@ -82,8 +82,8 @@ void RegisterVectorEngine() { | |||
| DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr vectorcore_engine_ptr = MakeShared<VectorCoreDNNEngine>(attr_vector_core); | |||
| if (vectorcore_engine_ptr == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterVectorEngine failed. as make vectorCoreEnginePtr failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterVectorEngine failed. as make vectorCoreEnginePtr failed"); | |||
| GELOGE(ge::FAILED, "[Register][VectorEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterVectorEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(vector_core, vectorcore_engine_ptr) != SUCCESS) { | |||
| @@ -98,8 +98,8 @@ void RegisterAiCpuEngine() { | |||
| DNNEngineAttribute attr_aicpu = {vm_aicpu, mem_type_aicpu, COST_3, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr vm_engine_ptr = MakeShared<AICpuDNNEngine>(attr_aicpu); | |||
| if (vm_engine_ptr == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterAiCpuEngine failed. as make vm_engine_ptr failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterAiCpuEngine failed. as make vm_engine_ptr failed"); | |||
| GELOGE(ge::FAILED, "[Register][AiCpuEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterAiCpuEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(vm_aicpu, vm_engine_ptr) != SUCCESS) { | |||
| @@ -114,8 +114,8 @@ void RegisterAiCpuTFEngine() { | |||
| DNNEngineAttribute attr_aicpu_tf = {vm_aicpu_tf, mem_type_aicpu_tf, COST_2, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr vm_engine_ptr = MakeShared<AICpuTFDNNEngine>(attr_aicpu_tf); | |||
| if (vm_engine_ptr == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterAiCpuTFEngine failed. as make vm_engine_ptr failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterAiCpuTFEngine failed. as make vm_engine_ptr failed"); | |||
| GELOGE(ge::FAILED, "[Register][AiCpuTFEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterAiCpuTFEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(vm_aicpu_tf, vm_engine_ptr) != SUCCESS) { | |||
| @@ -131,8 +131,8 @@ void RegisterGeLocalEngine() { | |||
| DNNEngineAttribute attr_ge_local = {vm_ge_local, mem_type_ge_local, COST_9, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr ge_local_engine = MakeShared<GeLocalDNNEngine>(attr_ge_local); | |||
| if (ge_local_engine == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterGeLocalEngine failed. as make ge_local_engine failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterGeLocalEngine failed. as make ge_local_engine failed"); | |||
| GELOGE(ge::FAILED, "[Register][GeLocalEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterGeLocalEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(vm_ge_local, ge_local_engine) != SUCCESS) { | |||
| @@ -148,8 +148,8 @@ void RegisterHostCpuEngine() { | |||
| DNNEngineAttribute attr_host_cpu = {vm_host_cpu, mem_type_host_cpu, COST_10, HOST, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr host_cpu_engine = MakeShared<HostCpuDNNEngine>(attr_host_cpu); | |||
| if (host_cpu_engine == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterHostCpuEngine failed. as make host_cpu_engine failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterHostCpuEngine failed. as make host_cpu_engine failed"); | |||
| GELOGE(ge::FAILED, "[Register][HostCpuEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterHostCpuEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(vm_host_cpu, host_cpu_engine) != SUCCESS) { | |||
| @@ -164,8 +164,8 @@ void RegisterRtsEngine() { | |||
| DNNEngineAttribute attr_rts = {vm_rts, mem_type_rts, COST_1, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr rts_engine = MakeShared<RtsDNNEngine>(attr_rts); | |||
| if (rts_engine == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterRtsEngine failed. as make rts_engine failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterRtsEngine failed. as make rts_engine failed"); | |||
| GELOGE(ge::FAILED, "[Register][RtsEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterRtsEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(vm_rts, rts_engine) != SUCCESS) { | |||
| @@ -180,8 +180,8 @@ void RegisterHcclEngine() { | |||
| DNNEngineAttribute attr_hccl = {dnn_hccl, mem_type_hccl, COST_1, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED}; | |||
| DNNEnginePtr hccl_engine = MakeShared<HcclDNNEngine>(attr_hccl); | |||
| if (hccl_engine == nullptr) { | |||
| GELOGE(ge::FAILED, "RegisterHcclEngine failed. as make hccl_engine failed"); | |||
| REPORT_INNER_ERROR("E19999", "RegisterHcclEngine failed. as make hccl_engine failed"); | |||
| GELOGE(ge::FAILED, "[Register][HcclEngine] failed, as malloc shared_ptr failed."); | |||
| REPORT_INNER_ERROR("E19999", "RegisterHcclEngine failed, as malloc shared_ptr failed."); | |||
| return; | |||
| } | |||
| if (EngineManager::RegisterEngine(dnn_hccl, hccl_engine) != SUCCESS) { | |||