Pre Merge pull request !1280 from ldy2021/master

pull/1280/MERGE
ldy2021 4 years ago committed by Gitee
commit b0fd431e84

@ -34,7 +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.");
GELOGE(FAILED, "[Init][HostCpuEngine] fail for new HostCpuOpsKernelInfoStore.");
REPORT_INNER_ERROR("E19999", "HostCpuEngine Initialize failed. fail for new HostCpuOpsKernelInfoStore.");
return FAILED;
}
}

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <securec.h>
#include "host_cpu_ops_kernel_builder.h"
#include <memory>
#include "common/ge_inner_error_codes.h"
@ -39,7 +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, "CalcOpRunningParam failed, as op desc is null");
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;
}
@ -73,9 +75,12 @@ 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, "Calc 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());
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], size=%ld, format=%s, 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;
}
GELOGI("Calc op[%s:%s] out[%zu] mem size is %ld, format=%s, data_type=%s.",
@ -84,8 +89,12 @@ 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, "Update 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());
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, 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;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -78,7 +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");
GELOGE(INTERNAL_ERROR, "[Init][CsaInteract] obj has not init, can't WriteJobState");
REPORT_INNER_ERROR("E19999", "WriteJobState failed before init. ");
return INTERNAL_ERROR;
}
if ((curr_state_ == JOBSTATE_FAILED) || (curr_state_ == JOBSTATE_KILLED)) {
@ -107,7 +108,10 @@ Status CsaInteract::WriteJobState(JobState job_state, JobSubState job_sub_state,
content = content_json.dump();
} catch (const nlohmann::json::exception &e) {
GELOGE(INTERNAL_ERROR, "build jobstate content json string 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;
}
@ -168,7 +172,8 @@ void CsaInteract::WriteInternalErrorCode() {
///
Status CsaInteract::WriteHcomDetection(const std::string &content) {
if (!is_init_) {
GELOGE(INTERNAL_ERROR, "CsaInteract has not init, can't WriteJobState");
GELOGE(INTERNAL_ERROR, "[Init][CsaInteract] obj has not init, can't WriteJobState");
REPORT_INNER_ERROR("E19999", "WriteHcomDetection failed before init.");
return INTERNAL_ERROR;
}
@ -192,28 +197,33 @@ 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, "csainteract 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, "open file fail, 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, "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, "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, "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;
}
@ -242,7 +252,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, "csainteract mkdir fail, errno is %d", errno);
GELOGE(INTERNAL_ERROR, "[Create][File Dir] fail, errno is %d, pre_path:%s", errno, pre_path.c_str());
REPORT_CALL_ERROR("E19999", "mmMkdir failed. errno is %d pre_path:%s", errno, pre_path.c_str());
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,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),
"Failed to invoke Initialize, 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);
}
@ -100,7 +100,8 @@ OpsKernelBuilderPtr OpsKernelBuilderManager::GetOpsKernelBuilder(const string &n
return nullptr;
}
Status OpsKernelBuilderManager::GetLibPaths(const std::map<std::string, std::string> &options, std::string &lib_paths) {
Status OpsKernelBuilderManager::GetLibPaths(const std::map<std::string,
std::string> &options, std::string &lib_paths) {
GELOGD("Start to execute GetLibPaths");
std::string path_base = PluginManager::GetPath();
std::string so_path = "plugin/opskernel/";
@ -128,18 +129,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,
"Failed to get OpKernelStore. libName = %s, node = %s",
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());
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),
"Failed to invoke CalcOpRunningParam, 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;
}
@ -152,18 +151,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,
"Failed to get OpKernelStore. libName = %s, node = %s",
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),
"Failed to invoke GenerateTask, 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;
}

@ -56,7 +56,7 @@ 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.");
return ret;
}
@ -85,7 +85,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,18 +115,20 @@ 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.");
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 for not find any valid so file.");
return ret;
}
}
void OpsKernelManager::GetExternalEnginePath(std::string &extern_engine_path, const std::map<string, string>& options) {
void OpsKernelManager::GetExternalEnginePath(std::string &extern_engine_path,
const std::map<string, string>& options) {
GELOGI("Enter get external engine so path schedule");
const char *path_env = std::getenv("ASCEND_ENGINE_PATH");
if (path_env != nullptr) {
@ -175,21 +178,33 @@ 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.",
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());
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.",
iter->second.c_str());
GELOGE(GE_GRAPH_OPTIONS_INVALID,
"[Check][Data] failed, 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, option_key:ge.feFlag, 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.",
iter->second.c_str());
GELOGE(GE_GRAPH_OPTIONS_INVALID,
"[Check][Data]failed, 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, option_key:ge.feFlag, its value %s is out of range, it must be 0 or 1.",
iter->second.c_str());option_key:ge.feFlag,
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.",
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());
return GE_GRAPH_OPTIONS_INVALID;
}
} else {
@ -203,13 +218,15 @@ 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());
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, "CheckPluginPtr GraphOptimizerPtr is null");
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;
}
}
@ -222,7 +239,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, "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());
REPORT_CALL_ERROR("E19999", "OpKernelInfoStore: %s initialize failed.", (it.first).c_str());
return GE_OPS_KERNEL_STORE_INIT_FAILED;
}
}
@ -247,7 +266,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", "InitOpsKernelInfo failed for new GELib failed.");
return;
}
// sort opinfo of ops_kernel_info_
@ -291,7 +311,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", "InitGraphOptimzers failed for new GELib failed.");
return GE_CLI_GE_NOT_INITIALIZED;
}
if (!instance_ptr->DNNEngineManagerObj().IsEngineRegistered(attrs.engineName)) {
@ -300,7 +321,9 @@ 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_CALL_ERROR("E19999", "InitGraphOptimzers failed. %s initialize failed.", (it.first).c_str());
return GE_OPS_GRAPH_OPTIMIZER_INIT_FAILED;
}
}
@ -317,7 +340,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_CALL_ERROR("E19999", "OpsKernelStore finalize failed, name: %s.", (iter->first).c_str());
return status;
}
}
@ -325,14 +349,16 @@ 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_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.");
REPORT_CALL_ERROR("E19999", "FinalizeOpsKernel failed, Free Ops kernel resource failed.");
return ret;
}
@ -443,7 +469,8 @@ 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.");
REPORT_INNER_ERROR("E19999", "PluginManager InvokeAll failed.");
return ret;
}

@ -29,7 +29,7 @@ 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, "enginePtr is nullptr");
GELOGE(FAILED, "[Register][Engine] failed, as input engine_ptr is nullptr");
return FAILED;
}
@ -64,7 +64,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, "make aiCoreEnginePtr failed");
GELOGE(ge::FAILED, "[Register][AiCoreEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterAiCoreEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(ai_core, aicore_engine_ptr) != SUCCESS) {
@ -80,7 +81,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, "make vectorCoreEnginePtr failed");
GELOGE(ge::FAILED, "[Register][VectorEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterVectorEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(vector_core, vectorcore_engine_ptr) != SUCCESS) {
@ -95,7 +97,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, "make vm_engine_ptr failed");
GELOGE(ge::FAILED, "[Register][AiCpuEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterAiCpuEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(vm_aicpu, vm_engine_ptr) != SUCCESS) {
@ -107,10 +110,12 @@ void RegisterAiCpuTFEngine() {
const std::string vm_aicpu_tf = "DNN_VM_AICPU";
std::vector<std::string> mem_type_aicpu_tf;
mem_type_aicpu_tf.emplace_back(GE_ENGINE_ATTR_MEM_TYPE_HBM);
DNNEngineAttribute attr_aicpu_tf = {vm_aicpu_tf, mem_type_aicpu_tf, COST_2, DEVICE, FORMAT_RESERVED, FORMAT_RESERVED};
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, "make vm_engine_ptr failed");
GELOGE(ge::FAILED, "[Register][AiCpuTFEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterAiCpuTFEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(vm_aicpu_tf, vm_engine_ptr) != SUCCESS) {
@ -126,7 +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, "make ge_local_engine failed");
GELOGE(ge::FAILED, "[Register][GeLocalEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterGeLocalEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(vm_ge_local, ge_local_engine) != SUCCESS) {
@ -139,10 +145,12 @@ void RegisterHostCpuEngine() {
std::vector<std::string> mem_type_host_cpu;
mem_type_host_cpu.emplace_back(GE_ENGINE_ATTR_MEM_TYPE_HBM);
// HostCpu use minimum priority, set it as 10
DNNEngineAttribute attr_host_cpu = {vm_host_cpu, mem_type_host_cpu, COST_10, HOST, FORMAT_RESERVED, FORMAT_RESERVED};
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, "make host_cpu_engine failed");
GELOGE(ge::FAILED, "[Register][HostCpuEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterHostCpuEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(vm_host_cpu, host_cpu_engine) != SUCCESS) {
@ -157,7 +165,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, "make rts_engine failed");
GELOGE(ge::FAILED, "[Register][RtsEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterRtsEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(vm_rts, rts_engine) != SUCCESS) {
@ -172,7 +181,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, "make hccl_engine failed");
GELOGE(ge::FAILED, "[Register][HcclEngine] failed, as malloc shared_ptr failed.");
REPORT_INNER_ERROR("E19999", "RegisterHcclEngine failed for new DNNEnginePtr failed.");
return;
}
if (EngineManager::RegisterEngine(dnn_hccl, hccl_engine) != SUCCESS) {

Loading…
Cancel
Save