From a9621da40ecb1e6203111bf5d5615770edb7e09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A9=B9=E9=9A=BD?= Date: Mon, 15 Sep 2025 13:29:47 +0000 Subject: [PATCH] !6934 replace err_msg.h instead error_manager.h * replace err_msg.h instead error_manager.h --- base/attr/attr_store.cc | 4 +- base/common/plugin/plugin_manager.cc | 6 +- base/registry/op_impl_space_registry_v2.cc | 2 +- base/type/ascend_string_impl.cc | 4 +- base/type/types_impl.cc | 2 - base/utils/aligned_ptr.cc | 12 +- base/utils/file_utils.cc | 84 +-- base/utils/type_utils_impl.cc | 16 +- .../lowering/data_dependent_interpreter.cc | 4 +- graph/attr/ge_attr_value.cc | 24 +- graph/buffer/buffer.cc | 4 +- graph/context/runtime_inference_context.cc | 2 +- graph/detail/attributes_holder.cc | 20 +- graph/fast_graph/execute_graph.cc | 54 +- graph/fast_graph/fast_graph_impl.h | 50 +- graph/fast_graph/fast_node.cc | 43 +- graph/hcom/hcom_topo_info.cc | 10 +- graph/normal_graph/anchor.cc | 44 +- graph/normal_graph/compute_graph.cc | 144 ++-- graph/normal_graph/ge_tensor.cc | 18 +- graph/normal_graph/gnode.cc | 215 +++--- graph/normal_graph/graph.cc | 159 ++-- graph/normal_graph/model.cc | 24 +- graph/normal_graph/node.cc | 131 ++-- graph/normal_graph/op_desc.cc | 66 +- graph/normal_graph/operator.cc | 683 ++++++++++-------- graph/normal_graph/operator_factory.cc | 6 +- graph/normal_graph/operator_factory_impl.cc | 2 +- graph/normal_graph/operator_impl.cc | 64 +- graph/normal_graph/tensor.cc | 28 +- graph/opsproto/opsproto_manager.cc | 2 +- graph/option/optimization_option.cc | 5 +- graph/refiner/format_refiner.cc | 12 +- graph/refiner/ref_relation.cc | 15 +- graph/refiner/shape_refiner.cc | 101 +-- .../serialization/attr_serializer_registry.cc | 7 +- graph/serialization/model_serialize.cc | 46 +- graph/type/sym_dtype.cc | 6 +- graph/type/types.cc | 1 - graph/utils/anchor_utils.cc | 4 +- graph/utils/ffts_graph_utils.cc | 58 +- graph/utils/ge_ir_utils.cc | 110 +-- graph/utils/graph_utils.cc | 342 ++++----- graph/utils/graph_utils_ex.cc | 4 +- graph/utils/inference_rule.cc | 1 + graph/utils/node_utils.cc | 90 +-- graph/utils/node_utils_ex.cc | 6 +- graph/utils/op_desc_utils.cc | 76 +- graph/utils/op_desc_utils_ex.cc | 11 +- graph/utils/op_type_utils.cc | 4 +- graph/utils/tensor_utils.cc | 26 +- graph/utils/transformer_utils.cc | 15 +- graph/utils/tuning_utils.cc | 117 +-- graph/utils/type_utils.cc | 4 +- inc/common/checker.h | 6 +- inc/common/ge_common/debug/ge_log.h | 91 ++- inc/common/ge_common/debug/log.h | 15 +- inc/common/ge_common/util.h | 2 +- inc/graph/ascendc_ir/ascendc_ir_check.h | 4 +- .../attribute_group/attr_group_shape_env.h | 1 + register/CMakeLists.txt | 1 + register/ascendc/ascendc_py.cc | 18 +- register/exe_res_generation_context.cc | 32 +- register/op_tiling/op_tiling.cc | 69 +- register/op_tiling/op_tiling_info.cc | 5 +- register/op_tiling/op_tiling_py.cc | 69 +- register/prototype_pass_registry.cc | 1 + register/register_custom_pass.cpp | 23 +- register/shape_inference.cc | 36 +- tests/run_test.sh | 3 +- .../testcase/error_manager_unittest.cc | 4 +- .../op_impl_space_registry_v2_unittest.cc | 2 +- 72 files changed, 1725 insertions(+), 1645 deletions(-) diff --git a/base/attr/attr_store.cc b/base/attr/attr_store.cc index b76a542e3a..3a43b21579 100644 --- a/base/attr/attr_store.cc +++ b/base/attr/attr_store.cc @@ -342,7 +342,7 @@ graphStatus OtherAttrs::SetAttr(const std::string &attr, const AnyValue &value) keys_to_attrs_[attr] = value; return GRAPH_SUCCESS; } - REPORT_INNER_ERROR("E18888", "Failed to set the %s.", attr.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to set the %s.", attr.c_str()); GELOGE(ge::GRAPH_FAILED, "Failed to set the %s.", attr.c_str()); return GRAPH_FAILED; } @@ -353,7 +353,7 @@ graphStatus OtherAttrs::GetAttr(const std::string &attr, AnyValue &value) const value = iter->second; return GRAPH_SUCCESS; } - REPORT_INNER_ERROR("E18888", "Failed to find the %s.", attr.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to find the %s.", attr.c_str()); GELOGE(ge::GRAPH_FAILED, "Failed to find the %s.", attr.c_str()); return GRAPH_FAILED; } diff --git a/base/common/plugin/plugin_manager.cc b/base/common/plugin/plugin_manager.cc index b7de614f3f..6af196617e 100644 --- a/base/common/plugin/plugin_manager.cc +++ b/base/common/plugin/plugin_manager.cc @@ -783,8 +783,8 @@ Status PluginManager::LoadSoWithFlags(const std::string &path, const int32_t fla if (real_fn == nullptr) { const char_t *error = mmDlerror(); GE_IF_BOOL_EXEC(error == nullptr, error = ""); - REPORT_INNER_ERROR("E19999", "[Check][So]%s is skipped since function %s does not exist! errmsg:%s", - func_name.c_str(), func_name.c_str(), error); + REPORT_INNER_ERR_MSG("E19999", "[Check][So]%s is skipped since function %s does not exist! errmsg:%s", + func_name.c_str(), func_name.c_str(), error); GELOGE(PARAM_INVALID, "[Check][So]%s is skipped since function %s does not exist! errmsg:%s", func_name.c_str(), func_name.c_str(), error); @@ -1138,7 +1138,7 @@ void PluginManager::GetFileListWithSuffix(const std::string &path, const std::st return; } if (path.size() >= static_cast(MMPA_MAX_PATH)) { - REPORT_INNER_ERROR("E18888", "param path size:%zu >= max path:%d", path.size(), MMPA_MAX_PATH); + REPORT_INNER_ERR_MSG("E18888", "param path size:%zu >= max path:%d", path.size(), MMPA_MAX_PATH); GELOGE(FAILED, "param path size:%zu >= max path:%d", path.size(), MMPA_MAX_PATH); return; } diff --git a/base/registry/op_impl_space_registry_v2.cc b/base/registry/op_impl_space_registry_v2.cc index 2102efdb27..143513b0d5 100644 --- a/base/registry/op_impl_space_registry_v2.cc +++ b/base/registry/op_impl_space_registry_v2.cc @@ -9,11 +9,11 @@ #include #include "common/checker.h" -#include "register/op_impl_space_registry.h" #include "common/util/mem_utils.h" #include "base/registry/op_impl_space_registry_v2.h" #include "graph/debug/ge_util.h" #include "op_impl_space_registry_v2_impl.h" +#include "graph/any_value.h" namespace gert { diff --git a/base/type/ascend_string_impl.cc b/base/type/ascend_string_impl.cc index a6f3fb1971..e8cfc2f997 100644 --- a/base/type/ascend_string_impl.cc +++ b/base/type/ascend_string_impl.cc @@ -24,7 +24,7 @@ void AscendStringImpl::Construct(AscendString &obj, const char_t *const name) { obj.name_ = std::shared_ptr(new (std::nothrow) std::string(name), [](const std::string *const ptr) { Destroy(ptr); }); if (obj.name_ == nullptr) { - REPORT_CALL_ERROR("E18888", "new string failed."); + REPORT_INNER_ERR_MSG("E18888", "new string failed."); GELOGE(FAILED, "[New][String]AscendStringImpl[%s] make shared failed.", name); } } @@ -35,7 +35,7 @@ void AscendStringImpl::Construct(AscendString &obj, const char_t *const name, si obj.name_ = std::shared_ptr(new (std::nothrow) std::string(name, length), [](const std::string *const ptr) { Destroy(ptr); }); if (obj.name_ == nullptr) { - REPORT_CALL_ERROR("E18888", "new string with length failed."); + REPORT_INNER_ERR_MSG("E18888", "new string with length failed."); GELOGE(FAILED, "[New][String]AscendStringImpl make shared failed, length=%zu.", length); } } diff --git a/base/type/types_impl.cc b/base/type/types_impl.cc index 97fa7c9685..2c8a13a162 100644 --- a/base/type/types_impl.cc +++ b/base/type/types_impl.cc @@ -12,8 +12,6 @@ #include #include "common/ge_common/debug/ge_log.h" #include "graph/utils/type_utils.h" -#include "inc/common/util/error_manager/error_manager.h" - namespace ge { diff --git a/base/utils/aligned_ptr.cc b/base/utils/aligned_ptr.cc index e3acfecf6f..b6d0c3db95 100644 --- a/base/utils/aligned_ptr.cc +++ b/base/utils/aligned_ptr.cc @@ -59,7 +59,7 @@ std::unique_ptr AlignedPtr::Reset() { std::unique_ptr AlignedPtr::Reset(uint8_t *const data, const AlignedPtr::Deleter &delete_func) { if ((data == nullptr) || (delete_func == nullptr)) { - REPORT_INNER_ERROR("E18888", "data is nullptr or delete_func is nullptr"); + REPORT_INNER_ERR_MSG("E18888", "data is nullptr or delete_func is nullptr"); GELOGE(FAILED, "[Check][Param] data/delete_func is null"); return nullptr; } @@ -73,13 +73,13 @@ std::unique_ptr AlignedPtr::Reset(uint8_t *const std::shared_ptr AlignedPtr::BuildFromAllocFunc(const AlignedPtr::Allocator &alloc_func, const AlignedPtr::Deleter &delete_func) { if ((alloc_func == nullptr) || (delete_func == nullptr)) { - REPORT_INNER_ERROR("E18888", "alloc_func or delete_func is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "alloc_func or delete_func is nullptr, check invalid"); GELOGE(FAILED, "[Check][Param] alloc_func/delete_func is null"); return nullptr; } const auto aligned_ptr = MakeShared(); if (aligned_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "create AlignedPtr failed."); + REPORT_INNER_ERR_MSG("E18888", "create AlignedPtr failed."); GELOGE(INTERNAL_ERROR, "[Create][AlignedPtr] make shared for AlignedPtr failed"); return nullptr; } @@ -87,7 +87,7 @@ std::shared_ptr AlignedPtr::BuildFromAllocFunc(const AlignedPtr::All alloc_func(aligned_ptr->base_); aligned_ptr->base_.get_deleter() = delete_func; if (aligned_ptr->base_ == nullptr) { - REPORT_CALL_ERROR("E18888", "allocate for AlignedPtr failed"); + REPORT_INNER_ERR_MSG("E18888", "allocate for AlignedPtr failed"); GELOGE(FAILED, "[Call][AllocFunc] allocate for AlignedPtr failed"); return nullptr; } @@ -97,13 +97,13 @@ std::shared_ptr AlignedPtr::BuildFromAllocFunc(const AlignedPtr::All std::shared_ptr AlignedPtr::BuildFromData(uint8_t * const data, const AlignedPtr::Deleter &delete_func) { if ((data == nullptr) || (delete_func == nullptr)) { - REPORT_INNER_ERROR("E18888", "data is nullptr or delete_func is nullptr"); + REPORT_INNER_ERR_MSG("E18888", "data is nullptr or delete_func is nullptr"); GELOGE(FAILED, "[Check][Param] data/delete_func is null"); return nullptr; } const auto aligned_ptr = MakeShared(); if (aligned_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "create AlignedPtr failed."); + REPORT_INNER_ERR_MSG("E18888", "create AlignedPtr failed."); GELOGE(INTERNAL_ERROR, "[Create][AlignedPtr] make shared for AlignedPtr failed"); return nullptr; } diff --git a/base/utils/file_utils.cc b/base/utils/file_utils.cc index 303db8fbe7..6dde695ff5 100644 --- a/base/utils/file_utils.cc +++ b/base/utils/file_utils.cc @@ -19,13 +19,13 @@ #include "graph/utils/file_utils.h" namespace { - const int32_t kFileSuccess = 0; - const uint32_t kMaxWriteSize = 1 * 1024 * 1024 * 1024U; // 1G -} +const int32_t kFileSuccess = 0; +const uint32_t kMaxWriteSize = 1 * 1024 * 1024 * 1024U; // 1G +} // namespace namespace ge { std::string RealPath(const char_t *path) { if (path == nullptr) { - REPORT_INNER_ERROR("E18888", "path is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "path is nullptr, check invalid"); GELOGE(FAILED, "[Check][Param] path pointer is NULL."); return ""; } @@ -76,14 +76,13 @@ inline int32_t CheckAndMkdir(const char_t *tmp_dir_path, mmMode_t mode) { if (mmAccess2(tmp_dir_path, M_F_OK) != EN_OK) { const int32_t ret = mmMkdir(tmp_dir_path, mode); if (ret != 0) { - REPORT_CALL_ERROR("E18888", - "Can not create directory %s. Make sure the directory " - "exists and writable. errmsg:%s", - tmp_dir_path, strerror(errno)); - GELOGW( - "[Util][mkdir] Create directory %s failed, reason:%s. Make sure the " - "directory exists and writable.", - tmp_dir_path, strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", + "Can not create directory %s. Make sure the directory " + "exists and writable. errmsg:%s", + tmp_dir_path, strerror(errno)); + GELOGW("[Util][mkdir] Create directory %s failed, reason:%s. Make sure the " + "directory exists and writable.", + tmp_dir_path, strerror(errno)); return ret; } } @@ -98,9 +97,8 @@ inline int32_t CheckAndMkdir(const char_t *tmp_dir_path, mmMode_t mode) { * @return 0 success */ int32_t CreateDir(const std::string &directory_path, uint32_t mode) { - GE_CHK_BOOL_EXEC(!directory_path.empty(), - REPORT_INNER_ERROR("E18888", "directory path is empty, check invalid"); - return -1, "[Check][Param] directory path is empty."); + GE_CHK_BOOL_EXEC(!directory_path.empty(), REPORT_INNER_ERR_MSG("E18888", "directory path is empty, check invalid"); + return -1, "[Check][Param] directory path is empty."); const auto dir_path_len = directory_path.length(); if (dir_path_len >= static_cast(MMPA_MAX_PATH)) { REPORT_PREDEFINED_ERR_MSG( @@ -159,16 +157,16 @@ std::unique_ptr GetBinDataFromFile(const std::string &path, uint32_t & return nullptr; } - (void)ifs.seekg(0, std::ifstream::end); + (void) ifs.seekg(0, std::ifstream::end); const uint32_t len = static_cast(ifs.tellg()); - (void)ifs.seekg(0, std::ifstream::beg); + (void) ifs.seekg(0, std::ifstream::beg); auto bin_data = ComGraphMakeUnique(len); if (bin_data == nullptr) { GELOGE(FAILED, "[Allocate][Mem]Allocate mem failed"); ifs.close(); return nullptr; } - (void)ifs.read(reinterpret_cast(bin_data.get()), static_cast(len)); + (void) ifs.read(reinterpret_cast(bin_data.get()), static_cast(len)); data_len = len; ifs.close(); return bin_data; @@ -180,15 +178,15 @@ std::unique_ptr GetBinFromFile(const std::string &path, size_t offset, s std::ifstream ifs(real_path, std::ifstream::binary); GE_ASSERT_TRUE(ifs.is_open(), "Read file %s failed.", real_path.c_str()); GE_MAKE_GUARD(close_ifs, [&ifs]() { ifs.close(); }); - (void)ifs.seekg(0, std::ifstream::end); + (void) ifs.seekg(0, std::ifstream::end); const size_t act_file_len = static_cast(ifs.tellg()); GE_ASSERT_TRUE((offset <= (SIZE_MAX - data_len)) && ((offset + data_len) <= act_file_len), "Offset add length overflow size_t or file length"); ifs.clear(); - (void)ifs.seekg(static_cast(offset), std::ifstream::beg); + (void) ifs.seekg(static_cast(offset), std::ifstream::beg); auto bin_data = ComGraphMakeUnique(data_len); GE_ASSERT_NOTNULL(bin_data, "[Allocate][Mem] Allocate mem failed"); - (void)ifs.read(reinterpret_cast(bin_data.get()), static_cast(data_len)); + (void) ifs.read(reinterpret_cast(bin_data.get()), static_cast(data_len)); ifs.close(); return bin_data; } @@ -197,28 +195,25 @@ graphStatus GetBinFromFile(const std::string &path, char_t *buffer, size_t &data GE_ASSERT_TRUE(!path.empty()); GE_ASSERT_TRUE(buffer != nullptr); std::string real_path = RealPath(path.c_str()); - GE_ASSERT_TRUE(!real_path.empty(), - "Path: %s is invalid, file or directory does not exist", path.c_str()); + GE_ASSERT_TRUE(!real_path.empty(), "Path: %s is invalid, file or directory does not exist", path.c_str()); std::ifstream ifs(real_path, std::ifstream::binary); if (!ifs.is_open()) { GELOGE(GRAPH_FAILED, "path:%s not open", real_path.c_str()); return GRAPH_FAILED; } - (void)ifs.seekg(0, std::ifstream::end); + (void) ifs.seekg(0, std::ifstream::end); const size_t len = static_cast(ifs.tellg()); - (void)ifs.seekg(0, std::ifstream::beg); + (void) ifs.seekg(0, std::ifstream::beg); if (len != data_len) { - REPORT_CALL_ERROR("E18888", - "Bin length[%zu] is not equal to defined length[%zu], file_path[%s].", - len, data_len, path.c_str()); - GELOGE(GRAPH_FAILED, - "Bin length[%zu] is not equal to defined length[%zu], file_path[%s].", - len, data_len, path.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Bin length[%zu] is not equal to defined length[%zu], file_path[%s].", len, data_len, + path.c_str()); + GELOGE(GRAPH_FAILED, "Bin length[%zu] is not equal to defined length[%zu], file_path[%s].", len, data_len, + path.c_str()); ifs.close(); return GRAPH_FAILED; } - (void)ifs.read(buffer, static_cast(len)); + (void) ifs.read(buffer, static_cast(len)); ifs.close(); return GRAPH_SUCCESS; } @@ -227,12 +222,12 @@ graphStatus WriteBinToFile(std::string &path, char_t *data, uint32_t &data_len) GE_ASSERT_TRUE(!path.empty()); std::ofstream ofs(path, std::ios::out | std::ifstream::binary); GE_ASSERT_TRUE(ofs.is_open(), "path:%s open failed", path.c_str()); - (void)ofs.write(data, static_cast(data_len)); + (void) ofs.write(data, static_cast(data_len)); ofs.close(); return GRAPH_SUCCESS; } -graphStatus WriteBinToFile(const int32_t fd, const char_t * const data, size_t data_len) { +graphStatus WriteBinToFile(const int32_t fd, const char_t *const data, size_t data_len) { if ((data == nullptr) || (data_len == 0UL)) { GELOGE(GRAPH_FAILED, "check param failed, data is nullptr or length is zero."); return GRAPH_FAILED; @@ -244,7 +239,7 @@ graphStatus WriteBinToFile(const int32_t fd, const char_t * const data, size_t d size_t copy_size = remain_size > kMaxWriteSize ? kMaxWriteSize : remain_size; write_count = mmWrite(fd, seek, static_cast(copy_size)); GE_ASSERT_TRUE(((write_count != EN_INVALID_PARAM) && (write_count != EN_ERROR)), - "Write data failed, data_len: %llu", data_len); + "Write data failed, data_len: %llu", data_len); seek = PtrAdd(PtrToPtr(seek), remain_size, static_cast(write_count)); remain_size -= static_cast(write_count); } while (remain_size > 0U); @@ -258,8 +253,7 @@ void SplitFilePath(const std::string &file_path, std::string &dir_path, std::str } int32_t split_pos = static_cast(file_path.length() - 1UL); for (; split_pos >= 0; split_pos--) { - if ((file_path[static_cast(split_pos)] == '\\') || - (file_path[static_cast(split_pos)] == '/')) { + if ((file_path[static_cast(split_pos)] == '\\') || (file_path[static_cast(split_pos)] == '/')) { break; } } @@ -272,7 +266,7 @@ void SplitFilePath(const std::string &file_path, std::string &dir_path, std::str return; } -graphStatus SaveBinToFile(const char * const data, size_t length, const std::string &file_path) { +graphStatus SaveBinToFile(const char *const data, size_t length, const std::string &file_path) { if (data == nullptr || length == 0UL) { GELOGE(GRAPH_FAILED, "check param failed, data is nullptr or length is zero."); return GRAPH_FAILED; @@ -282,16 +276,14 @@ graphStatus SaveBinToFile(const char * const data, size_t length, const std::str SplitFilePath(file_path, dir_path, file_name); const bool meta_file_exist = (mmAccess(dir_path.c_str()) == EN_OK); if ((!dir_path.empty()) && (!meta_file_exist)) { - GE_ASSERT_TRUE((CreateDir(dir_path) == kFileSuccess), - "Create direct failed, path: %s.", file_path.c_str()); + GE_ASSERT_TRUE((CreateDir(dir_path) == kFileSuccess), "Create direct failed, path: %s.", file_path.c_str()); } std::string real_path = RealPath(dir_path.c_str()); GE_ASSERT_TRUE(!real_path.empty(), "Path: %s is empty", file_path.c_str()); real_path = real_path + "/" + file_name; // Open file const mmMode_t mode = static_cast(static_cast(M_IRUSR) | static_cast(M_IWUSR)); - const int32_t open_flag = static_cast(static_cast(M_RDWR) | - static_cast(M_CREAT) | + const int32_t open_flag = static_cast(static_cast(M_RDWR) | static_cast(M_CREAT) | static_cast(O_TRUNC)); int32_t fd = mmOpen2(&real_path[0UL], open_flag, mode); GE_ASSERT_TRUE(((fd != EN_INVALID_PARAM) && (fd != EN_ERROR)), "Open file failed, path: %s", real_path.c_str()); @@ -300,7 +292,7 @@ graphStatus SaveBinToFile(const char * const data, size_t length, const std::str GELOGE(GRAPH_FAILED, "Write data to file: %s failed.", real_path.c_str()); ret = GRAPH_FAILED; } - if (mmClose(fd) != 0) { // mmClose:0 success + if (mmClose(fd) != 0) { // mmClose:0 success GELOGE(GRAPH_FAILED, "Close file failed."); return GRAPH_FAILED; } @@ -314,8 +306,8 @@ Status GetAscendWorkPath(std::string &ascend_work_path) { if (mmAccess(work_path) != EN_OK) { if (ge::CreateDir(work_path) != 0) { std::string reason = "The path doesn't exist, create path failed."; - REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), - std::vector({"ASCEND_WORK_PATH", work_path, reason})); + REPORT_PREDEFINED_ERR_MSG("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({"ASCEND_WORK_PATH", work_path, reason.c_str()})); return FAILED; } } @@ -348,4 +340,4 @@ int32_t Scandir(const CHAR *path, mmDirent ***entry_list, mmFilter filter_func, } return count; } -} +} // namespace ge diff --git a/base/utils/type_utils_impl.cc b/base/utils/type_utils_impl.cc index 23b76dd424..23ef88e988 100644 --- a/base/utils/type_utils_impl.cc +++ b/base/utils/type_utils_impl.cc @@ -314,7 +314,7 @@ bool TypeUtilsImpl::GetDataTypeLength(const ge::DataType data_type, uint32_t &le length = static_cast(size); return true; } else { - REPORT_INNER_ERROR("E18888", "data_type not support [%s]", DataTypeToAscendString(data_type).GetString()); + REPORT_INNER_ERR_MSG("E18888", "data_type not support [%s]", DataTypeToAscendString(data_type).GetString()); GELOGE(GRAPH_FAILED, "[Check][Param] data_type not support [%s]", DataTypeToAscendString(data_type).GetString()); return false; } @@ -323,7 +323,7 @@ bool TypeUtilsImpl::GetDataTypeLength(const ge::DataType data_type, uint32_t &le bool TypeUtilsInner::IsDataTypeValid(const DataType dt) { const uint32_t num = static_cast(dt); GE_CHK_BOOL_EXEC((num < DT_MAX), - REPORT_INNER_ERROR("E18888", "param dt:%u >= DT_MAX:%d, check invalid", num, DT_MAX); + REPORT_INNER_ERR_MSG("E18888", "param dt:%u >= DT_MAX:%d, check invalid", num, DT_MAX); return false, "[Check][Param] The DataType is invalid, dt:%u >= DT_MAX:%d", num, DT_MAX); return true; } @@ -331,7 +331,7 @@ bool TypeUtilsInner::IsDataTypeValid(const DataType dt) { bool TypeUtilsInner::IsFormatValid(const Format format) { const uint32_t num = static_cast(GetPrimaryFormat(format)); GE_CHK_BOOL_EXEC((num <= FORMAT_RESERVED), - REPORT_INNER_ERROR("E18888", "The Format is invalid, num:%u > FORMAT_RESERVED:%d", + REPORT_INNER_ERR_MSG("E18888", "The Format is invalid, num:%u > FORMAT_RESERVED:%d", num, FORMAT_RESERVED); return false, "[Check][Param] The Format is invalid, num:%u > FORMAT_RESERVED:%d", num, FORMAT_RESERVED); @@ -366,26 +366,26 @@ graphStatus TypeUtilsInner::SplitFormatFromStr(const std::string &str, primary_format_str = str.substr(0U, split_pos); if (std::any_of(sub_format_str.cbegin(), sub_format_str.cend(), [](const char_t c) { return !static_cast(isdigit(static_cast(c))); })) { - REPORT_CALL_ERROR("E18888", "sub_format: %s is not digital.", sub_format_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "sub_format: %s is not digital.", sub_format_str.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] sub_format: %s is not digital.", sub_format_str.c_str()); return GRAPH_FAILED; } sub_format = std::stoi(sub_format_str); } catch (std::invalid_argument &) { - REPORT_INNER_ERROR("E18888", "sub_format: %s is invalid.", sub_format_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "sub_format: %s is invalid.", sub_format_str.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] sub_format: %s is invalid.", sub_format_str.c_str()); return GRAPH_FAILED; } catch (std::out_of_range &) { - REPORT_INNER_ERROR("E18888", "sub_format: %s is out of range.", sub_format_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "sub_format: %s is out of range.", sub_format_str.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] sub_format: %s is out of range.", sub_format_str.c_str()); return GRAPH_FAILED; } catch (...) { - REPORT_INNER_ERROR("E18888", "sub_format: %s cannot change to int.", sub_format_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "sub_format: %s cannot change to int.", sub_format_str.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] sub_format: %s cannot change to int.", sub_format_str.c_str()); return GRAPH_FAILED; } if (sub_format > 0xFFFF) { - REPORT_INNER_ERROR("E18888", "sub_format: %d is out of range [0, 0xffff].", sub_format); + REPORT_INNER_ERR_MSG("E18888", "sub_format: %d is out of range [0, 0xffff].", sub_format); GELOGE(GRAPH_FAILED, "[Check][Param] sub_format: %d is out of range [0, 0xffff].", sub_format); return GRAPH_FAILED; } diff --git a/exe_graph/lowering/data_dependent_interpreter.cc b/exe_graph/lowering/data_dependent_interpreter.cc index 0e75da6432..6c2c927a16 100644 --- a/exe_graph/lowering/data_dependent_interpreter.cc +++ b/exe_graph/lowering/data_dependent_interpreter.cc @@ -42,8 +42,8 @@ ge::NodePtr FindSubgraphDataNode(const ge::ComputeGraphPtr &graph, int32_t paren if (!ge::AttrUtils::GetInt(node->GetOpDescBarePtr(), ge::ATTR_NAME_PARENT_NODE_INDEX, parent_index)) { GELOGE(ge::INTERNAL_ERROR, "[Get][Attr] failed, node:[%s(%s)] attr:[%s]", node->GetName().c_str(), node->GetType().c_str(), ge::ATTR_NAME_PARENT_NODE_INDEX.c_str()); - REPORT_CALL_ERROR("E19999", "invoke GetInt failed, node:[%s(%s)] attr:[%s]", node->GetName().c_str(), - node->GetType().c_str(), ge::ATTR_NAME_PARENT_NODE_INDEX.c_str()); + REPORT_INNER_ERR_MSG("E19999", "invoke GetInt failed, node:[%s(%s)] attr:[%s]", node->GetName().c_str(), + node->GetType().c_str(), ge::ATTR_NAME_PARENT_NODE_INDEX.c_str()); return nullptr; } if (parent_index == parent_node_index) { diff --git a/graph/attr/ge_attr_value.cc b/graph/attr/ge_attr_value.cc index 1b0549888b..74c7bd8ec6 100644 --- a/graph/attr/ge_attr_value.cc +++ b/graph/attr/ge_attr_value.cc @@ -127,7 +127,7 @@ bool AttrUtils::GetInt(ConstAttrHolderAdapter &&obj, const std::string &name, in } if (!IntegerChecker::Compat(int64_val)) { const std::string reason = GetOverflowDescribeOfInt(name, int64_val); - REPORT_INNER_ERROR("E18888", "%s", reason.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s", reason.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] %s", reason.c_str()); return false; } @@ -143,7 +143,7 @@ bool AttrUtils::GetInt(ConstAttrHolderAdapter &&obj, const std::string &name, ui } if (!IntegerChecker::Compat(int64_val)) { const std::string reason = GetOverflowDescribeOfInt(name, int64_val); - REPORT_INNER_ERROR("E18888", "%s", reason.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s", reason.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] %s", reason.c_str()); return false; } @@ -489,7 +489,7 @@ bool AttrUtils::GetListInt(ConstAttrHolderAdapter &&obj, const std::string &name for (size_t i = 0UL; i < int64_list.size(); ++i) { if (!IntegerChecker::Compat(int64_list[i])) { const std::string reason = GetOverflowDescribeOfListint(name, i, int64_list[i]); - REPORT_INNER_ERROR("E18888", "%s", reason.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s", reason.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] %s", reason.c_str()); return false; } @@ -508,7 +508,7 @@ bool AttrUtils::GetListInt(ConstAttrHolderAdapter &&obj, const std::string &name for (size_t i = 0UL; i < int64_list.size(); ++i) { if (!IntegerChecker::Compat(int64_list[i])) { const std::string reason = GetOverflowDescribeOfListint(name, i, int64_list[i]); - REPORT_INNER_ERROR("E18888", "%s", reason.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s", reason.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] %s", reason.c_str()); return false; } @@ -697,7 +697,7 @@ bool AttrUtils::SetGraph(AttrUtils::AttrHolderAdapter &&obj, const std::string & } const ModelSerializeImp imp; if (!imp.SerializeGraph(value, graph_def)) { - REPORT_CALL_ERROR("E18888", "SerializeGraph failed when add ComputeGraph to attr %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "SerializeGraph failed when add ComputeGraph to attr %s", name.c_str()); GELOGE(GRAPH_FAILED, "[Serialize][Graph] Failed when add ComputeGraph to attr %s", name.c_str()); (void) obj->MutableAttrMap().Delete(name); return false; @@ -721,7 +721,7 @@ bool AttrUtils::SetListGraph(AttrUtils::AttrHolderAdapter &&obj, const std::stri for (size_t i = 0UL; i < value.size(); ++i) { const ModelSerializeImp imp; if (!imp.SerializeGraph(value[i], &attr_graphs->at(i))) { - REPORT_CALL_ERROR("E18888", "SerializeGraph failed when add ComputeGraph to attr %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "SerializeGraph failed when add ComputeGraph to attr %s", name.c_str()); GELOGE(GRAPH_FAILED, "[Serialize][Graph] Failed when add ComputeGraph to attr %s", name.c_str()); (void) obj->MutableAttrMap().Delete(name); return false; @@ -742,7 +742,7 @@ bool AttrUtils::GetGraph(AttrUtils::ConstAttrHolderAdapter &&obj, const std::str // 下一步对这里做整改,直接传入attr_graph_def,避免这一次拷贝 const auto graph_def = ComGraphMakeShared(*attr_graph_def); if (graph_def == nullptr) { - REPORT_CALL_ERROR("E18888", "create proto::GraphDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create proto::GraphDef failed."); GELOGE(GRAPH_FAILED, "[Create][GraphDef] proto::GraphDef make shared failed"); return false; } @@ -750,7 +750,7 @@ bool AttrUtils::GetGraph(AttrUtils::ConstAttrHolderAdapter &&obj, const std::str ModelSerializeImp imp; imp.SetProtobufOwner(graph_def); if (!imp.UnserializeGraph(value, *graph_def)) { - REPORT_CALL_ERROR("E18888", "UnserializeGraph failed when get attr ComputeGraph by name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "UnserializeGraph failed when get attr ComputeGraph by name %s", name.c_str()); GELOGE(GRAPH_FAILED, "[Unserialize][Graph] Failed when get attr ComputeGraph by name %s", name.c_str()); return false; } @@ -773,7 +773,7 @@ bool AttrUtils::GetListGraph(AttrUtils::ConstAttrHolderAdapter &&obj, const std: std::shared_ptr graph_def; graph_def = ComGraphMakeShared(graph_defs->at(i)); if (graph_def == nullptr) { - REPORT_CALL_ERROR("E18888", "create proto::GraphDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create proto::GraphDef failed."); GELOGE(GRAPH_FAILED, "[Create][GraphDef] proto::GraphDef make shared failed"); graph_def = nullptr; return false; @@ -782,7 +782,7 @@ bool AttrUtils::GetListGraph(AttrUtils::ConstAttrHolderAdapter &&obj, const std: ModelSerializeImp imp; imp.SetProtobufOwner(static_cast(graph_def)); if (!imp.UnserializeGraph(graph, *graph_def)) { - REPORT_CALL_ERROR("E18888", "UnserializeGraph failed."); + REPORT_INNER_ERR_MSG("E18888", "UnserializeGraph failed."); GELOGE(GRAPH_FAILED, "[Unserialize][Graph] Failed"); return false; } @@ -984,7 +984,7 @@ std::string AttrUtils::ValueTypeToSerialString(const AnyValue::ValueType value_t if (it != kAttrTypesMap.end()) { return it->second; } else { - REPORT_INNER_ERROR("E18888", "value_type not support %d", value_type); + REPORT_INNER_ERR_MSG("E18888", "value_type not support %d", value_type); GELOGE(GRAPH_FAILED, "[Check][Param] value_type not support %d", value_type); return ""; } @@ -995,7 +995,7 @@ AnyValue::ValueType AttrUtils::SerialStringToValueType(const string &value_type_ if (it != kAttrStrTypesMap.end()) { return it->second; } else { - REPORT_INNER_ERROR("E18888", "value_type_string not support %s", value_type_string.c_str()); + REPORT_INNER_ERR_MSG("E18888", "value_type_string not support %s", value_type_string.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] value_type_string not support %s", value_type_string.c_str()); return AnyValue::VT_NONE; } diff --git a/graph/buffer/buffer.cc b/graph/buffer/buffer.cc index 935deb858c..dbbb7b4e39 100644 --- a/graph/buffer/buffer.cc +++ b/graph/buffer/buffer.cc @@ -36,7 +36,7 @@ BufferImpl::BufferImpl(const std::size_t buffer_size, const std::uint8_t default proto_msg->set_bt(std::string(buffer_size, static_cast(default_val))); buffer_ = proto_msg->mutable_bt(); } catch (std::bad_alloc &) { - REPORT_CALL_ERROR("E18888", "failed to alloc buffer memory, buffer size %zu", buffer_size); + REPORT_INNER_ERR_MSG("E18888", "failed to alloc buffer memory, buffer size %zu", buffer_size); GELOGE(MEMALLOC_FAILED, "[New][Memory] failed to alloc buffer memory, buffer size %zu", buffer_size); buffer_ = nullptr; } @@ -50,7 +50,7 @@ void BufferImpl::CopyFrom(const std::uint8_t * const data, const std::size_t buf proto_msg->set_bt(data, buffer_size); buffer_ = proto_msg->mutable_bt(); } catch (std::bad_alloc &) { - REPORT_CALL_ERROR("E18888", "Failed to alloc buffer memory, buffer size %zu", buffer_size); + REPORT_INNER_ERR_MSG("E18888", "Failed to alloc buffer memory, buffer size %zu", buffer_size); GELOGE(MEMALLOC_FAILED, "[New][Memory] Failed to alloc buffer memory, buffer size %zu", buffer_size); buffer_ = nullptr; } diff --git a/graph/context/runtime_inference_context.cc b/graph/context/runtime_inference_context.cc index e9ac6a035a..c9e20b2f11 100644 --- a/graph/context/runtime_inference_context.cc +++ b/graph/context/runtime_inference_context.cc @@ -36,7 +36,7 @@ graphStatus RuntimeInferenceContext::SetTensor(int64_t node_id, int32_t output_i graphStatus RuntimeInferenceContext::GetTensor(const int64_t node_id, int32_t output_id, GeTensorPtr &tensor) const { if (output_id < 0) { - REPORT_INNER_ERROR("E18888", "Invalid output index: %d", output_id); + REPORT_INNER_ERR_MSG("E18888", "Invalid output index: %d", output_id); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Invalid output index: %d", output_id); return GRAPH_PARAM_INVALID; } diff --git a/graph/detail/attributes_holder.cc b/graph/detail/attributes_holder.cc index b95f18121c..fb28d06aa1 100644 --- a/graph/detail/attributes_holder.cc +++ b/graph/detail/attributes_holder.cc @@ -25,7 +25,7 @@ void AttrHolder::CopyFrom(const AttrHolder &holder) { graphStatus AttrHolder::SetAttr(const std::string &name, const AnyValue &value) { if (value.IsEmpty()) { - REPORT_INNER_ERROR("E18888", "param value is empty, check invalid, key of the attr:%s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "param value is empty, check invalid, key of the attr:%s", name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] value is empty, key of the attr is %s", name.c_str()); return GRAPH_FAILED; } @@ -36,7 +36,7 @@ graphStatus AttrHolder::SetAttr(const std::string &name, const AnyValue &value) } graphStatus AttrHolder::TrySetAttr(const std::string &name, const AnyValue &value) { if (value.IsEmpty()) { - REPORT_INNER_ERROR("E18888", "param value is empty, check invalid, key of the attr:%s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "param value is empty, check invalid, key of the attr:%s", name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] value is empty, key of the attr is %s", name.c_str()); return GRAPH_FAILED; } @@ -98,7 +98,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create AttrDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create AttrDef failed."); GELOGE(GRAPH_FAILED, "[Create][AttrDef] proto::AttrDef make shared failed"); return; } @@ -111,7 +111,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create TensorDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create TensorDef failed."); GELOGE(GRAPH_FAILED, "[Create][TensorDef] proto::TensorDef make shared failed"); return; } @@ -124,7 +124,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create TensorDescriptor failed."); + REPORT_INNER_ERR_MSG("E18888", "create TensorDescriptor failed."); GELOGE(GRAPH_FAILED, "[Create][TensorDescriptor] proto::TensorDescriptor make shared failed"); return; } @@ -137,7 +137,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create ShapeDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create ShapeDef failed."); GELOGE(GRAPH_FAILED, "[Create][ShapeDef] proto::ShapeDef make shared failed"); return; } @@ -150,7 +150,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create NamedAttrs failed."); + REPORT_INNER_ERR_MSG("E18888", "create NamedAttrs failed."); GELOGE(GRAPH_FAILED, "[Create][NamedAttrs] proto::NamedAttrs make shared failed"); return; } @@ -163,7 +163,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create ModelDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create ModelDef failed."); GELOGE(GRAPH_FAILED, "[Create][ModelDef] proto::ModelDef make shared failed"); return; } @@ -176,7 +176,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create OpDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create OpDef failed."); GELOGE(GRAPH_FAILED, "[Create][OpDef] proto::OpDef make shared failed"); return; } @@ -189,7 +189,7 @@ void GeIrProtoHelper::InitDefault() { std::shared_ptr proto_owner; proto_owner = ComGraphMakeShared(); if (proto_owner == nullptr) { - REPORT_CALL_ERROR("E18888", "create GraphDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create GraphDef failed."); GELOGE(GRAPH_FAILED, "[Create][GraphDef] proto::GraphDef make shared failed"); return; } diff --git a/graph/fast_graph/execute_graph.cc b/graph/fast_graph/execute_graph.cc index 7d799540fe..244f12dd67 100644 --- a/graph/fast_graph/execute_graph.cc +++ b/graph/fast_graph/execute_graph.cc @@ -262,7 +262,7 @@ void ExecuteGraph::RemoveNodeFromNodesFree(const FastNode *const fast_node) cons FastNode *ExecuteGraph::AddNode(FastNode *fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return nullptr; } @@ -277,7 +277,7 @@ FastNode *ExecuteGraph::AddNodeFront(const OpDescPtr &op) { FastNode *ExecuteGraph::AddNodeFront(FastNode *const fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return nullptr; } @@ -288,7 +288,7 @@ FastNode *ExecuteGraph::AddNodeFront(FastNode *const fast_node) { graphStatus ExecuteGraph::RemoveJustNode(const FastNode *const fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return GRAPH_FAILED; } @@ -297,7 +297,7 @@ graphStatus ExecuteGraph::RemoveJustNode(const FastNode *const fast_node) { FastEdge *ExecuteGraph::AddEdge(FastNode *const src, int32_t src_index, FastNode *const dst, int32_t dst_index) { if ((src == nullptr) || (dst == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return nullptr; } @@ -311,7 +311,7 @@ FastEdge *ExecuteGraph::AddEdge(FastNode *const src, int32_t src_index, FastNode graphStatus ExecuteGraph::RemoveEdge(const FastEdge *const edge) { if (edge == nullptr) { - REPORT_INNER_ERROR("E18888", "The edge is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The edge is nullptr."); GE_LOGE("[Check][Param] The edge is nullptr."); return GRAPH_FAILED; } @@ -332,7 +332,7 @@ void ExecuteGraph::SetParentNode(FastNode *const node) { ExecuteGraph *ExecuteGraph::AddSubGraph(const std::shared_ptr &sub_graph) { if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Try to add a null subgraph"); + REPORT_INNER_ERR_MSG("E18888", "Try to add a null subgraph"); GE_LOGE("[Check][Param] Try to add a null subgraph"); return nullptr; } @@ -348,7 +348,7 @@ ExecuteGraph *ExecuteGraph::AddSubGraph(const std::shared_ptr &sub graphStatus ExecuteGraph::RemoveSubGraph(const ExecuteGraph *const sub_graph) { if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Try to add a null subgraph"); + REPORT_INNER_ERR_MSG("E18888", "Try to add a null subgraph"); GE_LOGE("[Check][Param] Try to add a null subgraph"); return GRAPH_PARAM_INVALID; } @@ -358,7 +358,7 @@ graphStatus ExecuteGraph::RemoveSubGraph(const ExecuteGraph *const sub_graph) { ExecuteGraph *ExecuteGraph::AddSubGraph(const std::shared_ptr &sub_graph_ptr, const std::string &name) { if (sub_graph_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "Try to add a null subgraph, name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Try to add a null subgraph, name %s", name.c_str()); GE_LOGE("[Check][Param] Try to add a null subgraph, name %s", name.c_str()); return nullptr; } @@ -366,23 +366,23 @@ ExecuteGraph *ExecuteGraph::AddSubGraph(const std::shared_ptr &sub auto sub_graph = sub_graph_ptr.get(); const auto parent_graph = sub_graph->GetParentGraphBarePtr(); if (parent_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "Try to add subgraph without parent graph, name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Try to add subgraph without parent graph, name %s", name.c_str()); GE_LOGE("[Get][Graph] Try to add subgraph without parent graph, name %s", name.c_str()); return nullptr; } const auto parent_node = sub_graph->GetParentNodeBarePtr(); if ((parent_node == nullptr) || (parent_node->GetExtendInfo() == nullptr)) { - REPORT_CALL_ERROR("E18888", "Try to add a subgraph without parent node, name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Try to add a subgraph without parent node, name %s", name.c_str()); GE_LOGE("[Get][Node] Try to add a subgraph without parent node, name %s", name.c_str()); return nullptr; } if (parent_node->GetExtendInfo()->GetOwnerGraphBarePtr() != parent_graph) { - REPORT_INNER_ERROR("E18888", - "Try to add a subgraph which parent node's graph is not equal to " - "the subgraph's parent graph, subgraph name %s, parent node name %s", - sub_graph->GetName().c_str(), parent_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "Try to add a subgraph which parent node's graph is not equal to " + "the subgraph's parent graph, subgraph name %s, parent node name %s", + sub_graph->GetName().c_str(), parent_graph->GetName().c_str()); GE_LOGE( "[Check][Param] Try to add a subgraph which parent node's graph is not equal to " "the subgraph's parent graph, subgraph name %s, parent node name %s", @@ -396,7 +396,7 @@ ExecuteGraph *ExecuteGraph::AddSubGraph(const std::shared_ptr &sub } if (names_to_subgraph_.find(sub_graph->GetName()) != names_to_subgraph_.end()) { - REPORT_INNER_ERROR("E18888", "The subgraph %s existed", GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "The subgraph %s existed", GetName().c_str()); GE_LOGE("[Check][Param] The subgraph %s existed", GetName().c_str()); return nullptr; } @@ -458,7 +458,7 @@ std::vector ExecuteGraph::GetAllSubgraphs() const { FastNode *ExecuteGraph::AddInputNode(FastNode *fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return nullptr; } @@ -469,7 +469,7 @@ FastNode *ExecuteGraph::AddInputNode(FastNode *fast_node) { graphStatus ExecuteGraph::RemoveInputNode(FastNode *const fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return GRAPH_FAILED; } @@ -479,7 +479,7 @@ graphStatus ExecuteGraph::RemoveInputNode(FastNode *const fast_node) { FastNode *ExecuteGraph::AddOutputNodeByIndex(FastNode *const fast_node, int32_t index) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return nullptr; } @@ -490,7 +490,7 @@ FastNode *ExecuteGraph::AddOutputNodeByIndex(FastNode *const fast_node, int32_t graphStatus ExecuteGraph::RemoveOutputNode(const FastNode *const fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return GRAPH_FAILED; } @@ -762,8 +762,8 @@ graphStatus ExecuteGraph::TopologicalSortingGraph(const ExecuteGraph *const exec for (auto &node : node_vec) { (void)itered_nodes_set.insert(node); } - REPORT_INNER_ERROR("E18888", "Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph:%s", - GetDirectNodesSize(), node_vec.size(), GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph:%s", + GetDirectNodesSize(), node_vec.size(), GetName().c_str()); GELOGW("[Check][Param] Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph.", GetDirectNodesSize(), node_vec.size()); for (auto node : graph_shared_->GetDirectNodeToModify()) { @@ -832,7 +832,7 @@ std::vector ExecuteGraph::AllGraphNodes(std::vectorTopologicalSortingGraph(FastGraphUtils::GetGraph(sub_graph), false); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Sub graph[%s] topological sort failed, saved to file black_box", - FastGraphUtils::GetGraph(sub_graph)->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Sub graph[%s] topological sort failed, saved to file black_box", + FastGraphUtils::GetGraph(sub_graph)->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Sort][Graph] Sub graph[%s] topological sort failed, saved to file black_box", FastGraphUtils::GetGraph(sub_graph)->GetName().c_str()); return ret; @@ -901,7 +901,7 @@ ExecuteGraph *ExecuteGraph::GetParentGraphBarePtr(void) { graphStatus ExecuteGraph::RecycleQuickEdge(const FastEdge *const fast_edge) { if (fast_edge == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return GRAPH_FAILED; } @@ -910,7 +910,7 @@ graphStatus ExecuteGraph::RecycleQuickEdge(const FastEdge *const fast_edge) { graphStatus ExecuteGraph::RecycleQuickNode(const FastNode *const fast_node) { if (fast_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr."); GE_LOGE("[Check][Param] The node is nullptr."); return GRAPH_FAILED; } @@ -961,7 +961,7 @@ bool ExecuteGraph::CheckEdgeIsInGraph(const FastEdge *const edge) const { graphStatus ExecuteGraph::MoveEdgeToGraph(const FastEdge *const edge) { if (edge == nullptr) { - REPORT_INNER_ERROR("E18888", "The edge is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "The edge is nullptr."); GE_LOGE("[Check][Param] The edge is nullptr."); return GRAPH_FAILED; } diff --git a/graph/fast_graph/fast_graph_impl.h b/graph/fast_graph/fast_graph_impl.h index d897c94594..3b9cd85773 100644 --- a/graph/fast_graph/fast_graph_impl.h +++ b/graph/fast_graph/fast_graph_impl.h @@ -130,7 +130,7 @@ class FastGraphImpl { for (size_t i = 0UL; i < nodes.size(); i++) { auto node = nodes[i]; if ((node == nullptr) || (node->GetOpDescBarePtr() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr or op_desc should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr or op_desc should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or op_desc should not be null."); return PARAM_INVALID; } @@ -150,7 +150,7 @@ class FastGraphImpl { for (size_t i = 0UL; i < nodes.size(); i++) { auto node = nodes[i]; if ((node == nullptr) || (node->GetOpDescBarePtr() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr or op_desc should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr or op_desc should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or op_desc should not be null."); return PARAM_INVALID; } @@ -161,7 +161,7 @@ class FastGraphImpl { NodeT *AddInputNode(NodeT *const node) { if (node->GetExtendInfo() == nullptr) { - REPORT_INNER_ERROR("E18888", "The node extend info should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node extend info should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node extend info should not be null."); return nullptr; } @@ -183,7 +183,7 @@ class FastGraphImpl { graphStatus RemoveInputNode(NodeT *const node) { if ((node == nullptr) || (node->GetExtendInfo() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -202,7 +202,7 @@ class FastGraphImpl { NodeT *AddOutputNodeByIndex(NodeT *const node, const int32_t index) { if ((node == nullptr) || (node->GetOpDescBarePtr() == nullptr) || node->GetExtendInfo() == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr or opdesc should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr or opdesc should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or opdesc should not be null."); return nullptr; } @@ -260,7 +260,7 @@ class FastGraphImpl { graphStatus RemoveOutputNode(const NodeT *const node) { if ((node == nullptr) || (node->GetExtendInfo() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -289,7 +289,7 @@ class FastGraphImpl { NodeT *AddNode(NodeT *const fast_node) { if ((fast_node == nullptr) || (fast_node->GetOpDescBarePtr() == nullptr) || (fast_node->GetExtendInfo() == nullptr)) { - REPORT_INNER_ERROR("E18888", "the node ptr or op desc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "the node ptr or op desc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or op desc ptr should not be null."); return nullptr; } @@ -318,7 +318,7 @@ class FastGraphImpl { NodeT *AddNodeFront(NodeT *const fast_node) { if ((fast_node == nullptr) || (fast_node->GetOpDescBarePtr() == nullptr) || (fast_node->GetExtendInfo() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr or op desc should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr or op desc should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or op desc should not be null."); return nullptr; } @@ -333,7 +333,7 @@ class FastGraphImpl { auto pos = nodes_.begin(); if (*pos == nullptr) { - REPORT_INNER_ERROR("E18888", "The node begin ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node begin ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node begin ptr should not be null."); return nullptr; } @@ -356,7 +356,7 @@ class FastGraphImpl { graphStatus RemoveJustNode(ListElement *node_ptr) { if ((node_ptr == nullptr) || (node_ptr->owner == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -381,7 +381,7 @@ class FastGraphImpl { graphStatus RecycleQuickNode(ListElement *const quick_node) { if (quick_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -396,7 +396,7 @@ class FastGraphImpl { graphStatus RecycleQuickEdge(ListElement> *const list_edge) { if (list_edge == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -416,7 +416,7 @@ class FastGraphImpl { FastEdge *AddEdge(NodeT *const src, int32_t src_index, NodeT *const dst, int32_t dst_index) { if ((src == nullptr) || (dst == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return nullptr; } @@ -424,7 +424,7 @@ class FastGraphImpl { auto io_index_valid_flag = ((src_index == kControlEdgeIndex) && (dst_index != kControlEdgeIndex)) || ((src_index != kControlEdgeIndex) && (dst_index == kControlEdgeIndex)); if (io_index_valid_flag) { - REPORT_INNER_ERROR("E18888", "Failed to check output index [%d] or input index [%d].", src_index, dst_index); + REPORT_INNER_ERR_MSG("E18888", "Failed to check output index [%d] or input index [%d].", src_index, dst_index); GELOGE(GRAPH_FAILED, "[check][index] Failed to check output index [%d] or input index [%d].", src_index, dst_index); return nullptr; @@ -439,7 +439,7 @@ class FastGraphImpl { free_edges_.erase(iter); } if (edge == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to malloc memory for edge."); + REPORT_INNER_ERR_MSG("E18888", "Failed to malloc memory for edge."); GELOGE(GRAPH_FAILED, "[malloc][edge] Failed to malloc memory for edge."); return nullptr; } @@ -451,7 +451,7 @@ class FastGraphImpl { auto ret = src->RecordEdge(&FastGraphUtils::GetEdge(edge), DirectionType::kDirectionOutType); if (ret != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Failed to record edge in the output node."); + REPORT_INNER_ERR_MSG("E18888", "Failed to record edge in the output node."); GELOGE(GRAPH_FAILED, "[malloc][edge] Failed to record edge in the output node."); free_edges_.push_back(edge, ListMode::kFreeMode); return nullptr; @@ -459,7 +459,7 @@ class FastGraphImpl { ret = dst->RecordEdge(&FastGraphUtils::GetEdge(edge), DirectionType::kDirectionInType); if (ret != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Failed to record edge in the input node."); + REPORT_INNER_ERR_MSG("E18888", "Failed to record edge in the input node."); GELOGE(GRAPH_FAILED, "[malloc][edge] Failed to record edge in the input node."); src->EraseEdge(&FastGraphUtils::GetEdge(edge), DirectionType::kDirectionOutType); free_edges_.push_back(edge, ListMode::kFreeMode); @@ -475,7 +475,7 @@ class FastGraphImpl { */ graphStatus RemoveEdge(ListElement> *const edge) { if (edge == nullptr) { - REPORT_INNER_ERROR("E18888", "The edge ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The edge ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The edge ptr should not be null."); return GRAPH_FAILED; } @@ -515,7 +515,7 @@ class FastGraphImpl { } if (quick_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to create a subgraph."); + REPORT_INNER_ERR_MSG("E18888", "Failed to create a subgraph."); GELOGE(GRAPH_FAILED, "[Create][SubGraph] Failed to create a subgraph."); return nullptr; } @@ -801,7 +801,7 @@ class FastGraphImpl { for (auto iter = other_graph.nodes_.begin(); iter != other_graph.nodes_.end(); ++iter) { auto origin_node = *iter; if (origin_node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node is nullptr in src graph."); + REPORT_INNER_ERR_MSG("E18888", "The node is nullptr in src graph."); GELOGE(GRAPH_FAILED, "[DeepCopyNodes] The node is nullptr in src graph."); continue; } @@ -820,7 +820,7 @@ class FastGraphImpl { ClearEdges(); for (auto origin_edge : other_graph.edges_) { if (origin_edge == nullptr) { - REPORT_INNER_ERROR("E18888", "The edge is nullptr in src graph."); + REPORT_INNER_ERR_MSG("E18888", "The edge is nullptr in src graph."); GELOGE(GRAPH_FAILED, "[DeepCopyEdges] The edge is nullptr in src graph."); continue; } @@ -858,7 +858,7 @@ class FastGraphImpl { for (auto iter = other_graph.sub_graphs_.begin(); iter != other_graph.sub_graphs_.end(); ++iter) { const ListElement *origin_graph_listnode = *iter; if ((origin_graph_listnode == nullptr) || (origin_graph_listnode->data == nullptr)) { - REPORT_INNER_ERROR("E18888", "The sub graph is nullptr in src graph."); + REPORT_INNER_ERR_MSG("E18888", "The sub graph is nullptr in src graph."); GELOGE(GRAPH_FAILED, "[DeepCopySubGraphs] The sub graph is nullptr in src graph."); continue; } @@ -866,7 +866,7 @@ class FastGraphImpl { auto name = origin_graph_listnode->data->GetName(); std::shared_ptr copy_sub_graph = std::make_shared(name); if (copy_sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to new sub graph."); + REPORT_INNER_ERR_MSG("E18888", "Failed to new sub graph."); GELOGE(GRAPH_FAILED, "[DeepCopySubGraphs] Failed to new sub graph."); continue; } @@ -935,7 +935,7 @@ class FastGraphImpl { NodeT *CreateOneNode(const OpDescPtr &op, int64_t id) { if (op == nullptr) { - REPORT_INNER_ERROR("E18888", "The OpDesc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The OpDesc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The OpDesc ptr should not be null."); return nullptr; } @@ -951,7 +951,7 @@ class FastGraphImpl { } if (node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "create node failed."); + REPORT_INNER_ERR_MSG("E18888", "create node failed."); GELOGE(GRAPH_FAILED, "[Create][Node] node_ptr is NULL!!!"); return nullptr; } diff --git a/graph/fast_graph/fast_node.cc b/graph/fast_graph/fast_node.cc index b78bb3fbec..ae763f5aec 100644 --- a/graph/fast_graph/fast_node.cc +++ b/graph/fast_graph/fast_node.cc @@ -10,7 +10,6 @@ #include "graph/fast_graph/fast_node.h" #include #include -#include "common/util/error_manager/error_manager.h" #include "common/checker.h" #include "utils/ge_ir_utils.h" #include "fast_graph_utils.h" @@ -50,7 +49,7 @@ graphStatus FastNode::Reset() { } else { extend_info_ = ComGraphMakeUnique(); GE_CHK_BOOL_EXEC(extend_info_ != nullptr, - REPORT_INNER_ERROR("E18888", "Failed to allocate memory for extend informations"); + REPORT_INNER_ERR_MSG("E18888", "Failed to allocate memory for extend informations"); return GRAPH_FAILED, "[Check][Param] Failed to allocate memory for extend informations"); } @@ -78,25 +77,25 @@ OpDesc *FastNode::GetOpDescBarePtr() const { } std::string FastNode::GetType() const { - GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return std::string(), "[Check][Param] original OpDesc is nullptr"); return opdesc_->GetType(); } std::string FastNode::GetName() const { - GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return std::string(), "[Check][Param] original OpDesc is nullptr"); return opdesc_->GetName(); } const char *FastNode::GetNamePtr() const { - GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return nullptr, "[Check][Param] original OpDesc is nullptr"); return opdesc_->GetNamePtr(); } const char *FastNode::GetTypePtr() const { - GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(opdesc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return nullptr, "[Check][Param] original OpDesc is nullptr"); return opdesc_->GetTypePtr(); } @@ -134,14 +133,14 @@ graphStatus FastNode::RecordOutControlEdge(FastEdge *const edge) { graphStatus FastNode::RecordInDataEdge(FastEdge *const edge, int32_t index) { if (!CheckDataIndexIsValid(index, DirectionType::kDirectionInType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of in edge.", index, data_in_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of in edge.", index, data_in_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of in edge.", index, data_in_num_); return GRAPH_FAILED; } if (in_data_edges_[index] != nullptr) { // if index > 0 ,it is data edge. the input edges must be empty. - REPORT_CALL_ERROR("E18888", "Failed to record edge in node [%s] for multiple input.", GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to record edge in node [%s] for multiple input.", GetName().c_str()); GELOGE(GRAPH_FAILED, "[Record][Edge] Failed to record edge in node [%s] for multiple input.", GetName().c_str()); return GRAPH_FAILED; } @@ -153,7 +152,7 @@ graphStatus FastNode::RecordInDataEdge(FastEdge *const edge, int32_t index) { graphStatus FastNode::RecordOutDataEdge(FastEdge *const edge, int32_t index) { if (!CheckDataIndexIsValid(index, DirectionType::kDirectionOutType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); return GRAPH_FAILED; } @@ -203,7 +202,7 @@ graphStatus FastNode::EraseInDataEdge(const FastEdge *const edge) { GE_ASSERT_NOTNULL(edge); const int32_t index = edge->dst_input; if (!CheckDataIndexIsValid(index, DirectionType::kDirectionInType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_in_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_in_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", index, data_in_num_); return GRAPH_FAILED; } @@ -215,7 +214,7 @@ graphStatus FastNode::EraseInDataEdge(const FastEdge *const edge) { graphStatus FastNode::EraseOutDataEdge(const FastEdge *const edge, int32_t index) { if (!CheckDataIndexIsValid(index, DirectionType::kDirectionOutType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); return GRAPH_FAILED; } @@ -248,7 +247,7 @@ graphStatus FastNode::EraseEdge(const FastEdge *const edge, DirectionType type) graphStatus FastNode::CheckAllInputParamter(DirectionType type, int32_t io_idx, int32_t cur_array_index, int32_t replace_array_index) const { if (io_idx < -1) { - REPORT_INNER_ERROR("E18888", "The idx[%d] exceed the max capacity of in_edges.", io_idx); + REPORT_INNER_ERR_MSG("E18888", "The idx[%d] exceed the max capacity of in_edges.", io_idx); GELOGE(GRAPH_FAILED, "[Check][Param] The idx[%d] exceed the max capacity of in_edges.", io_idx); return GRAPH_FAILED; } @@ -264,7 +263,7 @@ graphStatus FastNode::CheckAllInputParamter(DirectionType type, int32_t io_idx, } if (io_size <= static_cast(io_idx)) { - REPORT_INNER_ERROR("E18888", "The idx [%d] exceed the max capacity [%zu] of in_edges.", io_idx, io_size); + REPORT_INNER_ERR_MSG("E18888", "The idx [%d] exceed the max capacity [%zu] of in_edges.", io_idx, io_size); GELOGE(GRAPH_FAILED, "[Check][Param] The idx [%d] exceed the max capacity [%zu] of in_edges.", io_idx, io_size); return GRAPH_FAILED; } @@ -285,9 +284,9 @@ graphStatus FastNode::CheckAllInputParamter(DirectionType type, int32_t io_idx, } if ((edge_size <= static_cast(replace_array_index)) || (edge_size <= static_cast(cur_array_index))) { - REPORT_INNER_ERROR("E18888", - "The replace index [%d] or current index [%d] exceed the max capacity [%zu] of in_edges.", - replace_array_index, cur_array_index, edge_size); + REPORT_INNER_ERR_MSG("E18888", + "The replace index [%d] or current index [%d] exceed the max capacity [%zu] of in_edges.", + replace_array_index, cur_array_index, edge_size); GELOGE(GRAPH_FAILED, "[Check][Param] The replace index [%d] or current index [%d] exceed the max capacity [%zu] of in_edges.", replace_array_index, cur_array_index, edge_size); @@ -499,7 +498,7 @@ std::vector FastNode::GetOutDataNodesByIndex(int32_t index) const { std::vector out_data_nodes; if (!CheckDataIndexIsValid(index, DirectionType::kDirectionOutType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", index, data_out_num_); return out_data_nodes; } @@ -565,7 +564,7 @@ size_t FastNode::GetInEdgesSizeByIndex(int32_t idx) const { } if (!CheckDataIndexIsValid(idx, DirectionType::kDirectionInType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx, data_in_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx, data_in_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", idx, data_in_num_); return 0UL; } @@ -583,7 +582,7 @@ size_t FastNode::GetOutEdgesSizeByIndex(int32_t idx) const { } if (!CheckDataIndexIsValid(idx, DirectionType::kDirectionOutType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx + 1, data_in_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx + 1, data_in_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", idx + 1, data_in_num_); return 0UL; } @@ -597,7 +596,7 @@ size_t FastNode::GetOutEdgesSizeByIndex(int32_t idx) const { Edge *FastNode::GetInDataEdgeByIndex(int32_t idx) const { if (!CheckDataIndexIsValid(idx, DirectionType::kDirectionInType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of in edge.", idx, data_in_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of in edge.", idx, data_in_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of in edge.", idx, data_in_num_); return nullptr; } @@ -619,7 +618,7 @@ std::vector *> FastNode::GetOutEdgesByIndex(int32_t idx) const { } if (!CheckDataIndexIsValid(idx, DirectionType::kDirectionOutType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx, data_out_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx, data_out_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", idx, data_out_num_); return std::vector *>{}; } @@ -643,7 +642,7 @@ const std::vector *> &FastNode::GetOutEdgesRefByIndex(int32_t idx } if (!CheckDataIndexIsValid(idx, DirectionType::kDirectionOutType)) { - REPORT_INNER_ERROR("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx, data_out_num_); + REPORT_INNER_ERR_MSG("E18888", "The index [%d] exceeds the size [%zu] of out edge.", idx, data_out_num_); GELOGE(GRAPH_FAILED, "The index [%d] exceeds the size [%zu] of out edge.", idx, data_out_num_); return kEmpty; } diff --git a/graph/hcom/hcom_topo_info.cc b/graph/hcom/hcom_topo_info.cc index d468f98c0a..c5f971812f 100644 --- a/graph/hcom/hcom_topo_info.cc +++ b/graph/hcom/hcom_topo_info.cc @@ -13,7 +13,7 @@ namespace ge { Status HcomTopoInfo::SetGroupTopoInfo(const char_t *group, const HcomTopoInfo::TopoInfo &info) { if (group == nullptr) { - REPORT_INNER_ERROR("E18888", "Group key is nullptr,set failed."); + REPORT_INNER_ERR_MSG("E18888", "Group key is nullptr,set failed."); GELOGE(GRAPH_FAILED, "[Check][Param] Group key is nullptr,set failed."); return GRAPH_FAILED; } @@ -30,7 +30,7 @@ Status HcomTopoInfo::GetGroupRankSize(const char_t *group, int64_t &rank_size) { const std::lock_guard lock(mutex_); const auto &iter_info = rank_info_.find(group); if (iter_info == rank_info_.end()) { - REPORT_INNER_ERROR("E18888", "Group key [%s] has not been added, get failed.", group); + REPORT_INNER_ERR_MSG("E18888", "Group key [%s] has not been added, get failed.", group); GELOGE(GRAPH_FAILED, "[Check][Param] group key [%s] has not been added, get failed.", group); return GRAPH_FAILED; } @@ -41,7 +41,7 @@ Status HcomTopoInfo::GetGroupRankSize(const char_t *group, int64_t &rank_size) { Status HcomTopoInfo::SetGroupOrderedStream(const int32_t device_id, const char_t *group, void *stream) { if (group == nullptr) { - REPORT_INNER_ERROR("E18888", "Group is nullptr,set failed."); + REPORT_INNER_ERR_MSG("E18888", "Group is nullptr,set failed."); GELOGE(GRAPH_FAILED, "[Check][Param] group is nullptr,set failed."); return GRAPH_FAILED; } @@ -88,7 +88,7 @@ HcomTopoInfo::TopoDescs *HcomTopoInfo::GetGroupTopoDesc(const char_t *group) { const std::lock_guard lock(mutex_); const auto &iter_info = rank_info_.find(group); if (iter_info == rank_info_.end()) { - REPORT_INNER_ERROR("E18888", "Group key [%s] has not been added, get failed.", group); + REPORT_INNER_ERR_MSG("E18888", "Group key [%s] has not been added, get failed.", group); GELOGE(GRAPH_FAILED, "[Check][Param] group key [%s] has not been added, get failed.", group); return nullptr; } @@ -100,7 +100,7 @@ Status HcomTopoInfo::GetGroupNotifyHandle(const char_t *group, void *¬ify_han const std::lock_guard lock(mutex_); const auto &iter_info = rank_info_.find(group); if (iter_info == rank_info_.end()) { - REPORT_INNER_ERROR("E18888", "Group key [%s] has not been added, get failed.", group); + REPORT_INNER_ERR_MSG("E18888", "Group key [%s] has not been added, get failed.", group); GELOGE(GRAPH_FAILED, "[Check][Param] group key [%s] has not been added, get failed.", group); return GRAPH_FAILED; } diff --git a/graph/normal_graph/anchor.cc b/graph/normal_graph/anchor.cc index ed623c0f50..abcdfc98ff 100644 --- a/graph/normal_graph/anchor.cc +++ b/graph/normal_graph/anchor.cc @@ -20,7 +20,7 @@ namespace { constexpr size_t kAnchorTypeMaxLen = 1024U; bool CanAddPeer(const ge::AnchorPtr &anchor) { if (anchor->IsTypeIdOf() && (anchor->GetPeerAnchorsSize() != 0U)) { - REPORT_INNER_ERROR("E18888", "anchor is type of InDataAnchor, it's peer is not empty."); + REPORT_INNER_ERR_MSG("E18888", "anchor is type of InDataAnchor, it's peer is not empty."); GELOGE(ge::GRAPH_FAILED, "[Check][Param] anchor is type of InDataAnchor, it's peer is not empty."); return false; } @@ -193,7 +193,7 @@ void Anchor::UnlinkAll() noexcept { graphStatus Anchor::Unlink(const AnchorPtr &peer) { if (peer == nullptr) { - REPORT_INNER_ERROR("E18888", "param peer is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param peer is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] peer anchor is invalid."); return GRAPH_FAILED; } @@ -236,24 +236,24 @@ graphStatus Anchor::Insert(const AnchorPtr &old_peer, const AnchorPtr &first_pee GE_CHECK_NOTNULL(impl_); if (!IsSameType(old_peer->GetSelfType(), first_peer->GetSelfType())) { - REPORT_INNER_ERROR("E18888", "the type of old_peer[%s] and first_peer[%s] is not the same.", - old_peer->GetSelfType(), first_peer->GetSelfType()); + REPORT_INNER_ERR_MSG("E18888", "the type of old_peer[%s] and first_peer[%s] is not the same.", + old_peer->GetSelfType(), first_peer->GetSelfType()); GELOGE(GRAPH_FAILED, "[Check][Param] the type of old_peer[%s] and first_peer[%s] is not the same.", old_peer->GetSelfType(), first_peer->GetSelfType()); return GRAPH_FAILED; } if (!IsSameType(second_peer->GetSelfType(), this->GetSelfType())) { - REPORT_INNER_ERROR("E18888", "the type of second_peer[%s] and current anchor[%s] is not the same.", - second_peer->GetSelfType(), this->GetSelfType()); + REPORT_INNER_ERR_MSG("E18888", "the type of second_peer[%s] and current anchor[%s] is not the same.", + second_peer->GetSelfType(), this->GetSelfType()); GELOGE(GRAPH_FAILED, "[Check][Param] the type of second_peer[%s] and current anchor[%s] is not the same.", second_peer->GetSelfType(), this->GetSelfType()); return GRAPH_FAILED; } if ((!CanAddPeer(first_peer)) || (!CanAddPeer(second_peer))) { - REPORT_INNER_ERROR("E18888", "first_peer[%s] or second_peer[%s] check failed", - first_peer->GetSelfType(), second_peer->GetSelfType()); + REPORT_INNER_ERR_MSG("E18888", "first_peer[%s] or second_peer[%s] check failed", first_peer->GetSelfType(), + second_peer->GetSelfType()); GELOGE(GRAPH_FAILED, "[Check][Param] first_peer[%s] or second_peer[%s] check failed", first_peer->GetSelfType(), second_peer->GetSelfType()); return GRAPH_FAILED; @@ -291,15 +291,15 @@ graphStatus Anchor::ReplacePeer(const AnchorPtr &old_peer, const AnchorPtr &new_ GE_CHECK_NOTNULL(new_peer); GE_CHECK_NOTNULL(impl_); if (!IsSameType(old_peer->GetSelfType(), new_peer->GetSelfType())) { - REPORT_INNER_ERROR("E18888", "the type of old_peer[%s] and new_peer[%s] is not the same.", - old_peer->GetSelfType(), new_peer->GetSelfType()); + REPORT_INNER_ERR_MSG("E18888", "the type of old_peer[%s] and new_peer[%s] is not the same.", + old_peer->GetSelfType(), new_peer->GetSelfType()); GELOGE(GRAPH_FAILED, "[Check][Param] the type of old_peer[%s] and new_peer[%s] is not the same.", old_peer->GetSelfType(), new_peer->GetSelfType()); return GRAPH_FAILED; } if (!CanAddPeer(new_peer)) { - REPORT_INNER_ERROR("E18888", "new_peer[%s] check failed.", new_peer->GetSelfType()); + REPORT_INNER_ERR_MSG("E18888", "new_peer[%s] check failed.", new_peer->GetSelfType()); GELOGE(GRAPH_FAILED, "[Check][Param] new_peer[%s] check failed.", new_peer->GetSelfType()); return GRAPH_FAILED; } @@ -394,7 +394,7 @@ graphStatus InDataAnchor::LinkFrom(const OutDataAnchorPtr &src) { // InDataAnchor must be only linkfrom once if ((src == nullptr) || (src->impl_ == nullptr) || (impl_ == nullptr) || (!impl_->peer_anchors_.empty())) { - REPORT_INNER_ERROR("E18888", "src anchor is invalid or the peerAnchors is not empty."); + REPORT_INNER_ERR_MSG("E18888", "src anchor is invalid or the peerAnchors is not empty."); GELOGE(GRAPH_FAILED, "[Check][Param] src anchor is invalid or the peerAnchors is not empty."); return GRAPH_FAILED; } @@ -499,12 +499,12 @@ OutDataAnchor::Vistor OutDataAnchor::GetPeerInControlAnchors graphStatus OutDataAnchor::LinkTo(const InDataAnchorPtr &dest) { if ((dest == nullptr) || (dest->impl_ == nullptr) || (!dest->impl_->peer_anchors_.empty())) { - REPORT_INNER_ERROR("E18888", "dest anchor is nullptr or the peerAnchors is not empty."); + REPORT_INNER_ERR_MSG("E18888", "dest anchor is nullptr or the peerAnchors is not empty."); GELOGE(GRAPH_FAILED, "[Check][Param] dest anchor is nullptr or the peerAnchors is not empty."); return GRAPH_FAILED; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "anchor param is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "anchor param is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] owner anchor is invalid."); return GRAPH_FAILED; } @@ -519,7 +519,7 @@ graphStatus OutDataAnchor::LinkTo(const InDataAnchorPtr &dest) { graphStatus OutDataAnchor::LinkTo(const InControlAnchorPtr &dest) { if ((dest == nullptr) || (dest->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param dest is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dest is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] dest anchor is invalid."); return GRAPH_FAILED; } @@ -538,12 +538,12 @@ graphStatus OutDataAnchor::LinkTo(const InControlAnchorPtr &dest) { graphStatus OutControlAnchor::LinkTo(const InDataAnchorPtr &dest) { if ((dest == nullptr) || (dest->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param dest is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dest is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] dest anchor is invalid."); return GRAPH_FAILED; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "anchor param is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "anchor param is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] owner anchor is invalid."); return GRAPH_FAILED; } @@ -661,12 +661,12 @@ InControlAnchor::Vistor InControlAnchor::GetPeerOutDataAnchors graphStatus InControlAnchor::LinkFrom(const OutControlAnchorPtr &src) { if ((src == nullptr) || (src->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param src is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] src anchor is invalid."); return GRAPH_FAILED; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "anchor param is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "anchor param is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] owner anchor is invalid."); return GRAPH_FAILED; } @@ -680,7 +680,7 @@ graphStatus InControlAnchor::LinkFrom(const OutControlAnchorPtr &src) { } bool InControlAnchor::Equal(const AnchorPtr anchor) const { - CHECK_FALSE_EXEC(anchor != nullptr, REPORT_INNER_ERROR("E18888", "param anchor is nullptr, check invalid"); + CHECK_FALSE_EXEC(anchor != nullptr, REPORT_INNER_ERR_MSG("E18888", "param anchor is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] anchor is invalid."); return false); const auto in_control_anchor = Anchor::DynamicAnchorCast(anchor); if (in_control_anchor != nullptr) { @@ -756,12 +756,12 @@ OutControlAnchor::Vistor OutControlAnchor::GetPeerInDataAnchors graphStatus OutControlAnchor::LinkTo(const InControlAnchorPtr &dest) { if ((dest == nullptr) || (dest->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param dest is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dest is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] dest anchor is invalid."); return GRAPH_FAILED; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "anchor param is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "anchor param is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] owner anchor is invalid."); return GRAPH_FAILED; } diff --git a/graph/normal_graph/compute_graph.cc b/graph/normal_graph/compute_graph.cc index 79ad290896..d9418167bb 100644 --- a/graph/normal_graph/compute_graph.cc +++ b/graph/normal_graph/compute_graph.cc @@ -17,7 +17,6 @@ #include "debug/ge_util.h" #include "common/checker.h" #include "common/ge_common/debug/ge_log.h" -#include "common/util/error_manager/error_manager.h" #include "graph/normal_graph/compute_graph_impl.h" #include "graph/utils/ge_ir_utils.h" #include "graph/utils/graph_utils.h" @@ -645,9 +644,10 @@ bool ComputeGraphImpl::VectorInputNodePtrIsEqual(const std::vector &lef const auto left_nodes_size = left_nodes.size(); const auto right_nodes_size = right_nodes.size(); if (left_nodes_size != right_nodes_size) { - REPORT_INNER_ERROR("E18888", "Check failed with graph input_nodes_: " - "left inputNodes size %zu is different with right inputNodes size %zu .", - left_nodes_size, right_nodes_size); + REPORT_INNER_ERR_MSG("E18888", + "Check failed with graph input_nodes_: " + "left inputNodes size %zu is different with right inputNodes size %zu .", + left_nodes_size, right_nodes_size); GELOGE(GRAPH_FAILED, "[Check][Param] failed with graph input_nodes_: " "left inputNodes size %zu is different with right inputNodes size %zu .", left_nodes_size, right_nodes_size); @@ -655,16 +655,17 @@ bool ComputeGraphImpl::VectorInputNodePtrIsEqual(const std::vector &lef } for (size_t j = 0UL; j < left_nodes_size; j++) { if ((left_nodes.at(j) == nullptr) || (right_nodes.at(j) == nullptr)) { - REPORT_INNER_ERROR("E18888", "left_nodes.at(%zu) or right_nodes.at(%zu) is nullptr", j, j); + REPORT_INNER_ERR_MSG("E18888", "left_nodes.at(%zu) or right_nodes.at(%zu) is nullptr", j, j); GELOGE(GRAPH_FAILED, "[Check][Param] left_nodes.at(%zu) or right_nodes.at(%zu) is nullptr", j, j); return false; } const auto &left_input_name = left_nodes.at(j)->GetName(); const auto &right_input_name = right_nodes.at(j)->GetName(); if (left_input_name != right_input_name) { - REPORT_INNER_ERROR("E18888", "Check failed with graph input_nodes_: " - "left inputNode name %s is different with right inputNode name %s at inputNodes index %zu.", - left_input_name.c_str(), right_input_name.c_str(), j); + REPORT_INNER_ERR_MSG("E18888", + "Check failed with graph input_nodes_: " + "left inputNode name %s is different with right inputNode name %s at inputNodes index %zu.", + left_input_name.c_str(), right_input_name.c_str(), j); GELOGE(GRAPH_FAILED, "[Check][Param] failed with graph input_nodes_: " "left inputNode name %s is different with right inputNode name %s at inputNodes index %zu.", left_input_name.c_str(), right_input_name.c_str(), j); @@ -698,7 +699,7 @@ bool ComputeGraphImpl::operator==(const ComputeGraphImpl &r_graph) const { // Secondly: Node equal means the link relationship between node and node itself equal for (const auto &left_node : nodes_) { if (left_node == nullptr) { - REPORT_INNER_ERROR("E18888", "left_node is nullptr, graph:%s", this->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "left_node is nullptr, graph:%s", this->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] left_node is nullptr"); return false; } @@ -706,11 +707,11 @@ bool ComputeGraphImpl::operator==(const ComputeGraphImpl &r_graph) const { // After TopologicalSorting, node order can change, so find node by name const auto &right_node = r_graph.FindNode(node_name); GE_IF_BOOL_EXEC(right_node == nullptr, - REPORT_INNER_ERROR("E18888", "left_node:%s not find in r_graph:%s", + REPORT_INNER_ERR_MSG("E18888", "left_node:%s not find in r_graph:%s", node_name.c_str(), r_graph.GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] right_node is NULL!!!"); return false); if (!((*right_node) == (*left_node))) { - REPORT_INNER_ERROR("E18888", "Compare graph failed, node:%s not equal.", node_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Compare graph failed, node:%s not equal.", node_name.c_str()); GELOGE(GRAPH_FAILED, "[Compare][Graph] failed, node:%s not equal.", node_name.c_str()); return false; } @@ -727,7 +728,7 @@ bool ComputeGraphImpl::operator==(const ComputeGraphImpl &r_graph) const { NodePtr ComputeGraphImpl::AddNodeFront(const NodePtr node) { if ((node == nullptr) || (node->GetOpDescBarePtr() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr or op desc should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr or op desc should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or op desc should not be null."); return nullptr; } @@ -745,7 +746,7 @@ NodePtr ComputeGraphImpl::AddNodeFront(const NodePtr node) { NodePtr ComputeGraphImpl::AddNodeFront(const OpDescPtr &op, const ComputeGraphPtr &compute_graph) { if (op == nullptr) { - REPORT_INNER_ERROR("E18888", "The OpDesc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The OpDesc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The OpDesc ptr should not be null."); return nullptr; } @@ -754,7 +755,7 @@ NodePtr ComputeGraphImpl::AddNodeFront(const OpDescPtr &op, GE_IF_BOOL_EXEC(node_ptr == nullptr, GELOGE(GRAPH_FAILED, "[Create][Node] node_ptr is NULL!!!"); return nullptr); GE_IF_BOOL_EXEC(node_ptr->Init() != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "node %s init failed.", op->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node %s init failed.", op->GetName().c_str()); GELOGE(GRAPH_FAILED, "node init fail."); return nullptr); return AddNodeFront(node_ptr); @@ -874,7 +875,7 @@ std::vector ComputeGraphImpl::FuseNodeKeepTopo(const std::vectorGetOpDescBarePtr() == nullptr)) { - REPORT_INNER_ERROR("E18888", "the node ptr or op desc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "the node ptr or op desc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or op desc ptr should not be null."); return nullptr; } @@ -887,17 +888,17 @@ NodePtr ComputeGraphImpl::AddNode(const NodePtr node) { NodePtr ComputeGraphImpl::AddNode(const OpDescPtr op, const ComputeGraphPtr &compute_graph) { if (op == nullptr) { - REPORT_INNER_ERROR("E18888", "The OpDesc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The OpDesc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The OpDesc ptr should not be null."); return nullptr; } op->SetId(static_cast(GetDirectNodesSize())); const NodePtr node_ptr = std::shared_ptr(new (std::nothrow) Node(op, compute_graph)); GE_IF_BOOL_EXEC(node_ptr == nullptr, - REPORT_CALL_ERROR("E18888", "create node failed."); + REPORT_INNER_ERR_MSG("E18888", "create node failed."); GELOGE(GRAPH_FAILED, "[Create][Node] node_ptr is NULL!!!"); return nullptr); GE_IF_BOOL_EXEC(node_ptr->Init() != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "node:%s init failed.", op->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node:%s init failed.", op->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Init][Node] %s fail.", op->GetName().c_str()); return nullptr); return AddNode(node_ptr); @@ -905,17 +906,17 @@ NodePtr ComputeGraphImpl::AddNode(const OpDescPtr op, const ComputeGraphPtr &com NodePtr ComputeGraphImpl::AddNode(const OpDescPtr op, const int64_t id, const ComputeGraphPtr &compute_graph) { if (op == nullptr) { - REPORT_INNER_ERROR("E18888", "The OpDesc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The OpDesc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The OpDesc ptr should not be null."); return nullptr; } op->SetId(id); const NodePtr node = std::shared_ptr(new (std::nothrow) Node(op, compute_graph)); GE_IF_BOOL_EXEC(node == nullptr, - REPORT_CALL_ERROR("E18888", "create node failed."); + REPORT_INNER_ERR_MSG("E18888", "create node failed."); GELOGE(GRAPH_FAILED, "[Create][Node] node_ptr is NULL!!!"); return nullptr); GE_IF_BOOL_EXEC(node->Init() != GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "node init failed."); + REPORT_INNER_ERR_MSG("E18888", "node init failed."); GELOGE(GRAPH_FAILED, "[Init][Node] fail."); return nullptr); node->SetHostNode(is_valid_flag_); @@ -934,7 +935,7 @@ void ComputeGraphImpl::AddInputDataNode(const NodePtr &node) { NodePtr ComputeGraphImpl::AddInputNode(const NodePtr node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return nullptr; } @@ -953,7 +954,7 @@ NodePtr ComputeGraphImpl::AddOutputNode(const NodePtr node) { NodePtr ComputeGraphImpl::AddOutputNodeByIndex(const NodePtr node, const int32_t index) { if ((node == nullptr) || (node->GetOpDescBarePtr() == nullptr)) { - REPORT_INNER_ERROR("E18888", "The node ptr or opdesc should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The node ptr or opdesc should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr or opdesc should not be null."); return nullptr; } @@ -1006,7 +1007,7 @@ graphStatus ComputeGraphImpl::RemoveConstInput(const NodePtr &node) { graphStatus ComputeGraphImpl::RemoveNode(const NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -1037,7 +1038,7 @@ graphStatus ComputeGraphImpl::RemoveNode(const NodePtr &node) { // Used in sub_graph scenes graphStatus ComputeGraphImpl::RemoveInputNode(const NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -1053,7 +1054,7 @@ graphStatus ComputeGraphImpl::RemoveInputNode(const NodePtr &node) { // Used in sub_graph scenes graphStatus ComputeGraphImpl::RemoveOutputNode(const NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The node ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -1075,7 +1076,7 @@ graphStatus ComputeGraphImpl::RemoveOutputNode(const NodePtr &node) { std::shared_ptr ComputeGraphImpl::AddSubGraph(const std::shared_ptr &sub_graph) { if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "The graph ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The graph ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The graph ptr should not be null."); return nullptr; } @@ -1086,7 +1087,7 @@ std::shared_ptr ComputeGraphImpl::AddSubGraph(const std::shared_pt graphStatus ComputeGraphImpl::RemoveSubGraph(const std::shared_ptr &sub_graph) { if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "The graph ptr should not be null, graph:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The graph ptr should not be null, graph:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The graph ptr should not be null."); return GRAPH_FAILED; } @@ -1104,26 +1105,27 @@ graphStatus ComputeGraphImpl::RemoveSubGraph(const std::shared_ptr graphStatus ComputeGraphImpl::AddSubgraph(const std::string &name, const std::shared_ptr &subgraph) { if (subgraph == nullptr) { - REPORT_INNER_ERROR("E18888", "Try to add a null subgraph, name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Try to add a null subgraph, name %s", name.c_str()); GE_LOGE("[Check][Param] Try to add a null subgraph, name %s", name.c_str()); return GRAPH_PARAM_INVALID; } const auto parent_graph = subgraph->GetParentGraph(); if (parent_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "Try to add subgraph without parent graph, name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Try to add subgraph without parent graph, name %s", name.c_str()); GE_LOGE("[Get][Graph] Try to add subgraph without parent graph, name %s", name.c_str()); return GRAPH_PARAM_INVALID; } const auto parent_node = subgraph->GetParentNode(); if (parent_node == nullptr) { - REPORT_CALL_ERROR("E18888", "Try to add a subgraph without parent node, name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Try to add a subgraph without parent node, name %s", name.c_str()); GE_LOGE("[Get][Node] Try to add a subgraph without parent node, name %s", name.c_str()); return GRAPH_PARAM_INVALID; } if (parent_node->GetOwnerComputeGraph() != parent_graph) { - REPORT_INNER_ERROR("E18888", "Try to add a subgraph which parent node's graph is not equal to " - "the subgraph's parent graph, subgraph name %s, parent node name %s", - subgraph->GetName().c_str(), parent_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "Try to add a subgraph which parent node's graph is not equal to " + "the subgraph's parent graph, subgraph name %s, parent node name %s", + subgraph->GetName().c_str(), parent_graph->GetName().c_str()); GE_LOGE("[Check][Param] Try to add a subgraph which parent node's graph is not equal to " "the subgraph's parent graph, subgraph name %s, parent node name %s", subgraph->GetName().c_str(), parent_graph->GetName().c_str()); @@ -1137,7 +1139,7 @@ graphStatus ComputeGraphImpl::AddSubgraph(const std::string &name, name.c_str()); } if (names_to_subgraph_.find(name) != names_to_subgraph_.end()) { - REPORT_INNER_ERROR("E18888", "The subgraph %s existed", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "The subgraph %s existed", name.c_str()); GE_LOGE("[Check][Param] The subgraph %s existed", name.c_str()); return GRAPH_PARAM_INVALID; } @@ -1238,8 +1240,8 @@ graphStatus ComputeGraphImpl::UpdateInputMapping(const std::mapGetOpDescBarePtr(), ATTR_NAME_PARENT_NODE_INDEX, static_cast(iter->second))) { - REPORT_CALL_ERROR("E18888", "set attr ATTR_NAME_PARENT_NODE_INDEX failed, op:%s.", - input->GetOpDescBarePtr()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "set attr ATTR_NAME_PARENT_NODE_INDEX failed, op:%s.", + input->GetOpDescBarePtr()->GetName().c_str()); GE_LOGE("[Call][SetInt] UpdateInputMapping failed: set attr ATTR_NAME_PARENT_NODE_INDEX failed, op:%s.", input->GetOpDescBarePtr()->GetName().c_str()); return GRAPH_FAILED; @@ -1256,13 +1258,13 @@ graphStatus ComputeGraphImpl::UpdateInputMapping(const std::map &output_mapping) const { const NodePtr net_output = FindFirstNodeMatchType(NETOUTPUT); if (net_output == nullptr) { - REPORT_INNER_ERROR("E18888", "UpdateOutputMapping failed: node type %s does not exist in graph.", NETOUTPUT); + REPORT_INNER_ERR_MSG("E18888", "UpdateOutputMapping failed: node type %s does not exist in graph.", NETOUTPUT); GE_LOGE("[Get][NodeType] UpdateOutputMapping failed: node type %s does not exist in graph.", NETOUTPUT); return GRAPH_FAILED; } const auto op_desc = net_output->GetOpDescBarePtr(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "net output's op desc pr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "net output's op desc pr should not be null."); GE_LOGE("[Get][OpDesc] UpdateOutputMapping failed: op_desc is NULL."); return GRAPH_FAILED; } @@ -1279,14 +1281,14 @@ graphStatus ComputeGraphImpl::UpdateOutputMapping(const std::map(iter->second))) { - REPORT_CALL_ERROR("E18888", "op %s set %zu input tensor attr ATTR_NAME_PARENT_NODE_INDEX failed.", - op_desc->GetName().c_str(), i); + REPORT_INNER_ERR_MSG("E18888", "op %s set %zu input tensor attr ATTR_NAME_PARENT_NODE_INDEX failed.", + op_desc->GetName().c_str(), i); GE_LOGE("[Set][Int] op %s set %zu input tensor attr ATTR_NAME_PARENT_NODE_INDEX failed.", op_desc->GetName().c_str(), i); return GRAPH_FAILED; } if (op_desc->UpdateInputDesc(static_cast(i), tensor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "op %s update %zu input_tensor failed.", op_desc->GetName().c_str(), i); + REPORT_INNER_ERR_MSG("E18888", "op %s update %zu input_tensor failed.", op_desc->GetName().c_str(), i); GE_LOGE("[Update][InputDesc] UpdateOutputMapping failed: update %zu input_tensor failed.", i); return GRAPH_FAILED; } @@ -1326,7 +1328,7 @@ graphStatus ComputeGraphImpl::ReorderEventNodes(const ConstComputeGraphPtr &comp graphStatus ComputeGraphImpl::InsertGraphEvents(const ConstComputeGraphPtr &compute_graph) { auto status = ReorderEventNodes(compute_graph); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Graph [%s] record event nodes failed, status:%u", name_.c_str(), status); + REPORT_INNER_ERR_MSG("E18888", "Graph [%s] record event nodes failed, status:%u", name_.c_str(), status); GELOGE(status, "[Reorder][EventNodes] failed for Graph:%s, status:%u", name_.c_str(), status); return status; } @@ -1335,8 +1337,8 @@ graphStatus ComputeGraphImpl::InsertGraphEvents(const ConstComputeGraphPtr &comp for (const auto &graph : sub_graph_) { status = graph->ReorderEventNodes(); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "ReorderEventNodes failed for SubGraph:%s, status:%u", - graph->GetName().c_str(), status); + REPORT_INNER_ERR_MSG("E18888", "ReorderEventNodes failed for SubGraph:%s, status:%u", graph->GetName().c_str(), + status); GELOGE(status, "[Reorder][EventNodes] failed for SubGraph:%s, status:%u", graph->GetName().c_str(), status); return status; } @@ -1599,7 +1601,7 @@ graphStatus ComputeGraphImpl::TopologicalSorting(const ComputeGraphPtr &const_gr auto ret = TopologicalSortingGraph(const_compute_graph); if (ret != GRAPH_SUCCESS) { GE_DUMP(const_graph_ptr, "black_box" + name_); - REPORT_CALL_ERROR("E18888", "Graph [%s] topological sort failed, saved to file black_box", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Graph [%s] topological sort failed, saved to file black_box", name_.c_str()); GELOGW("[Sort][Graph] Graph [%s] topological sort failed, saved to file black_box", name_.c_str()); return ret; } @@ -1613,8 +1615,8 @@ graphStatus ComputeGraphImpl::TopologicalSorting(const ComputeGraphPtr &const_gr ret = sub_graph->TopologicalSortingGraph(); if (ret != GRAPH_SUCCESS) { GE_DUMP(sub_graph, "black_box" + sub_graph->GetName()); - REPORT_CALL_ERROR("E18888", "Sub graph[%s] topological sort failed, saved to file black_box", - sub_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Sub graph[%s] topological sort failed, saved to file black_box", + sub_graph->GetName().c_str()); GELOGW("[Sort][Graph] Sub graph[%s] topological sort failed, saved to file black_box", sub_graph->GetName().c_str()); return ret; @@ -1663,8 +1665,8 @@ graphStatus ComputeGraphImpl::DoTopologicalSorting(const ConstComputeGraphPtr &c for (auto &node : node_vec) { (void) itered_nodes_set.insert(node.get()); } - REPORT_INNER_ERROR("E18888", "Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph:%s", - GetDirectNodesSize(), node_vec.size(), name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph:%s", + GetDirectNodesSize(), node_vec.size(), name_.c_str()); GELOGW("[Check][Param] Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph.", GetDirectNodesSize(), node_vec.size()); for (auto &node : nodes_) { @@ -1899,7 +1901,7 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { const auto pre_out_data_anchor = in_data_anchor->GetPeerOutAnchor(); if (pre_out_data_anchor != nullptr) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(pre_out_data_anchor, in_data_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", pre_out_data_anchor->GetOwnerNode()->GetName().c_str(), in_data_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", @@ -1911,14 +1913,14 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { for (const auto &out_data_anchor : node->GetAllOutDataAnchors()) { for (const auto &next_in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_data_anchor, next_in_data_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_data_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_data_anchor->GetOwnerNode()->GetName().c_str()); GE_CHK_BOOL_EXEC(GraphUtils::AddEdge(pre_out_data_anchor, next_in_data_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "add edge from %s to %s failed", pre_out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_data_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Add][Edge] from %s to %s failed", @@ -1927,14 +1929,14 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { } for (const auto &next_in_ctrl_anchor : out_data_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_data_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); GE_CHK_BOOL_EXEC(GraphUtils::AddEdge(pre_out_data_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "add edge from %s to %s failed", pre_out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Add][Edge] from %s to %s failed", @@ -1948,14 +1950,14 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { GE_CHECK_NOTNULL(pre_out_ctrl_anchor); for (const auto &next_in_ctrl_anchor : out_ctrl_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_ctrl_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); GE_CHK_BOOL_EXEC(GraphUtils::AddEdge(pre_out_ctrl_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "add edge from %s to %s failed", pre_out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Add][Edge] from %s to %s failed", @@ -1970,7 +1972,7 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { GE_CHECK_NOTNULL(in_ctrl_anchor); for (const auto &pre_out_ctrl_anchor : in_ctrl_anchor->GetPeerOutControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(pre_out_ctrl_anchor, in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", pre_out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", @@ -1979,14 +1981,14 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { for (const auto &out_data_anchor : node->GetAllOutDataAnchors()) { for (const auto &next_in_ctrl_anchor : out_data_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_data_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); GE_CHK_BOOL_EXEC(GraphUtils::AddEdge(pre_out_ctrl_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "add edge from %s to %s failed", pre_out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Add][Edge] from %s to %s failed", @@ -1998,14 +2000,14 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { if (out_ctrl_anchor != nullptr) { for (const auto &next_in_ctrl_anchor : out_ctrl_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_ctrl_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); GE_CHK_BOOL_EXEC(GraphUtils::AddEdge(pre_out_ctrl_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "add edge from %s to %s failed", pre_out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Add][Edge] from %s to %s failed", @@ -2017,7 +2019,7 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { for (const auto &out_peer_data_anchor : in_ctrl_anchor->GetPeerOutDataAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_peer_data_anchor, in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_peer_data_anchor->GetOwnerNode()->GetName().c_str(), in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", @@ -2026,7 +2028,7 @@ graphStatus ComputeGraphImpl::IsolateNode(const NodePtr &node) const { for (const auto &next_node : next_nodes) { const auto next_in_control_anchor = next_node->GetInControlAnchor(); GE_CHK_BOOL_EXEC(GraphUtils::AddEdge(out_peer_data_anchor, next_in_control_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "add edge from %s to %s failed", out_peer_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_control_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Add][Edge] from %s to %s failed", @@ -2044,7 +2046,7 @@ graphStatus ComputeGraphImpl::RemoveExtraOutEdge(const NodePtr &node) const { for (const auto &out_data_anchor : node->GetAllOutDataAnchors()) { for (const auto &next_in_data_anchor : out_data_anchor->GetPeerInDataAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_data_anchor, next_in_data_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_data_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", @@ -2054,7 +2056,7 @@ graphStatus ComputeGraphImpl::RemoveExtraOutEdge(const NodePtr &node) const { for (const auto &next_in_ctrl_anchor : out_data_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_data_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_data_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", @@ -2066,7 +2068,7 @@ graphStatus ComputeGraphImpl::RemoveExtraOutEdge(const NodePtr &node) const { if (out_ctrl_anchor != nullptr) { for (const auto &next_in_ctrl_anchor : out_ctrl_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(GraphUtils::RemoveEdge(out_ctrl_anchor, next_in_ctrl_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "remove edge from %s to %s failed", + REPORT_INNER_ERR_MSG("E18888", "remove edge from %s to %s failed", out_ctrl_anchor->GetOwnerNode()->GetName().c_str(), next_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); return GRAPH_FAILED, "[Remove][Edge] from %s to %s failed", @@ -2096,7 +2098,7 @@ void ComputeGraphImpl::SetUserDefOutput(const std::string &output_name) { for (const std::string &node : nodes) { std::vector item = StringUtils::Split(node, ':'); if (item.size() != OUTPUT_PARAM_SIZE) { - REPORT_INNER_ERROR("W18888", "Check output param size failed, output_name:%s", output_name.c_str()); + REPORT_INNER_ERR_MSG("W18888", "Check output param size failed, output_name:%s", output_name.c_str()); GELOGW("[Check][Output] Check output param size failed, output_name:%s", output_name.c_str()); continue; } @@ -2105,15 +2107,15 @@ void ComputeGraphImpl::SetUserDefOutput(const std::string &output_name) { try { index = stoi(StringUtils::Trim(item[1UL])); } catch (const std::out_of_range &) { - REPORT_INNER_ERROR("W18888", "Catch out_of_range exception, output_name:%s", output_name.c_str()); + REPORT_INNER_ERR_MSG("W18888", "Catch out_of_range exception, output_name:%s", output_name.c_str()); GELOGW("[Catch][Exception] Catch out_of_range exception, output_name:%s", output_name.c_str()); continue; } catch (const std::invalid_argument &) { - REPORT_INNER_ERROR("W18888", "Catch invalid_argument exception, output_name:%s", output_name.c_str()); + REPORT_INNER_ERR_MSG("W18888", "Catch invalid_argument exception, output_name:%s", output_name.c_str()); GELOGW("[Catch][Exception] Catch invalid_argument exception, output_name:%s", output_name.c_str()); continue; } catch (...) { - REPORT_INNER_ERROR("W18888", "Catch exception, output_name:%s", output_name.c_str()); + REPORT_INNER_ERR_MSG("W18888", "Catch exception, output_name:%s", output_name.c_str()); GELOGW("[Catch][Exception] Catch exception, output_name:%s", output_name.c_str()); continue; } diff --git a/graph/normal_graph/ge_tensor.cc b/graph/normal_graph/ge_tensor.cc index d98db40cf7..aa6c9c4216 100644 --- a/graph/normal_graph/ge_tensor.cc +++ b/graph/normal_graph/ge_tensor.cc @@ -847,7 +847,7 @@ graphStatus GeTensorDesc::GetValueRange(std::vector> for (const auto &ele : value_range) { // here must be only two elemenet because pair if (ele.size() != PAIR_ELEMENT_SIZE) { - REPORT_INNER_ERROR("E18888", "value_range must contain only 2 value but really is %zu", ele.size()); + REPORT_INNER_ERR_MSG("E18888", "value_range must contain only 2 value but really is %zu", ele.size()); GELOGE(GRAPH_FAILED, "[Check][Param] value_range must contain only 2 value but really is %zu", ele.size()); return GRAPH_FAILED; } @@ -882,7 +882,7 @@ graphStatus GeTensorDesc::GetShapeRange(std::vector> for (const auto &ele : shape_range) { // here must be only two elemenet because pair if (ele.size() != PAIR_ELEMENT_SIZE) { - REPORT_INNER_ERROR("E18888", "shape_range must contain only 2 value but really is %zu", ele.size()); + REPORT_INNER_ERR_MSG("E18888", "shape_range must contain only 2 value but really is %zu", ele.size()); GELOGE(GRAPH_FAILED, "[Check][Param] shape_range must contain only 2 value but really is %zu", ele.size()); return GRAPH_FAILED; } @@ -900,7 +900,7 @@ graphStatus GeTensorDesc::GetOriginShapeRange(std::vector SECUREC_MEM_MAX_LEN) { if (memcpy_s(ValueToPtr(dst_addr), SECUREC_MEM_MAX_LEN, ValueToPtr(src_addr), SECUREC_MEM_MAX_LEN) != EOK) { - REPORT_CALL_ERROR("E18888", "memcpy failed, size = %lu", SECUREC_MEM_MAX_LEN); + REPORT_INNER_ERR_MSG("E18888", "memcpy failed, size = %lu", SECUREC_MEM_MAX_LEN); GELOGE(INTERNAL_ERROR, "[Memcpy][Data] failed, size = %lu", SECUREC_MEM_MAX_LEN); return GRAPH_FAILED; } @@ -1071,7 +1071,7 @@ graphStatus TensorDataImpl::SetData(const uint8_t *const data, const size_t size } if (memcpy_s(ValueToPtr(dst_addr), remain_size, ValueToPtr(src_addr), remain_size) != EOK) { - REPORT_CALL_ERROR("E18888", "memcpy failed, size=%zu", remain_size); + REPORT_INNER_ERR_MSG("E18888", "memcpy failed, size=%zu", remain_size); GELOGE(INTERNAL_ERROR, "[Memcpy][Data] failed, size=%zu", remain_size); return GRAPH_FAILED; } @@ -1090,7 +1090,7 @@ graphStatus TensorDataImpl::SetData(uint8_t *const data, const size_t size, cons return GRAPH_SUCCESS; } if (data == nullptr) { - REPORT_CALL_ERROR("E18888", "data is nullptr"); + REPORT_INNER_ERR_MSG("E18888", "data is nullptr"); GELOGE(GRAPH_FAILED, "[Check][Param] data is nullptr"); return GRAPH_FAILED; } @@ -1127,7 +1127,7 @@ const uint8_t *TensorDataImpl::MallocAlignedPtr(const size_t size) { if (aligned_ptr_ == nullptr) { aligned_ptr_ = MakeShared(length_); if (aligned_ptr_ == nullptr) { - REPORT_CALL_ERROR("E18888", "create AlignedPtr failed."); + REPORT_INNER_ERR_MSG("E18888", "create AlignedPtr failed."); GELOGE(INTERNAL_ERROR, "[Create][AlignedPtr] failed."); return nullptr; } @@ -1636,7 +1636,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY int64_t TensorUtils::GetWeightSiz GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY uint8_t *TensorUtils::GetWeightAddr(const ConstGeTensorPtr &tensor_ptr, const uint8_t *const base) { if (tensor_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "param tensor_ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param tensor_ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] tensor_ptr is null."); return nullptr; } @@ -1645,7 +1645,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY uint8_t *TensorUtils::GetWeightAd uint8_t *TensorUtils::GetWeightAddr(const GeTensor &tensor, const uint8_t *const base) { if (base == nullptr) { - REPORT_INNER_ERROR("E18888", "param base is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param base is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] base is null."); return nullptr; } diff --git a/graph/normal_graph/gnode.cc b/graph/normal_graph/gnode.cc index 284b8cd081..963da3e68a 100644 --- a/graph/normal_graph/gnode.cc +++ b/graph/normal_graph/gnode.cc @@ -28,20 +28,20 @@ graphStatus GNode::GetAttr(const AscendString &name, ArgType &attr_value) const { \ const char_t *const ascend_name = name.GetString(); \ if (std::string(ascend_name).empty()) { \ - REPORT_INNER_ERROR("E18888", "ascend std::string error."); \ + REPORT_INNER_ERR_MSG("E18888", "ascend std::string error."); \ GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] GetAttr: ascend std::string error."); \ return GRAPH_PARAM_INVALID; \ } \ \ if (impl_ == nullptr) { \ - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] GetAttr: node impl is nullptr."); \ return GRAPH_FAILED; \ } \ \ const std::shared_ptr node_ptr_share = impl_->node_ptr_.lock(); \ if (node_ptr_share == nullptr) { \ - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] GetAttr: the node shared ptr is not valid."); \ return GRAPH_FAILED; \ } \ @@ -58,20 +58,20 @@ graphStatus GNode::SetAttr(const AscendString &name, ArgType &attr_value) const { \ const char_t *const ascend_name = name.GetString(); \ if (std::string(ascend_name).empty()) { \ - REPORT_INNER_ERROR("E18888", "ascend std::string error."); \ + REPORT_INNER_ERR_MSG("E18888", "ascend std::string error."); \ GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] SetAttr: ascend std::string error."); \ return GRAPH_PARAM_INVALID; \ } \ \ if (impl_ == nullptr) { \ - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: node impl is nullptr."); \ return GRAPH_FAILED; \ } \ \ const std::shared_ptr node_ptr_share = impl_->node_ptr_.lock(); \ if (node_ptr_share == nullptr) { \ - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: the node shared ptr is not valid."); \ return GRAPH_FAILED; \ } \ @@ -98,7 +98,7 @@ private: NodePtr NodeAdapter::GNode2Node(const ge::GNode &node) { if (node.impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "param graph_node.impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param graph_node.impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GNode2Node: gnode impl is nullptr."); return nullptr; } @@ -108,7 +108,7 @@ NodePtr NodeAdapter::GNode2Node(const ge::GNode &node) { GNode NodeAdapter::Node2GNode(const ge::NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Node2GNode: node is nullptr"); return GNode(); } @@ -125,14 +125,14 @@ GNode NodeAdapter::Node2GNode(const ge::NodePtr &node) { GNodePtr NodeAdapter::Node2GNodePtr(const ge::NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Node2GNodePtr: node is nullptr"); return nullptr; } const GNodePtr gnode = MakeShared(); if (gnode == nullptr) { - REPORT_CALL_ERROR("E18888", "create GNode failed."); + REPORT_INNER_ERR_MSG("E18888", "create GNode failed."); GELOGE(GRAPH_FAILED, "[Create][GNode] Node2GNodePtr: gnode is nullptr, node[%s].", node->GetName().c_str()); return nullptr; } @@ -151,14 +151,14 @@ GNode::GNode() { impl_ = ComGraphMakeShared(); } graphStatus GNode::GetType(AscendString &type) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetType: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "node ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetType: the node shared ptr is not valid."); return GRAPH_FAILED; } @@ -171,14 +171,14 @@ graphStatus GNode::GetType(AscendString &type) const { graphStatus GNode::GetName(AscendString &name) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetName: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "node ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetName: the node shared ptr is not valid."); return GRAPH_FAILED; } @@ -191,21 +191,21 @@ graphStatus GNode::GetName(AscendString &name) const { std::pair GNode::GetInDataNodesAndPortIndexs(const int32_t index) const { const std::pair gnode_idx = {nullptr, 0xFF}; if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] Gnode: node impl is nullptr."); return gnode_idx; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node ptr is not valid."); + REPORT_INNER_ERR_MSG("E18888", "the node ptr is not valid."); GELOGE(GRAPH_FAILED, "[Check][Param] Gnode: the node shared ptr is not valid."); return gnode_idx; } const auto in_anchor = node_ptr->GetInDataAnchor(index); if (in_anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Failed to get in data node of index[%d] from node[%s], " + REPORT_INNER_ERR_MSG("E18888", "Failed to get in data node of index[%d] from node[%s], " "the anchor does not exist", index, node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Anchor] Failed to get in data node of index[%d] from node[%s], " "the anchor does not exist", index, node_ptr->GetName().c_str()); @@ -214,7 +214,7 @@ std::pair GNode::GetInDataNodesAndPortIndexs(const int32_t in const auto out_anchor = in_anchor->GetPeerOutAnchor(); if (out_anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Failed to get in data node of index[%d] from node [%s], " + REPORT_INNER_ERR_MSG("E18888", "Failed to get in data node of index[%d] from node [%s], " "the data input does not exist", index, node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Anchor] Failed to get in data node of index[%d] from node [%s], " "the data input does not exist", index, node_ptr->GetName().c_str()); @@ -233,14 +233,14 @@ std::pair GNode::GetInDataNodesAndPortIndexs(const int32_t in std::vector GNode::GetInControlNodes() const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Gnode: node impl is nullptr."); return {}; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "Gnode: node ptr is not valid."); + REPORT_INNER_ERR_MSG("E18888", "Gnode: node ptr is not valid."); GELOGE(GRAPH_FAILED, "[Check][Param] Gnode: the node shared ptr is not valid."); return {}; } @@ -261,21 +261,21 @@ std::vector GNode::GetInControlNodes() const { std::vector> GNode::GetOutDataNodesAndPortIndexs(const int32_t index) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Gnode: node impl is nullptr."); return {}; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "node ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Gnode: the node shared ptr is not valid."); return {}; } const auto out_anchor = node_ptr->GetOutDataAnchor(index); if (out_anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Failed to get out data node of index %d from node %s, " + REPORT_INNER_ERR_MSG("E18888", "Failed to get out data node of index %d from node %s, " "the anchor does not exist", index, node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Anchor] Failed to get out data node of index %d from node %s, " "the anchor does not exist", index, node_ptr->GetName().c_str()); @@ -286,7 +286,7 @@ std::vector> GNode::GetOutDataNodesAndPortIndexs(co const auto in_data_anchors = out_anchor->GetPeerInDataAnchors(); for (auto &in_data_anchor : in_data_anchors) { if (in_data_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "In data anchor of node[%s] is nullptr.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "In data anchor of node[%s] is nullptr.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] In data anchor of node[%s] is nullptr.", node_ptr->GetName().c_str()); return {}; } @@ -304,14 +304,14 @@ std::vector> GNode::GetOutDataNodesAndPortIndexs(co std::vector GNode::GetOutControlNodes() const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutControlNodes: node impl is nullptr."); return {}; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutControlNodes: the node shared ptr is not valid."); return {}; } @@ -332,14 +332,14 @@ std::vector GNode::GetOutControlNodes() const { graphStatus GNode::GetInputConstData(const int32_t index, Tensor &data) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputConstData: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputConstData: the node shared ptr is not valid."); return GRAPH_FAILED; } @@ -350,8 +350,8 @@ graphStatus GNode::GetInputConstData(const int32_t index, Tensor &data) const { if ((op_type == CONSTANT) || (op_type == CONSTANTOP)) { const Operator const_op = OpDescUtils::CreateOperatorFromNode(input_data_node); if (const_op.GetAttr(ATTR_NAME_WEIGHTS.c_str(), data) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Input data node[%s] of node[%s] get data failed.", - input_data_node->GetName().c_str(), node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Input data node[%s] of node[%s] get data failed.", + input_data_node->GetName().c_str(), node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Attr] Input data node[%s] of node[%s] get data failed.", input_data_node->GetName().c_str(), node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -366,8 +366,8 @@ graphStatus GNode::GetInputConstData(const int32_t index, Tensor &data) const { ((parent_node->GetType() == CONSTANT) || (parent_node->GetType() == CONSTANTOP))) { const Operator const_op = OpDescUtils::CreateOperatorFromNode(parent_node); if (const_op.GetAttr(ATTR_NAME_WEIGHTS.c_str(), data) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Input data node[%s] of node[%s] get data failed.", - parent_node->GetName().c_str(), node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Input data node[%s] of node[%s] get data failed.", + parent_node->GetName().c_str(), node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Attr] Input data node[%s] of node[%s] get data failed.", parent_node->GetName().c_str(), node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -377,7 +377,7 @@ graphStatus GNode::GetInputConstData(const int32_t index, Tensor &data) const { } else { // empty } - REPORT_INNER_ERROR("E18888", "Node[%s] has no const input.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Node[%s] has no const input.", node_ptr->GetName().c_str()); GELOGE(GRAPH_NODE_WITHOUT_CONST_INPUT, "[Check][Param] Node[%s] has no const input.", node_ptr->GetName().c_str()); return GRAPH_NODE_WITHOUT_CONST_INPUT; } @@ -385,27 +385,27 @@ graphStatus GNode::GetInputConstData(const int32_t index, Tensor &data) const { graphStatus GNode::GetInputIndexByName(const AscendString &name, int32_t &index) { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] GetInputIndexByName: ascend string error."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputIndexByName: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputIndexByName: the node shared ptr is not valid."); return GRAPH_FAILED; } const auto op_desc = node_ptr->GetOpDescBarePtr(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "get Op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get Op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -419,27 +419,27 @@ graphStatus GNode::GetInputIndexByName(const AscendString &name, int32_t &index) graphStatus GNode::GetOutputIndexByName(const AscendString &name, int32_t &index) { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] GetOutputIndexByName: ascend string error."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutputIndexByName: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutputIndexByName: the node shared ptr is not valid."); return GRAPH_FAILED; } const auto op_desc = node_ptr->GetOpDescBarePtr(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -453,27 +453,27 @@ graphStatus GNode::GetOutputIndexByName(const AscendString &name, int32_t &index graphStatus GNode::GetDynamicInputIndexesByName(const AscendString &name, std::vector &indexes) { const std::string node_name = name.GetString(); if (node_name.empty()) { - REPORT_INNER_ERROR("E18888", "input name is empty."); + REPORT_INNER_ERR_MSG("E18888", "input name is empty."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] input name is empty."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr"); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr"); GELOGE(GRAPH_FAILED, "[Check][Param] the node shared ptr is not valid."); return GRAPH_FAILED; } const auto op_desc = node_ptr->GetOpDescBarePtr(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -482,7 +482,7 @@ graphStatus GNode::GetDynamicInputIndexesByName(const AscendString &name, std::v const std::string error_message = indexes.empty() ? "the dynamic input indexes is empty, input name is " + node_name + "." : "get dynamic input index by name failed, input name is " + node_name + "."; - REPORT_INNER_ERROR("E18888", "%s", error_message.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s", error_message.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] %s", error_message.c_str()); return GRAPH_FAILED; } @@ -493,27 +493,27 @@ graphStatus GNode::GetDynamicInputIndexesByName(const AscendString &name, std::v graphStatus GNode::GetDynamicOutputIndexesByName(const AscendString &name, std::vector &indexes) { const std::string node_name = name.GetString(); if (node_name.empty()) { - REPORT_INNER_ERROR("E18888", "output name is empty."); + REPORT_INNER_ERR_MSG("E18888", "output name is empty."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] output name is empty."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] the node shared ptr is nullptr."); return GRAPH_FAILED; } const auto op_desc = node_ptr->GetOpDescBarePtr(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -522,7 +522,7 @@ graphStatus GNode::GetDynamicOutputIndexesByName(const AscendString &name, std:: const std::string error_message = indexes.empty() ? "the dynamic output indexes is empty, output name is " + node_name + "." : "get dynamic output index by name failed, output name is " + node_name + "."; - REPORT_INNER_ERROR("E18888", "%s", error_message.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s", error_message.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] %s", error_message.c_str()); return GRAPH_FAILED; } @@ -532,21 +532,21 @@ graphStatus GNode::GetDynamicOutputIndexesByName(const AscendString &name, std:: size_t GNode::GetInputsSize() const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputsSize: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputsSize: the node shared ptr is not valid."); return GRAPH_FAILED; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -556,21 +556,21 @@ size_t GNode::GetInputsSize() const { size_t GNode::GetOutputsSize() const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutputsSize: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutputsSize: the node shared ptr is not valid."); return GRAPH_FAILED; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -580,34 +580,34 @@ size_t GNode::GetOutputsSize() const { graphStatus GNode::GetInputDesc(const int32_t index, TensorDesc &tensor_desc) const { if (index < 0) { - REPORT_INNER_ERROR("E18888", "index:%d can not be less than zero, check invalid.", index); + REPORT_INNER_ERR_MSG("E18888", "index:%d can not be less than zero, check invalid.", index); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] GetInputDesc: index[%d] cannot be less than zero.", index); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputDesc: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetInputDesc: the node shared ptr is not valid."); return GRAPH_FAILED; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } const ConstGeTensorDescPtr ge_tensor_desc = op_desc->GetInputDescPtr(static_cast(index)); if (ge_tensor_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get tensor desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get tensor desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][TensorDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -618,34 +618,34 @@ graphStatus GNode::GetInputDesc(const int32_t index, TensorDesc &tensor_desc) co graphStatus GNode::UpdateInputDesc(const int32_t index, const TensorDesc &tensor_desc) { if (index < 0) { - REPORT_INNER_ERROR("E18888", "index:%d cannot be less than zero.", index); + REPORT_INNER_ERR_MSG("E18888", "index:%d cannot be less than zero.", index); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] UpdateInputDesc: index[%d] cannot be less than zero.", index); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] UpdateInputDesc: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] UpdateInputDesc: the node shared ptr is not valid."); return GRAPH_FAILED; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } const GeTensorDesc ge_tensor_desc = TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc); if (op_desc->UpdateInputDesc(static_cast(index), ge_tensor_desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Update input desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Update input desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Update][InputDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -655,34 +655,34 @@ graphStatus GNode::UpdateInputDesc(const int32_t index, const TensorDesc &tensor graphStatus GNode::GetOutputDesc(const int32_t index, TensorDesc &tensor_desc) const { if (index < 0) { - REPORT_INNER_ERROR("E18888", "index:%d cannot be less than zero.", index); + REPORT_INNER_ERR_MSG("E18888", "index:%d cannot be less than zero.", index); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] GetOutputDesc: index[%d] cannot be less than zero.", index); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutputDesc: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetOutputDesc: the node shared ptr is not valid."); return GRAPH_FAILED; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } const ConstGeTensorDescPtr ge_tensor_desc = op_desc->GetOutputDescPtr(static_cast(index)); if (ge_tensor_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get tensor desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get tensor desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][TensorDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -693,34 +693,34 @@ graphStatus GNode::GetOutputDesc(const int32_t index, TensorDesc &tensor_desc) c graphStatus GNode::UpdateOutputDesc(const int32_t index, const TensorDesc &tensor_desc) { if (index < 0) { - REPORT_INNER_ERROR("E18888", "index:%d cannot be less than zero.", index); + REPORT_INNER_ERR_MSG("E18888", "index:%d cannot be less than zero.", index); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Gnode: index[%d] cannot be less than zero.", index); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] UpdateOutputDesc: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] UpdateOutputDesc: the node shared ptr is not valid."); return GRAPH_FAILED; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } const GeTensorDesc ge_tensor_desc = TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc); if (op_desc->UpdateOutputDesc(static_cast(index), ge_tensor_desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Update input desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Update input desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Update][InputDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -766,20 +766,20 @@ NODE_ATTR_SET_IMP(ge::DataType) graphStatus GNode::SetAttr(const AscendString &name, AttrValue &attr_value) const { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] SetAttr: ascend string error."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: the shared ptr is not valid."); return GRAPH_FAILED; } @@ -793,20 +793,20 @@ graphStatus GNode::SetAttr(const AscendString &name, AttrValue &attr_value) cons graphStatus GNode::SetAttr(const AscendString &name, AscendString &attr_value) const { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "name ascend string error"); + REPORT_INNER_ERR_MSG("E18888", "name ascend string error"); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] SetAttr: name ascend string error."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: the shared ptr is not valid."); return GRAPH_FAILED; } @@ -821,7 +821,7 @@ graphStatus GNode::SetAttr(const AscendString &name, AscendString &attr_value) c graphStatus GNode::SetAttr(const AscendString &name, std::vector &attr_values) const { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "name ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "name ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] SetAttr: name ascend string error."); return GRAPH_PARAM_INVALID; } @@ -829,21 +829,21 @@ graphStatus GNode::SetAttr(const AscendString &name, std::vector & for (auto &attr_val : attr_values) { const char_t *const ascend_attr_value = attr_val.GetString(); if (std::string(ascend_attr_value).empty()) { - REPORT_INNER_ERROR("E18888", "param attr values is invalid"); + REPORT_INNER_ERR_MSG("E18888", "param attr values is invalid"); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] SetAttr: attr val error."); return GRAPH_PARAM_INVALID; } } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] SetAttr: the shared ptr is not valid."); return GRAPH_FAILED; } @@ -864,20 +864,20 @@ graphStatus GNode::SetAttr(const AscendString &name, std::vector & graphStatus GNode::GetAttr(const AscendString &name, AscendString &attr_value) const { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "name ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "name ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "GetAttr: name ascend string error."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetAttr: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetAttr: the node shared ptr is not valid."); return GRAPH_FAILED; } @@ -899,20 +899,20 @@ graphStatus GNode::GetAttr(const AscendString &name, AscendString &attr_value) c graphStatus GNode::GetAttr(const AscendString &name, std::vector &attr_values) const { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "name ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "name ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] GetAttr: name ascend string error."); return GRAPH_PARAM_INVALID; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetAttr: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetAttr: the node shared ptr is not valid."); return GRAPH_FAILED; } @@ -936,27 +936,27 @@ graphStatus GNode::GetAttr(const AscendString &name, std::vector & bool GNode::HasAttr(const AscendString &name) { const char_t *const ascend_name = name.GetString(); if (std::string(ascend_name).empty()) { - REPORT_INNER_ERROR("E18888", "ascend string error."); + REPORT_INNER_ERR_MSG("E18888", "ascend string error."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] HasAttr: ascend string error."); return false; } if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] HasAttr: node impl is nullptr."); return false; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] HasAttr: the node shared ptr is not valid."); return false; } const OpDescPtr op_desc = node_ptr->GetOpDesc(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get op desc of node[%s] failed.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] of node[%s] failed.", node_ptr->GetName().c_str()); return false; } @@ -971,22 +971,21 @@ bool GNode::HasAttr(const AscendString &name) { graphStatus GNode::GetSubgraph(uint32_t index, GraphPtr &graph) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetSubgraph: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetSubgraph: the node shared ptr is not valid."); return GRAPH_FAILED; } const ComputeGraphPtr compute_graph_ptr = NodeUtils::GetSubgraph(*node_ptr, index); if (compute_graph_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "get subgraph[%u] failed from node[%s].", - index, node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get subgraph[%u] failed from node[%s].", index, node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][SubGraph] subgraph[%u] from node[%s] is nullptr.", index, node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -994,7 +993,7 @@ graphStatus GNode::GetSubgraph(uint32_t index, GraphPtr &graph) const { graph = GraphUtilsEx::CreateGraphPtrFromComputeGraph(compute_graph_ptr); if (graph == nullptr) { - REPORT_INNER_ERROR("E18888", "create compute graph failed from %s.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "create compute graph failed from %s.", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Create][Graph] failed from %s.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -1004,40 +1003,40 @@ graphStatus GNode::GetSubgraph(uint32_t index, GraphPtr &graph) const { graphStatus GNode::GetALLSubgraphs(std::vector &graph_list) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "node impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetALLSubgraphs: node impl is nullptr."); return GRAPH_FAILED; } const std::shared_ptr node_ptr = impl_->node_ptr_.lock(); if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "the node shared ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "the node shared ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] GetALLSubgraphs: the node shared ptr is not valid."); return GRAPH_FAILED; } const auto root_graph = GraphUtils::FindRootGraph(node_ptr->GetOwnerComputeGraph()); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to find root graph from node %s ", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to find root graph from node %s ", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][RootGraph] Failed to find root graph from node %s ", node_ptr->GetName().c_str()); return GRAPH_FAILED; } const std::vector sub_graphs = root_graph->GetAllSubgraphs(); if (sub_graphs.empty()) { - REPORT_CALL_ERROR("E18888", "get all subgraphs failed from node[%s].", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get all subgraphs failed from node[%s].", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][ALLSubGraphs] failed from node[%s].", node_ptr->GetName().c_str()); return GRAPH_FAILED; } for (auto &sub_graph : sub_graphs) { if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "get subgraph failed from node[%s].", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get subgraph failed from node[%s].", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][SubGraph] failed from node[%s].", node_ptr->GetName().c_str()); return GRAPH_FAILED; } GraphPtr graph = GraphUtilsEx::CreateGraphPtrFromComputeGraph(sub_graph); if (graph == nullptr) { - REPORT_CALL_ERROR("E18888", "create compute graph failed from node[%s].", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "create compute graph failed from node[%s].", node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Create][ComputeGraph] failed from node[%s].", node_ptr->GetName().c_str()); return GRAPH_FAILED; } diff --git a/graph/normal_graph/graph.cc b/graph/normal_graph/graph.cc index 9e38c51fff..56ee927614 100644 --- a/graph/normal_graph/graph.cc +++ b/graph/normal_graph/graph.cc @@ -59,7 +59,7 @@ class GraphImpl { graphStatus SetOutputs(const std::vector &outputs) { if (compute_graph_ == nullptr) { - REPORT_INNER_ERROR("E18888", "compute graph is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "compute graph is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] set ComputeGraph failed."); return GRAPH_FAILED; } @@ -80,7 +80,7 @@ class GraphImpl { graphStatus SetOutputs(const std::vector>> &output_indexs) { if (compute_graph_ == nullptr) { - REPORT_INNER_ERROR("E18888", "compute graph is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "compute graph is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] set ComputeGraph failed."); return GRAPH_FAILED; } @@ -151,8 +151,8 @@ class GraphImpl { (void) item.first.GetName(out_name); ge::NodePtr node = compute_graph_->FindNode(out_name.GetString()); if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "designated out_node (%s) does not exist in graph:%s, this out_node ignored!", - out_name.GetString(), compute_graph_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "designated out_node (%s) does not exist in graph:%s, this out_node ignored!", + out_name.GetString(), compute_graph_->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Warning, user designated out_node (%s) does not exist in graph:%s, " "this out_node ignored!", out_name.GetString(), compute_graph_->GetName().c_str()); return GRAPH_FAILED; @@ -172,9 +172,10 @@ class GraphImpl { } else { int32_t index = tmp_op_ptr->GetOutputIndexByName(item.second); if (index < 0) { - REPORT_INNER_ERROR("E18888", "user designated out_node (%s):(%s) does not exist in graph:%s, " - "this out_node ignored!", out_name.GetString(), item.second.c_str(), - compute_graph_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "user designated out_node (%s):(%s) does not exist in graph:%s, " + "this out_node ignored!", + out_name.GetString(), item.second.c_str(), compute_graph_->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Warning, user designated out_node (%s):(%s) does not exist in graph:%s, " "this out_node ignored!", out_name.GetString(), item.second.c_str(), compute_graph_->GetName().c_str()); @@ -240,7 +241,7 @@ class GraphImpl { graphStatus FindOpByName(const std::string &name, ge::Operator &op) const { const auto it = op_list_.find(name); GE_CHK_BOOL_EXEC(it != op_list_.end(), - REPORT_INNER_ERROR("E18888", "there is no op: %s.", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "there is no op: %s.", name.c_str()); return GRAPH_FAILED, "[Find][Op] there is no op: %s.", name.c_str()); op = it->second; return GRAPH_SUCCESS; @@ -266,7 +267,7 @@ class GraphImpl { void SetNeedIteration(bool need_iteration) { if (compute_graph_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Set need iteration failed, as compute graph is null."); + REPORT_INNER_ERR_MSG("E18888", "Set need iteration failed, as compute graph is null."); GELOGE(GRAPH_FAILED, "[Check][Param] Set need iteration failed, as compute graph is null."); return; } @@ -295,14 +296,14 @@ class GraphImpl { graphStatus res = GRAPH_FAILED; if ((src_port_index == -1) && (dst_port_index == -1)) { if (src_node_ptr->GetOutControlAnchor() == nullptr) { - REPORT_CALL_ERROR("E18888", "src node:%s out control anchor is null.", src_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src node:%s out control anchor is null.", src_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Anchor] src node:%s out control anchor is null.", src_node_ptr->GetName().c_str()); return GRAPH_FAILED; } res = GraphUtils::RemoveEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor()); if (res != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "remove control edge between [%s] and [%s]failed.", - src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "remove control edge between [%s] and [%s]failed.", + src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Remove][ControlEdge] between [%s] and [%s]failed.", src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -311,8 +312,8 @@ class GraphImpl { } if (src_node_ptr->GetOutDataAnchor(src_port_index) == nullptr) { - REPORT_CALL_ERROR("E18888", "src node[%s] out data anchor[%d] is null.", - src_node_ptr->GetName().c_str(), src_port_index); + REPORT_INNER_ERR_MSG("E18888", "src node[%s] out data anchor[%d] is null.", src_node_ptr->GetName().c_str(), + src_port_index); GELOGE(GRAPH_FAILED, "[Get][Anchor] src node[%s] out data anchor[%d] is null.", src_node_ptr->GetName().c_str(), src_port_index); return GRAPH_FAILED; @@ -321,8 +322,8 @@ class GraphImpl { if ((src_port_index != -1) && (dst_port_index == -1)) { res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInControlAnchor()); if (res != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "remove data-control edge between [%s] and [%s]failed.", - src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "remove data-control edge between [%s] and [%s]failed.", + src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Remove][Edge] between [%s] and [%s]failed.", src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -333,8 +334,8 @@ class GraphImpl { res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInDataAnchor(dst_port_index)); if (res != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "remove data edge between [%s] and [%s] failed.", - src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "remove data edge between [%s] and [%s] failed.", src_node_ptr->GetName().c_str(), + dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Remove][Edge] between [%s] and [%s] failed.", src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -370,19 +371,19 @@ Graph::Graph(const char_t *name) { } graphStatus Graph::AddOp(const ge::Operator &op) { - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return GRAPH_FAILED, "[Check][Param] AddOp failed: graph can not be used, impl is nullptr."); return impl_->AddOp(op); } graphStatus Graph::GetAllOpName(std::vector &op_name) const { - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return GRAPH_FAILED, "[Check][Param] GetAllOpName failed: graph can not be used, impl is nullptr."); return impl_->GetAllOpName(op_name); } graphStatus Graph::GetAllOpName(std::vector &names) const { - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return GRAPH_FAILED, "[Check][Param] GetAllOpName failed: graph can not be used, impl is nullptr."); std::vector op_names; if (impl_->GetAllOpName(op_names) != GRAPH_SUCCESS) { @@ -400,20 +401,20 @@ graphStatus Graph::GetAllOpName(std::vector &names) const { graphStatus Graph::FindOpByName(const std::string &name, Operator &op) const { const Operator op_find_op_def("NULL"); op = op_find_op_def; - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return GRAPH_FAILED, "[Check][Param] FindOpByName failed: graph can not be used, impl is nullptr."); return impl_->FindOpByName(name, op); } graphStatus Graph::FindOpByName(const char_t *name, Operator &op) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] FindOpByName: name is nullptr."); return GRAPH_FAILED; } const Operator op_find_op_def("NULL"); op = op_find_op_def; - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return GRAPH_FAILED, "[Check][Param] FindOpByName failed: graph can not be used, impl is nullptr."); const std::string op_name = name; return impl_->FindOpByName(op_name, op); @@ -426,7 +427,7 @@ graphStatus Graph::FindOpByType(const std::string &type, std::vector &ops) const { if (type == nullptr) { - REPORT_INNER_ERROR("E18888", "param type is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param type is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] FindOpByType: type is nullptr."); return GRAPH_FAILED; } @@ -436,9 +437,9 @@ graphStatus Graph::FindOpByType(const char_t *type, std::vector &o } Graph &Graph::SetInputs(const std::vector &inputs) { - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return *this, "[Check][Param] SetInputs failed: graph can not be used, impl is nullptr."); - GE_CHK_BOOL_EXEC(!inputs.empty(), REPORT_INNER_ERROR("E18888", "input operator size can not be 0"); + GE_CHK_BOOL_EXEC(!inputs.empty(), REPORT_INNER_ERR_MSG("E18888", "input operator size can not be 0"); return *this, "[Check][Param] SetInputs failed: input operator size can not be 0, graph: %s", impl_->GetName().c_str()); (void)impl_->SetInputs(inputs); @@ -447,7 +448,7 @@ Graph &Graph::SetInputs(const std::vector &inputs) { Graph &Graph::SetOutputs(const std::vector &outputs) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] SetOutputs failed: graph can not be used, impl is nullptr."); return *this; } @@ -457,7 +458,7 @@ Graph &Graph::SetOutputs(const std::vector &outputs) { Graph &Graph::SetOutputs(const std::vector>> &output_indexs) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] SetOutputs failed: graph can not be used, impl is nullptr."); return *this; } @@ -466,14 +467,14 @@ Graph &Graph::SetOutputs(const std::vector> &outputs) { - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return *this, "[Check][Param] SetOutputs failed: graph can not be used, impl is nullptr."); (void)impl_->SetOutputs(outputs); return *this; } Graph &Graph::SetOutputs(const std::vector> &outputs) { - GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + GE_CHK_BOOL_EXEC(impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); return *this, "[Check][Param] SetOutputs failed: graph can not be used, impl is nullptr."); std::vector> graph_outputs; for (auto &item : outputs) { @@ -491,7 +492,7 @@ Graph &Graph::SetOutputs(const std::vector Graph &Graph::SetTargets(const std::vector &targets) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] SetTargets failed: graph can not be used, impl is nullptr."); return *this; } @@ -508,7 +509,7 @@ bool Graph::IsValid() const { void Graph::SetNeedIteration(bool need_iteration) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] Set need iteration failed, as impl is null."); return; } @@ -518,14 +519,14 @@ void Graph::SetNeedIteration(bool need_iteration) { std::vector Graph::GetAllNodes() const { std::vector graph_nodes; if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] GetAllNodes: graph can not be used, impl is nullptr."); return graph_nodes; } const ComputeGraphPtr compute_graph_ptr = impl_->GetComputeGraph(); if (compute_graph_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "impl compute graph is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "impl compute graph is nullptr."); GELOGE(GRAPH_FAILED, "[Get][Graph] GetAllNodes: compute graph ptr is nullptr, graph %s", impl_->GetName().c_str()); return graph_nodes; } @@ -541,13 +542,13 @@ std::vector Graph::GetAllNodes() const { std::vector Graph::GetDirectNode() const { std::vector graph_nodes; if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] GetDirectNode: graph can not be used, impl is nullptr."); return graph_nodes; } const ComputeGraphPtr compute_graph_ptr = impl_->GetComputeGraph(); if (compute_graph_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "impl compute graph is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "impl compute graph is nullptr."); GELOGE(GRAPH_FAILED, "[Get][Graph] GetDirectNode: compute graph ptr is nullptr, graph %s", impl_->GetName().c_str()); return graph_nodes; @@ -579,8 +580,8 @@ graphStatus Graph::RemoveNode(GNode &node, bool contain_subgraph) { if (contain_subgraph) { if (!GraphUtils::IsNodeInGraphRecursively(compute_graph_ptr, *node_ptr)) { - REPORT_CALL_ERROR("E18888", "node[%s] is not in the graph[%s] or not in subgraph.", - node_ptr->GetName().c_str(), compute_graph_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node[%s] is not in the graph[%s] or not in subgraph.", + node_ptr->GetName().c_str(), compute_graph_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node[%s] is not in the graph[%s].", node_ptr->GetName().c_str(), compute_graph_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -588,8 +589,8 @@ graphStatus Graph::RemoveNode(GNode &node, bool contain_subgraph) { compute_graph_ptr = owner_compute_graph; } else { if (compute_graph_ptr != owner_compute_graph) { - REPORT_INNER_ERROR("E18888", "node[%s] is not in the graph[%s].", - node_ptr->GetName().c_str(), compute_graph_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node[%s] is not in the graph[%s].", node_ptr->GetName().c_str(), + compute_graph_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node[%s] is not in the graph[%s].", node_ptr->GetName().c_str(), compute_graph_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -598,8 +599,8 @@ graphStatus Graph::RemoveNode(GNode &node, bool contain_subgraph) { ge::NodeUtils::UnlinkAll(*node_ptr); if (GraphUtils::RemoveNodeWithoutRelink(compute_graph_ptr, node_ptr) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "graph:%s remove node:%s failed", - compute_graph_ptr->GetName().c_str(), node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "graph:%s remove node:%s failed", compute_graph_ptr->GetName().c_str(), + node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Remove][Node] %s from graph:%s failed.", node_ptr->GetName().c_str(), compute_graph_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -611,46 +612,46 @@ graphStatus Graph::RemoveNode(GNode &node, bool contain_subgraph) { graphStatus Graph::RemoveEdge(GNode &src_node, const int32_t src_port_index, GNode &dst_node, const int32_t dst_port_index) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] graph can not be used, impl is nullptr."); return GRAPH_FAILED; } if ((src_port_index == -1) && (dst_port_index != -1)) { - REPORT_INNER_ERROR("E18888", "src_port_index == -1 and dst_port_index != -1, check invalid ."); + REPORT_INNER_ERR_MSG("E18888", "src_port_index == -1 and dst_port_index != -1, check invalid ."); GELOGE(GRAPH_FAILED, "[Check][Param] src control anchor link to dst data anchor does not exist."); return GRAPH_FAILED; } const NodePtr src_node_ptr = NodeAdapter::GNode2Node(src_node); if (src_node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "src gnode to node failed."); + REPORT_INNER_ERR_MSG("E18888", "src gnode to node failed."); GELOGE(GRAPH_FAILED, "[Get][Node] src gnode to node failed."); return GRAPH_FAILED; } const NodePtr dst_node_ptr = NodeAdapter::GNode2Node(dst_node); if (dst_node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "dst gnode to node failed."); + REPORT_INNER_ERR_MSG("E18888", "dst gnode to node failed."); GELOGE(GRAPH_FAILED, "[Get][Node] dst gnode to node failed."); return GRAPH_FAILED; } if (src_node_ptr->GetOwnerComputeGraph() == nullptr) { - REPORT_CALL_ERROR("E18888", "src node:%s compute graph is nullptr.", src_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src node:%s compute graph is nullptr.", src_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] src node:%s compute graph is nullptr.", src_node_ptr->GetName().c_str()); return GRAPH_FAILED; } if (dst_node_ptr->GetOwnerComputeGraph() == nullptr) { - REPORT_CALL_ERROR("E18888", "dst node:%s compute graph is nullptr", dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "dst node:%s compute graph is nullptr", dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] dst node:%s compute graph is nullptr.", dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; } if (impl_->RemoveEdge(src_node_ptr, src_port_index, dst_node_ptr, dst_port_index) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "remove edge between %s(%d) and %s(%d) failed.", - src_node_ptr->GetName().c_str(), src_port_index, dst_node_ptr->GetName().c_str(), dst_port_index); + REPORT_INNER_ERR_MSG("E18888", "remove edge between %s(%d) and %s(%d) failed.", src_node_ptr->GetName().c_str(), + src_port_index, dst_node_ptr->GetName().c_str(), dst_port_index); GELOGE(GRAPH_FAILED, "[Remove][Edge] between %s(%d) and %s(%d) failed.", src_node_ptr->GetName().c_str(), src_port_index, dst_node_ptr->GetName().c_str(), dst_port_index); return GRAPH_FAILED; @@ -661,7 +662,7 @@ graphStatus Graph::RemoveEdge(GNode &src_node, const int32_t src_port_index, GNode Graph::AddNodeByOp(const Operator &op) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] graph can not be used, impl is nullptr."); return GNode(); } @@ -670,7 +671,7 @@ GNode Graph::AddNodeByOp(const Operator &op) { if (op_desc == nullptr) { AscendString name; (void) op.GetName(name); - REPORT_CALL_ERROR("E18888", "get op desc from op:%s failed", name.GetString()); + REPORT_INNER_ERR_MSG("E18888", "get op desc from op:%s failed", name.GetString()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] from op[%s] failed.", name.GetString()); return GNode(); } @@ -687,33 +688,33 @@ GNode Graph::AddNodeByOp(const Operator &op) { graphStatus Graph::AddDataEdge(GNode &src_node, const int32_t src_port_index, GNode &dst_node, const int32_t dst_port_index) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] graph can not be used, impl is nullptr."); return GRAPH_FAILED; } const NodePtr src_node_ptr = NodeAdapter::GNode2Node(src_node); if (src_node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "src gnode to node failed."); + REPORT_INNER_ERR_MSG("E18888", "src gnode to node failed."); GELOGE(GRAPH_FAILED, "[Get][Node] src gnode to node failed."); return GRAPH_FAILED; } const NodePtr dst_node_ptr = NodeAdapter::GNode2Node(dst_node); if (dst_node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "dst gnode to node failed."); + REPORT_INNER_ERR_MSG("E18888", "dst gnode to node failed."); GELOGE(GRAPH_FAILED, "[Get][Node] dst gnode to node failed."); return GRAPH_FAILED; } if (src_node_ptr->GetOwnerComputeGraph() == nullptr) { - REPORT_CALL_ERROR("E18888", "src node[%s] owner compute graph is nullptr.", src_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src node[%s] owner compute graph is nullptr.", src_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] src node[%s] owner compute graph is nullptr.", src_node_ptr->GetName().c_str()); return GRAPH_FAILED; } if (dst_node_ptr->GetOwnerComputeGraph() == nullptr) { - REPORT_CALL_ERROR("E18888", "dst node[%s] owner compute graph is nullptr.", dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "dst node[%s] owner compute graph is nullptr.", dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] dst node[%s] owner compute graph is nullptr.", dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -721,8 +722,8 @@ graphStatus Graph::AddDataEdge(GNode &src_node, const int32_t src_port_index, const graphStatus res = GraphUtils::AddEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInDataAnchor(dst_port_index)); if (res != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "add data edge from %s(%d) to %s(%d) failed.", src_node_ptr->GetName().c_str(), - src_port_index, dst_node_ptr->GetName().c_str(), dst_port_index); + REPORT_INNER_ERR_MSG("E18888", "add data edge from %s(%d) to %s(%d) failed.", src_node_ptr->GetName().c_str(), + src_port_index, dst_node_ptr->GetName().c_str(), dst_port_index); GELOGE(GRAPH_FAILED, "[Add][DataEdge] from %s(%d) to %s(%d) failed.", src_node_ptr->GetName().c_str(), src_port_index, dst_node_ptr->GetName().c_str(), dst_port_index); return GRAPH_FAILED; @@ -733,41 +734,41 @@ graphStatus Graph::AddDataEdge(GNode &src_node, const int32_t src_port_index, graphStatus Graph::AddControlEdge(GNode &src_node, GNode &dst_node) { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "graph can not be used, impl is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "graph can not be used, impl is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] graph can not be used, impl is nullptr."); return GRAPH_FAILED; } const NodePtr src_node_ptr = NodeAdapter::GNode2Node(src_node); if (src_node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "src gnode to node failed."); + REPORT_INNER_ERR_MSG("E18888", "src gnode to node failed."); GELOGE(GRAPH_FAILED, "[Get][Node] src gnode to node failed."); return GRAPH_FAILED; } const NodePtr dst_node_ptr = NodeAdapter::GNode2Node(dst_node); if (dst_node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "dst gnode to node failed."); + REPORT_INNER_ERR_MSG("E18888", "dst gnode to node failed."); GELOGE(GRAPH_FAILED, "[Get][Node] dst gnode to node failed."); return GRAPH_FAILED; } if (src_node_ptr->GetOwnerComputeGraph() == nullptr) { - REPORT_CALL_ERROR("E18888", "src node[%s] owner compute graph is nullptr.", src_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src node[%s] owner compute graph is nullptr.", src_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] src node[%s] owner compute graph is nullptr.", src_node_ptr->GetName().c_str()); return GRAPH_FAILED; } if (dst_node_ptr->GetOwnerComputeGraph() == nullptr) { - REPORT_CALL_ERROR("E18888", "dst node[%s] owner compute graph is nullptr.", dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "dst node[%s] owner compute graph is nullptr.", dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] dst node[%s] owner compute graph is nullptr.", dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; } const graphStatus res = GraphUtils::AddEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor()); if (res != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "add control edge from %s to %s failed.", src_node_ptr->GetName().c_str(), - dst_node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add control edge from %s to %s failed.", src_node_ptr->GetName().c_str(), + dst_node_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][ControlEdge] from %s to %s failed.", src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); return GRAPH_FAILED; @@ -779,13 +780,13 @@ graphStatus Graph::AddControlEdge(GNode &src_node, GNode &dst_node) { GraphPtr Graph::ConstructFromInputs(const std::vector &inputs, const AscendString &name) { const char_t *const ascend_name = name.GetString(); if (ascend_name == nullptr) { - REPORT_INNER_ERROR("E18888", "ascend string error"); + REPORT_INNER_ERR_MSG("E18888", "ascend string error"); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] ascend string error."); return nullptr; } if (inputs.empty()) { - REPORT_INNER_ERROR("E18888", "inputs size can not be 0."); + REPORT_INNER_ERR_MSG("E18888", "inputs size can not be 0."); GELOGE(GRAPH_FAILED, "[Check][Param] inputs size can not be 0, graph: %s", ascend_name); return nullptr; } @@ -793,7 +794,7 @@ GraphPtr Graph::ConstructFromInputs(const std::vector &inputs, const A const std::string graph_name = ascend_name; const ComputeGraphPtr compute_graph = GraphUtilsEx::CreateGraphFromOperator(graph_name, inputs); if (compute_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "create compute graph from op failed, name:%s", graph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "create compute graph from op failed, name:%s", graph_name.c_str()); GELOGE(GRAPH_FAILED, "[Create][ComputeGraph] failed, name:%s.", graph_name.c_str()); return nullptr; } @@ -801,7 +802,7 @@ GraphPtr Graph::ConstructFromInputs(const std::vector &inputs, const A compute_graph->SetInputSize(static_cast(inputs.size())); const GraphPtr graph_ptr = GraphUtilsEx::CreateGraphPtrFromComputeGraph(compute_graph); if (graph_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "create graph from compute graph:%s failed.", compute_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "create graph from compute graph:%s failed.", compute_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Create][Graph] from compute graph:%s failed.", compute_graph->GetName().c_str()); return nullptr; } @@ -817,7 +818,7 @@ graphStatus Graph::SaveToFile(const std::string &file_name) const { graphStatus Graph::SaveToFile(const char_t *file_name) const { if (file_name == nullptr) { - REPORT_INNER_ERROR("E18888", "file name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "file name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] file name is nullptr."); return GRAPH_FAILED; } @@ -840,7 +841,7 @@ graphStatus Graph::LoadFromFile(const std::string &file_name) { graphStatus Graph::LoadFromFile(const char_t *file_name) { if (file_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param file name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param file name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] file name is nullptr."); return GRAPH_FAILED; } @@ -900,7 +901,7 @@ const std::string &Graph::GetName() const { graphStatus Graph::GetName(AscendString &name) const { if (impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] impl is nullptr."); return GRAPH_FAILED; } @@ -914,7 +915,7 @@ graphStatus Graph::CopyFrom(const Graph &src_graph) { if (res != GRAPH_SUCCESS) { AscendString name; (void)src_graph.GetName(name); - REPORT_CALL_ERROR("E18888", "copy graph from %s failed.", name.GetString()); + REPORT_INNER_ERR_MSG("E18888", "copy graph from %s failed.", name.GetString()); GELOGE(GRAPH_FAILED, "[Copy][Graph] from %s failed.", name.GetString()); return GRAPH_FAILED; } @@ -962,14 +963,14 @@ GraphUtils::CopyGraphImpl(const Graph &src_graph, Graph &dst_graph, node_old_2_new, op_desc_old_2_new, src_op_list, dst_op_list); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "copy operators to graph:%s failed.", dst_compute_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "copy operators to graph:%s failed.", dst_compute_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Copy][Operators] to graph:%s failed.", dst_compute_graph->GetName().c_str()); return GRAPH_FAILED; } ret = OpDescUtils::CopyOperatorLinks(src_op_list, dst_op_list); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "copy operator links failed, ret:%u.", ret); + REPORT_INNER_ERR_MSG("E18888", "copy operator links failed, ret:%u.", ret); GELOGE(GRAPH_FAILED, "[Copy][OperatorLinks] failed, ret:%u.", ret); return GRAPH_FAILED; } @@ -1055,14 +1056,14 @@ GraphUtilsEx::CopyGraphImpl(const Graph &src_graph, Graph &dst_graph, node_old_2_new, op_desc_old_2_new, src_op_list, dst_op_list); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "copy operators to graph:%s failed.", dst_compute_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "copy operators to graph:%s failed.", dst_compute_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Copy][Operators] to graph:%s failed.", dst_compute_graph->GetName().c_str()); return GRAPH_FAILED; } ret = OpDescUtils::CopyOperatorLinks(src_op_list, dst_op_list); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "copy operator links failed, ret:%u.", ret); + REPORT_INNER_ERR_MSG("E18888", "copy operator links failed, ret:%u.", ret); GELOGE(GRAPH_FAILED, "[Copy][OperatorLinks] failed, ret:%u.", ret); return GRAPH_FAILED; } diff --git a/graph/normal_graph/model.cc b/graph/normal_graph/model.cc index 267d94721c..e1ef577062 100644 --- a/graph/normal_graph/model.cc +++ b/graph/normal_graph/model.cc @@ -151,7 +151,7 @@ graphStatus Model::SaveToFile(const std::string &file_name, const bool force_sep ret = (*this).SaveSeparateModel(buffer, real_path); } if (ret != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "[Save][Data] to file:%s fail.", file_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "[Save][Data] to file:%s fail.", file_name.c_str()); GELOGE(ret, "[Save][Data] to file:%s fail.", file_name.c_str()); return ret; } @@ -166,28 +166,28 @@ graphStatus Model::SaveToFile(const std::string &file_name, const bool force_sep mmOpen2(&real_path[0], static_cast(static_cast(M_WRONLY) | static_cast(M_CREAT) | static_cast(O_TRUNC)), static_cast(ACCESS_PERMISSION_BITS)); if (fd < 0) { - REPORT_CALL_ERROR("E18888", "open file:%s failed, error:%s ", &real_path[0], GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "open file:%s failed, error:%s ", &real_path[0], GetStrError()); GELOGE(GRAPH_FAILED, "[Open][File] %s failed, error:%s ", &real_path[0], GetStrError()); return GRAPH_FAILED; } const bool result = ge_proto.SerializeToFileDescriptor(fd); if (!result) { - REPORT_CALL_ERROR("E18888", "SerializeToFileDescriptor failed, file:%s.", &real_path[0]); + REPORT_INNER_ERR_MSG("E18888", "SerializeToFileDescriptor failed, file:%s.", &real_path[0]); GELOGE(GRAPH_FAILED, "[Call][SerializeToFileDescriptor] failed, file:%s.", &real_path[0]); if (mmClose(fd) != 0) { - REPORT_CALL_ERROR("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); GELOGE(GRAPH_FAILED, "[Close][File] %s fail, error:%s.", &real_path[0], GetStrError()); return GRAPH_FAILED; } return GRAPH_FAILED; } if (mmClose(fd) != 0) { - REPORT_CALL_ERROR("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); GELOGE(GRAPH_FAILED, "[Close][File] %s fail, error:%s.", &real_path[0], GetStrError()); return GRAPH_FAILED; } if (!result) { - REPORT_CALL_ERROR("E18888", "SerializeToFileDescriptor failed, file:%s.", &real_path[0]); + REPORT_INNER_ERR_MSG("E18888", "SerializeToFileDescriptor failed, file:%s.", &real_path[0]); GELOGE(GRAPH_FAILED, "[Call][SerializeToFileDescriptor] failed, file:%s.", &real_path[0]); return GRAPH_FAILED; } @@ -204,13 +204,13 @@ graphStatus Model::LoadFromFile(const std::string &file_name) { } const INT32 result = mmRealPath(file_name.c_str(), &real_path[0], MMPA_MAX_PATH); if (result != EN_OK) { - REPORT_CALL_ERROR("E18888", "get realpath failed for %s, error:%s.", file_name.c_str(), GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "get realpath failed for %s, error:%s.", file_name.c_str(), GetStrError()); GELOGE(GRAPH_FAILED, "[Get][RealPath] failed for %s, error:%s.", file_name.c_str(), GetStrError()); return GRAPH_FAILED; } const int32_t fd = mmOpen(&real_path[0], M_RDONLY); if (fd < 0) { - REPORT_CALL_ERROR("E18888", "open file:%s failed, error:%s", &real_path[0], GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "open file:%s failed, error:%s", &real_path[0], GetStrError()); GELOGE(GRAPH_FAILED, "[Open][File] %s failed, error:%s", &real_path[0], GetStrError()); return GRAPH_FAILED; } @@ -218,22 +218,22 @@ graphStatus Model::LoadFromFile(const std::string &file_name) { ge::proto::ModelDef model_def; const bool ret = model_def.ParseFromFileDescriptor(fd); if (!ret) { - REPORT_CALL_ERROR("E18888", "ParseFromFileDescriptor failed, file:%s.", &real_path[0]); + REPORT_INNER_ERR_MSG("E18888", "ParseFromFileDescriptor failed, file:%s.", &real_path[0]); GELOGE(GRAPH_FAILED, "[Call][ParseFromFileDescriptor] failed, file:%s.", &real_path[0]); if (mmClose(fd) != 0) { - REPORT_CALL_ERROR("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); GELOGE(GRAPH_FAILED, "[Close][File] %s fail. error:%s", &real_path[0], GetStrError()); return GRAPH_FAILED; } return GRAPH_FAILED; } if (mmClose(fd) != 0) { - REPORT_CALL_ERROR("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); + REPORT_INNER_ERR_MSG("E18888", "close file:%s fail, error:%s.", &real_path[0], GetStrError()); GELOGE(GRAPH_FAILED, "[Close][File] %s fail. error:%s", &real_path[0], GetStrError()); return GRAPH_FAILED; } if (!ret) { - REPORT_CALL_ERROR("E18888", "ParseFromFileDescriptor failed, file:%s.", &real_path[0]); + REPORT_INNER_ERR_MSG("E18888", "ParseFromFileDescriptor failed, file:%s.", &real_path[0]); GELOGE(GRAPH_FAILED, "[Call][ParseFromFileDescriptor] failed, file:%s.", &real_path[0]); return GRAPH_FAILED; } diff --git a/graph/normal_graph/node.cc b/graph/normal_graph/node.cc index 473cdb50c8..90249ce7b7 100644 --- a/graph/normal_graph/node.cc +++ b/graph/normal_graph/node.cc @@ -55,14 +55,14 @@ graphStatus Node::NodeImpl::Init(const NodePtr &node) { if (has_init_) { return GRAPH_SUCCESS; } - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return GRAPH_FAILED, "[Check][Param] original OpDesc is nullptr"); size_t size = op_->GetAllInputsSize(); in_data_anchors_.reserve(size); for (size_t i = 0UL; i < size; i++) { const std::shared_ptr anchor = ComGraphMakeShared(node, i); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Current in_data_anchor is null, malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "Current in_data_anchor is null, malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][InDataAnchor] Current in_data_anchor is null, malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -73,7 +73,7 @@ graphStatus Node::NodeImpl::Init(const NodePtr &node) { for (size_t i = 0UL; i < size; i++) { const std::shared_ptr anchor = ComGraphMakeShared(node, i); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Current out_data_anchor is null, malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "Current out_data_anchor is null, malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][OutDataAnchor] Current out_data_anchor is null, malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -82,7 +82,7 @@ graphStatus Node::NodeImpl::Init(const NodePtr &node) { in_control_anchor_ = ComGraphMakeShared(node, -1); out_control_anchor_ = ComGraphMakeShared(node, -1); if ((in_control_anchor_ == nullptr) || (out_control_anchor_ == nullptr)) { - REPORT_CALL_ERROR("E18888", "Current in_control_anchor or out_control_anchor is null, malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "Current in_control_anchor or out_control_anchor is null, malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][ControlAnchor] Current in_control_anchor or out_control_anchor is null, " "malloc shared_ptr failed."); return GRAPH_FAILED; @@ -92,25 +92,25 @@ graphStatus Node::NodeImpl::Init(const NodePtr &node) { } std::string Node::NodeImpl::GetName() const { - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return std::string(), "[Check][Param] original OpDesc is nullptr"); return op_->GetName(); } std::string Node::NodeImpl::GetType() const { - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return std::string(), "[Check][Param] original OpDesc is nullptr"); return op_->GetType(); } const char *Node::NodeImpl::GetNamePtr() const { - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return nullptr, "[Check][Param] original OpDesc is nullptr"); return op_->GetNamePtr(); } const char *Node::NodeImpl::GetTypePtr() const { - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return nullptr, "[Check][Param] original OpDesc is nullptr"); return op_->GetTypePtr(); } @@ -127,17 +127,18 @@ bool Node::NodeImpl::NodeMembersAreEqual(const NodeImpl &r_node) const { bool Node::NodeImpl::NodeAnchorIsEqual(const AnchorPtr &left_anchor, const AnchorPtr &right_anchor, const size_t i) const { - GE_IF_BOOL_EXEC(left_anchor == nullptr, REPORT_INNER_ERROR("E18888", "left_anchor is nullptr, check invalid."); + GE_IF_BOOL_EXEC(left_anchor == nullptr, REPORT_INNER_ERR_MSG("E18888", "left_anchor is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] left_anchor is null."); return false); - GE_IF_BOOL_EXEC(right_anchor == nullptr, REPORT_INNER_ERROR("E18888", "right_anchor is nullptr, check invalid."); + GE_IF_BOOL_EXEC(right_anchor == nullptr, REPORT_INNER_ERR_MSG("E18888", "right_anchor is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] right_anchor is null."); return false); const auto anchor_peer_size = left_anchor->GetPeerAnchorsSize(); const auto right_anchor_peer_size = right_anchor->GetPeerAnchorsSize(); // Firstly, verify anchor's peer anchors size equal or not if (anchor_peer_size != right_anchor_peer_size) { - REPORT_INNER_ERROR("E18888", "Size of anchor's peer anchors verify failed, node name: %s " - "anchor_peer_size [%zu] is different form [%zu] at index [%zu].", - this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); + REPORT_INNER_ERR_MSG("E18888", + "Size of anchor's peer anchors verify failed, node name: %s " + "anchor_peer_size [%zu] is different form [%zu] at index [%zu].", + this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); GELOGE(GRAPH_FAILED, "[Check][Param] Size of anchor's peer anchors verify failed, node name: %s " "anchor_peer_size [%zu] is different form [%zu] at index [%zu].", this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); @@ -148,17 +149,18 @@ bool Node::NodeImpl::NodeAnchorIsEqual(const AnchorPtr &left_anchor, const auto peer_node = left_anchor->GetPeerAnchorsPtr().at(j)->GetOwnerNodeBarePtr(); const auto r_peer_node = right_anchor->GetPeerAnchorsPtr().at(j)->GetOwnerNodeBarePtr(); if ((peer_node == nullptr) || (r_peer_node == nullptr)) { - REPORT_CALL_ERROR("E18888", "anchor's peer node is null, node name: %s index[%zu] peer node index[%zu].", - this->GetName().c_str(), i, j); + REPORT_INNER_ERR_MSG("E18888", "anchor's peer node is null, node name: %s index[%zu] peer node index[%zu].", + this->GetName().c_str(), i, j); GELOGE(GRAPH_FAILED, "[Get][OwnerNode] anchor's peer node is null, node name: %s index[%zu] " "peer node index[%zu].", this->GetName().c_str(), i, j); return false; } // Determine the connection relationship by linking the node's name if (peer_node->GetName() != r_peer_node->GetName()) { - REPORT_INNER_ERROR("E18888", "anchor's peer node name verify failed, node name: %s index[%zu]" - "peer node name %s is different from %s at index [%zu].", - this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); + REPORT_INNER_ERR_MSG("E18888", + "anchor's peer node name verify failed, node name: %s index[%zu]" + "peer node name %s is different from %s at index [%zu].", + this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); GELOGE(GRAPH_FAILED, "[Check][Param] anchor's peer node name verify failed, node name: %s index[%zu]" "peer node name %s is different from %s at index [%zu].", this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); @@ -174,24 +176,24 @@ graphStatus Node::NodeImpl::AddLinkFrom(const NodePtr &input_node, const NodePtr // Input_node ---> this auto out_anchors = input_node->GetAllOutDataAnchors(); if (out_anchors.size() != 1UL) { - REPORT_INNER_ERROR("E18888", "node:%s out_anchor size is:%zu, only support 1", - input_node->GetName().c_str(), out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "node:%s out_anchor size is:%zu, only support 1", input_node->GetName().c_str(), + out_anchors.size()); GELOGE(GRAPH_FAILED, "[Check][Param] out_anchor size is:%zu, only support 1", out_anchors.size()); return GRAPH_PARAM_INVALID; } - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return GRAPH_FAILED, "[Check][Param] original OpDesc is nullptr"); const auto op_desc = input_node->GetOpDesc(); GE_CHECK_NOTNULL(op_desc); if (op_->AddInputDesc(op_desc->GetOutputDesc(0U)) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "add input desc failed, op:%s.", op_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add input desc failed, op:%s.", op_->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][InputDesc] failed."); return GRAPH_FAILED; } const std::shared_ptr anchor = ComGraphMakeShared(owner_node, in_data_anchors_.size()); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size()); GELOGE(GRAPH_FAILED, "[Create][InDataAnchor] out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size()); return GRAPH_FAILED; @@ -209,8 +211,8 @@ graphStatus Node::NodeImpl::AddLinkFrom(const uint32_t &index, // Input_node ---> this auto out_anchors = input_node->GetAllOutDataAnchors(); if (out_anchors.size() != 1UL) { - REPORT_INNER_ERROR("E18888", "node:%s out_anchor size is:%zu, only support 1", - input_node->GetName().c_str(), out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "node:%s out_anchor size is:%zu, only support 1", input_node->GetName().c_str(), + out_anchors.size()); GELOGE(GRAPH_FAILED, "[Check][Param] out_anchor size is:%zu, only support 1", out_anchors.size()); return GRAPH_PARAM_INVALID; } @@ -220,7 +222,7 @@ graphStatus Node::NodeImpl::AddLinkFrom(const uint32_t &index, GE_CHECK_NOTNULL(op_desc); if (op_->AddInputDesc(index, op_desc->GetOutputDesc(0U)) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "add input desc failed, index:%u.", index); + REPORT_INNER_ERR_MSG("E18888", "add input desc failed, index:%u.", index); GELOGE(GRAPH_FAILED, "[Add][InputDesc] failed."); return GRAPH_FAILED; } @@ -231,7 +233,7 @@ graphStatus Node::NodeImpl::AddLinkFrom(const uint32_t &index, const std::shared_ptr anchor = ComGraphMakeShared(owner_node, in_data_anchors_.size()); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size()); GELOGE(GRAPH_FAILED, "[Create][InDataAnchor] out_anchor size is:%zu, malloc shared_ptr failed.", out_anchors.size()); return GRAPH_FAILED; @@ -249,15 +251,15 @@ graphStatus Node::NodeImpl::AddLinkFromForParse(const NodePtr &input_node, const // Input_node ---> this auto out_anchors = input_node->GetAllOutDataAnchors(); if (out_anchors.size() != 1UL) { - REPORT_INNER_ERROR("E18888", "node:%s out_anchor size is:%zu, only support 1", - input_node->GetName().c_str(), out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "node:%s out_anchor size is:%zu, only support 1", input_node->GetName().c_str(), + out_anchors.size()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] out_anchor size is:%zu, only support 1", out_anchors.size()); return GRAPH_PARAM_INVALID; } const std::shared_ptr anchor = ComGraphMakeShared(owner_node, in_data_anchors_.size()); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "out_anchor size is:%zu, make anchor failed", out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "out_anchor size is:%zu, make anchor failed", out_anchors.size()); GELOGE(GRAPH_FAILED, "[Create][InDataAnchor] out_anchor size is:%zu, make anchor failed", out_anchors.size()); return GRAPH_FAILED; } @@ -272,8 +274,8 @@ graphStatus Node::NodeImpl::AddLinkFrom(const std::string &name, const NodePtr & // Input_node ---> this auto out_anchors = input_node->GetAllOutDataAnchors(); if (out_anchors.size() != 1UL) { - REPORT_INNER_ERROR("E18888", "node:%s out_anchor size is:%zu, only support 1", - input_node->GetName().c_str(), out_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", "node:%s out_anchor size is:%zu, only support 1", input_node->GetName().c_str(), + out_anchors.size()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] out_anchor size is:%zu, only support 1", out_anchors.size()); return GRAPH_PARAM_INVALID; } @@ -284,8 +286,9 @@ graphStatus Node::NodeImpl::AddLinkFrom(const std::string &name, const NodePtr & const auto index = op_->GetInputIndexByName(name); if (index != -1) { if (index >= static_cast(in_data_anchors_.size())) { - REPORT_INNER_ERROR("E18888", "op %s get input name %s 's index %d is illegal as which >= indataanchors size:%zu.", - op_->GetName().c_str(), name.c_str(), index, in_data_anchors_.size()); + REPORT_INNER_ERR_MSG("E18888", + "op %s get input name %s 's index %d is illegal as which >= indataanchors size:%zu.", + op_->GetName().c_str(), name.c_str(), index, in_data_anchors_.size()); GELOGE(GRAPH_FAILED, "[Check][Param] op %s get input name %s 's index %d is illegal.", op_->GetName().c_str(), name.c_str(), index); return GRAPH_FAILED; @@ -299,7 +302,7 @@ graphStatus Node::NodeImpl::AddLinkFrom(const std::string &name, const NodePtr & (void) out_anchors.at(0U)->LinkTo(in_data_anchors_.back()); } if (op_->AddInputDesc(name, input_op_desc->GetOutputDesc(0U)) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "add input desc failed, name:%s, op:%s", name.c_str(), op_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add input desc failed, name:%s, op:%s", name.c_str(), op_->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][InputDesc] failed."); return GRAPH_FAILED; } @@ -447,8 +450,8 @@ AnchorPtr Node::NodeImpl::GetInAnchor(const int32_t idx) const { AnchorPtr Node::NodeImpl::GetOutAnchor(const int32_t idx) const { // Idx can't be less than -1 or >= out_data_anchors_.size(), -1 means index of control anchor_ if ((idx < -1) || (idx >= static_cast(out_data_anchors_.size()))) { - REPORT_INNER_ERROR("E18888", "Op:%s(%s) doesn't have index:%d's anchorname", - GetName().c_str(), GetType().c_str(), idx); + REPORT_INNER_ERR_MSG("E18888", "Op:%s(%s) doesn't have index:%d's anchorname", GetName().c_str(), GetType().c_str(), + idx); GELOGE(GRAPH_FAILED, "[Check][Param] Op[%s] doesn't have index[%d]'s out_anchor which optype is %s.", GetName().c_str(), idx, GetType().c_str()); return nullptr; @@ -464,8 +467,8 @@ AnchorPtr Node::NodeImpl::GetOutAnchor(const int32_t idx) const { OutDataAnchorPtr Node::NodeImpl::GetOutDataAnchor(const int32_t idx) const { if ((idx < 0) || (idx >= static_cast(out_data_anchors_.size()))) { - REPORT_INNER_ERROR("E18888", "Op:%s(%s) doesn't have index:%d's anchorname", - GetName().c_str(), GetType().c_str(), idx); + REPORT_INNER_ERR_MSG("E18888", "Op:%s(%s) doesn't have index:%d's anchorname", GetName().c_str(), GetType().c_str(), + idx); GELOGE(GRAPH_FAILED, "[Check][Param] Op[%s] doesn't have index[%d]'s out_data_anchor which optype is %s.", GetName().c_str(), idx, GetType().c_str()); return nullptr; @@ -536,8 +539,8 @@ bool Node::NodeImpl::IsAllInNodesSeen(const std::unordered_set &nodes_se } const auto node = out_anchor->GetOwnerNodeBarePtr(); if (node == nullptr) { - REPORT_CALL_ERROR("E18888", "peer node is null, node name: %s input index[%d] peer node output index[%d].", - GetName().c_str(), in_anchor->GetIdx(), out_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "peer node is null, node name: %s input index[%d] peer node output index[%d].", + GetName().c_str(), in_anchor->GetIdx(), out_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Get][OwnerNode] peer node is null, node name: %s input index[%d] peer node output index[%d].", GetName().c_str(), in_anchor->GetIdx(), out_anchor->GetIdx()); @@ -684,22 +687,24 @@ OpDesc *Node::NodeImpl::GetOpDescBarePtr() const { } graphStatus Node::NodeImpl::UpdateOpDesc(const OpDescPtr &op_desc) { - GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERROR("E18888", "original OpDesc is nullptr"); + GE_CHK_BOOL_EXEC(op_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "original OpDesc is nullptr"); return GRAPH_FAILED, "[Check][Param] original OpDesc is nullptr"); - GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERROR("E18888", "param op_desc is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERR_MSG("E18888", "param op_desc is nullptr, check invalid."); return GRAPH_PARAM_INVALID, "[Check][Param] Param OpDesc is nullptr"); GE_CHK_BOOL_EXEC(op_->GetInputsSize() == op_desc->GetInputsSize(), - REPORT_INNER_ERROR("E18888", "inputs count(%zu) of param op_desc not equal to " - "inputs count(%zu) of original opdesc:%s, check invalid", - op_desc->GetInputsSize(), op_->GetInputsSize(), op_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "inputs count(%zu) of param op_desc not equal to " + "inputs count(%zu) of original opdesc:%s, check invalid", + op_desc->GetInputsSize(), op_->GetInputsSize(), op_->GetName().c_str()); return GRAPH_PARAM_INVALID, "[Check][Param] Inputs count expected to be same, original OpDesc %zu, Param OpDesc %zu", op_->GetInputsSize(), op_desc->GetInputsSize()); GE_CHK_BOOL_EXEC(op_->GetOutputsSize() == op_desc->GetOutputsSize(), - REPORT_INNER_ERROR("E18888", "outputs count(%zu) of param op_desc not equal to " - "outputs count(%zu) of original opdesc:%s, check invalid", - op_desc->GetOutputsSize(), op_->GetOutputsSize(), op_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "outputs count(%zu) of param op_desc not equal to " + "outputs count(%zu) of original opdesc:%s, check invalid", + op_desc->GetOutputsSize(), op_->GetOutputsSize(), op_->GetName().c_str()); return GRAPH_PARAM_INVALID, "[Check][Param] Outputs count expected to be same, original OpDesc %zu, Param OpDesc %zu", op_->GetOutputsSize(), op_desc->GetOutputsSize()); @@ -839,9 +844,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool Node::NodeInConnectsAreEqual const auto in_data_anchor_size = this->GetAllInDataAnchors().size(); const auto r_in_data_anchor_size = r_node.GetAllInDataAnchors().size(); if (in_data_anchor_size != r_in_data_anchor_size) { - REPORT_INNER_ERROR("E18888", "param node in data anchors count:%zu not equal to " - "this in data anchors count:%zu, verify failed, node name: %s.", - r_in_data_anchor_size, in_data_anchor_size, this->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "param node in data anchors count:%zu not equal to " + "this in data anchors count:%zu, verify failed, node name: %s.", + r_in_data_anchor_size, in_data_anchor_size, this->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Size of node's in data anchors verify failed, node name: %s.", this->GetName().c_str()); return false; @@ -852,9 +858,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool Node::NodeInConnectsAreEqual const auto in_control_anchor_size = l_in_anchors.size() - in_data_anchor_size; const auto r_in_control_anchor_size = r_in_anchors.size() - r_in_data_anchor_size; if (in_control_anchor_size != r_in_control_anchor_size) { - REPORT_INNER_ERROR("E18888", "param node in control anchors count:%zu not equal to " - "this in control anchors count:%zu, verify failed, node name: %s.", - r_in_control_anchor_size, in_control_anchor_size, this->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "param node in control anchors count:%zu not equal to " + "this in control anchors count:%zu, verify failed, node name: %s.", + r_in_control_anchor_size, in_control_anchor_size, this->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Size of node's in control anchors verify failed, node name: %s.", this->GetName().c_str()); return false; @@ -891,9 +898,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool Node::NodeOutConnectsAreEqua const auto out_data_anchor_size = l_out_data_anchors.size(); const auto r_out_data_anchor_size = r_out_data_anchors.size(); if (out_data_anchor_size != r_out_data_anchor_size) { - REPORT_INNER_ERROR("E18888", "param node out data anchors count:%zu not equal to " - "this out data anchors count:%zu, verify failed, node name: %s.", - r_out_data_anchor_size, out_data_anchor_size, this->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "param node out data anchors count:%zu not equal to " + "this out data anchors count:%zu, verify failed, node name: %s.", + r_out_data_anchor_size, out_data_anchor_size, this->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Size of node's out data anchors verify failed, node name: %s.", this->GetName().c_str()); return false; @@ -904,9 +912,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool Node::NodeOutConnectsAreEqua const auto out_control_anchor_size = l_out_anchors.size() - out_data_anchor_size; const auto r_out_control_anchor_size = r_out_anchors.size() - r_out_data_anchor_size; if (out_control_anchor_size != r_out_control_anchor_size) { - REPORT_INNER_ERROR("E18888", "param node out control anchors count:%zu not equal to " - "this out control anchors count:%zu, verify failed, node name: %s.", - r_out_control_anchor_size, out_control_anchor_size, this->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "param node out control anchors count:%zu not equal to " + "this out control anchors count:%zu, verify failed, node name: %s.", + r_out_control_anchor_size, out_control_anchor_size, this->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Size of node's out control anchors verify failed, node name: %s.", this->GetName().c_str()); return false; diff --git a/graph/normal_graph/op_desc.cc b/graph/normal_graph/op_desc.cc index 2b382d2342..b2fbc20168 100644 --- a/graph/normal_graph/op_desc.cc +++ b/graph/normal_graph/op_desc.cc @@ -302,7 +302,7 @@ graphStatus OpDescImpl::AddInputDesc(const std::string &name, const ge::GeTensor int32_t index = static_cast(inputs_desc_.size()); const std::shared_ptr in_desc = ComGraphMakeShared(input_desc); if (in_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "AddInputDesc failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "AddInputDesc failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] AddInputDesc failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -321,20 +321,20 @@ graphStatus OpDescImpl::AddInputDescMiddle(const std::string &name, const uint32 for (uint32_t i = 0U; i < num; i++) { std::string input_name = name + std::to_string(i); GE_CHK_BOOL_EXEC((input_name_idx_.find(input_name) == input_name_idx_.end()), - REPORT_INNER_ERROR("E18888", "Add input tensor_desc is existed. name[%s]", input_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add input tensor_desc is existed. name[%s]", input_name.c_str()); GELOGE(ge::FAILED, "[Check][Param] Add input tensor_desc is existed. name[%s]", input_name.c_str()); return GRAPH_FAILED); const std::shared_ptr in_desc = ComGraphMakeShared(GeTensorDesc()); if (in_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "AddInputDescMiddle failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "AddInputDescMiddle failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] AddInputDescMiddle failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } if (index > inputs_desc_.size()) { - REPORT_INNER_ERROR("E18888", "AddInputDescMiddle failed, as param index(%zu) " + REPORT_INNER_ERR_MSG("E18888", "AddInputDescMiddle failed, as param index(%zu) " "is bigger than inputs size(%zu).", index, inputs_desc_.size()); GELOGE(GRAPH_FAILED, "[Check][Param] AddInputDescMiddle failed, as param index(%zu) " "is bigger than inputs size(%zu).", index, inputs_desc_.size()); @@ -358,19 +358,19 @@ graphStatus OpDescImpl::AddOutputDescMiddle(const std::string &name, const uint3 for (uint32_t i = 0U; i < num; i++) { std::string output_name = name + std::to_string(i); GE_CHK_BOOL_EXEC((output_name_idx_.find(output_name) == output_name_idx_.end()), - REPORT_INNER_ERROR("E18888", "Add output tensor_desc is existed. name[%s]", output_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add output tensor_desc is existed. name[%s]", output_name.c_str()); return GRAPH_FAILED, "[Check][Param] Add output tensor_desc is existed. name[%s]", output_name.c_str()); const std::shared_ptr out_desc = ComGraphMakeShared(GeTensorDesc()); if (out_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "AddOutputDescMiddle failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "AddOutputDescMiddle failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] AddOutputDescMiddle failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } if (index > outputs_desc_.size()) { - REPORT_INNER_ERROR("E18888", "AddOutputDescMiddle failed, as param index(%zu) " + REPORT_INNER_ERR_MSG("E18888", "AddOutputDescMiddle failed, as param index(%zu) " "is bigger than outputs size(%zu).", index, outputs_desc_.size()); GELOGE(GRAPH_FAILED, "[Check][Param] AddOutputDescMiddle failed, as param index(%zu) " "is bigger than outputs size(%zu).", index, outputs_desc_.size()); @@ -393,13 +393,13 @@ graphStatus OpDescImpl::AddInputDescForward(const std::string &name, const uint3 for (uint32_t i = 0U; i < num; i++) { std::string input_name = name + std::to_string(i); GE_CHK_BOOL_EXEC((input_name_idx_.find(input_name) == input_name_idx_.end()), - REPORT_INNER_ERROR("E18888", "Add input tensor_desc is existed. name[%s]", input_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add input tensor_desc is existed. name[%s]", input_name.c_str()); return GRAPH_FAILED, "[Check][Param] Add input tensor_desc is existed. name[%s]", input_name.c_str()); const std::shared_ptr in_desc = ComGraphMakeShared(GeTensorDesc()); if (in_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "AddInputDescForward failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "AddInputDescForward failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] AddInputDescForward failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -419,13 +419,13 @@ graphStatus OpDescImpl::AddOutputDescForward(const std::string &name, const uint const auto index = i; std::string output_name = name + std::to_string(index); GE_CHK_BOOL_EXEC((output_name_idx_.find(output_name) == output_name_idx_.end()), - REPORT_INNER_ERROR("E18888", "Add output tensor_desc is existed. name[%s]", output_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add output tensor_desc is existed. name[%s]", output_name.c_str()); return GRAPH_FAILED, "[Check][Param] Add output tensor_desc is existed. name[%s]", output_name.c_str()); const std::shared_ptr in_desc = ComGraphMakeShared(GeTensorDesc()); if (in_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "AddOutputDescForward failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "AddOutputDescForward failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] AddOutputDescForward failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -456,7 +456,7 @@ graphStatus OpDescImpl::UpdateInputDesc(const uint32_t index, const ge::GeTensor inputs_desc_[static_cast(index)] = ComGraphMakeShared(tensor_Desc); if (inputs_desc_[static_cast(index)] == nullptr) { - REPORT_CALL_ERROR("E18888", "UpdateInputDesc failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "UpdateInputDesc failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] UpdateInputDesc failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -502,7 +502,7 @@ const { const auto inputs_desc_size = this->inputs_desc_.size(); const auto r_inputs_desc_size = r_op_desc.inputs_desc_.size(); if (inputs_desc_size != r_inputs_desc_size) { - REPORT_INNER_ERROR("E18888", "param r_op_desc inputs count(%zu) not equal to %s inputs count(%zu), " + REPORT_INNER_ERR_MSG("E18888", "param r_op_desc inputs count(%zu) not equal to %s inputs count(%zu), " "verify failed.", r_inputs_desc_size, this->GetName().c_str(), inputs_desc_size); GELOGE(GRAPH_FAILED, "[Check][Param] Size of OpDesc's inputs desc verify failed, node name: %s.", this->GetName().c_str()); @@ -511,7 +511,7 @@ const { const auto outputs_desc_size = this->outputs_desc_.size(); const auto r_outputs_desc_size = r_op_desc.outputs_desc_.size(); if (outputs_desc_size != r_outputs_desc_size) { - REPORT_INNER_ERROR("E18888", "param r_op_desc outputs count(%zu) not equal to %s outputs count(%zu), " + REPORT_INNER_ERR_MSG("E18888", "param r_op_desc outputs count(%zu) not equal to %s outputs count(%zu), " "verify failed.", r_inputs_desc_size, this->GetName().c_str(), inputs_desc_size); GELOGE(GRAPH_FAILED, "[Check][Param] Size of OpDesc's outputs desc verify failed, node name: %s.", this->GetName().c_str()); @@ -523,7 +523,7 @@ const { const auto &r_in_ge_tensor_desc = r_op_desc.GetInputDesc(i); // Determine the connection relationship by GeTensorDesc if (!(in_ge_tensor_desc == r_in_ge_tensor_desc)) { - REPORT_INNER_ERROR("E18888", "r_op_desc inputdesc(index:%u) not equal to %s inputdesc(index:%u), " + REPORT_INNER_ERR_MSG("E18888", "r_op_desc inputdesc(index:%u) not equal to %s inputdesc(index:%u), " "verify failed.", i, this->GetName().c_str(), i); GELOGE(GRAPH_FAILED, "[Check][Param] Link info of OpDesc's inputs desc verify failed, OpDesc name: %s.", this->GetName().c_str()); @@ -535,7 +535,7 @@ const { const auto &out_ge_tensor_desc = this->GetOutputDesc(i); const auto &r_out_ge_tensor_desc = r_op_desc.GetOutputDesc(i); if (!(out_ge_tensor_desc == r_out_ge_tensor_desc)) { - REPORT_INNER_ERROR("E18888", "r_op_desc outputdesc(index:%u) not equal to %s outputdesc(index:%u), " + REPORT_INNER_ERR_MSG("E18888", "r_op_desc outputdesc(index:%u) not equal to %s outputdesc(index:%u), " "verify failed.", i, this->GetName().c_str(), i); GELOGE(GRAPH_FAILED, "[Check][Param] Link info of OpDesc's outputs desc verify failed, OpDesc name: %s.", this->GetName().c_str()); @@ -552,14 +552,14 @@ graphStatus OpDescImpl::UpdateInputDesc(const std::string &name, const ge::GeTen return GRAPH_FAILED; } if (it->second >= inputs_desc_.size()) { - REPORT_INNER_ERROR("E18888", "%u is out of range(0, %zu), check invalid", it->second, inputs_desc_.size()); + REPORT_INNER_ERR_MSG("E18888", "%u is out of range(0, %zu), check invalid", it->second, inputs_desc_.size()); GELOGE(GRAPH_FAILED, "[Check][Param] [%u] more than size:%zu of inputs_desc_", it->second, inputs_desc_.size()); return GRAPH_FAILED; } inputs_desc_[static_cast(it->second)] = ComGraphMakeShared(tensor_Desc); if (inputs_desc_[static_cast(it->second)] == nullptr) { - REPORT_CALL_ERROR("E18888", "UpdateInputDesc failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "UpdateInputDesc failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] UpdateInputDesc failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -573,13 +573,13 @@ bool OpDescImpl::InputIsSet(const std::string &name) const { const auto it = input_name_idx_.find(name); if (it != input_name_idx_.end()) { GE_IF_BOOL_EXEC(it->second >= inputs_desc_.size(), - REPORT_INNER_ERROR("E18888", "input name(%s) id(%u) is out of range(0, %zu), check invalid", + REPORT_INNER_ERR_MSG("E18888", "input name(%s) id(%u) is out of range(0, %zu), check invalid", name.c_str(), it->second, inputs_desc_.size()); GELOGE(GRAPH_FAILED, "[Check][Param] it->second is invalid."); return false); const auto tensor_desc = inputs_desc_[static_cast(it->second)]; GE_IF_BOOL_EXEC(tensor_desc == nullptr, - REPORT_INNER_ERROR("E18888", "tensor_desc(index:%u) is null.", it->second); + REPORT_INNER_ERR_MSG("E18888", "tensor_desc(index:%u) is null.", it->second); GELOGE(GRAPH_FAILED, "[Check][Param] tensor_desc(index:%u) is null.", it->second); return false); const auto dims = tensor_desc->GetShape().GetDims(); if (dims.size() > 0U) { @@ -700,14 +700,14 @@ graphStatus OpDescImpl::AddOutputDesc(const ge::GeTensorDesc &output_desc) { graphStatus OpDescImpl::AddOutputDesc(const std::string &name, const ge::GeTensorDesc &output_desc) { GE_CHK_BOOL_EXEC((output_name_idx_.find(name) == output_name_idx_.end()), - REPORT_INNER_ERROR("E18888", "Add output tensor_Desc is existed. name[%s]", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add output tensor_Desc is existed. name[%s]", name.c_str()); return GRAPH_FAILED, "[Check][Param] Add output tensor_Desc is existed. name[%s]", name.c_str()); const int32_t index = static_cast(outputs_desc_.size()); const std::shared_ptr tensor = ComGraphMakeShared(output_desc); if (tensor == nullptr) { - REPORT_CALL_ERROR("E18888", "AddOutputDesc failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "AddOutputDesc failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] AddOutputDesc failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -722,13 +722,13 @@ graphStatus OpDescImpl::AddOutputDesc(const std::string &name, const ge::GeTenso graphStatus OpDescImpl::UpdateOutputDesc(const uint32_t index, const ge::GeTensorDesc &tensor_Desc) { GE_CHK_BOOL_EXEC((index < outputs_desc_.size()), - REPORT_INNER_ERROR("E18888", "param index(%u) is out of range(0, %zu), check invalid", + REPORT_INNER_ERR_MSG("E18888", "param index(%u) is out of range(0, %zu), check invalid", index, outputs_desc_.size()); return GRAPH_FAILED, "[Check][Param] The index is invalid. index[%u]", index); outputs_desc_[static_cast(index)] = ComGraphMakeShared(tensor_Desc); if (outputs_desc_[static_cast(index)] == nullptr) { - REPORT_CALL_ERROR("E18888", "UpdateOutputDesc failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "UpdateOutputDesc failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] UpdateOutputDesc failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -745,13 +745,13 @@ graphStatus OpDescImpl::UpdateOutputDesc(const std::string &name, const ge::GeTe return GRAPH_FAILED; } GE_IF_BOOL_EXEC(it->second >= outputs_desc_.size(), - REPORT_INNER_ERROR("E18888", "output name(%s) idx(%u) is out of range(0, %zu), check invalid", + REPORT_INNER_ERR_MSG("E18888", "output name(%s) idx(%u) is out of range(0, %zu), check invalid", name.c_str(), it->second, outputs_desc_.size()); GELOGE(GRAPH_FAILED, "[Check][Param] it->second is invalid."); return GRAPH_FAILED); outputs_desc_[static_cast(it->second)] = ComGraphMakeShared(tensor_Desc); if (outputs_desc_[static_cast(it->second)] == nullptr) { - REPORT_CALL_ERROR("E18888", "UpdateOutputDesc failed, as malloc shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "UpdateOutputDesc failed, as malloc shared_ptr failed."); GELOGE(GRAPH_FAILED, "[Create][GeTensorDesc] UpdateOutputDesc failed, as malloc shared_ptr failed."); return GRAPH_FAILED; } @@ -1340,8 +1340,8 @@ const std::map &OpDescImpl::GetSubgraphNameIndexes() cons graphStatus OpDescImpl::SetSubgraphInstanceName(const size_t index, const std::string &name) { GELOGI("Add sub graph instance name is %s, index is %zu", name.c_str(), index); if (index >= subgraph_instance_names_.size()) { - REPORT_INNER_ERROR("E18888", "Index %zu exceeds the max instance count %zu", - index, subgraph_instance_names_.size()); + REPORT_INNER_ERR_MSG("E18888", "Index %zu exceeds the max instance count %zu", index, + subgraph_instance_names_.size()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Index %zu exceeds the max instance count %zu", index, subgraph_instance_names_.size()); return GRAPH_PARAM_INVALID; @@ -1539,7 +1539,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void OpDesc::SetOpKernelLibName(c impl_->SetOpKernelLibName(name); const auto ret = AttrUtils::SetStr(this, ATTR_NAME_OP_KERNEL_LIB_NAME, name); if (!ret) { - REPORT_CALL_ERROR("E18888", "set %s to op failed.", ATTR_NAME_OP_KERNEL_LIB_NAME.c_str()); + REPORT_INNER_ERR_MSG("E18888", "set %s to op failed.", ATTR_NAME_OP_KERNEL_LIB_NAME.c_str()); GELOGE(GRAPH_FAILED, "[Set][Str] %s to op failed.", ATTR_NAME_OP_KERNEL_LIB_NAME.c_str()); } } @@ -1799,7 +1799,7 @@ graphStatus OpDesc::CommonVerify() const { continue; } for (const int64_t dim : ishape) { - if (dim < -2) { // -2 is all shape + if (dim < -2) { // -2 is all shape REPORT_PREDEFINED_ERR_MSG("E19014", std::vector({"opname", "value", "reason"}), std::vector({GetName().c_str(), ("input " + iname + " shape").c_str(), "contains negative or zero dimension"})); @@ -2210,20 +2210,20 @@ OpDescBuilder& OpDescBuilder::AddDynamicOutput(const std::string &name, const ui GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY OpDescPtr OpDescBuilder::Build() { const OpDescPtr op_desc = MakeShared(name_, type_); if (op_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "create opdesc failed, name:%s, type:%s.", name_.c_str(), type_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "create opdesc failed, name:%s, type:%s.", name_.c_str(), type_.c_str()); GELOGE(GRAPH_FAILED, "[Create][OpDesc] failed, name:%s, type:%s.", name_.c_str(), type_.c_str()); return nullptr; } for (auto &input : inputs_) { if (op_desc->AddInputDesc(input.first, input.second) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "AddInputDesc failed, op:%s.", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddInputDesc failed, op:%s.", name_.c_str()); GELOGE(GRAPH_FAILED, "[Add][InputDesc] failed, op:%s.", name_.c_str()); return nullptr; } } for (auto &output : outputs_) { if (op_desc->AddOutputDesc(output.first, output.second) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "AddOutputDesc failed, op:%s", name_.c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddOutputDesc failed, op:%s", name_.c_str()); GELOGE(GRAPH_FAILED, "[Add][OutputDesc] failed, op:%s.", name_.c_str()); return nullptr; } diff --git a/graph/normal_graph/operator.cc b/graph/normal_graph/operator.cc index 4de5c49061..1656fa0b05 100644 --- a/graph/normal_graph/operator.cc +++ b/graph/normal_graph/operator.cc @@ -41,7 +41,7 @@ #define OP_ATTR_SET_IMP(ArgType, AttrUtilsFun) \ Operator &ge::Operator::SetAttr(const std::string &name, ArgType attr_value) { \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); \ return *this; \ } \ @@ -52,13 +52,13 @@ } \ Operator &ge::Operator::SetAttr(const char_t *name, ArgType attr_value) { \ if (name == nullptr) { \ - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator attr name is nullptr."); \ return *this; \ } \ const std::string op_name = name; \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", op_name.c_str()); \ return *this; \ } \ @@ -71,7 +71,7 @@ #define OP_ATTR_GET_IMP(ArgType, AttrUtilsFun) \ graphStatus ge::Operator::GetAttr(const std::string &name, ArgType attr_value) const { \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); \ return GRAPH_FAILED; \ } \ @@ -83,12 +83,12 @@ } \ graphStatus ge::Operator::GetAttr(const char_t *name, ArgType attr_value) const { \ if (name == nullptr) { \ - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator attr name is nullptr."); \ return GRAPH_FAILED; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return GRAPH_FAILED; \ } \ @@ -104,7 +104,7 @@ void ge::Operator::AttrRegister(const char_t *name, ArgType attr_value) { \ GE_CHECK_NOTNULL_JUST_RETURN(name); \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return; \ } \ @@ -117,12 +117,12 @@ #define EDGE_ATTR_SET_BY_IDX_IMP(ArgType, AttrUtilsFun) \ Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, ArgType attr_value) { \ if (name == nullptr) { \ - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator attr name is nullptr."); \ return *this; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return *this; \ } \ @@ -136,12 +136,12 @@ } \ Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, ArgType attr_value) { \ if (name == nullptr) { \ - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator attr name is nullptr."); \ return *this; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return *this; \ } \ @@ -156,12 +156,12 @@ #define EDGE_ATTR_SET_BY_NAME_IMP(ArgType, AttrUtilsFun) \ Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, ArgType attr_value) { \ if ((dst_name == nullptr) || (name == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "dst_name or attr name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "dst_name or attr name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator input name or attr name is nullptr."); \ return *this; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return *this; \ } \ @@ -176,12 +176,12 @@ } \ Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, ArgType attr_value) { \ if ((dst_name == nullptr) || (name == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "dst_name or attr name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "dst_name or attr name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator output name or attr name is nullptr."); \ return *this; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return *this; \ } \ @@ -198,12 +198,12 @@ #define EDGE_ATTR_GET_BY_IDX_IMP(ArgType, AttrUtilsFun) \ graphStatus Operator::GetInputAttr(const int32_t index, const char_t *name, ArgType attr_value) const { \ if (name == nullptr) { \ - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator attr name is nullptr."); \ return GRAPH_FAILED; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return GRAPH_FAILED; \ } \ @@ -217,12 +217,12 @@ } \ graphStatus Operator::GetOutputAttr(const int32_t index, const char_t *name, ArgType attr_value) const { \ if (name == nullptr) { \ - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator attr name is nullptr."); \ return GRAPH_FAILED; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return GRAPH_FAILED; \ } \ @@ -237,12 +237,12 @@ #define EDGE_ATTR_GET_BY_NAME_IMP(ArgType, AttrUtilsFun) \ graphStatus Operator::GetInputAttr(const char_t *dst_name, const char_t *name, ArgType attr_value) const { \ if ((dst_name == nullptr) || (name == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "dst_name or attr name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "dst_name or attr name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator input name or attr name is nullptr."); \ return GRAPH_FAILED; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return GRAPH_FAILED; \ } \ @@ -257,12 +257,12 @@ } \ graphStatus Operator::GetOutputAttr(const char_t *dst_name, const char_t *name, ArgType attr_value) const { \ if ((dst_name == nullptr) || (name == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "dst_name or attr name is nullptr, check invalid."); \ + REPORT_INNER_ERR_MSG("E18888", "dst_name or attr name is nullptr, check invalid."); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator output name or attr name is nullptr."); \ return GRAPH_FAILED; \ } \ if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { \ - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); \ GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); \ return GRAPH_FAILED; \ } \ @@ -282,10 +282,10 @@ if ((v) == nullptr) { \ auto msg = CreateErrorMsg(__VA_ARGS__); \ if (msg.empty()) { \ - REPORT_INNER_ERROR("E19999", "Assert %s not null failed", #v); \ + REPORT_INNER_ERR_MSG("E19999", "Assert %s not null failed", #v); \ GELOGE(ge::FAILED, "Assert %s not null failed", #v); \ } else { \ - REPORT_INNER_ERROR("E19999", "%s", msg.data()); \ + REPORT_INNER_ERR_MSG("E19999", "%s", msg.data()); \ GELOGE(ge::FAILED, "%s", msg.data()); \ } \ return; \ @@ -302,7 +302,7 @@ namespace { graphStatus SetTensorAttr(const GeTensorDescPtr &tensor, const char_t *name, const std::vector &attr_value) { if ((tensor == nullptr) || (name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator input parameters name or tensor is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "Operator input parameters name or tensor is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name or tensor is nullptr, check invalid."); return GRAPH_PARAM_INVALID; } @@ -318,7 +318,7 @@ graphStatus SetTensorAttr(const GeTensorDescPtr &tensor, const char_t *name, graphStatus GetTensorAttr(const GeTensorDesc &tensor, const char_t *name, std::vector &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator input parameters name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "Operator input parameters name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr, check invalid."); return GRAPH_PARAM_INVALID; } @@ -340,7 +340,7 @@ OperatorKeeper &OperatorKeeper::GetInstance() { GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator OpDescUtils::CreateOperatorFromNode(ge::ConstNodePtr node_ptr) { const ge::OperatorImplPtr operator_impl_ptr = ComGraphMakeShared(node_ptr); if (operator_impl_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "OperatorImpl make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OperatorImpl make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OperatorImpl make shared failed"); return Operator("default"); } @@ -374,7 +374,7 @@ OpDescUtils::CopyOperators(const ComputeGraphPtr &dst_compute_graph, } else { dst_op_desc = OpDescUtils::CopyOpDesc(scr_op_impl_ptr->op_desc_); if (dst_op_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "CopyOpDesc from %s failed", scr_op_impl_ptr->op_desc_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "CopyOpDesc from %s failed", scr_op_impl_ptr->op_desc_->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Copy][OpDesc] from %s failed", scr_op_impl_ptr->op_desc_->GetName().c_str()); return GRAPH_FAILED; } @@ -385,7 +385,7 @@ OpDescUtils::CopyOperators(const ComputeGraphPtr &dst_compute_graph, } else { const auto original_op_desc = scr_op_impl_ptr->node_->GetOpDesc(); if (scr_op_impl_ptr->op_desc_ != original_op_desc) { - REPORT_INNER_ERROR("E18888", "node and op_desc of operator are not equal."); + REPORT_INNER_ERR_MSG("E18888", "node and op_desc of operator are not equal."); GELOGE(GRAPH_FAILED, "[Check][Param] node and op_desc of operator are not equal."); return GRAPH_FAILED; } @@ -398,7 +398,7 @@ OpDescUtils::CopyOperators(const ComputeGraphPtr &dst_compute_graph, } else { dst_op_desc = OpDescUtils::CopyOpDesc(scr_op_impl_ptr->op_desc_); if (dst_op_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "CopyOpDesc from %s failed", scr_op_impl_ptr->op_desc_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "CopyOpDesc from %s failed", scr_op_impl_ptr->op_desc_->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Copy][OpDesc] from %s failed", scr_op_impl_ptr->op_desc_->GetName().c_str()); return GRAPH_FAILED; } @@ -435,7 +435,7 @@ OpDescUtils::CopyOperatorLinks(const std::map &src_op GE_CHECK_NOTNULL(input_impl_ptr); const auto iter = dst_op_list.find(input_impl_ptr->GetName()); if (iter == dst_op_list.end()) { - REPORT_INNER_ERROR("E18888", "Find dst operator:%s failed", input_impl_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find dst operator:%s failed", input_impl_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Find dst operator:%s failed", input_impl_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -448,7 +448,7 @@ OpDescUtils::CopyOperatorLinks(const std::map &src_op GE_CHECK_NOTNULL(input_ctrl_impl_ptr); const auto iter = dst_op_list.find(input_ctrl_impl_ptr->GetName()); if (iter == dst_op_list.end()) { - REPORT_INNER_ERROR("E18888", "Find dst ctrl operator:%s failed", input_ctrl_impl_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find dst ctrl operator:%s failed", input_ctrl_impl_ptr->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Find dst ctrl operator:%s failed", input_ctrl_impl_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -488,7 +488,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Operator OpDescUtils::CreateOpera std::shared_ptr operator_impl_ptr; operator_impl_ptr = ComGraphMakeShared(op_desc); if (operator_impl_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "OperatorImpl make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OperatorImpl make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OperatorImpl make shared failed"); return Operator("default"); } @@ -512,7 +512,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtilsEx::SetNode GE_FUNC_HOST_VISIBILITY Operator::Operator(const std::string &name, const std::string &type) { operator_impl_ = ComGraphMakeShared(name, type); if (operator_impl_ == nullptr) { - REPORT_CALL_ERROR("E18888", "OperatorImpl make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OperatorImpl make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OperatorImpl make shared failed"); return; } @@ -525,7 +525,7 @@ GE_FUNC_HOST_VISIBILITY Operator::Operator(const AscendString &name, const Ascen std::string op_type = type.GetString(); operator_impl_ = ComGraphMakeShared(op_name, op_type); if (operator_impl_ == nullptr) { - REPORT_CALL_ERROR("E18888", "OperatorImpl make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OperatorImpl make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OperatorImpl make shared failed"); return; } @@ -541,7 +541,7 @@ GE_FUNC_HOST_VISIBILITY Operator::Operator(const char_t *name, const char_t *typ std::string op_type = type; operator_impl_ = ComGraphMakeShared(op_name, op_type); if (operator_impl_ == nullptr) { - REPORT_CALL_ERROR("E18888", "OperatorImpl make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OperatorImpl make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OperatorImpl make shared failed"); return; } @@ -577,17 +577,19 @@ graphStatus Operator::GetName(AscendString &name) const { GE_FUNC_HOST_VISIBILITY Operator &Operator::SetInput(const std::string &dst_name, const ge::Operator &src_oprt) { // Describe the connection relationship between operators, no create action - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator impl is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator impl is nullptr, check invalid."); return *this, "[Check][Param] operator impl is nullptr."); operator_impl_->SetInputImpl(dst_name, src_oprt); return *this; } GE_FUNC_HOST_VISIBILITY Operator &Operator::SetInput(const char_t *dst_name, const ge::Operator &src_oprt) { - GE_CHK_BOOL_EXEC(dst_name != nullptr, REPORT_INNER_ERROR("E18888", "param dst name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(dst_name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param dst name is nullptr, check invalid"); return *this, "[Check][Param] Operator dst name is nullptr."); // Describe the connection relationship between operators, no create action - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); return *this, "[Check][Param] Operator impl is nullptr."); const std::string dst_op_name = dst_name; operator_impl_->SetInputImpl(dst_op_name, src_oprt); @@ -600,11 +602,12 @@ Operator &Operator::SetInput(const std::string &dst_name, const ge::OutHandler & Operator &Operator::SetInput(const char_t *dst_name, const ge::OutHandler &out_handler) { if (dst_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator dst_name is nullptr."); return *this; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); return *this, "[Check][Param] operator impl is nullptr."); operator_impl_->SetInputImpl(dst_name, out_handler); return *this; @@ -615,13 +618,13 @@ Operator &Operator::SetInput(const std::string &dst_name, const ge::Operator &sr } Operator &Operator::SetInput(const char_t *dst_name, const ge::Operator &src_oprt, const char_t *name) { - GE_CHK_BOOL_EXEC(dst_name != nullptr, REPORT_INNER_ERROR("E18888", "param dst_name is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(dst_name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param dst_name is nullptr, check invalid."); return *this, "[Check][Param] Dst name is nullptr."); - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); return *this, "[Check][Param] Name is nullptr."); const auto out_handler = src_oprt.GetOutput(name); GE_CHK_BOOL_EXEC(out_handler != nullptr, - REPORT_INNER_ERROR("E18888", "GetOutput by name:%s failed, out_handler is nullptr.", name); + REPORT_INNER_ERR_MSG("E18888", "GetOutput by name:%s failed, out_handler is nullptr.", name); return *this, "[Get][Output] by name:%s failed, out_handler is nullptr.", name); return SetInput(dst_name, out_handler); } @@ -631,11 +634,11 @@ Operator &Operator::SetInput(const std::string &dst_name, const ge::Operator &sr } Operator &Operator::SetInput(const char_t *dst_name, const ge::Operator &src_oprt, uint32_t index) { - GE_CHK_BOOL_EXEC(dst_name != nullptr, REPORT_INNER_ERROR("E18888", "param dst_name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(dst_name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param dst_name is nullptr, check invalid"); return *this, "[Check][Param] Dst name is nullptr."); const auto out_handler = src_oprt.GetOutput(index); GE_CHK_BOOL_EXEC(out_handler != nullptr, - REPORT_INNER_ERROR("E18888", "GetOutput by index:%u failed, out_handler is nullptr.", index); + REPORT_INNER_ERR_MSG("E18888", "GetOutput by index:%u failed, out_handler is nullptr.", index); return *this, "[Get][Output] by index:%u failed, out_handler is nullptr.", index); return SetInput(dst_name, out_handler); } @@ -643,13 +646,13 @@ Operator &Operator::SetInput(const char_t *dst_name, const ge::Operator &src_opr Operator &Operator::SetInput(uint32_t dst_index, const Operator &src_oprt, uint32_t src_index) { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { const char_t *invalid_obj_name = ((operator_impl_ == nullptr) ? "operator" : "op desc"); - REPORT_INNER_ERROR("E18888", "%s impl is nullptr, check invalid.", invalid_obj_name); + REPORT_INNER_ERR_MSG("E18888", "%s impl is nullptr, check invalid.", invalid_obj_name); GELOGE(ge::FAILED, "[Check][Param] %s impl is nullptr.", invalid_obj_name); return *this; } std::string dst_name = operator_impl_->GetOpDescImpl()->GetInputNameByIndex(dst_index); if (dst_name.empty()) { - REPORT_INNER_ERROR("E18888", "Set by dst_index:%u failed, dst_index is invalid.", dst_index); + REPORT_INNER_ERR_MSG("E18888", "Set by dst_index:%u failed, dst_index is invalid.", dst_index); GELOGE(ge::FAILED, "[GetInputNameByIndex] by index:%u failed, dst_index is invalid.", dst_index); return *this; } @@ -658,7 +661,7 @@ Operator &Operator::SetInput(uint32_t dst_index, const Operator &src_oprt, uint3 Operator &Operator::AddControlInput(const Operator &src_oprt) { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator impl is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); return *this; } @@ -695,12 +698,12 @@ graphStatus Operator::GetInputConstDataOut(const std::string &dst_name, Tensor & graphStatus Operator::GetInputConstDataOut(const char_t *dst_name, Tensor &data) const { GE_CHECK_NOTNULL(operator_impl_); if (dst_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator dst_name is nullptr."); return GRAPH_FAILED; } if (operator_impl_->GetInputConstDataOut(dst_name, data) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "%s get input const data out failed", dst_name); + REPORT_INNER_ERR_MSG("E18888", "%s get input const data out failed", dst_name); GELOGE(GRAPH_FAILED, "[Get][Tensor] %s get input const data out failed", dst_name); return GRAPH_FAILED; } @@ -708,46 +711,49 @@ graphStatus Operator::GetInputConstDataOut(const char_t *dst_name, Tensor &data) } std::shared_ptr Operator::GetNode() const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return nullptr, "[Check][Param] operator impl is nullptr."); return operator_impl_->GetNode(); } TensorDesc Operator::GetInputDesc(const std::string &name) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] operator impl is nullptr."); return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetInputDesc(name)); } TensorDesc Operator::GetInputDescByName(const char_t *name) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetInputDesc(op_name)); } void Operator::SetInferenceContext(const InferenceContextPtr &inference_context) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); operator_impl_->SetInferenceContext(inference_context); } InferenceContextPtr Operator::GetInferenceContext() const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return nullptr, "[Check][Param] operator impl is nullptr."); return operator_impl_->GetInferenceContext(); } TensorDesc Operator::GetInputDesc(uint32_t index) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] operator impl is nullptr."); return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetInputDesc(index)); } graphStatus Operator::TryGetInputDesc(const std::string &name, TensorDesc &tensor_desc) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); const auto check = operator_impl_->InputIsSet(name); if (check) { @@ -757,9 +763,10 @@ graphStatus Operator::TryGetInputDesc(const std::string &name, TensorDesc &tenso } graphStatus Operator::TryGetInputDesc(const char_t *name, TensorDesc &tensor_desc) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; const auto check = operator_impl_->InputIsSet(op_name); @@ -770,15 +777,17 @@ graphStatus Operator::TryGetInputDesc(const char_t *name, TensorDesc &tensor_des } graphStatus Operator::UpdateInputDesc(const std::string &name, const ge::TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); return operator_impl_->UpdateInputDesc(name, TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc)); } graphStatus Operator::UpdateInputDesc(const char_t *name, const ge::TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return operator_impl_->UpdateInputDesc(op_name, TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc)); @@ -790,81 +799,91 @@ OutHandler Operator::GetOutput(const std::string &name) const { OutHandler Operator::GetOutput(const char_t *name) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return nullptr; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return nullptr, "[Check][Param] operator impl is nullptr."); return operator_impl_->GetOutput(name); } OutHandler Operator::GetOutput(uint32_t index) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return nullptr, "[Check][Param] operator impl is nullptr."); return operator_impl_->GetOutput(index); } TensorDesc Operator::GetOutputDesc(const std::string &name) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] operator impl is nullptr."); return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetOutputDesc(name)); } TensorDesc Operator::GetOutputDescByName(const char_t *name) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetOutputDesc(op_name)); } TensorDesc Operator::GetOutputDesc(uint32_t index) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] operator impl is nullptr."); return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetOutputDesc(index)); } graphStatus Operator::UpdateOutputDesc(const std::string &name, const ge::TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); return operator_impl_->UpdateOutputDesc(name, TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc)); } graphStatus Operator::UpdateOutputDesc(const char_t *name, const ge::TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return operator_impl_->UpdateOutputDesc(op_name, TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc)); } TensorDesc Operator::GetDynamicInputDesc(const std::string &name, uint32_t index) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] operator impl is nullptr."); return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetInputDesc(name + std::to_string(index))); } TensorDesc Operator::GetDynamicInputDesc(const char_t *name, uint32_t index) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetInputDesc(op_name + std::to_string(index))); } graphStatus Operator::UpdateDynamicInputDesc(const std::string &name, uint32_t index, const TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); return operator_impl_->UpdateInputDesc(name + std::to_string(index), TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc)); } graphStatus Operator::UpdateDynamicInputDesc(const char_t *name, uint32_t index, const TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); const std::string op_name = name; return operator_impl_->UpdateInputDesc(op_name + std::to_string(index), @@ -872,31 +891,35 @@ graphStatus Operator::UpdateDynamicInputDesc(const char_t *name, uint32_t index, } TensorDesc Operator::GetDynamicOutputDesc(const std::string &name, uint32_t index) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] operator impl is nullptr."); return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetOutputDesc(name + std::to_string(index))); } TensorDesc Operator::GetDynamicOutputDesc(const char_t *name, uint32_t index) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return TensorDesc(), "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return TensorAdapter::GeTensorDesc2TensorDesc(operator_impl_->GetOutputDesc(op_name + std::to_string(index))); } graphStatus Operator::UpdateDynamicOutputDesc(const std::string &name, uint32_t index, const TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); return operator_impl_->UpdateOutputDesc(name + std::to_string(index), TensorAdapter::TensorDesc2GeTensorDesc(tensor_desc)); } graphStatus Operator::UpdateDynamicOutputDesc(const char_t *name, uint32_t index, const TensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; return operator_impl_->UpdateOutputDesc(op_name + std::to_string(index), @@ -904,20 +927,22 @@ graphStatus Operator::UpdateDynamicOutputDesc(const char_t *name, uint32_t index } graphStatus Operator::InferShapeAndType() { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return GRAPH_FAILED, "[Get][OpDescImpl] is nullptr."); return OpDescUtilsEx::CallInferFunc(operator_impl_->GetOpDescImpl(), *this); } graphStatus Operator::VerifyAllAttr(bool disable_common_verifier) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return GRAPH_FAILED, "[Get][OpDescImpl] is nullptr."); if ((!disable_common_verifier) && (static_cast(Operator::VerifyAll()) == GRAPH_FAILED)) { @@ -928,13 +953,15 @@ graphStatus Operator::VerifyAllAttr(bool disable_common_verifier) { } GE_FUNC_HOST_VISIBILITY size_t Operator::GetInputsSize() const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return 0UL, "[Check][Param] OperatorImpl_ is nullptr"); return static_cast(operator_impl_->GetInputsSize()); } GE_FUNC_HOST_VISIBILITY size_t Operator::GetOutputsSize() const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return 0UL, "[Check][Param] OperatorImpl_ is nullptr"); return static_cast(operator_impl_->GetOutputsSize()); } @@ -963,10 +990,11 @@ const std::map kIrAttrTypesMap = { const std::map Operator::GetAllAttrNamesAndTypes() const { std::map attr_types; - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return attr_types, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return attr_types, "[Get][OpDescImpl] is nullptr."); const std::map attr_map = operator_impl_->GetOpDescImpl()->GetAllAttrs(); for (const auto &iter : attr_map) { @@ -979,10 +1007,11 @@ const std::map Operator::GetAllAttrNamesAndTypes() con } graphStatus Operator::GetAllAttrNamesAndTypes(std::map &attr_name_types) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return GRAPH_FAILED, "[Get][OpDescImpl] is nullptr."); const std::map attr_map = operator_impl_->GetOpDescImpl()->GetAllAttrs(); @@ -1027,14 +1056,15 @@ void Operator::InputRegister(const std::string &name) { void Operator::InputRegister(const char_t *name) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); (void)operator_impl_->GetOpDescImpl()->AddInputDesc(name, GeTensorDesc()); operator_impl_->GetOpDescImpl()->AppendIrInput(name, kIrInputRequired); @@ -1055,14 +1085,15 @@ void Operator::OptionalInputRegister(const std::string &name) { void Operator::OptionalInputRegister(const char_t *name) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); // [No need to verify return value] (void)operator_impl_->GetOpDescImpl()->AddOptionalInputDesc(name, @@ -1080,30 +1111,33 @@ void Operator::OptionalInputRegister(const char_t *name, const char_t *datatype_ } void Operator::InferFuncRegister(const std::function &func) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); // [No need to verify return value] (void)operator_impl_->GetOpDescImpl()->AddInferFunc(func); } void Operator::InferFormatFuncRegister(const std::function &func) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); // [No need to verify return value] (void)operator_impl_->GetOpDescImpl()->AddInferFormatFunc(func); } void Operator::VerifierFuncRegister(const std::function &func) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); // [No need to verify return value] (void)operator_impl_->GetOpDescImpl()->AddVerifierFunc(func); @@ -1115,14 +1149,15 @@ void Operator::OutputRegister(const std::string &name) { void Operator::OutputRegister(const char_t *name) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); // [No need to verify return value] (void)operator_impl_->GetOpDescImpl()->AddOutputDesc(name, GeTensorDesc()); @@ -1144,21 +1179,21 @@ void Operator::DynamicInputRegister(const std::string &name, const uint32_t num, void Operator::DynamicInputRegister(const char_t *name, const uint32_t num, bool is_push_back) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); GE_CHK_BOOL_EXEC(AttrUtils::SetInt(operator_impl_->GetOpDescImpl(), DYNAMIC_INPUT_TD_NUM(std::string(name)), static_cast(num)), - REPORT_INNER_ERROR("E18888", "set attr %s to op:%s failed.", name, - operator_impl_->GetOpDescImpl()->GetName().c_str()); - return, "[Set][Int] %s to op:%s failed", name, - operator_impl_->GetOpDescImpl()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "set attr %s to op:%s failed.", name, + operator_impl_->GetOpDescImpl()->GetName().c_str()); + return, "[Set][Int] %s to op:%s failed", name, operator_impl_->GetOpDescImpl()->GetName().c_str()); (void)operator_impl_->GetOpDescImpl()->AddDynamicInputDesc(name, num, is_push_back); if (num == 0U) { operator_impl_->GetOpDescImpl()->AppendIrInput(name, kIrInputDynamic); @@ -1171,14 +1206,15 @@ void Operator::DynamicInputRegisterByIndex(const std::string &name, const uint32 void Operator::DynamicInputRegisterByIndex(const char_t *name, const uint32_t num, size_t index) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); (void)(operator_impl_->GetOpDescImpl()->AddDynamicInputDescByIndex(name, num, index)); } @@ -1188,17 +1224,18 @@ int32_t Operator::GetDynamicInputNum(const std::string &name) const { } int32_t Operator::GetDynamicInputNum(const char_t *name) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return 0, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return 0, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return 0, "[Get][OpDescImpl] is nullptr."); const std::string op_name = name; int32_t num = 0; GE_CHK_BOOL_EXEC(AttrUtils::GetInt(operator_impl_->GetOpDescImpl(), DYNAMIC_INPUT_TD_NUM(op_name), num), - REPORT_INNER_ERROR("E18888", "get attr %s failed, op:%s.", op_name.c_str(), + REPORT_INNER_ERR_MSG("E18888", "get attr %s failed, op:%s.", op_name.c_str(), operator_impl_->GetOpDescImpl()->GetName().c_str()); return num, "[Get][Int] %s failed", op_name.c_str()); return num; @@ -1210,18 +1247,19 @@ void Operator::DynamicOutputRegister(const std::string &name, const uint32_t num void Operator::DynamicOutputRegister(const char_t *name, const uint32_t num, bool is_push_back) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); GE_CHK_BOOL_EXEC(AttrUtils::SetInt(operator_impl_->GetOpDescImpl(), DYNAMIC_OUTPUT_TD_NUM(std::string(name)), static_cast(num)), - REPORT_INNER_ERROR("E18888", "set attr %s to op:%s failed.", name, + REPORT_INNER_ERR_MSG("E18888", "set attr %s to op:%s failed.", name, operator_impl_->GetOpDescImpl()->GetName().c_str()); return, "[Set][Int] %s to op:%s failed", name, operator_impl_->GetOpDescImpl()->GetName().c_str()); @@ -1236,18 +1274,19 @@ int32_t Operator::GetDynamicOutputNum(const std::string &name) const { } int32_t Operator::GetDynamicOutputNum(const char_t *name) const { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); return 0, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return 0, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return 0, "[Get][OpDescImpl] is nullptr."); const std::string op_name = name; int32_t num = 0; GE_CHK_BOOL_EXEC(AttrUtils::GetInt(operator_impl_->GetOpDescImpl(), DYNAMIC_OUTPUT_TD_NUM(op_name), num), - REPORT_INNER_ERROR("E18888", "get attr %s failed, op:%s.", op_name.c_str(), - operator_impl_->GetOpDescImpl()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "get attr %s failed, op:%s.", op_name.c_str(), + operator_impl_->GetOpDescImpl()->GetName().c_str()); return num, "[Get][Init] %s failed", op_name.c_str()); return num; } @@ -1258,14 +1297,15 @@ void Operator::RequiredAttrRegister(const std::string &name) { void Operator::RequiredAttrRegister(const char_t *name) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return, "[Get][OpDescImpl] is nullptr."); (void)(operator_impl_->GetOpDescImpl()->AddRequiredAttr(name)); operator_impl_->GetOpDescImpl()->AppendIrAttrName(name); @@ -1273,7 +1313,7 @@ void Operator::RequiredAttrRegister(const char_t *name) { void Operator::RequiredAttrWithTypeRegister(const char_t *name, const char_t *type) { if ((name == nullptr) || (operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "param is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] param is nullptr."); return; } @@ -1312,10 +1352,11 @@ void Operator::DataTypeRegister(const char_t *datatype_symbol, const Promote &pr } graphStatus Operator::VerifyAll() { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); GE_CHK_BOOL_EXEC(operator_impl_->GetOpDescImpl() != nullptr, - REPORT_INNER_ERROR("E18888", "GetOpDescImpl failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescImpl failed, as return nullptr."); return GRAPH_FAILED, "[Get][OpDescImpl] is nullptr."); // Check all inputs defined @@ -1342,13 +1383,13 @@ graphStatus Operator::VerifyAll() { } std::string Operator::GetOpType() const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return "Data", "[Check][Param] operator impl is nullptr."); return OperatorImpl::GetOpDesc(*this)->GetType(); } graphStatus Operator::GetOpType(AscendString &type) const { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); const std::string op_type = OperatorImpl::GetOpDesc(*this)->GetType(); type = op_type.c_str(); @@ -1361,7 +1402,7 @@ Operator &Operator::SetInput(const std::string &dst_name, uint32_t dst_index, co Operator &Operator::SetInput(const char_t *dst_name, uint32_t dst_index, const ge::Operator &src_oprt) { if (dst_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator dst_name is nullptr."); return *this; } @@ -1377,12 +1418,12 @@ Operator &Operator::SetInput(const std::string &dst_name, uint32_t dst_index, co Operator &Operator::SetInput(const char_t *dst_name, uint32_t dst_index, const ge::Operator &src_oprt, const char_t *name) { if (dst_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator dst_name is nullptr."); return *this; } if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } @@ -1520,12 +1561,12 @@ void Operator::AttrRegister(const std::string &name, const vector &a void Operator::AttrRegister(const std::string &name, const AscendString &attr_value) { if (attr_value.GetString() == nullptr) { - REPORT_INNER_ERROR("E18888", "Attr %s register param is invalid.", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Attr %s register param is invalid.", name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Attr %s register param is invalid.", name.c_str()); return; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name.c_str()); return; } @@ -1537,18 +1578,18 @@ void Operator::AttrRegister(const std::string &name, const AscendString &attr_va void Operator::AttrRegister(const char_t *name, const AscendString &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } const std::string op_name = name; if (attr_value.GetString() == nullptr) { - REPORT_INNER_ERROR("E18888", "Attr %s register param is invalid.", name); + REPORT_INNER_ERR_MSG("E18888", "Attr %s register param is invalid.", name); GELOGE(GRAPH_FAILED, "[Check][Param] Attr %s register param is invalid.", name); return; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", op_name.c_str()); return; } @@ -1565,21 +1606,21 @@ void Operator::AttrRegister(const std::string &name, const std::vector &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } std::vector str_attr_values; for (auto &val : attr_value) { if (val.GetString() == nullptr) { - REPORT_INNER_ERROR("E18888", "Attr %s register value is invalid.", name); + REPORT_INNER_ERR_MSG("E18888", "Attr %s register value is invalid.", name); GELOGE(GRAPH_FAILED, "Attr %s register value is invalid.", name); return; } str_attr_values.emplace_back(val.GetString()); } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return; } @@ -1591,12 +1632,12 @@ void Operator::AttrRegister(const char_t *name, const std::vector void Operator::AttrRegister(const char_t *name, const AttrValue &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return; } @@ -1606,7 +1647,7 @@ void Operator::AttrRegister(const char_t *name, const AttrValue &attr_value) { Operator &Operator::SetAttr(const std::string &name, const std::string &attr_value) { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name.c_str()); return *this; } @@ -1618,7 +1659,7 @@ Operator &Operator::SetAttr(const std::string &name, const std::string &attr_val graphStatus Operator::GetAttr(const std::string &name, std::string &attr_value) const { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name.c_str()); return GRAPH_FAILED; } @@ -1631,7 +1672,7 @@ graphStatus Operator::GetAttr(const std::string &name, std::string &attr_value) Operator &Operator::SetAttr(const std::string &name, const std::vector &attr_value) { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name.c_str()); return *this; } @@ -1643,7 +1684,7 @@ Operator &Operator::SetAttr(const std::string &name, const std::vector &attr_value) const { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name.c_str()); return GRAPH_FAILED; } @@ -1656,13 +1697,13 @@ graphStatus Operator::GetAttr(const std::string &name, std::vector Operator &Operator::SetAttr(const char_t *name, const char_t *attr_value) { if ((name == nullptr) || (attr_value == nullptr)) { - REPORT_INNER_ERROR("E18888", "param name is nullptr or attr_value is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr or attr_value is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1676,12 +1717,12 @@ Operator &Operator::SetAttr(const char_t *name, const char_t *attr_value) { Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const char_t *attr_value) { if ((name == nullptr) || (attr_value == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1689,7 +1730,7 @@ Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const const std::string op_attr_value = attr_value; auto tensor = operator_impl_->MutableInputDesc(index); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); return *this; } @@ -1701,12 +1742,12 @@ Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, const char_t *attr_value) { if ((dst_name == nullptr) || (name == nullptr) || (attr_value == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1714,7 +1755,7 @@ Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, con const std::string op_attr_value = attr_value; auto tensor = operator_impl_->MutableInputDesc(dst_name); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); return *this; } @@ -1726,12 +1767,12 @@ Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, con Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const char_t *attr_value) { if ((name == nullptr) || (attr_value == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1739,7 +1780,7 @@ Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const const std::string op_attr_value = attr_value; auto tensor = operator_impl_->MutableOutputDesc(index); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); return *this; } @@ -1751,12 +1792,12 @@ Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, const char_t *attr_value) { if ((dst_name == nullptr) || (name == nullptr) || (attr_value == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator output parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1764,7 +1805,7 @@ Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, co const std::string op_attr_value = attr_value; auto tensor = operator_impl_->MutableOutputDesc(dst_name); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); return *this; } @@ -1776,12 +1817,12 @@ Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, co Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const AscendString &attr_value) { if ((name == nullptr) || (attr_value.GetString() == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1789,7 +1830,7 @@ Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const const std::string op_attr_value = attr_value.GetString(); auto tensor = operator_impl_->MutableInputDesc(index); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); return *this; } @@ -1801,12 +1842,12 @@ Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, const AscendString &attr_value) { if ((dst_name == nullptr) || (name == nullptr) || (attr_value.GetString() == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1814,7 +1855,7 @@ Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, con const std::string op_attr_value = attr_value.GetString(); auto tensor = operator_impl_->MutableInputDesc(dst_name); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); return *this; } @@ -1826,12 +1867,12 @@ Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, con Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const std::vector &attr_value) { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, check invalid"); return *this; } if (SetTensorAttr(operator_impl_->MutableInputDesc(index), name, attr_value) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Set input attr failed, input index[%d], please check.", index); + REPORT_INNER_ERR_MSG("E18888", "Set input attr failed, input index[%d], please check.", index); GELOGE(GRAPH_FAILED, "[Set][InputAttr] failed, input index[%d], please check.", index); return *this; } @@ -1841,12 +1882,12 @@ Operator &Operator::SetInputAttr(const int32_t index, const char_t *name, const Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const std::vector &attr_value) { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, check invalid"); return *this; } if (SetTensorAttr(operator_impl_->MutableOutputDesc(index), name, attr_value) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Set output attr failed, output index[%d], please check.", index); + REPORT_INNER_ERR_MSG("E18888", "Set output attr failed, output index[%d], please check.", index); GELOGE(GRAPH_FAILED, "[Set][OutputAttr] failed, output index[%d], please check.", index); return *this; } @@ -1856,12 +1897,12 @@ Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, const std::vector &attr_value) { if ((operator_impl_ == nullptr) || (dst_name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator impl or dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl or dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl or dst_name is nullptr, check invalid"); return *this; } if (SetTensorAttr(operator_impl_->MutableInputDesc(dst_name), name, attr_value) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Set input attr failed, input dst_name[%s], please check.", dst_name); + REPORT_INNER_ERR_MSG("E18888", "Set input attr failed, input dst_name[%s], please check.", dst_name); GELOGE(GRAPH_FAILED, "[Set][InputAttr] failed, input dst_name[%s], please check.", dst_name); return *this; } @@ -1871,12 +1912,12 @@ Operator &Operator::SetInputAttr(const char_t *dst_name, const char_t *name, Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, const std::vector &attr_value) { if ((operator_impl_ == nullptr) || (dst_name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator impl or dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl or dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl or dst_name is nullptr, check invalid"); return *this; } if (SetTensorAttr(operator_impl_->MutableOutputDesc(dst_name), name, attr_value) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Set output attr failed, output dst_name[%s], please check.", dst_name); + REPORT_INNER_ERR_MSG("E18888", "Set output attr failed, output dst_name[%s], please check.", dst_name); GELOGE(GRAPH_FAILED, "[Set][OutputAttr] failed, output dst_name[%s], please check.", dst_name); return *this; } @@ -1886,7 +1927,7 @@ Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, graphStatus Operator::GetInputAttr(const char_t *dst_name, const char_t *name, std::vector &attr_value) const { if ((operator_impl_ == nullptr) || (dst_name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator impl or dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl or dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl or dst_name is nullptr, check invalid"); return GRAPH_FAILED; }; @@ -1898,7 +1939,7 @@ graphStatus Operator::GetInputAttr(const char_t *dst_name, const char_t *name, graphStatus Operator::GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector &attr_value) const { if ((operator_impl_ == nullptr) || (dst_name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator impl or dst_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl or dst_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl or dst_name is nullptr, check invalid"); return GRAPH_FAILED; } @@ -1910,7 +1951,7 @@ graphStatus Operator::GetOutputAttr(const char_t *dst_name, const char_t *name, graphStatus Operator::GetInputAttr(const int32_t index, const char_t *name, std::vector &attr_value) const { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, check invalid"); return GRAPH_FAILED; } @@ -1922,7 +1963,7 @@ graphStatus Operator::GetInputAttr(const int32_t index, const char_t *name, graphStatus Operator::GetOutputAttr(const int32_t index, const char_t *name, std::vector &attr_value) const { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, check invalid"); return GRAPH_FAILED; } @@ -1933,12 +1974,12 @@ graphStatus Operator::GetOutputAttr(const int32_t index, const char_t *name, Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const AscendString &attr_value) { if ((name == nullptr) || (attr_value.GetString() == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator output parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1946,7 +1987,7 @@ Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const const std::string op_attr_value = attr_value.GetString(); auto tensor = operator_impl_->MutableOutputDesc(index); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%d] of op[%s] failed, check invalid", index, op_name.c_str()); return *this; } @@ -1958,12 +1999,12 @@ Operator &Operator::SetOutputAttr(const int32_t index, const char_t *name, const Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, const AscendString &attr_value) { if ((dst_name == nullptr) || (name == nullptr) || (attr_value.GetString() == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator output parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -1971,7 +2012,7 @@ Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, co const std::string op_attr_value = attr_value.GetString(); auto tensor = operator_impl_->MutableOutputDesc(dst_name); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get index[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); return *this; } @@ -1983,12 +2024,12 @@ Operator &Operator::SetOutputAttr(const char_t *dst_name, const char_t *name, co graphStatus Operator::GetOutputAttr(const char_t *dst_name, const char_t *name, AscendString &attr_value) const { if ((dst_name == nullptr) || (name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator name parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator name parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator output parameters is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -1996,7 +2037,7 @@ graphStatus Operator::GetOutputAttr(const char_t *dst_name, const char_t *name, std::string op_attr_value; auto tensor = operator_impl_->MutableOutputDesc(dst_name); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get output[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); return GRAPH_FAILED; } @@ -2010,12 +2051,12 @@ graphStatus Operator::GetOutputAttr(const char_t *dst_name, const char_t *name, graphStatus Operator::GetInputAttr(const char_t *dst_name, const char_t *name, AscendString &attr_value) const { if ((dst_name == nullptr) || (name == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator name parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator name parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2023,7 +2064,7 @@ graphStatus Operator::GetInputAttr(const char_t *dst_name, const char_t *name, A std::string op_attr_value; auto tensor = operator_impl_->MutableInputDesc(dst_name); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get input[%s] of op[%s] failed, check invalid", dst_name, op_name.c_str()); return GRAPH_FAILED; } @@ -2037,12 +2078,12 @@ graphStatus Operator::GetInputAttr(const char_t *dst_name, const char_t *name, A graphStatus Operator::GetInputAttr(const int32_t index, const char_t *name, AscendString &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator name parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator name parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2050,7 +2091,7 @@ graphStatus Operator::GetInputAttr(const int32_t index, const char_t *name, Asce std::string op_attr_value; auto tensor = operator_impl_->MutableInputDesc(index); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get input[%d] of op[%s] failed, check invalid", index, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get input[%d] of op[%s] failed, check invalid", index, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get input[%d] of op[%s] failed, check invalid", index, op_name.c_str()); return GRAPH_FAILED; } @@ -2064,12 +2105,12 @@ graphStatus Operator::GetInputAttr(const int32_t index, const char_t *name, Asce graphStatus Operator::GetOutputAttr(const int32_t index, const char_t *name, AscendString &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator output parameters is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2077,7 +2118,7 @@ graphStatus Operator::GetOutputAttr(const int32_t index, const char_t *name, Asc std::string op_attr_value; auto tensor = operator_impl_->MutableOutputDesc(index); if (tensor == nullptr) { - REPORT_INNER_ERROR("E18888", "Get output[%d] of op[%s] failed, check invalid", index, op_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get output[%d] of op[%s] failed, check invalid", index, op_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Get output[%d] of op[%s] failed, check invalid", index, op_name.c_str()); return GRAPH_FAILED; } @@ -2091,12 +2132,12 @@ graphStatus Operator::GetOutputAttr(const int32_t index, const char_t *name, Asc Operator &Operator::SetAttr(const char_t *name, const AscendString &attr_value) { if ((name == nullptr) || (attr_value.GetString() == nullptr)) { - REPORT_INNER_ERROR("E18888", "Operator input parameters is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator input parameters is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -2110,12 +2151,12 @@ Operator &Operator::SetAttr(const char_t *name, const AscendString &attr_value) graphStatus Operator::GetAttr(const char_t *name, AscendString &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator input parameters name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator input parameters name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator input parameters is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2131,21 +2172,21 @@ graphStatus Operator::GetAttr(const char_t *name, AscendString &attr_value) cons Operator &Operator::SetAttr(const char_t *name, const std::vector &attr_values) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator input parameters name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator input parameters name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } std::vector op_attr_values; for (auto &attr_value : attr_values) { if (attr_value.GetString() == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator ascend std::string name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator ascend std::string name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator ascend std::string name is nullptr."); return *this; } op_attr_values.emplace_back(attr_value.GetString()); } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -2158,12 +2199,12 @@ Operator &Operator::SetAttr(const char_t *name, const std::vector graphStatus Operator::GetAttr(const char_t *name, std::vector &attr_values) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator input parameters name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Operator input parameters name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2181,7 +2222,7 @@ graphStatus Operator::GetAttr(const char_t *name, std::vector &att Operator &Operator::SetAttr(const std::string &name, const Tensor &attr_value) { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); return *this; } @@ -2194,12 +2235,12 @@ Operator &Operator::SetAttr(const std::string &name, const Tensor &attr_value) { Operator &Operator::SetAttr(const char_t *name, const Tensor &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); return *this; } @@ -2213,7 +2254,7 @@ Operator &Operator::SetAttr(const char_t *name, const Tensor &attr_value) { Operator &Operator::SetAttr(const std::string &name, const std::vector &attr_value) { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); return *this; } @@ -2230,12 +2271,12 @@ Operator &Operator::SetAttr(const std::string &name, const std::vector & Operator &Operator::SetAttr(const char_t *name, const std::vector &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -2253,7 +2294,7 @@ Operator &Operator::SetAttr(const char_t *name, const std::vector &attr_ graphStatus Operator::GetAttr(const std::string &name, Tensor &attr_value) const { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); return GRAPH_FAILED; } @@ -2268,12 +2309,12 @@ graphStatus Operator::GetAttr(const std::string &name, Tensor &attr_value) const graphStatus Operator::GetAttr(const char_t *name, Tensor &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2290,7 +2331,7 @@ graphStatus Operator::GetAttr(const char_t *name, Tensor &attr_value) const { graphStatus Operator::GetAttr(const std::string &name, std::vector &attr_value) const { attr_value.clear(); if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); return GRAPH_FAILED; } @@ -2307,13 +2348,13 @@ graphStatus Operator::GetAttr(const std::string &name, std::vector &attr graphStatus Operator::GetAttr(const char_t *name, std::vector &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return GRAPH_FAILED; } attr_value.clear(); if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2331,7 +2372,7 @@ graphStatus Operator::GetAttr(const char_t *name, std::vector &attr_valu Operator &Operator::SetAttr(const std::string &name, const OpBytes &attr_value) { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); return *this; } @@ -2344,12 +2385,12 @@ Operator &Operator::SetAttr(const std::string &name, const OpBytes &attr_value) Operator &Operator::SetAttr(const char_t *name, const OpBytes &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -2363,7 +2404,7 @@ Operator &Operator::SetAttr(const char_t *name, const OpBytes &attr_value) { graphStatus Operator::GetAttr(const std::string &name, OpBytes &attr_value) const { if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", name.c_str()); return GRAPH_FAILED; } @@ -2374,7 +2415,7 @@ graphStatus Operator::GetAttr(const std::string &name, OpBytes &attr_value) cons } attr_value.clear(); if (buffer.data() == nullptr) { - REPORT_CALL_ERROR("E18888", "buffer data is null, op:%s", operator_impl_->GetOpDescImpl()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "buffer data is null, op:%s", operator_impl_->GetOpDescImpl()->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] buffer data is null."); return GRAPH_FAILED; } @@ -2384,12 +2425,12 @@ graphStatus Operator::GetAttr(const std::string &name, OpBytes &attr_value) cons graphStatus Operator::GetAttr(const char_t *name, OpBytes &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2401,7 +2442,7 @@ graphStatus Operator::GetAttr(const char_t *name, OpBytes &attr_value) const { } attr_value.clear(); if (buffer.data() == nullptr) { - REPORT_CALL_ERROR("E18888", "buffer data is null, op:%s", operator_impl_->GetOpDescImpl()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "buffer data is null, op:%s", operator_impl_->GetOpDescImpl()->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] buffer data is null."); return GRAPH_FAILED; } @@ -2410,16 +2451,17 @@ graphStatus Operator::GetAttr(const char_t *name, OpBytes &attr_value) const { } Operator &Operator::SetAttr(const std::string &name, ge::AttrValue &&attr_value) { - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); return *this, "[Check][Param] Operator impl is nullptr."); (void)operator_impl_->SetAttr(name, std::move(attr_value.impl->geAttrValue_)); return *this; } Operator &Operator::SetAttr(const char_t *name, ge::AttrValue &&attr_value) { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); return *this, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); return *this, "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; (void)operator_impl_->SetAttr(op_name, std::move(attr_value.impl->geAttrValue_)); @@ -2427,9 +2469,10 @@ Operator &Operator::SetAttr(const char_t *name, ge::AttrValue &&attr_value) { } Operator &Operator::SetAttr(const char_t *name, const ge::AttrValue &attr_value) { - GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(name != nullptr, REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); return *this, "[Check][Param] Operator name is nullptr."); - GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(operator_impl_ != nullptr, + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); return *this, "[Check][Param] Operator impl is nullptr."); const std::string op_name = name; (void)operator_impl_->SetAttr(op_name, attr_value.impl->geAttrValue_); @@ -2453,12 +2496,12 @@ Operator &Operator::SetAttr(const std::string &name, const std::vector &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (!operator_impl_->GetOpDescImpl())) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -2475,13 +2518,13 @@ graphStatus Operator::GetAttr(const std::string &name, std::vector graphStatus Operator::GetAttr(const char_t *name, std::vector &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return GRAPH_FAILED; } attr_value.clear(); if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2499,12 +2542,12 @@ Operator &Operator::SetAttr(const std::string &name, const ge::DataType &attr_va Operator &Operator::SetAttr(const char_t *name, const ge::DataType &attr_value) { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return *this; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return *this; } @@ -2521,12 +2564,12 @@ graphStatus Operator::GetAttr(const std::string &name, ge::DataType &attr_value) graphStatus Operator::GetAttr(const char_t *name, ge::DataType &attr_value) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return GRAPH_FAILED; } if ((operator_impl_ == nullptr) || (operator_impl_->GetOpDescImpl() == nullptr)) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr or opdesc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr, name %s.", name); return GRAPH_FAILED; } @@ -2620,12 +2663,12 @@ void Operator::SubgraphRegister(const std::string &ir_name, bool dynamic) { void Operator::SubgraphRegister(const char_t *ir_name, bool dynamic) { if (ir_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", ir_name); return; } @@ -2638,12 +2681,12 @@ void Operator::SubgraphCountRegister(const std::string &ir_name, uint32_t count) void Operator::SubgraphCountRegister(const char_t *ir_name, uint32_t count) { if (ir_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return; } if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", ir_name); return; } @@ -2656,12 +2699,12 @@ void Operator::SetSubgraphBuilder(const std::string &ir_name, uint32_t index, co void Operator::SetSubgraphBuilder(const char_t *ir_name, uint32_t index, const SubgraphBuilder &builder) { if (ir_name == nullptr) { - REPORT_INNER_ERROR("E18888", "param ir_name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param ir_name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator ir_name is nullptr."); return; } if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr, name %s.", ir_name); return; } @@ -2682,7 +2725,7 @@ graphStatus Operator::GetSubgraphNames(std::vector &names) const { SubgraphBuilder Operator::GetDynamicSubgraphBuilder(const std::string &name, uint32_t index) const { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] operator impl is nullptr."); return nullptr; } @@ -2691,12 +2734,12 @@ SubgraphBuilder Operator::GetDynamicSubgraphBuilder(const std::string &name, uin SubgraphBuilder Operator::GetDynamicSubgraphBuilder(const char_t *name, uint32_t index) const { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator impl is nullptr."); return nullptr; } if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param ir_name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param ir_name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return nullptr; } @@ -2718,55 +2761,55 @@ Graph Operator::GetSubgraphImpl(const std::string &name) const { Graph Operator::GetSubgraphImpl(const char_t *name) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return Graph(""); } if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GE_LOGE("[Check][Param] Failed to get subgraph %s, the operator impl is null", name); return Graph(""); } const auto op_desc = OpDescUtils::GetOpDescFromOperator(*this); if (op_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "Failed to get subgraph %s, because the op_desc is nullptr.", name); + REPORT_INNER_ERR_MSG("E18888", "Failed to get subgraph %s, because the op_desc is nullptr.", name); GE_LOGE("[Get][OpDesc] Failed to get subgraph %s, the op_desc is null", name); return Graph(""); } const auto &subgraph_names_to_index = op_desc->GetSubgraphNameIndexes(); const auto iter = subgraph_names_to_index.find(name); if (iter == subgraph_names_to_index.end()) { - REPORT_INNER_ERROR("E18888", "Failed to get subgraph %s, the name may be invalid", name); + REPORT_INNER_ERR_MSG("E18888", "Failed to get subgraph %s, the name may be invalid", name); GE_LOGE("[Check][Param] Failed to get subgraph %s, the name may be invalid", name); return Graph(""); } const auto subgraph_instance_name = op_desc->GetSubgraphInstanceName(iter->second); if (subgraph_instance_name.empty()) { - REPORT_CALL_ERROR("E18888", "Failed to get subgraph %s index %u, the subgraph may not be added", name, - iter->second); + REPORT_INNER_ERR_MSG("E18888", "Failed to get subgraph %s index %u, the subgraph may not be added", name, + iter->second); GE_LOGE("[Get][Subgraph] %s index %u failed, because the subgraph may not be added", name, iter->second); return Graph(""); } const auto node = operator_impl_->GetNode(); if (node == nullptr) { - REPORT_CALL_ERROR("E18888", "Failed to get subgraph %s, because the node is null", name); + REPORT_INNER_ERR_MSG("E18888", "Failed to get subgraph %s, because the node is null", name); GE_LOGE("[Get][Node] Failed to get subgraph %s, because the node is null", name); return Graph(""); } const auto root_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph()); if (root_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "Failed to get subgraph %s, because can not find the root graph,node:%s", name, - node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to get subgraph %s, because can not find the root graph,node:%s", name, + node->GetName().c_str()); GE_LOGE("[Get][Subgraph] subgraph %s failed, because can not find the root graph", name); return Graph(""); } const auto subgraph = root_graph->GetSubgraph(subgraph_instance_name); if (subgraph == nullptr) { - REPORT_CALL_ERROR("E18888", - "Failed to get subgraph %s index %u, because can not find the instance %s " - "from the root graph", - name, iter->second, subgraph_instance_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", + "Failed to get subgraph %s index %u, because can not find the instance %s " + "from the root graph", + name, iter->second, subgraph_instance_name.c_str()); GE_LOGE("[Get][Subgraph] %s index %u failed, because can not find the instance %s from the root graph", name, iter->second, subgraph_instance_name.c_str()); return Graph(""); @@ -2780,7 +2823,7 @@ Graph Operator::GetSubgraph(const std::string &name) const { Graph Operator::GetSubgraph(const char_t *name) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Get subgraph failed, name is nullptr."); return Graph(""); } @@ -2793,7 +2836,7 @@ Graph Operator::GetDynamicSubgraph(const std::string &name, uint32_t index) cons Graph Operator::GetDynamicSubgraph(const char_t *name, uint32_t index) const { if (name == nullptr) { - REPORT_INNER_ERROR("E18888", "param name is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param name is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator name is nullptr."); return Graph(""); } @@ -2803,7 +2846,7 @@ Graph Operator::GetDynamicSubgraph(const char_t *name, uint32_t index) const { size_t Operator::GetSubgraphNamesCount() const { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GE_LOGE("[Check][Param] Failed to get subgraph names count, the operator impl is null"); return 0UL; } @@ -2812,7 +2855,7 @@ size_t Operator::GetSubgraphNamesCount() const { graphStatus Operator::UpdateInputDesc(const uint32_t index, const TensorDesc &tensor_desc) { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to update input desc, the operator impl is null"); return GRAPH_FAILED; } @@ -2821,7 +2864,7 @@ graphStatus Operator::UpdateInputDesc(const uint32_t index, const TensorDesc &te graphStatus Operator::UpdateOutputDesc(const uint32_t index, const TensorDesc &tensor_desc) { if (operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "operator_impl_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "operator_impl_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to update output desc, the operator impl is null"); return GRAPH_FAILED; } @@ -2832,7 +2875,7 @@ class GraphBuilderImpl { public: explicit GraphBuilderImpl(const std::string &name) : graph_(ComGraphMakeShared(name)) { if (graph_ == nullptr) { - REPORT_CALL_ERROR("E18888", "ComputeGraph make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "ComputeGraph make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] ComputeGraph make shared failed"); return; } @@ -2844,10 +2887,10 @@ public: std::vector vec_inputs; for (auto &it : inputs) { const auto src_op_impl = it.operator_impl_; - GE_CHK_BOOL_EXEC(src_op_impl != nullptr, REPORT_INNER_ERROR("E18888", "src_op_impl is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(src_op_impl != nullptr, REPORT_INNER_ERR_MSG("E18888", "src_op_impl is nullptr, check invalid."); return nullptr, "[Check][Param] Operator Impl is null."); GE_CHK_BOOL_EXEC(src_op_impl->op_desc_ != nullptr, - REPORT_INNER_ERROR("E18888", "impl's opdesc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "impl's opdesc is nullptr, check invalid."); return nullptr, "[Check][Param] Operator impl's opdesc is null."); const std::string type = src_op_impl->op_desc_->GetType(); @@ -2865,10 +2908,12 @@ public: } } GE_CHK_BOOL_EXEC(!vec_inputs.empty(), - REPORT_INNER_ERROR("E18888", "User Input do not include operator such as " - "Data, Variable operator or operator that has output but no input."); - return nullptr, "[Check][Param] User Input do not include operator such as " - "Data, Variable operator or operator that has output but no input."); + REPORT_INNER_ERR_MSG("E18888", + "User Input do not include operator such as " + "Data, Variable operator or operator that has output but no input."); + return nullptr, + "[Check][Param] User Input do not include operator such as " + "Data, Variable operator or operator that has output but no input."); auto ret = WalkAllOperators(vec_inputs); GE_CHK_BOOL_EXEC(ret == GRAPH_SUCCESS, return nullptr, "[Call][WalkAllOperators] failed, ret:%d.", ret); @@ -2912,7 +2957,7 @@ private: graphStatus WalkAllOperators(const std::vector &vec_ops) { GE_CHK_BOOL_EXEC(graph_ != nullptr, - REPORT_INNER_ERROR("E18888", "graph_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "graph_ is nullptr, check invalid."); return GRAPH_FAILED, "[Check][Param] graph_ is null."); std::queue> que; que.push(vec_ops); @@ -2921,7 +2966,7 @@ private: que.pop(); for (const auto &op_impl : vec_tem) { GE_CHK_BOOL_EXEC(op_impl != nullptr, - REPORT_INNER_ERROR("E18888", "op_impl is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "op_impl is nullptr, check invalid."); return GRAPH_FAILED, "[Check][Param] Operator Impl is null."); if (all_nodes_info_.find(op_impl) != all_nodes_info_.cend()) { GELOGI("This node %s has created.", op_impl->GetName().c_str()); @@ -2929,7 +2974,7 @@ private: } auto node_ptr = graph_->AddNode(op_impl->op_desc_); GE_CHK_BOOL_EXEC(node_ptr != nullptr, - REPORT_CALL_ERROR("E18888", "add node failed."); + REPORT_INNER_ERR_MSG("E18888", "add node failed."); return GRAPH_FAILED, "[Add][Node] failed."); (void)(all_nodes_info_.insert(std::make_pair(op_impl, node_ptr))); (void)(stable_all_nodes_info_.insert(std::make_pair(op_impl, node_ptr))); @@ -2980,7 +3025,7 @@ private: const Graph graph = builder(); // Build subgraph from user define builder. const ComputeGraphPtr &subgraph = GraphUtilsEx::GetComputeGraph(graph); GE_CHK_BOOL_EXEC(subgraph != nullptr, - REPORT_CALL_ERROR("E18888", "Node: %s, Build graph failed.", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Node: %s, Build graph failed.", name.c_str()); return GRAPH_FAILED, "[Get][Graph] Node: %s, Build graph failed.", name.c_str()); subgraph->SetParentNode(node); @@ -2990,7 +3035,7 @@ private: } if (op_impl->op_desc_->SetSubgraphInstanceName(name_idx.second, subgraph->GetName()) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to set subgraph %s index %u", subgraph->GetName().c_str(), name_idx.second); + REPORT_INNER_ERR_MSG("E18888", "Failed to set subgraph %s index %u", subgraph->GetName().c_str(), name_idx.second); GELOGE(GRAPH_FAILED, "[Set][SubGraph] %s index %u failed", subgraph->GetName().c_str(), name_idx.second); return GRAPH_FAILED; } @@ -3001,14 +3046,14 @@ private: graphStatus MoveSubgraphToRoot(const int32_t recursion_depth, const ComputeGraphPtr &graph) const { if (recursion_depth > kMaxDepth) { - REPORT_INNER_ERROR("E18888", "param recursion_depth:%d is bigger than kMaxRecursiveDepth:%d", - recursion_depth, kMaxDepth); + REPORT_INNER_ERR_MSG("E18888", "param recursion_depth:%d is bigger than kMaxRecursiveDepth:%d", recursion_depth, + kMaxDepth); GELOGE(GRAPH_FAILED, "[Check][Param] DecodeGraph: recursion depth is too large, abort"); return GRAPH_FAILED; } const ComputeGraphPtr &root_graph = GraphUtils::FindRootGraph(graph); if (root_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "failed to find root graph of %s", graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "failed to find root graph of %s", graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Find][RootGraph] failed for graph:%s.", graph->GetName().c_str()); return GRAPH_FAILED; } @@ -3045,46 +3090,46 @@ private: GE_IF_BOOL_EXEC((src_op_impl_ptr == nullptr) || (src_node_ptr == nullptr), continue); const auto out_links = src_op_impl_ptr->output_links_; GE_CHK_BOOL_EXEC(src_op_impl_ptr->op_desc_ != nullptr, - REPORT_INNER_ERROR("E18888", "Src operator impl's op_desc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "Src operator impl's op_desc is nullptr, check invalid."); return GRAPH_FAILED, "[Check][Param] Src operator impl's op_desc is null."); auto &op_desc = src_op_impl_ptr->op_desc_; GE_IF_BOOL_EXEC(op_desc == nullptr, continue); for (const auto &out : out_links) { const auto src_idx = op_desc->GetOutputIndexByName(out.first); GE_CHK_BOOL_EXEC(src_idx >= 0, - REPORT_INNER_ERROR("E18888", "Find output index by name:%s in op:%s failed", - out.first.c_str(), op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find output index by name:%s in op:%s failed", + out.first.c_str(), op_desc->GetName().c_str()); return GRAPH_FAILED, "[Get][Index] Find output index by name:%s failed", out.first.c_str()); const auto src_anchor = src_node_ptr->GetOutDataAnchor(src_idx); GE_CHK_BOOL_EXEC(src_anchor != nullptr, - REPORT_INNER_ERROR("E18888", "GetOutDataAnchor failed, index:%d, op:%s.", - src_idx, op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "GetOutDataAnchor failed, index:%d, op:%s.", src_idx, + op_desc->GetName().c_str()); return GRAPH_FAILED, "[Get][OutDataAnchor] failed, index:%d.", src_idx); for (const auto &dst_opio : out.second) { const std::map::const_iterator dst_node_info = all_nodes_info_.find(dst_opio.GetOwner()); GE_CHK_BOOL_EXEC(dst_node_info != all_nodes_info_.cend(), - REPORT_INNER_ERROR("E18888", "Find Dst node failed, op:%s.", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find Dst node failed, op:%s.", op_desc->GetName().c_str()); return GRAPH_FAILED, "[Check][Param] Find Dst node failed."); GE_IF_BOOL_EXEC(dst_node_info->second == nullptr, continue); const auto dst_anchor = dst_node_info->second->GetInDataAnchor(dst_opio.GetIndex()); GE_CHK_BOOL_EXEC(dst_anchor != nullptr, - REPORT_INNER_ERROR("E18888", "GetInDataAnchor failed, index:%d, op:%s", - dst_opio.GetIndex(), op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "GetInDataAnchor failed, index:%d, op:%s", + dst_opio.GetIndex(), op_desc->GetName().c_str()); return GRAPH_FAILED, "GetInDataAnchor failed, index:%d", dst_opio.GetIndex()); const auto ret = GraphUtils::AddEdge(src_anchor, dst_anchor); GE_CHK_BOOL_EXEC(ret == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add edge from node[%s][%d] to node[%s][%d] failed.", - src_node_ptr->GetName().c_str(), src_anchor->GetIdx(), - dst_node_info->second->GetName().c_str(), dst_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "add edge from node[%s][%d] to node[%s][%d] failed.", + src_node_ptr->GetName().c_str(), src_anchor->GetIdx(), + dst_node_info->second->GetName().c_str(), dst_anchor->GetIdx()); return GRAPH_FAILED, "[Add][Edge] from node[%s][%d] to node[%s][%d] failed.", - src_node_ptr->GetName().c_str(), src_anchor->GetIdx(), - dst_node_info->second->GetName().c_str(), dst_anchor->GetIdx()); + src_node_ptr->GetName().c_str(), src_anchor->GetIdx(), + dst_node_info->second->GetName().c_str(), dst_anchor->GetIdx()); } } const auto out_control_anchor = src_node_ptr->GetOutControlAnchor(); @@ -3092,7 +3137,7 @@ private: const std::map::const_iterator dst_node_info = all_nodes_info_.find(control_out.lock()); if (dst_node_info == all_nodes_info_.cend()) { - REPORT_INNER_ERROR("E18888", "Find Dst node failed."); + REPORT_INNER_ERR_MSG("E18888", "Find Dst node failed."); GELOGE(GRAPH_FAILED, "[Check][Param] Find Dst node failed."); return GRAPH_FAILED; } @@ -3100,9 +3145,9 @@ private: const auto in_control_anchor = dst_node_info->second->GetInControlAnchor(); const auto ret = GraphUtils::AddEdge(out_control_anchor, in_control_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "add edge failed. srcNode %s:%s, dstNode %s:%s", op_desc->GetName().c_str(), - op_desc->GetType().c_str(), dst_node_info->second->GetName().c_str(), - dst_node_info->second->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add edge failed. srcNode %s:%s, dstNode %s:%s", op_desc->GetName().c_str(), + op_desc->GetType().c_str(), dst_node_info->second->GetName().c_str(), + dst_node_info->second->GetType().c_str()); GELOGE(ret, "[Add][Edge] failed. srcNode %s:%s, dstNode %s:%s", op_desc->GetName().c_str(), op_desc->GetType().c_str(), dst_node_info->second->GetName().c_str(), dst_node_info->second->GetType().c_str()); @@ -3162,10 +3207,10 @@ static inline bool HasSameNameNode(const ComputeGraphPtr &compute_graph) { for (auto const &node : graph->GetDirectNode()) { const auto result = node_names.insert(node->GetName()); if (!result.second) { - REPORT_INNER_ERROR("E18888", "[Check][Param] graph %s has same name node %s", - graph->GetName().c_str(), node->GetName().c_str()); - GELOGE(GRAPH_FAILED, "[Check][Param] graph %s has same name node %s", - graph->GetName().c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "[Check][Param] graph %s has same name node %s", graph->GetName().c_str(), + node->GetName().c_str()); + GELOGE(GRAPH_FAILED, "[Check][Param] graph %s has same name node %s", graph->GetName().c_str(), + node->GetName().c_str()); return true; } } @@ -3175,10 +3220,10 @@ static inline bool HasSameNameNode(const ComputeGraphPtr &compute_graph) { for (auto const &node : compute_graph->GetDirectNode()) { const auto result = node_names.insert(node->GetName()); if (!result.second) { - REPORT_INNER_ERROR("E18888", "[Check][Param] graph %s has same name node %s", - compute_graph->GetName().c_str(), node->GetName().c_str()); - GELOGE(GRAPH_FAILED, "[Check][Param] graph %s has same name node %s", - compute_graph->GetName().c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "[Check][Param] graph %s has same name node %s", compute_graph->GetName().c_str(), + node->GetName().c_str()); + GELOGE(GRAPH_FAILED, "[Check][Param] graph %s has same name node %s", compute_graph->GetName().c_str(), + node->GetName().c_str()); return true; } } @@ -3190,7 +3235,7 @@ ComputeGraphPtr GraphUtilsEx::CreateGraphFromOperator(const std::string &name, auto graph_builder_impl = GraphBuilderImpl(name); ComputeGraphPtr compute_graph = graph_builder_impl.BuildGraph(inputs); GE_CHK_BOOL_EXEC(compute_graph != nullptr, - REPORT_INNER_ERROR("E18888", "BuildGraph failed, as return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "BuildGraph failed, as return nullptr."); return compute_graph, "[Build][Graph] Computer graph is nullptr"); compute_graph->SetAllNodesInfo(graph_builder_impl.GetAllNodesInfo()); if (HasSameNameNode(compute_graph)) { diff --git a/graph/normal_graph/operator_factory.cc b/graph/normal_graph/operator_factory.cc index 1565b76e3f..2b6abdb3e7 100644 --- a/graph/normal_graph/operator_factory.cc +++ b/graph/normal_graph/operator_factory.cc @@ -17,7 +17,7 @@ Operator OperatorFactory::CreateOperator(const std::string &operator_name, const Operator OperatorFactory::CreateOperator(const char_t *const operator_name, const char_t *const operator_type) { if ((operator_name == nullptr) || (operator_type == nullptr)) { - REPORT_INNER_ERROR("E18888", "Create Operator input parameter is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "Create Operator input parameter is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Create Operator input parameter is nullptr."); return Operator(); } @@ -33,7 +33,7 @@ graphStatus OperatorFactory::GetOpsTypeList(std::vector &all_ops) { graphStatus OperatorFactory::GetOpsTypeList(std::vector &all_ops) { std::vector all_op_types; if (OperatorFactoryImpl::GetOpsTypeList(all_op_types) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Get ops type list failed."); + REPORT_INNER_ERR_MSG("E18888", "Get ops type list failed."); GELOGE(GRAPH_FAILED, "[Get][OpsTypeList] failed."); return GRAPH_FAILED; } @@ -49,7 +49,7 @@ bool OperatorFactory::IsExistOp(const std::string &operator_type) { bool OperatorFactory::IsExistOp(const char_t *const operator_type) { if (operator_type == nullptr) { - REPORT_INNER_ERROR("E18888", "Operator type is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "Operator type is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Operator type is nullptr."); return false; } diff --git a/graph/normal_graph/operator_factory_impl.cc b/graph/normal_graph/operator_factory_impl.cc index 642824269b..4818300acd 100644 --- a/graph/normal_graph/operator_factory_impl.cc +++ b/graph/normal_graph/operator_factory_impl.cc @@ -71,7 +71,7 @@ graphStatus OperatorFactoryImpl::GetOpsTypeList(std::vector &all_op operator_creators_->begin(), operator_creators_->end(), all_ops.begin(), [](const std::pair &operator_creator) { return operator_creator.first; }); } else { - REPORT_INNER_ERROR("E18888", "no operator creators found"); + REPORT_INNER_ERR_MSG("E18888", "no operator creators found"); GELOGE(GRAPH_FAILED, "[Check][Param] no operator creators found"); return GRAPH_FAILED; } diff --git a/graph/normal_graph/operator_impl.cc b/graph/normal_graph/operator_impl.cc index 33ef8ca492..203f4db9fc 100644 --- a/graph/normal_graph/operator_impl.cc +++ b/graph/normal_graph/operator_impl.cc @@ -42,13 +42,13 @@ OperatorImpl::~OperatorImpl() {} void OperatorImpl::SetInputImpl(const std::string &dst_name, const ge::Operator &src_oprt) { if (src_oprt.GetOutputsSize() != 1U) { if ((src_oprt.operator_impl_ == nullptr) || (src_oprt.operator_impl_->op_desc_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "The source op is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "The source op is nullptr, check invalid."); return; } GELOGE(ge::FAILED, "[Check][Param] The source operator[%s] must be single output operator", src_oprt.operator_impl_->op_desc_->GetName().c_str()); - REPORT_INNER_ERROR("E18888", "The source operator[%s] must be single output operator", - src_oprt.operator_impl_->op_desc_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "The source operator[%s] must be single output operator", + src_oprt.operator_impl_->op_desc_->GetName().c_str()); return; } @@ -61,24 +61,24 @@ void OperatorImpl::SetInputImpl(const std::string &dst_name, const ge::Operator } void OperatorImpl::SetInputImpl(const std::string &dst_name, const ge::OutHandler &out_handler) { - GE_CHK_BOOL_EXEC(out_handler != nullptr, REPORT_INNER_ERROR("E18888", "param out_handler is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(out_handler != nullptr, REPORT_INNER_ERR_MSG("E18888", "param out_handler is nullptr, check invalid."); return, "[Check][Param] SetInputImpl faild, as out_handler is nullptr."); - GE_CHK_BOOL_EXEC(!dst_name.empty(), REPORT_INNER_ERROR("E18888", "param dst_name is empty, check invalid."); + GE_CHK_BOOL_EXEC(!dst_name.empty(), REPORT_INNER_ERR_MSG("E18888", "param dst_name is empty, check invalid."); return, "[Check][Param] dst name is empty"); - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr."); return, "[Check][Param] op_desc_ is nullptr."); (void)input_link_.insert(std::make_pair(dst_name, *out_handler)); const std::string src_name = out_handler->GetName(); const int32_t dst_index = op_desc_->GetInputIndexByName(dst_name); GE_CHK_BOOL_EXEC(dst_index >= 0, - REPORT_INNER_ERROR("E18888", "Find input index by name failed. name[%s], op name:%s", - dst_name.c_str(), op_desc_->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find input index by name failed. name[%s], op name:%s", + dst_name.c_str(), op_desc_->GetName().c_str()); return, "[Get][InputIndex] Find input index by name failed. name[%s], op name:%s", dst_name.c_str(), op_desc_->GetName().c_str()); const auto out_op_impl = out_handler->GetOwner(); GE_CHK_BOOL_EXEC((out_op_impl != nullptr) && (out_op_impl->GetOpDescImpl() != nullptr), - REPORT_INNER_ERROR("E18888", "out_handler invalid. name[%s]", dst_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "out_handler invalid. name[%s]", dst_name.c_str()); return, "[Get][Impl] out_handler invalid. name[%s]", dst_name.c_str()); bool is_const = false; if (out_op_impl->GetOpDescImpl()->GetType() == CONSTANT) { @@ -93,7 +93,7 @@ void OperatorImpl::SetInputImpl(const std::string &dst_name, const ge::OutHandle const OpIO in_handler(dst_name, dst_index, shared_from_this()); GE_CHK_BOOL_EXEC(out_op_impl != nullptr, - REPORT_INNER_ERROR("E18888", "out_handler invalid. name[%s]", dst_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "out_handler invalid. name[%s]", dst_name.c_str()); return, "[Get][Impl] of out_handler failed."); out_op_impl->UpdateLinkMapImpl(src_name, in_handler); @@ -116,7 +116,7 @@ void OperatorImpl::SetInputImpl(const std::string &dst_name, const ge::OutHandle } GE_CHK_BOOL_EXEC(op_desc_->UpdateInputDesc(dst_name, src_output_desc) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "UpdateInputDesc failed, dst name is %s, src name is %s", + REPORT_INNER_ERR_MSG("E18888", "UpdateInputDesc failed, dst name is %s, src name is %s", dst_name.c_str(), src_name.c_str()); return, "[Update][InputDesc] failed, dst name is %s, src name is %s", dst_name.c_str(), src_name.c_str()); // fix for linking opdesc @@ -124,7 +124,7 @@ void OperatorImpl::SetInputImpl(const std::string &dst_name, const ge::OutHandle void OperatorImpl::AddControlInputImp(const ge::Operator &src_oprt) { if (src_oprt.operator_impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Src operator impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Src operator impl is nullptr, check invalid"); GELOGE(FAILED, "[Check][Param] Src operator impl is nullptr"); return; } @@ -295,7 +295,7 @@ graphStatus OperatorImpl::GetInputConstDataOut(const uint32_t idx, ConstGeTensor graphStatus OperatorImpl::GetInputConstDataOut(const std::string &dst_name, Tensor &data) const { ge::OpIO out_handle("", 0, nullptr); if (GetInputImpl(dst_name, out_handle) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "%s get input impl failed", dst_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s get input impl failed", dst_name.c_str()); GELOGE(FAILED, "[Get][InputImpl] failed, dst_name:%s", dst_name.c_str()); return GRAPH_FAILED; } @@ -318,59 +318,59 @@ graphStatus OperatorImpl::GetInputConstDataOut(const std::string &dst_name, Tens } bool OperatorImpl::InputIsSet(const std::string &name) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return false, "[Check][Param] op_desc_ is nullptr."); return op_desc_->InputIsSet(name); } std::string OperatorImpl::GetName() const { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return std::string(), "[Check][Param] op_desc_ is nullptr."); return op_desc_->GetName(); } GeTensorDesc OperatorImpl::GetInputDesc(const std::string &name) const { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return GeTensorDesc(), "[Check][Param] op_desc_ is nullptr."); return op_desc_->GetInputDesc(name); } GeTensorDesc OperatorImpl::GetInputDesc(const uint32_t index) const { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return GeTensorDesc(), "[Check][Param] op_desc_ is nullptr."); return op_desc_->GetInputDesc(index); } GeTensorDescPtr OperatorImpl::MutableInputDesc(const std::string &name) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return nullptr, "[Check][Param] op_desc_ is nullptr."); return op_desc_->MutableInputDesc(name); } GeTensorDescPtr OperatorImpl::MutableInputDesc(const uint32_t index) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return nullptr, "[Check][Param] op_desc_ is nullptr."); return op_desc_->MutableInputDesc(index); } graphStatus OperatorImpl::UpdateInputDesc(const std::string &name, const GeTensorDesc &tensor_desc) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return GRAPH_FAILED, "[Check][Param] op_desc_ is nullptr."); return op_desc_->UpdateInputDesc(name, tensor_desc); } OutHandler OperatorImpl::GetOutput(const std::string &name) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return nullptr, "[Check][Param] op_desc_ is nullptr."); int32_t src_index = op_desc_->GetOutputIndexByName(name); GE_CHK_BOOL_EXEC(src_index >= 0, - REPORT_INNER_ERROR("E18888", "Find src index by name failed. name[%s]", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find src index by name failed. name[%s]", name.c_str()); return nullptr, "[Get][OutputIndex] Find src index by name failed. name[%s]", name.c_str()); const shared_ptr output_ptr = ComGraphMakeShared(name, src_index, shared_from_this()); if (output_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "OpIO make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OpIO make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OpIO make shared failed"); return nullptr; } @@ -378,17 +378,17 @@ OutHandler OperatorImpl::GetOutput(const std::string &name) { } OutHandler OperatorImpl::GetOutput(uint32_t index) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return nullptr, "[Check][Param] op_desc_ is nullptr."); std::string name = op_desc_->GetOutputNameByIndex(index); if (name.empty()) { - REPORT_INNER_ERROR("E18888", "Find src name by index failed. index[%u]", index); + REPORT_INNER_ERR_MSG("E18888", "Find src name by index failed. index[%u]", index); GELOGE(GRAPH_FAILED, "[Get][OutputName] Find src name by index failed. index[%u]", index); return nullptr; } const shared_ptr output_ptr = ComGraphMakeShared(name, index, shared_from_this()); if (output_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "OpIO make shared failed"); + REPORT_INNER_ERR_MSG("E18888", "OpIO make shared failed"); GELOGE(GRAPH_FAILED, "[Call][ComGraphMakeShared] OpIO make shared failed"); return nullptr; } @@ -396,27 +396,27 @@ OutHandler OperatorImpl::GetOutput(uint32_t index) { } GeTensorDesc OperatorImpl::GetOutputDesc(const std::string &name) const { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return GeTensorDesc(), "[Check][Param] op_desc_ is nullptr."); return op_desc_->GetOutputDesc(name); } GeTensorDesc OperatorImpl::GetOutputDesc(const uint32_t index) const { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return GeTensorDesc(), "[Check][Param] op_desc_ is nullptr."); return op_desc_->GetOutputDesc(index); } GeTensorDescPtr OperatorImpl::MutableOutputDesc(const std::string &name) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return nullptr, "[Check][Param] op_desc_ is nullptr."); return op_desc_->MutableOutputDesc(name); } GeTensorDescPtr OperatorImpl::MutableOutputDesc(const uint32_t index) { - GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(op_desc_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); return nullptr, "[Check][Param] op_desc_ is nullptr."); return op_desc_->MutableOutputDesc(index); } @@ -541,7 +541,7 @@ void OperatorImpl::SetSubgraphBuilder(const std::string &ir_name, const uint32_t const auto it = subgraph_names_to_builders_.find(key_name); if (it == subgraph_names_to_builders_.end()) { - REPORT_INNER_ERROR("E18888", "Failed to set subgraph builder for name %s index %u.", ir_name.c_str(), index); + REPORT_INNER_ERR_MSG("E18888", "Failed to set subgraph builder for name %s index %u.", ir_name.c_str(), index); GELOGE(PARAM_INVALID, "[Check][Param] Failed to set subgraph builder for name %s index %u.", ir_name.c_str(), index); return; @@ -561,7 +561,7 @@ SubgraphBuilder OperatorImpl::GetSubgraphBuilder(const std::string &ir_name, con SubgraphBuilder OperatorImpl::GetSubgraphBuilder(const std::string &name) const { const auto iter = subgraph_names_to_builders_.find(name); if (iter == subgraph_names_to_builders_.end()) { - REPORT_INNER_ERROR("E18888", "Failed to get subgraph builder for name %s", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to get subgraph builder for name %s", name.c_str()); GELOGE(PARAM_INVALID, "[Check][Param] Failed to get subgraph builder for name %s", name.c_str()); return nullptr; } diff --git a/graph/normal_graph/tensor.cc b/graph/normal_graph/tensor.cc index 6603142633..6d1ac779ba 100644 --- a/graph/normal_graph/tensor.cc +++ b/graph/normal_graph/tensor.cc @@ -158,7 +158,7 @@ class TensorImpl { const size_t total_size = data.size() + sizeof(StringHead) + 1U; const std::unique_ptr buff = ComGraphMakeUnique(total_size); if (buff == nullptr) { - REPORT_CALL_ERROR("E18888", "allocate string raw data buff failed, size:%zu", total_size); + REPORT_INNER_ERR_MSG("E18888", "allocate string raw data buff failed, size:%zu", total_size); GELOGE(GRAPH_FAILED, "[New][Buffer] allocate string raw data buff failed"); return GRAPH_FAILED; } @@ -170,7 +170,7 @@ class TensorImpl { string_head->len = static_cast(data.size()); const int32_t memcpy_ret = memcpy_s(raw_data, total_size - sizeof(StringHead), data.c_str(), data.size() + 1U); if (memcpy_ret != EOK) { - REPORT_CALL_ERROR("E18888", "memcpy data failed, ret:%d, size:%zu.", memcpy_ret, data.size() + 1U); + REPORT_INNER_ERR_MSG("E18888", "memcpy data failed, ret:%d, size:%zu.", memcpy_ret, data.size() + 1U); GELOGE(GRAPH_FAILED, "[Copy][Data] failed, ret:%d", memcpy_ret); return GRAPH_FAILED; } @@ -182,7 +182,7 @@ class TensorImpl { graphStatus SetData(const std::vector &data) { if (data.empty()) { - REPORT_INNER_ERROR("E18888", "there is no data, please check the input variable"); + REPORT_INNER_ERR_MSG("E18888", "there is no data, please check the input variable"); GELOGE(GRAPH_FAILED, "[Check][Param] there is no data, please check the input variable"); return GRAPH_FAILED; } @@ -196,7 +196,7 @@ class TensorImpl { const std::unique_ptr buff = ComGraphMakeUnique(total_size); if (buff == nullptr) { - REPORT_CALL_ERROR("E18888", "allocate string raw data buff failed, size:%zu", total_size); + REPORT_INNER_ERR_MSG("E18888", "allocate string raw data buff failed, size:%zu", total_size); GELOGE(GRAPH_FAILED, "[New][Buffer] allocate string raw data buff failed"); return GRAPH_FAILED; } @@ -208,7 +208,7 @@ class TensorImpl { PtrAdd(string_head, data.size(), i)->addr = static_cast(ptr_size); PtrAdd(string_head, data.size(), i)->len = static_cast(data[i].size()); if (total_size < ptr_size) { - REPORT_INNER_ERROR("E18888", "Subtraction invalid, total_size:%zu, ptr_size:%" PRIu64, total_size, ptr_size); + REPORT_INNER_ERR_MSG("E18888", "Subtraction invalid, total_size:%zu, ptr_size:%" PRIu64, total_size, ptr_size); GELOGE(GRAPH_FAILED, "[Check][Param] Subtraction invalid, total_size: %zu, ptr_size: %" PRIu64, total_size, ptr_size); return GRAPH_FAILED; @@ -308,7 +308,7 @@ int64_t Shape::GetShapeSize() const { } if (!Int64MulNotOverflow(size, i)) { - REPORT_CALL_ERROR("E18888", "mul overflow: %" PRId64 ", %" PRId64, size, i); + REPORT_INNER_ERR_MSG("E18888", "mul overflow: %" PRId64 ", %" PRId64, size, i); GELOGE(GRAPH_FAILED, "[Check][Overflow] mul overflow: %" PRId64 ", %" PRId64, size, i); size = 0; return size; @@ -387,7 +387,7 @@ graphStatus TensorDesc::SetUnknownDimNumShape() { impl->shape_ = Shape({UNKNOWN_DIM_NUM}); return GRAPH_SUCCESS; } - REPORT_INNER_ERROR("E18888", "Set unknown shape failed, because no impl class!"); + REPORT_INNER_ERR_MSG("E18888", "Set unknown shape failed, because no impl class!"); GELOGE(GRAPH_FAILED, "[Set][UnknownDimNumShape] failed, because no impl class!"); return GRAPH_FAILED; } @@ -398,7 +398,7 @@ graphStatus TensorDesc::SetShapeRange(const std::vectorrange_ = range; return GRAPH_SUCCESS; } - REPORT_INNER_ERROR("E18888", "SetShapeRange failed! impl is nullptr!"); + REPORT_INNER_ERR_MSG("E18888", "SetShapeRange failed! impl is nullptr!"); GELOGE(GRAPH_FAILED, "[Set][ShapeRange] failed! impl is nullptr!"); return GRAPH_FAILED; } @@ -407,7 +407,7 @@ graphStatus TensorDesc::GetShapeRange(std::vector> & range = impl->range_; return GRAPH_SUCCESS; } - REPORT_INNER_ERROR("E18888", "impl is nullptr! check invalid"); + REPORT_INNER_ERR_MSG("E18888", "impl is nullptr! check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] impl is nullptr! check invalid"); return GRAPH_FAILED; } @@ -731,7 +731,7 @@ graphStatus Tensor::SetData(const std::vector &datas) { std::vector tensor_data; for (auto &data : datas) { if (data.GetString() == nullptr) { - REPORT_INNER_ERROR("E18888", "Data is nullptr. check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Data is nullptr. check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Data is nullptr."); return GRAPH_FAILED; } @@ -961,13 +961,13 @@ GeTensorDesc TensorAdapter::TensorDesc2GeTensorDesc(const TensorDesc &tensor_des std::vector> shape_range; auto status = tensor_desc.GetShapeRange(shape_range); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Get shape range failed! ret:%u", status); + REPORT_INNER_ERR_MSG("E18888", "Get shape range failed! ret:%u", status); GELOGE(GRAPH_FAILED, "[Get][ShapeRange] failed! ret:%u", status); return ge_tensor_desc; } status = ge_tensor_desc.SetShapeRange(shape_range); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Set shape range failed! ret:%u", status); + REPORT_INNER_ERR_MSG("E18888", "Set shape range failed! ret:%u", status); GELOGE(GRAPH_FAILED, "[Set][ShapeRange] failed! ret:%u", status); return ge_tensor_desc; } @@ -991,13 +991,13 @@ TensorDesc TensorAdapter::GeTensorDesc2TensorDesc(const GeTensorDesc &ge_tensor_ std::vector> shape_range; auto status = ge_tensor_desc.GetShapeRange(shape_range); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Get shape range failed! ret:%u", status); + REPORT_INNER_ERR_MSG("E18888", "Get shape range failed! ret:%u", status); GELOGE(GRAPH_FAILED, "[Get][ShapeRange] failed! ret:%u", status); return tensor_desc; } status = tensor_desc.SetShapeRange(shape_range); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Set shape range failed! ret:%u", status); + REPORT_INNER_ERR_MSG("E18888", "Set shape range failed! ret:%u", status); GELOGE(GRAPH_FAILED, "[Set][ShapeRange] failed! ret:%u", status); return tensor_desc; } diff --git a/graph/opsproto/opsproto_manager.cc b/graph/opsproto/opsproto_manager.cc index 0aba1129a8..bca6aa5035 100644 --- a/graph/opsproto/opsproto_manager.cc +++ b/graph/opsproto/opsproto_manager.cc @@ -128,7 +128,7 @@ void GetOpsProtoSoFileList(const std::string &path, std::vector &fi void OpsProtoManager::LoadOpsProtoPluginSo(const std::string &path) { if (path.empty()) { - REPORT_INNER_ERROR("E18888", "filePath is empty. please check your text file."); + REPORT_INNER_ERR_MSG("E18888", "filePath is empty. please check your text file."); GELOGE(GRAPH_FAILED, "[Check][Param] filePath is empty. please check your text file."); return; } diff --git a/graph/option/optimization_option.cc b/graph/option/optimization_option.cc index feb1bf997a..79e075833f 100644 --- a/graph/option/optimization_option.cc +++ b/graph/option/optimization_option.cc @@ -8,7 +8,6 @@ * ===================================================================================================================*/ #include "graph/option/optimization_option.h" -#include "common/util/error_manager/error_manager.h" #include "common/ge_common/debug/ge_log.h" #include "common/ge_common/string_util.h" #include "common/checker.h" @@ -22,8 +21,8 @@ const std::unordered_map kOptValToLevels{ }; void ReportParamInvalid(const std::string &opt_name, const std::string &opt_value, const std::string &reason) { - REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), - std::vector({opt_name, opt_value, reason})); + REPORT_PREDEFINED_ERR_MSG("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({opt_name.c_str(), opt_value.c_str(), reason.c_str()})); GELOGE(GRAPH_PARAM_INVALID, "[Oo][Check] the value [%s] of option [%s] is invalid. %s", opt_value.c_str(), opt_name.c_str(), reason.c_str()); } diff --git a/graph/refiner/format_refiner.cc b/graph/refiner/format_refiner.cc index 16dea5a441..8168532007 100644 --- a/graph/refiner/format_refiner.cc +++ b/graph/refiner/format_refiner.cc @@ -157,8 +157,8 @@ static graphStatus AnchorsInferProcess(std::deque &nodes, const Out std::unordered_set reflection; auto ret_status = reflection_builder.LookUpRefRelations(key, reflection); if (ret_status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "LookUpRefRelations failed! Node is [%s], the %d input edge", - (peer_in_data_node->GetName()).c_str(), idx); + REPORT_INNER_ERR_MSG("E18888", "LookUpRefRelations failed! Node is [%s], the %d input edge", + (peer_in_data_node->GetName()).c_str(), idx); GELOGE(GRAPH_FAILED, "[Call][LookUpRefRelations] failed! Node is [%s], the %d input edge", (peer_in_data_node->GetName()).c_str(), idx); return GRAPH_FAILED; @@ -219,7 +219,7 @@ graphStatus FormatRefiner::RefreshConstantOutProcess(const ComputeGraphPtr &com_ if ((op_desc->GetType() == CONSTANTOP) && (!IsGraphInferred(com_graph))) { ConstGeTensorPtr tensor_value; if (!AttrUtils::GetTensor(op_desc, "value", tensor_value)) { - REPORT_CALL_ERROR("E18888", "GetTensor failed, node name:%s.", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "GetTensor failed, node name:%s.", op_desc->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Tensor] failed, node name:%s.", op_desc->GetName().c_str()); return GRAPH_FAILED; } @@ -236,13 +236,13 @@ graphStatus FormatRefiner::GetAnchorPoints(const ge::ComputeGraphPtr &com_graph, // Get all anchor point nodes and switch nodes for (auto &one_node_ptr : com_graph->GetAllNodes()) { if (one_node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "node ptr in graph(%s) should not be null", com_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node ptr in graph(%s) should not be null", com_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node ptr in graph(%s) should not be null", com_graph->GetName().c_str()); return GRAPH_FAILED; } const auto &one_op_desc = one_node_ptr->GetOpDesc(); if (one_op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "node's opdesc is nullptr,graph:%s", com_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node's opdesc is nullptr,graph:%s", com_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node's opdesc is nullptr,graph:%s", com_graph->GetName().c_str()); return GRAPH_FAILED; } @@ -475,7 +475,7 @@ graphStatus FormatRefiner::InferOrigineFormat(const ge::ComputeGraphPtr &graph) std::vector anchor_data_nodes; if (graph == nullptr) { - REPORT_INNER_ERROR("E18888", "param graph is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param graph is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] input graph is nullptr"); return GRAPH_FAILED; } diff --git a/graph/refiner/ref_relation.cc b/graph/refiner/ref_relation.cc index 9ee9d99833..4420a11f1e 100644 --- a/graph/refiner/ref_relation.cc +++ b/graph/refiner/ref_relation.cc @@ -276,7 +276,7 @@ graphStatus RefRelations::Impl::GetRootGraph(ge::ComputeGraph &graph, ge::Comput } const auto root_graph_ptr = GraphUtils::FindRootGraph(parent_graph_ptr); if (root_graph_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "Get null root graph, graph:%s", parent_graph_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get null root graph, graph:%s", parent_graph_ptr->GetName().c_str()); GE_LOGE("[Find][Graph] Get null root graph"); return GRAPH_PARAM_INVALID; } @@ -293,8 +293,7 @@ graphStatus RefRelations::Impl::ProcessSubgraphDataNodes(std::vector &g bool is_exist = true; is_exist = AttrUtils::GetInt(e->GetOpDesc(), kRefIdx, i); if (!is_exist) { - REPORT_INNER_ERROR("E18888", "Invalid SubGraph NetOutput node[%s].no attr %s", - e->GetName().c_str(), kRefIdx); + REPORT_INNER_ERR_MSG("E18888", "Invalid SubGraph NetOutput node[%s].no attr %s", e->GetName().c_str(), kRefIdx); GELOGE(GRAPH_FAILED, "[Get][Int] Invalid SubGraph NetOutput node[%s].no attr %s", e->GetName().c_str(), kRefIdx); return GRAPH_FAILED; @@ -328,8 +327,8 @@ graphStatus RefRelations::Impl::ProcessSubgraphNetoutput( for (const auto &in_data_anchor : sub_netoutput_node->GetAllInDataAnchors()) { const auto in_desc = op_desc->MutableInputDesc(static_cast(in_data_anchor->GetIdx())); if (in_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Invalid NetOutput node [%s] idx [%d], no tensor on it", - sub_netoutput_node->GetName().c_str(), in_data_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "Invalid NetOutput node [%s] idx [%d], no tensor on it", + sub_netoutput_node->GetName().c_str(), in_data_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Get][Tensor] Invalid NetOutput node [%s] idx [%d], no tensor on it", sub_netoutput_node->GetName().c_str(), in_data_anchor->GetIdx()); return GRAPH_FAILED; @@ -338,8 +337,8 @@ graphStatus RefRelations::Impl::ProcessSubgraphNetoutput( if (AttrUtils::GetInt(in_desc, kRefIdx, ref_o)) { max_ref_idx = (ref_o > max_ref_idx) ? ref_o : max_ref_idx; } else { - REPORT_INNER_ERROR("E18888", "Invalid NetOutput node [%s] idx [%d], no attr[_parent_node_index] on it", - sub_netoutput_node->GetName().c_str(), in_data_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "Invalid NetOutput node [%s] idx [%d], no attr[_parent_node_index] on it", + sub_netoutput_node->GetName().c_str(), in_data_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Get][Int] Invalid NetOutput node [%s] idx [%d], no attr[_parent_node_index] on it", sub_netoutput_node->GetName().c_str(), in_data_anchor->GetIdx()); return GRAPH_FAILED; @@ -461,7 +460,7 @@ graphStatus RefRelations::Impl::BuildRefRelations(ge::ComputeGraph &graph) { RefRelations::RefRelations() { impl_ = MakeShared(); if (impl_ == nullptr) { - REPORT_CALL_ERROR("E18888", "new impl failed."); + REPORT_INNER_ERR_MSG("E18888", "new impl failed."); GELOGE(GRAPH_FAILED, "[New][Impl] MakeShared failed!"); return; } diff --git a/graph/refiner/shape_refiner.cc b/graph/refiner/shape_refiner.cc index a233d95727..ea572b774f 100644 --- a/graph/refiner/shape_refiner.cc +++ b/graph/refiner/shape_refiner.cc @@ -61,8 +61,8 @@ graphStatus UpdateOutputForMultiBatch(const ConstNodePtr &node, for (size_t j = 0UL; j < ref_out_tensors[i].size(); ++j) { auto &tensor = ref_out_tensors[i].at(j); if (ref_out_tensor.GetDataType() != tensor.GetDataType()) { - REPORT_INNER_ERROR("E18888", "node[%s] does not support diff dtype among all ref output", - node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node[%s] does not support diff dtype among all ref output", + node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node[%s] does not support diff dtype among all ref output", node->GetName().c_str()); return GRAPH_FAILED; @@ -72,8 +72,8 @@ graphStatus UpdateOutputForMultiBatch(const ConstNodePtr &node, int64_t size = 1; for (const auto dim : shape.GetDims()) { if ((dim != 0) && ((std::numeric_limits::max() / dim) < size)) { - REPORT_INNER_ERROR("E18888", "The shape:%s size overflow, node:%s", - shape.ToString().c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "The shape:%s size overflow, node:%s", shape.ToString().c_str(), + node->GetName().c_str()); GELOGE(PARAM_INVALID, "[Check][Overflow] The shape size overflow"); return PARAM_INVALID; } @@ -108,8 +108,8 @@ graphStatus UpdateParentNodeForBranch(const ConstNodePtr &node, ge::GeShape &ref_out_tensor_shape = ref_out_tensor.MutableShape(); for (auto &tensor : ref_out_tensors[i]) { if (ref_out_tensor.GetDataType() != tensor.GetDataType()) { - REPORT_INNER_ERROR("E18888", "node[%s] does not support diff dtype among all ref output, shape:%s", - node->GetName().c_str(), ref_out_tensor_shape.ToString().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node[%s] does not support diff dtype among all ref output, shape:%s", + node->GetName().c_str(), ref_out_tensor_shape.ToString().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node[%s] does not support diff dtype output", node->GetName().c_str()); return GRAPH_FAILED; } @@ -157,16 +157,16 @@ graphStatus UpdateParentNodeForWhile(const ConstNodePtr &node, std::vector> &ref_out_tensors) { GELOGD("Enter update parent node shape for class while op process"); if (ref_data_tensors.size() != ref_out_tensors.size()) { - REPORT_INNER_ERROR("E18888", "op:%s(%s) input number[%zu] and output number[%zu] is not same!", - node->GetName().c_str(), node->GetType().c_str(), - ref_data_tensors.size(), ref_out_tensors.size()); + REPORT_INNER_ERR_MSG("E18888", "op:%s(%s) input number[%zu] and output number[%zu] is not same!", + node->GetName().c_str(), node->GetType().c_str(), ref_data_tensors.size(), + ref_out_tensors.size()); GELOGE(GRAPH_FAILED, "[Check][Param] while op [%s] input number[%zu] and output number[%zu] is not same!", node->GetName().c_str(), ref_data_tensors.size(), ref_out_tensors.size()); return GRAPH_FAILED; } for (size_t i = 0U; i < ref_data_tensors.size(); i++) { if (ref_out_tensors[i].size() != 1U) { - REPORT_INNER_ERROR("E18888", "while op, every output should only find one output tensor in all graph!"); + REPORT_INNER_ERR_MSG("E18888", "while op, every output should only find one output tensor in all graph!"); GELOGE(GRAPH_FAILED, "[Check][Param] while op, every output should only find one output tensor in all graph!"); return GRAPH_FAILED; } @@ -181,8 +181,8 @@ graphStatus UpdateParentNodeForWhile(const ConstNodePtr &node, // if the input tensor shares multiple references, the ranges should ensure consistency std::vector> data_shape_range; if (ref_out_tensor.GetDataType() != tensor.GetDataType()) { - REPORT_INNER_ERROR("E18888", "node[%s] does not support diff dtype or format among all ref output", - node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node[%s] does not support diff dtype or format among all ref output", + node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node[%s] does not support diff dtype or format output.", node->GetName().c_str()); return GRAPH_FAILED; @@ -219,7 +219,7 @@ graphStatus UpdateSubGraphDataNodes(const ConstNodePtr &node) { for (const auto &name : sub_graph_names) { const auto sub_graph = root_graph->GetSubgraph(name); if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Can not find the subgrpah %s for node %s", name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Can not find the subgrpah %s for node %s", name.c_str(), node->GetName().c_str()); GE_LOGE("[Get][Graph] can not find the subgrpah %s for node %s", name.c_str(), node->GetName().c_str()); return GRAPH_FAILED; } @@ -230,15 +230,15 @@ graphStatus UpdateSubGraphDataNodes(const ConstNodePtr &node) { int32_t ref_i; const auto data_opdesc = node_sub->GetOpDesc(); if (data_opdesc == nullptr) { - REPORT_INNER_ERROR("E18888", "Invalid data node on the sub graph %s parent node %s, no OpDesc", - name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Invalid data node on the sub graph %s parent node %s, no OpDesc", name.c_str(), + node->GetName().c_str()); GE_LOGE("[Get][OpDesc] Invalid data node on the sub graph %s parent node %s, no OpDesc", name.c_str(), node->GetName().c_str()); return GRAPH_FAILED; } if (!AttrUtils::GetInt(data_opdesc, ATTR_NAME_PARENT_NODE_INDEX, ref_i)) { - REPORT_INNER_ERROR("E18888", "Invalid data node on the sub graph %s parent node %s, no ref-index attribute", - name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Invalid data node on the sub graph %s parent node %s, no ref-index attribute", + name.c_str(), node->GetName().c_str()); GE_LOGE("[Get][Int] Invalid data node on the sub graph %s parent node %s, no ref-index attribute", name.c_str(), node->GetName().c_str()); return GRAPH_FAILED; @@ -248,9 +248,11 @@ graphStatus UpdateSubGraphDataNodes(const ConstNodePtr &node) { } auto input_desc = op_desc->MutableInputDesc(static_cast(ref_i)); if (input_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "The ref index(%d) on the data %s on the sub graph %s " - "parent node %s are incompatible, inputs num %u", ref_i, node_sub->GetName().c_str(), - name.c_str(), node->GetName().c_str(), node->GetAllInDataAnchorsSize()); + REPORT_INNER_ERR_MSG("E18888", + "The ref index(%d) on the data %s on the sub graph %s " + "parent node %s are incompatible, inputs num %u", + ref_i, node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str(), + node->GetAllInDataAnchorsSize()); GE_LOGE("[Call][MutableInputDesc] The ref index(%d) on the data %s on the sub graph %s " "parent node %s are incompatible, inputs num %u", ref_i, node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str(), node->GetAllInDataAnchorsSize()); @@ -280,16 +282,16 @@ graphStatus UpdateSubGraphDataNodes(const ConstNodePtr &node) { auto ret = data_opdesc->UpdateInputDesc(0U, *input_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to update input desc of data %s on the sub graph %s parent node %s", - node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to update input desc of data %s on the sub graph %s parent node %s", + node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str()); GE_LOGE("[Update][InputDesc] of data %s on the sub graph %s parent node %s failed", node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str()); return ret; } ret = data_opdesc->UpdateOutputDesc(0U, *input_desc); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to update output desc of data %s on the sub graph %s parent node %s", - node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to update output desc of data %s on the sub graph %s parent node %s", + node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str()); GE_LOGE("[Update][OutputDesc] of data %s on the sub graph %s parent node %s failed", node_sub->GetName().c_str(), name.c_str(), node->GetName().c_str()); return ret; @@ -315,13 +317,13 @@ graphStatus FindSubgraphDataAndNetoutput(const std::shared_ptr &su int32_t ref_i; if (!AttrUtils::GetInt(sub_node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, ref_i)) { - REPORT_INNER_ERROR("E18888", "subgraph data node[%s] has no parent node!", sub_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "subgraph data node[%s] has no parent node!", sub_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Int] subgraph data node[%s] has no parent node!", sub_node->GetName().c_str()); return GRAPH_FAILED; } if ((ref_i < 0) || (static_cast(ref_i) >= node->GetAllInDataAnchorsSize())) { - REPORT_INNER_ERROR("E18888", "data node[%s]'s ref index[%d] is not in range [0, %u)!", - sub_node->GetName().c_str(), ref_i, node->GetAllInDataAnchorsSize()); + REPORT_INNER_ERR_MSG("E18888", "data node[%s]'s ref index[%d] is not in range [0, %u)!", + sub_node->GetName().c_str(), ref_i, node->GetAllInDataAnchorsSize()); GELOGE(GRAPH_FAILED, "[Check][Param] data node[%s]'s ref index[%d] is not in range [0, %u)!", sub_node->GetName().c_str(), ref_i, node->GetAllInDataAnchorsSize()); return GRAPH_FAILED; @@ -346,7 +348,7 @@ graphStatus UpdateParentNodeOutTensor(const ConstNodePtr &node) { for (const auto &name : sub_graph_names) { const auto sub_graph = root_graph->GetSubgraph(name); if (sub_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Can not find the subgraph %s for node %s", name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Can not find the subgraph %s for node %s", name.c_str(), node->GetName().c_str()); GE_LOGE("[Get][Subgraph] Can not find the subgraph %s for node %s", name.c_str(), node->GetName().c_str()); return GRAPH_FAILED; } @@ -356,16 +358,16 @@ graphStatus UpdateParentNodeOutTensor(const ConstNodePtr &node) { return ret; } if (netoutput == nullptr) { - REPORT_INNER_ERROR("E18888", "No NetOutput node on sub graph %s, parent node %s", - name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "No NetOutput node on sub graph %s, parent node %s", name.c_str(), + node->GetName().c_str()); GE_LOGE("[Check][Param] No NetOutput node on sub graph %s, parent node %s", name.c_str(), node->GetName().c_str()); return GRAPH_FAILED; } const auto netoutput_opdesc = netoutput->GetOpDesc(); if (netoutput_opdesc == nullptr) { - REPORT_INNER_ERROR("E18888", "Invalid NetOutput node on sub graph %s, parent node %s, no OpDesc on it", - name.c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Invalid NetOutput node on sub graph %s, parent node %s, no OpDesc on it", + name.c_str(), node->GetName().c_str()); GE_LOGE("[Get][OpDesc] Invalid NetOutput node on sub graph %s, parent node %s, no OpDesc on it", name.c_str(), node->GetName().c_str()); return GRAPH_FAILED; @@ -373,9 +375,10 @@ graphStatus UpdateParentNodeOutTensor(const ConstNodePtr &node) { for (auto &edge_anchor : netoutput->GetAllInDataAnchors()) { const auto edge_desc = netoutput_opdesc->MutableInputDesc(static_cast(edge_anchor->GetIdx())); if (edge_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Invalid NetOutput node on sub graph %s, parent node %s, " - "can not find input tensor %d", - name.c_str(), node->GetName().c_str(), edge_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", + "Invalid NetOutput node on sub graph %s, parent node %s, " + "can not find input tensor %d", + name.c_str(), node->GetName().c_str(), edge_anchor->GetIdx()); GE_LOGE("[Get][Tensor] Invalid NetOutput node on sub graph %s, parent node %s, can not find input tensor %d", name.c_str(), node->GetName().c_str(), edge_anchor->GetIdx()); return GRAPH_FAILED; @@ -644,7 +647,7 @@ graphStatus ShapeRefiner::GetRealInNodesAndIndex(NodePtr &input_node, int32_t &o if (IsOpWithSubgraph(input_node)) { if (GetOutNodesByParentNodeOutIndex(input_node, output_idx, nodes_idx) != SUCCESS) { - REPORT_CALL_ERROR("E18888", "Get outnodes of %s by parent node out index failed.", input_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get outnodes of %s by parent node out index failed.", input_node->GetName().c_str()); GELOGE(FAILED, "[Get][Outnodes] of %s by parent node out index failed.", input_node->GetName().c_str()); return FAILED; } @@ -684,7 +687,7 @@ graphStatus ShapeRefiner::CreateInferenceContext(const NodePtr &node, ResourceCo auto out_idx = out_anchor->GetIdx(); std::map input_nodes_2_out_idx; if (GetRealInNodesAndIndex(input_node, out_idx, input_nodes_2_out_idx) != SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to get real in nodes and index, node:%s", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to get real in nodes and index, node:%s", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][InNodesAndIndex] of node[%s] failed.", node->GetName().c_str()); return GRAPH_FAILED; } @@ -761,7 +764,7 @@ graphStatus ShapeRefiner::InferShapeAndType(const ConstNodePtr &node, Operator & const auto temp_op_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op); node_op.BreakConnect(); if (temp_op_desc == nullptr) { - REPORT_CALL_ERROR("E18888", "GetOpDescFromOperator failed, return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescFromOperator failed, return nullptr."); GELOGE(GRAPH_FAILED, "[Get][OpDesc] temp op desc is null"); return GRAPH_FAILED; } @@ -818,8 +821,10 @@ graphStatus ShapeRefiner::DoInferShapeAndTypeForRunning(const ConstNodePtr &node const auto infer_func = OperatorFactoryImpl::GetInferShapeFunc((it == kGeLocalOpMapping.end()) ? origin_type : it->second); if (infer_func == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to Get InferFunc. Reason: ASCEND_OPP_PATH is not set or it's invalid;" - " Or the infer func of %s is not registered.", origin_type.c_str()); + REPORT_INNER_ERR_MSG("E18888", + "Failed to Get InferFunc. Reason: ASCEND_OPP_PATH is not set or it's invalid;" + " Or the infer func of %s is not registered.", + origin_type.c_str()); GELOGE(GRAPH_FAILED, "[Get][InferFunc] failed. type is %s", origin_type.c_str()); return GRAPH_FAILED; } @@ -873,8 +878,8 @@ graphStatus ShapeRefiner::InferShapeAndTypeForRunning(const NodePtr &node, Opera PrintInOutTensorShape(node, "after_infershape when running"); return GRAPH_SUCCESS; } else { - REPORT_CALL_ERROR("EZ8888", "%s(%s) call infer function failed.", - node->GetName().c_str(), node->GetType().c_str()); + REPORT_INNER_ERR_MSG("EZ8888", "%s(%s) call infer function failed.", node->GetName().c_str(), + node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Call][InferFunction] failed, node:%s(%s).", node->GetName().c_str(), node->GetType().c_str()); return GRAPH_FAILED; @@ -927,7 +932,7 @@ graphStatus ShapeRefiner::PostProcessAfterInfershape(const NodePtr &node, const } if (UpdateInputOutputDesc(node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Update input and output desc of %s failed.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Update input and output desc of %s failed.", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Update][TensorDesc] Update input and output desc of %s failed.", node->GetName().c_str()); return GRAPH_FAILED; } @@ -961,14 +966,14 @@ graphStatus ShapeRefiner::InferShapeAndType(const NodePtr &node, const bool befo if (need_update_input) { const auto status = UpdateOpInputDesc(node); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "update op input_desc failed! ret:%u, node:%s", status, node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "update op input_desc failed! ret:%u, node:%s", status, node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Update][OpInputDesc] failed! ret:%u", status); return status; } } if (NodeUtilsEx::Verify(node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("EZ8888", "Verifying %s(%s) failed.", node->GetName().c_str(), node->GetType().c_str()); + REPORT_INNER_ERR_MSG("EZ8888", "Verifying %s(%s) failed.", node->GetName().c_str(), node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Call][Verify] Verifying %s(%s) failed.", node->GetName().c_str(), node->GetType().c_str()); return GRAPH_FAILED; } @@ -978,7 +983,7 @@ graphStatus ShapeRefiner::InferShapeAndType(const NodePtr &node, const bool befo if (!is_unknown_graph) { InferenceContextPtr inference_context; if (CreateInferenceContext(node, inference_context) != SUCCESS) { - REPORT_CALL_ERROR("E18888", "CreateInferenceContext of %s failed.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "CreateInferenceContext of %s failed.", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Create][Context] CreateInferenceContext of %s failed.", node->GetName().c_str()); return GRAPH_FAILED; } @@ -992,8 +997,8 @@ graphStatus ShapeRefiner::InferShapeAndType(const NodePtr &node, const bool befo const graphStatus status = InferShapeAndType(node, op, before_subgraph); const bool check_status_valid = (status == GRAPH_PARAM_INVALID) || (status == GRAPH_SUCCESS); if (!check_status_valid) { - REPORT_CALL_ERROR("EZ8888", "%s(%s) call infer function failed.", - node->GetName().c_str(), node->GetType().c_str()); + REPORT_INNER_ERR_MSG("EZ8888", "%s(%s) call infer function failed.", node->GetName().c_str(), + node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Call][InferFunction] failed, node:%s(%s).", node->GetName().c_str(), node->GetType().c_str()); return GRAPH_FAILED; diff --git a/graph/serialization/attr_serializer_registry.cc b/graph/serialization/attr_serializer_registry.cc index 7189b2dec5..bb9b830440 100644 --- a/graph/serialization/attr_serializer_registry.cc +++ b/graph/serialization/attr_serializer_registry.cc @@ -78,7 +78,7 @@ GeIrAttrSerializer *AttrSerializerRegistry::GetSerializer(const TypeId obj_type) const std::map::const_iterator iter = serializer_map_.find(obj_type); if (iter == serializer_map_.cend()) { // print type - REPORT_INNER_ERROR("E18888", "Serializer for type has not been registered"); + REPORT_INNER_ERR_MSG("E18888", "Serializer for type has not been registered"); GELOGE(FAILED, "Serializer for type has not been registered"); return nullptr; } @@ -89,9 +89,8 @@ GeIrAttrSerializer *AttrSerializerRegistry::GetDeserializer(const proto::AttrDef const std::map::const_iterator iter = deserializer_map_.find(proto_type); if (iter == deserializer_map_.cend()) { - REPORT_INNER_ERROR("E18888", - "Deserializer for type [%d] has not been registered", - static_cast(proto_type)); + REPORT_INNER_ERR_MSG("E18888", "Deserializer for type [%d] has not been registered", + static_cast(proto_type)); GELOGE(FAILED, "Deserializer for type [%d] has not been registered", static_cast(proto_type)); return nullptr; } diff --git a/graph/serialization/model_serialize.cc b/graph/serialization/model_serialize.cc index bfa72f8a13..44dec7bf19 100644 --- a/graph/serialization/model_serialize.cc +++ b/graph/serialization/model_serialize.cc @@ -119,9 +119,9 @@ int64_t ModelSerializeImp::GenCtrlInputInfo(const OutControlAnchorPtr &src_ancho bool ModelSerializeImp::SerializeEdge(const NodePtr &node, proto::OpDef *const op_def_proto, const bool is_dump_graph) const { - GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); return false, "[Check][Param] node is null."); - GE_CHK_BOOL_EXEC(op_def_proto != nullptr, REPORT_INNER_ERROR("E18888", "param op_def_proto is null, check invalid."); + GE_CHK_BOOL_EXEC(op_def_proto != nullptr, REPORT_INNER_ERR_MSG("E18888", "param op_def_proto is null, check invalid."); return false, "[Check][Param] op_def_proto is null."); op_def_proto->clear_input(); @@ -169,12 +169,12 @@ void ModelSerializeImp::FixOpDefSubgraphInstanceName(const ConstOpDescPtr &op_de bool ModelSerializeImp::SerializeOpDesc(const ConstOpDescPtr &op_desc, proto::OpDef *const op_def_proto, const bool not_dump_all) const { - GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERROR("E18888", "param op_desc is nullptr. check invalid."); + GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERR_MSG("E18888", "param op_desc is nullptr. check invalid."); return false, "[Check][Param] op_desc is null."); - GE_CHK_BOOL_EXEC(op_def_proto != nullptr, REPORT_INNER_ERROR("E18888", "param op_def_proto is null, check invalid."); + GE_CHK_BOOL_EXEC(op_def_proto != nullptr, REPORT_INNER_ERR_MSG("E18888", "param op_def_proto is null, check invalid."); return false, "[Check][Param] op_def_proto is null."); GE_CHK_BOOL_EXEC(op_desc->impl_ != nullptr, - REPORT_INNER_ERROR("E18888", "param op_desc impl is null, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param op_desc impl is null, check invalid."); return false, "[Check][Param] op_desc impl is null."); FixOpDefSubgraphInstanceName(op_desc); @@ -304,7 +304,7 @@ bool ModelSerializeImp::SerializeNode(const NodePtr &node, proto::OpDef *const o bool ModelSerializeImp::SerializeNode(const NodePtr &node, const bool is_dump_graph, proto::OpDef *const op_def_proto, const bool not_dump_all) const { if ((node == nullptr) || (op_def_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or op_def_proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node or op_def_proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] param node or op_def_proto is nullptr, check invalid."); return false; } @@ -323,7 +323,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool ModelSerializeImp::Serialize GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool ModelSerializeImp::SerializeGraph(const ConstComputeGraphPtr &graph, const bool is_dump_graph, proto::GraphDef *const graph_proto, const bool not_dump_all) const { if ((graph == nullptr) || (graph_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param graph or graph_proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param graph or graph_proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] param graph or graph_proto is nullptr, check invalid."); return false; } @@ -369,7 +369,7 @@ bool ModelSerializeImp::SerializeModel(const Model &model, proto::ModelDef *cons bool ModelSerializeImp::SerializeModel(const Model &model, const bool is_dump_graph, proto::ModelDef *const model_proto, const bool not_dump_all) const { if (model_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "param model_proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param model_proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] param model_proto is nullptr, check Invalid"); return false; } @@ -391,7 +391,7 @@ bool ModelSerializeImp::SerializeModel(const Model &model, const bool is_dump_gr const auto compute_graph = model.graph_; if (compute_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "get compute graph from graph failed as graph is invalid."); + REPORT_INNER_ERR_MSG("E18888", "get compute graph from graph failed as graph is invalid."); GELOGE(GRAPH_FAILED, "[Get][ComputeGraph] return nullptr"); return false; } @@ -542,21 +542,21 @@ bool ModelSerializeImp::UnserializeOpDesc(OpDescPtr &op_desc, proto::OpDef &op_d ExtractMetaDataAttr(op_def_proto, key_out, value_out); op_desc = ComGraphMakeShared(op_def_proto); - GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_CALL_ERROR("E18888", "create OpDesc failed."); + GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERR_MSG("E18888", "create OpDesc failed."); return false, "[Create][OpDesc] op_desc is nullptr."); - GE_CHK_BOOL_EXEC(op_desc->impl_ != nullptr, REPORT_CALL_ERROR("E18888", "create OpDesc impl failed."); + GE_CHK_BOOL_EXEC(op_desc->impl_ != nullptr, REPORT_INNER_ERR_MSG("E18888", "create OpDesc impl failed."); return false, "[Create][OpDesc] op_desc impl is nullptr."); // Input tensor for (auto &input_desc : *op_def_proto.mutable_input_desc()) { const std::shared_ptr temp_value = ComGraphMakeShared(&input_desc); - GE_CHK_BOOL_EXEC(temp_value != nullptr, REPORT_CALL_ERROR("E18888", "create GeTensorDesc failed."); + GE_CHK_BOOL_EXEC(temp_value != nullptr, REPORT_INNER_ERR_MSG("E18888", "create GeTensorDesc failed."); return false, "[Create][GeTensorDesc] temp_value is nullptr."); op_desc->impl_->inputs_desc_.push_back(temp_value); } // Output tensor for (auto &output_desc : *op_def_proto.mutable_output_desc()) { const std::shared_ptr temp_value = ComGraphMakeShared(&output_desc); - GE_CHK_BOOL_EXEC(temp_value != nullptr, REPORT_CALL_ERROR("E18888", "create GeTensorDesc failed."); + GE_CHK_BOOL_EXEC(temp_value != nullptr, REPORT_INNER_ERR_MSG("E18888", "create GeTensorDesc failed."); return false, "[Create][GeTensorDesc] temp_value is nullptr."); op_desc->impl_->outputs_desc_.push_back(temp_value); } @@ -635,7 +635,7 @@ bool ModelSerializeImp::UnserializeNode(ComputeGraphPtr &graph, proto::OpDef &op const NodePtr node = graph->AddNode(op_desc, op_desc->GetId()); GE_CHK_BOOL_EXEC(node != nullptr, - REPORT_CALL_ERROR("E18888", "add node to graph:%s failed", graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add node to graph:%s failed", graph->GetName().c_str()); return false, "[Add][Node] to graph:%s failed.", graph->GetName().c_str()); std::vector src_out_peer_index; @@ -756,8 +756,8 @@ bool ModelSerializeImp::RebuildOwnership(ComputeGraphPtr &compute_graph, } const auto it = subgraphs.find(name); if (it == subgraphs.end()) { - REPORT_INNER_ERROR("E18888", "Node:%s, Subgraph:%s not found, num:%zu.", - op_desc->GetName().c_str(), name.c_str(), subgraphs.size()); + REPORT_INNER_ERR_MSG("E18888", "Node:%s, Subgraph:%s not found, num:%zu.", op_desc->GetName().c_str(), + name.c_str(), subgraphs.size()); GELOGE(GRAPH_FAILED, "[Check][Param] Node:%s, Subgraph:%s not found, num:%zu.", op_desc->GetName().c_str(), name.c_str(), subgraphs.size()); return false; @@ -887,7 +887,7 @@ bool ModelSerializeImp::UnserializeModel(Model &model, proto::ModelDef &model_pr bool ModelSerializeImp::UnserializeGraphWithoutEdge(ComputeGraphPtr &graph, proto::GraphDef &graph_proto) { graph = ComGraphMakeShared(graph_proto.name()); if ((graph == nullptr) || (graph->impl_ == nullptr)) { - REPORT_CALL_ERROR("E18888", "create ComputeGraph failed."); + REPORT_INNER_ERR_MSG("E18888", "create ComputeGraph failed."); GELOGE(GRAPH_FAILED, "[Create][ComputeGraph] ComputeGraph make shared failed"); return false; } @@ -948,16 +948,16 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool ModelSerializeImp::Unseriali static bool ReadProtoFromBinaryFile(const uint8_t *const data, const size_t len, google::protobuf::Message *const proto) { - GE_CHK_BOOL_EXEC(data != nullptr, REPORT_INNER_ERROR("E18888", "param data is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(data != nullptr, REPORT_INNER_ERR_MSG("E18888", "param data is nullptr, check invalid."); return false, "[Check][Param] data is null."); - GE_CHK_BOOL_EXEC(proto != nullptr, REPORT_INNER_ERROR("E18888", "param proto is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(proto != nullptr, REPORT_INNER_ERR_MSG("E18888", "param proto is nullptr, check invalid."); return false, "[Check][Param] proto is null."); google::protobuf::io::CodedInputStream coded_stream(data, static_cast(len)); // 2048M -1 coded_stream.SetTotalBytesLimit(INT32_MAX); if (!proto->ParseFromCodedStream(&coded_stream)) { - REPORT_CALL_ERROR("E18888", "Read proto from BinaryFile failed, len %zu", len); + REPORT_INNER_ERR_MSG("E18888", "Read proto from BinaryFile failed, len %zu", len); GELOGE(GRAPH_FAILED, "[Read][Proto] from BinaryFile failed, len %zu", len); return false; } @@ -1193,7 +1193,7 @@ bool ModelSerializeImp::SetWeightForModel(proto::OpDef &op_def) const { bool ModelSerialize::UnserializeModel(const uint8_t *const data, const size_t len, Model &model, const bool is_enable_multi_thread) const { if (data == nullptr) { - REPORT_INNER_ERROR("E18888", "param data is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param data is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] data is nullptr"); return false; } @@ -1201,7 +1201,7 @@ bool ModelSerialize::UnserializeModel(const uint8_t *const data, const size_t le std::shared_ptr model_proto_ptr; model_proto_ptr = ComGraphMakeShared(); if (model_proto_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "create ModelDef failed."); + REPORT_INNER_ERR_MSG("E18888", "create ModelDef failed."); GELOGE(GRAPH_FAILED, "[Create][ModelDef] proto::ModelDef make shared failed"); return false; } @@ -1227,7 +1227,7 @@ bool ModelSerialize::UnserializeModel(ge::proto::ModelDef &model_def, Model &mod bool ModelSerialize::UnserializeModel(ge::proto::ModelDef &model_def, Model &model, const std::string &path) const { const std::shared_ptr model_def_ptr = ComGraphMakeShared(model_def); - GE_CHK_BOOL_EXEC(model_def_ptr != nullptr, REPORT_CALL_ERROR("E18888", "create ModelDef failed."); + GE_CHK_BOOL_EXEC(model_def_ptr != nullptr, REPORT_INNER_ERR_MSG("E18888", "create ModelDef failed."); return false, "[Create][ModelDef] mode_def make shared failed"); ModelSerializeImp model_imp; diff --git a/graph/type/sym_dtype.cc b/graph/type/sym_dtype.cc index 9800a53682..c0e4dcaf24 100644 --- a/graph/type/sym_dtype.cc +++ b/graph/type/sym_dtype.cc @@ -316,9 +316,9 @@ graphStatus SymDtype::Eval(const OpDesc &op, DataType &dtype) const { infered_dtypes.size()); dtype = *infered_dtypes.begin(); if (!tensor_type_.tensor_type_impl_->IsDataTypeInRange(dtype)) { - REPORT_CALL_ERROR("EZ9999", "Sym %s of op %s %s infered dtype %s not in range %s", - id_.c_str(), op.GetName().c_str(), op.GetType().c_str(), - TypeUtils::DataTypeToSerialString(dtype).c_str(), ToString(tensor_type_).c_str()); + REPORT_INNER_ERR_MSG("EZ9999", "Sym %s of op %s %s infered dtype %s not in range %s", id_.c_str(), + op.GetName().c_str(), op.GetType().c_str(), TypeUtils::DataTypeToSerialString(dtype).c_str(), + ToString(tensor_type_).c_str()); GELOGW("Sym %s infered dtype %s not in range %s", id_.c_str(), TypeUtils::DataTypeToSerialString(dtype).c_str(), ToString(tensor_type_).c_str()); return PARAM_INVALID; diff --git a/graph/type/types.cc b/graph/type/types.cc index 28a4b04d22..99fa65f20b 100644 --- a/graph/type/types.cc +++ b/graph/type/types.cc @@ -13,7 +13,6 @@ #include "common/ge_common/debug/ge_log.h" #include "graph/ge_error_codes.h" #include "graph/utils/type_utils.h" -#include "inc/common/util/error_manager/error_manager.h" namespace ge { const char_t *GetFormatName(Format format) { diff --git a/graph/utils/anchor_utils.cc b/graph/utils/anchor_utils.cc index 7748cfa6dc..c7c2b1b5cb 100644 --- a/graph/utils/anchor_utils.cc +++ b/graph/utils/anchor_utils.cc @@ -16,7 +16,7 @@ namespace ge { // Get anchor status GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY AnchorStatus AnchorUtils::GetStatus(const DataAnchorPtr &data_anchor) { if (data_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "param data_anchor is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param data_anchor is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] The input data anchor is invalid."); return ANCHOR_RESERVED; } @@ -27,7 +27,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY AnchorStatus AnchorUtils::GetStat GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus AnchorUtils::SetStatus(const DataAnchorPtr &data_anchor, const AnchorStatus anchor_status) { if ((data_anchor == nullptr) || (anchor_status == ANCHOR_RESERVED)) { - REPORT_INNER_ERROR("E18888", "The input data anchor or input data format is invalid."); + REPORT_INNER_ERR_MSG("E18888", "The input data anchor or input data format is invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] The input data anchor or input data format is invalid."); return GRAPH_FAILED; } diff --git a/graph/utils/ffts_graph_utils.cc b/graph/utils/ffts_graph_utils.cc index f77f901f8f..3a7753e6c5 100644 --- a/graph/utils/ffts_graph_utils.cc +++ b/graph/utils/ffts_graph_utils.cc @@ -189,7 +189,7 @@ graphStatus FftsGraphUtils::SplitSubgraph(const ComputeGraphPtr &subgraph, const auto &subgraph_name = "FFTS_Plus_Subgraph_" + std::to_string(g_fftsPlusSubgraphNum++); const auto &new_subgraph = GraphUtils::BuildSubgraphWithNodes(subgraph, item.second, subgraph_name); if (new_subgraph == nullptr) { - REPORT_CALL_ERROR("E18888", "Build subgraph %s failed", subgraph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Build subgraph %s failed", subgraph_name.c_str()); GELOGE(GRAPH_FAILED, "[Build][Subgraph] %s failed", subgraph_name.c_str()); return GRAPH_FAILED; } @@ -212,7 +212,7 @@ graphStatus FftsGraphUtils::BuildFftsPlusSubgraphWithAllNodes(const ComputeGraph const auto &subgraph_name = "FFTS_Plus_Subgraph_" + std::to_string(g_fftsPlusSubgraphNum++); const auto &new_subgraph = GraphUtils::BuildSubgraphWithNodes(subgraph, calc_nodes, subgraph_name); if (new_subgraph == nullptr) { - REPORT_CALL_ERROR("E18888", "Build subgraph %s failed", subgraph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Build subgraph %s failed", subgraph_name.c_str()); GELOGE(GRAPH_FAILED, "[Build][Subgraph] %s failed", subgraph_name.c_str()); return GRAPH_FAILED; } @@ -285,19 +285,19 @@ void FftsGraphUtils::CollectEndNodeInSubgraph(const ComputeGraphPtr &subgraph, ComputeGraphPtr FftsGraphUtils::GetFftsPlusGraph(ComputeGraph &graph) { const auto &parent_node = graph.GetParentNode(); if (parent_node == nullptr) { - REPORT_INNER_ERROR("E18888", "parent node of graph %s is null", graph.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "parent node of graph %s is null", graph.GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] parent node of graph %s is null", graph.GetName().c_str()); return nullptr; } std::vector subgraphs; if (NodeUtils::GetDirectSubgraphs(parent_node, subgraphs) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Get subgraph failed, node:%s", parent_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get subgraph failed, node:%s", parent_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Subgraph] failed, node:%s", parent_node->GetName().c_str()); return nullptr; } if (subgraphs.size() != 1U) { - REPORT_INNER_ERROR("E18888", "Number of subgraphs in parent_node:%s is %zu, graph:%s", - parent_node->GetName().c_str(), subgraphs.size(), graph.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Number of subgraphs in parent_node:%s is %zu, graph:%s", + parent_node->GetName().c_str(), subgraphs.size(), graph.GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Number of subgraphs in parent_node:%s is %zu, graph:%s", parent_node->GetName().c_str(), subgraphs.size(), graph.GetName().c_str()); return nullptr; @@ -308,7 +308,7 @@ ComputeGraphPtr FftsGraphUtils::GetFftsPlusGraph(ComputeGraph &graph) { graphStatus FftsGraphUtils::SetAttrForFftsPlusSubgraph(const ComputeGraphPtr &subgraph) { const auto &parent_node = subgraph->GetParentNode(); if (parent_node == nullptr) { - REPORT_INNER_ERROR("E18888", "Parent node of subgraph %s is null", subgraph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Parent node of subgraph %s is null", subgraph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Parent node of subgraph %s is null", subgraph->GetName().c_str()); return GRAPH_FAILED; } @@ -338,7 +338,7 @@ graphStatus FftsGraphUtils::GraphPartition(ComputeGraph &graph, GE_CHK_STATUS_RET(Calculate(ffts_plus_graph, calc_func, node_value, graph_value), "[Calculate][Value] failed for graph %s", ffts_plus_graph->GetName().c_str()); if (!IsValueValid(ffts_plus_graph, upper_limit, node_value, graph_value)) { - REPORT_CALL_ERROR("E18888", "Check value invalid"); + REPORT_INNER_ERR_MSG("E18888", "Check value invalid"); GELOGE(GRAPH_FAILED, "[Check][Value] invalid"); return GRAPH_FAILED; } @@ -381,7 +381,7 @@ graphStatus FftsGraphUtils::Calculate(const ComputeGraphPtr &graph, std::map> &graph_value, const uint32_t recursive_depth) { if (recursive_depth >= kMaxiumRecursionDepth) { - REPORT_INNER_ERROR("E18888", "param depth:%u >= %u(allow max subgraphs)", recursive_depth, kMaxiumRecursionDepth); + REPORT_INNER_ERR_MSG("E18888", "param depth:%u >= %u(allow max subgraphs)", recursive_depth, kMaxiumRecursionDepth); GELOGE(GRAPH_FAILED, "[Check][Param]exist too much subgraphs:%u > %u(allow max subgraphs)", recursive_depth, kMaxiumRecursionDepth); return GRAPH_FAILED; @@ -395,7 +395,7 @@ graphStatus FftsGraphUtils::Calculate(const ComputeGraphPtr &graph, } else { cur_node_value = Calculate(node, calc_func, node_value, graph_value, recursive_depth); if (cur_node_value.empty()) { - REPORT_INNER_ERROR("E18888", "Calculate value for func node %s failed", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Calculate value for func node %s failed", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Calculate][Value] for func node %s failed", node->GetName().c_str()); return GRAPH_FAILED; } @@ -404,9 +404,11 @@ graphStatus FftsGraphUtils::Calculate(const ComputeGraphPtr &graph, if (cur_graph_value.empty()) { cur_graph_value = cur_node_value; } else if (cur_graph_value.size() != cur_node_value.size()) { - REPORT_INNER_ERROR("E18888", "Value size not match, value size of graph %s is %zu, " - "value size of node %s is %zu", graph->GetName().c_str(), cur_graph_value.size(), - node->GetName().c_str(), cur_node_value.size()); + REPORT_INNER_ERR_MSG("E18888", + "Value size not match, value size of graph %s is %zu, " + "value size of node %s is %zu", + graph->GetName().c_str(), cur_graph_value.size(), node->GetName().c_str(), + cur_node_value.size()); GELOGE(GRAPH_FAILED, "[Check][Param] Value size not match, value size of graph %s is %zu, " "value size of node %s is %zu", graph->GetName().c_str(), cur_graph_value.size(), node->GetName().c_str(), cur_node_value.size()); @@ -426,7 +428,7 @@ std::vector FftsGraphUtils::Calculate(const NodePtr &node, const CalcF const uint32_t recursive_depth) { std::vector subgraphs; if (NodeUtils::GetDirectSubgraphs(node, subgraphs) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Get subgraphs failed"); + REPORT_INNER_ERR_MSG("E18888", "Get subgraphs failed"); GELOGE(GRAPH_FAILED, "[Get][Subgraphs] failed"); return {}; } @@ -434,15 +436,15 @@ std::vector FftsGraphUtils::Calculate(const NodePtr &node, const CalcF for (const auto &subgraph : subgraphs) { if (graph_value.count(subgraph) == 0U) { if (Calculate(subgraph, calc_func, node_value, graph_value, recursive_depth + 1U) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Calculate value failed, graph %s, parent_node:%s", - subgraph->GetName().c_str(), node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Calculate value failed, graph %s, parent_node:%s", subgraph->GetName().c_str(), + node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Calculate][Value] failed, graph %s, parent_node:%s", subgraph->GetName().c_str(), node->GetName().c_str()); return {}; } } if (graph_value.find(subgraph) == graph_value.end()) { - REPORT_INNER_ERROR("E18888", "Find value failed for graph %s", subgraph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find value failed for graph %s", subgraph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Find][Value] failed for graph %s", subgraph->GetName().c_str()); return {}; } @@ -450,9 +452,11 @@ std::vector FftsGraphUtils::Calculate(const NodePtr &node, const CalcF if (cur_node_value.empty()) { cur_node_value = subgraph_value; } else if (cur_node_value.size() != subgraph_value.size()) { - REPORT_INNER_ERROR("E18888", "Value size not match, value size of node %s is %zu, value size of subgraph %s " - "is %zu", node->GetName().c_str(), cur_node_value.size(), - subgraph->GetName().c_str(), subgraph_value.size()); + REPORT_INNER_ERR_MSG("E18888", + "Value size not match, value size of node %s is %zu, value size of subgraph %s " + "is %zu", + node->GetName().c_str(), cur_node_value.size(), subgraph->GetName().c_str(), + subgraph_value.size()); GELOGE(GRAPH_FAILED, "[Check][Param] Value size not match, value size of node %s is %zu, " "value size of subgraph %s is %zu", node->GetName().c_str(), cur_node_value.size(), subgraph->GetName().c_str(), subgraph_value.size()); @@ -471,13 +475,13 @@ bool FftsGraphUtils::IsValueValid(const ComputeGraphPtr &graph, const std::vecto const std::map> &graph_value) { std::vector subgraphs; if (GraphUtils::GetSubgraphsRecursively(graph, subgraphs) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Get subgraphs failed, graph:%s", graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get subgraphs failed, graph:%s", graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Subgraphs] failed, graph:%s", graph->GetName().c_str()); return false; } for (const auto &subgraph : subgraphs) { if (graph_value.count(subgraph) == 0U) { - REPORT_INNER_ERROR("E18888", "Find graph value failed, graph:%s", subgraph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find graph value failed, graph:%s", subgraph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Find graph value failed, graph:%s", subgraph->GetName().c_str()); return false; } @@ -485,7 +489,7 @@ bool FftsGraphUtils::IsValueValid(const ComputeGraphPtr &graph, const std::vecto CollectCalcNodeInSubgraph(subgraph, calc_nodes); for (const auto &node : calc_nodes) { if (node_value.count(node) == 0U) { - REPORT_INNER_ERROR("E18888", "Find node value failed, node:%s", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find node value failed, node:%s", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Find node value failed, node:%s", node->GetName().c_str()); return false; } @@ -496,7 +500,7 @@ bool FftsGraphUtils::IsValueValid(const ComputeGraphPtr &graph, const std::vecto return pair_item.second.size() != upper_limit.size(); }; if (std::find_if(node_value.begin(), node_value.end(), is_node_value_match) != node_value.end()) { - REPORT_INNER_ERROR("E18888", "Node value size not match"); + REPORT_INNER_ERR_MSG("E18888", "Node value size not match"); GELOGE(GRAPH_FAILED, "[Check][Param] Node value size not match"); return false; } @@ -505,7 +509,7 @@ bool FftsGraphUtils::IsValueValid(const ComputeGraphPtr &graph, const std::vecto return pair_item.second.size() != upper_limit.size(); }; if (std::find_if(graph_value.begin(), graph_value.end(), is_graph_value_match) != graph_value.end()) { - REPORT_INNER_ERROR("E18888", "Graph value size not match"); + REPORT_INNER_ERR_MSG("E18888", "Graph value size not match"); GELOGE(GRAPH_FAILED, "[Check][Param] Graph value size not match"); return false; } @@ -519,7 +523,7 @@ graphStatus FftsGraphUtils::PartitionGraphWithLimit(const ComputeGraphPtr &graph const std::vector &upper_limit, const uint32_t recursive_depth) { if (recursive_depth >= kMaxiumRecursionDepth) { - REPORT_INNER_ERROR("E18888", "param depth:%u >= %u(allow max subgraphs)", recursive_depth, kMaxiumRecursionDepth); + REPORT_INNER_ERR_MSG("E18888", "param depth:%u >= %u(allow max subgraphs)", recursive_depth, kMaxiumRecursionDepth); GELOGE(GRAPH_FAILED, "[Check][Param]exist too much subgraphs:%u > %u(allow max subgraphs)", recursive_depth, kMaxiumRecursionDepth); return GRAPH_FAILED; @@ -562,7 +566,7 @@ graphStatus FftsGraphUtils::PartitionGraphWithLimit(const ComputeGraphPtr &graph const auto &subgraph_name = "FFTS_Plus_Subgraph_" + std::to_string(g_fftsPlusSubgraphNum++); const auto &subgraph = GraphUtils::BuildSubgraphWithNodes(graph, item.second, subgraph_name); if (subgraph == nullptr) { - REPORT_CALL_ERROR("E18888", "Build subgraph %s failed", subgraph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Build subgraph %s failed", subgraph_name.c_str()); GELOGE(GRAPH_FAILED, "[Build][Subgraph] %s failed", subgraph_name.c_str()); return GRAPH_FAILED; } diff --git a/graph/utils/ge_ir_utils.cc b/graph/utils/ge_ir_utils.cc index 09a279ab46..8c0ba1bb49 100644 --- a/graph/utils/ge_ir_utils.cc +++ b/graph/utils/ge_ir_utils.cc @@ -107,13 +107,13 @@ onnx::TensorProto_DataType OnnxUtils::EncodeDataType(const DataType data_type) { void OnnxUtils::AddAttrProtoFromAttribute(const std::pair &string_attr_value, onnx::NodeProto *const node_proto) { if (node_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_proto is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node_proto is nullptr, check invalid"); GELOGE(FAILED, "[Check][Param] Node proto is nullptr."); return; } const auto attr = node_proto->add_attribute(); if (attr == nullptr) { - REPORT_INNER_ERROR("E18888", "add attr to node proto return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "add attr to node proto return nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] attr is nullptr."); return; } @@ -179,13 +179,13 @@ void OnnxUtils::AddAttrProtoFromAttribute(const std::pairadd_attribute(); if (attr == nullptr) { - REPORT_INNER_ERROR("E18888", "add attr to node proto return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "add attr to node proto return nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] attr is nullptr."); return; } @@ -237,14 +237,14 @@ void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::Attr const std::string &name, const ::google::protobuf::RepeatedField<::google::protobuf::int64> data) { if (node_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_proto is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "param node_proto is nullptr."); GELOGE(FAILED, "[Check][Param] Node_proto is nullptr."); return; } if (!data.empty()) { const auto attr = node_proto->add_attribute(); if (attr == nullptr) { - REPORT_INNER_ERROR("E18888", "add attr to node proto return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "add attr to node proto return nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] attr is nullptr."); return; } @@ -259,14 +259,14 @@ void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::Attr void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::AttributeProto_AttributeType type, const std::string &name, const ::google::protobuf::RepeatedField data) { if (node_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_proto is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "param node_proto is nullptr."); GELOGE(FAILED, "[Check][Param] Node proto is nullptr."); return; } if (!data.empty()) { const auto attr = node_proto->add_attribute(); if (attr == nullptr) { - REPORT_INNER_ERROR("E18888", "add attr to node proto return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "add attr to node proto return nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] attr is nullptr."); return; } @@ -281,14 +281,14 @@ void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::Attr void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::AttributeProto_AttributeType type, const std::string &name, const ::google::protobuf::RepeatedField data) { if (node_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_proto is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "param node_proto is nullptr."); GELOGE(FAILED, "[Check][Param] Node_proto is nullptr."); return; } if (!data.empty()) { const auto attr = node_proto->add_attribute(); if (attr == nullptr) { - REPORT_INNER_ERROR("E18888", "add attr to node proto return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "add attr to node proto return nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] attr is nullptr."); return; } @@ -303,14 +303,14 @@ void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::Attr void OnnxUtils::AddAttrProto(onnx::NodeProto *const node_proto, const onnx::AttributeProto_AttributeType type, const std::string &name, const ::google::protobuf::RepeatedPtrField<::std::string> data) { if (node_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_proto is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "param node_proto is nullptr."); GELOGE(FAILED, "[Check][Param] Node proto is nullptr."); return; } if (!data.empty()) { const auto attr = node_proto->add_attribute(); if (attr == nullptr) { - REPORT_INNER_ERROR("E18888", "add attr to node proto return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "add attr to node proto return nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] attr is nullptr."); return; } @@ -491,7 +491,7 @@ void OnnxUtils::AddAttrProtoForOpOutDesc(onnx::NodeProto *const node_proto, cons void OnnxUtils::AddAttrProtoForOpInAndOutDesc(onnx::NodeProto *const node_proto, const OpDescPtr &op_desc) { if ((node_proto == nullptr) || (op_desc == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node_proto or op_desc is nullptr"); + REPORT_INNER_ERR_MSG("E18888", "param node_proto or op_desc is nullptr"); GELOGE(GRAPH_FAILED, "[Check][Param] node_proto or op_desc is nullptr"); return; } @@ -636,7 +636,7 @@ void OnnxUtils::AddCommonAttrIntoProto(onnx::NodeProto *const node_proto, const void OnnxUtils::AddAttrProtoFromNodeMembers(const NodePtr &node, onnx::NodeProto *const node_proto) { if ((node == nullptr) || (node->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node is nullptr."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr."); GELOGE(GRAPH_FAILED, "[Check][Param] node is nullptr"); return; } @@ -668,7 +668,7 @@ void OnnxUtils::AddAttrProtoFromNodeMembers(const NodePtr &node, onnx::NodeProto // Others AddCommonAttrIntoProto(node_proto, op_desc); } else { - REPORT_INNER_ERROR("E18888", "Opdesc is nullptr, node:%s", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Opdesc is nullptr, node:%s", node->GetName().c_str()); GELOGE(FAILED, "[Check][Param] Opdesc is nullptr"); return; } @@ -676,7 +676,7 @@ void OnnxUtils::AddAttrProtoFromNodeMembers(const NodePtr &node, onnx::NodeProto bool OnnxUtils::EncodeNodeDesc(const NodePtr &node, onnx::NodeProto *const node_proto) { if ((node == nullptr) || (node->impl_ == nullptr) || (node_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or node_proto is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node or node_proto is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeOpDesc: Input Para Node Invalid"); return false; } @@ -690,7 +690,7 @@ bool OnnxUtils::EncodeNodeDesc(const NodePtr &node, onnx::NodeProto *const node_ void OnnxUtils::EncodeNodeLinkForNetronVisual(const NodePtr &node, onnx::NodeProto *const node_proto) { if ((node == nullptr) || (node_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or node_proto is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node or node_proto is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeNodeLinkForNetronVisual: Input Para Node Invalid"); return; } @@ -708,7 +708,7 @@ void OnnxUtils::EncodeNodeLinkForNetronVisual(const NodePtr &node, onnx::NodePro bool OnnxUtils::EncodeNodeLink(const NodePtr &node, onnx::NodeProto *const node_proto) { if ((node == nullptr) || (node_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or node_proto is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node or node_proto is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeNodeLink: Input Para Node Invalid"); return false; } @@ -735,7 +735,7 @@ bool OnnxUtils::EncodeNodeLink(const NodePtr &node, onnx::NodeProto *const node_ } } } else { - REPORT_INNER_ERROR("E18888", "In control anchor of node(%s) is nullptr", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "In control anchor of node(%s) is nullptr", node->GetName().c_str()); GELOGE(FAILED, "[Check][Param] In control anchor of node(%s) is nullptr", node->GetName().c_str()); return false; } @@ -747,7 +747,7 @@ bool OnnxUtils::EncodeNodeLink(const NodePtr &node, onnx::NodeProto *const node_ bool OnnxUtils::EncodeNode(const NodePtr &node, onnx::NodeProto *const node_proto) { if ((node == nullptr) || (node_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or node_proto is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node or node_proto is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeNode: Input Para Node Invalid"); return false; } @@ -771,7 +771,7 @@ bool OnnxUtils::EncodeNode(const NodePtr &node, onnx::NodeProto *const node_prot void OnnxUtils::EncodeTypeProtoTensorType(const NodePtr &node, onnx::TypeProto_Tensor *const tensor_type) { if ((node == nullptr) || (tensor_type == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or tensor type is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node or tensor type is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeTypeProtoTensorType: Input Para Node or tensor_type Invalid"); return; } @@ -803,7 +803,7 @@ void OnnxUtils::EncodeTypeProtoTensorType(const NodePtr &node, onnx::TypeProto_T void OnnxUtils::EncodeValueInfo(const NodePtr &node, onnx::ValueInfoProto *const value_info_proto) { if ((node == nullptr) || (value_info_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node or value info proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node or value info proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeValueInfo: Input Param Node or value_info_proto Invalid"); return; } @@ -815,7 +815,7 @@ void OnnxUtils::EncodeValueInfo(const NodePtr &node, onnx::ValueInfoProto *const bool OnnxUtils::EncodeGraph(const ConstComputeGraphPtr &graph, onnx::GraphProto *const graph_proto) { if ((graph == nullptr) || (graph_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param graph or graph proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param graph or graph proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] EncodeGraph: Input para Invalid"); return false; } @@ -851,13 +851,13 @@ bool OnnxUtils::ConvertGeModelToModelProto(const ge::Model &model, onnx::ModelPr model_proto.set_producer_name(model.GetName()); const auto compute_graph = model.graph_; if (compute_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "GetComputeGraph for model return nullptr."); + REPORT_INNER_ERR_MSG("E18888", "GetComputeGraph for model return nullptr."); GELOGE(GRAPH_FAILED, "[Invoke][GetComputeGraph] return nullptr"); return false; } const auto graph_proto = model_proto.mutable_graph(); if (graph_proto == nullptr) { - REPORT_INNER_ERROR("E18888", "mutable_graph return nullptr, graph:%s", compute_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "mutable_graph return nullptr, graph:%s", compute_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][MutableGraph] return nullptr, graph:%s", compute_graph->GetName().c_str()); return false; } @@ -921,7 +921,7 @@ bool OnnxUtils::ParseNameAndIndex(const std::string &node_name_index, std::strin bool OnnxUtils::DecodeNodeLinkImp(const NodeLinkInfo &item, const NodePtr &node_ptr) { if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_ptr is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node_ptr is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] DecodeNodeLinkImp: node_ptr is nullptr"); return false; } @@ -930,14 +930,14 @@ bool OnnxUtils::DecodeNodeLinkImp(const NodeLinkInfo &item, const NodePtr &node_ const auto src_anchor = node_ptr->GetOutDataAnchor(item.GetSrcOutIndex()); const auto dst_anchor = item.GetDstNode()->GetInDataAnchor(item.GetDstInIndex()); if ((src_anchor == nullptr) || (dst_anchor == nullptr)) { - REPORT_INNER_ERROR("E18888", "Get DataAnchor failed, %s:%d, %s:%d ", item.GetSrcNodeName().c_str(), - item.GetSrcOutIndex(), item.GetDstNodeName().c_str(), item.GetDstInIndex()); + REPORT_INNER_ERR_MSG("E18888", "Get DataAnchor failed, %s:%d, %s:%d ", item.GetSrcNodeName().c_str(), + item.GetSrcOutIndex(), item.GetDstNodeName().c_str(), item.GetDstInIndex()); GELOGE(GRAPH_FAILED, "[Get][DataAnchor] failed, %s:%d, %s:%d ", item.GetSrcNodeName().c_str(), item.GetSrcOutIndex(), item.GetDstNodeName().c_str(), item.GetDstInIndex()); return false; } if (src_anchor->LinkTo(dst_anchor) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "src anchor link to dst anchor failed."); + REPORT_INNER_ERR_MSG("E18888", "src anchor link to dst anchor failed."); GELOGE(GRAPH_FAILED, "[Invoke][LinkTo] Data Anchor: src anchor link to dst anchor failed"); return false; } @@ -946,16 +946,16 @@ bool OnnxUtils::DecodeNodeLinkImp(const NodeLinkInfo &item, const NodePtr &node_ const auto src_anchor = node_ptr->GetOutControlAnchor(); const auto dst_anchor = item.GetDstNode()->GetInControlAnchor(); if ((src_anchor == nullptr) || (dst_anchor == nullptr)) { - REPORT_INNER_ERROR("E18888", "Get ControlAnchor failed, %s:%d, %s:%d ", item.GetSrcNodeName().c_str(), - item.GetSrcOutIndex(), item.GetDstNodeName().c_str(), item.GetDstInIndex()); + REPORT_INNER_ERR_MSG("E18888", "Get ControlAnchor failed, %s:%d, %s:%d ", item.GetSrcNodeName().c_str(), + item.GetSrcOutIndex(), item.GetDstNodeName().c_str(), item.GetDstInIndex()); GELOGE(GRAPH_FAILED, "[Get][ControlAnchor] failed, %s:%d, %s:%d ", item.GetSrcNodeName().c_str(), item.GetSrcOutIndex(), item.GetDstNodeName().c_str(), item.GetDstInIndex()); return false; } if (src_anchor->LinkTo(dst_anchor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "src anchor(%s) link to dst anchor(%s) failed.", - src_anchor->GetOwnerNode()->GetName().c_str(), - dst_anchor->GetOwnerNode()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src anchor(%s) link to dst anchor(%s) failed.", + src_anchor->GetOwnerNode()->GetName().c_str(), + dst_anchor->GetOwnerNode()->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][LinkTo] Control Anchor: src anchor(%s) link to dst anchor(%s) failed", src_anchor->GetOwnerNode()->GetName().c_str(), dst_anchor->GetOwnerNode()->GetName().c_str()); return false; @@ -970,7 +970,7 @@ bool OnnxUtils::DecodeNodeLink(const std::vector &node_proto_ve const auto &node_name = node_proto.name(); const auto dst_node = node_map.find(node_name); if ((dst_node == node_map.end()) || (dst_node->second == nullptr)) { - REPORT_INNER_ERROR("E18888", "destination node: %s find failed or is nullptr", node_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "destination node: %s find failed or is nullptr", node_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] destination node: %s find failed or is nullptr", node_name.c_str()); return false; } @@ -982,13 +982,13 @@ bool OnnxUtils::DecodeNodeLink(const std::vector &node_proto_ve const auto item = NodeLinkInfo{input_node_name, index, dst_node->second, dst_index, node_proto.name()}; const auto src_node = node_map.find(input_node_name); if (src_node == node_map.end()) { - REPORT_INNER_ERROR("E18888", "find src node: %s failed", input_node_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "find src node: %s failed", input_node_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] find src node: %s failed", input_node_name.c_str()); return false; } const auto node_ptr = src_node->second; if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "src node: %s is nullptr", input_node_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "src node: %s is nullptr", input_node_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] src node: %s is nullptr", input_node_name.c_str()); return false; } @@ -1007,7 +1007,7 @@ bool OnnxUtils::DecodeNodeLink(const std::vector &node_proto_ve void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, std::vector &strings) { if (attr_proto.type() != ge::onnx::AttributeProto_AttributeType_STRINGS) { - REPORT_INNER_ERROR("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); return; } @@ -1018,7 +1018,7 @@ void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, std: void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, std::string &value) { if (attr_proto.type() != ge::onnx::AttributeProto_AttributeType_STRING) { - REPORT_INNER_ERROR("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); return; } @@ -1027,7 +1027,7 @@ void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, std: void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, std::vector &ints) { if (attr_proto.type() != ge::onnx::AttributeProto_AttributeType_INTS) { - REPORT_INNER_ERROR("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); return; } @@ -1038,7 +1038,7 @@ void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, std: void OnnxUtils::DecodeAttribute(const ge::onnx::AttributeProto &attr_proto, int64_t &value) { if (attr_proto.type() != ge::onnx::AttributeProto_AttributeType_INT) { - REPORT_INNER_ERROR("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Attribute %s call wrong decode attribute function", attr_proto.name().c_str()); return; } @@ -1051,8 +1051,8 @@ void OnnxUtils::DecodeNodeAttributeForOpInDesc(const onnx::AttributeProto &attr_ const OpDescPtr &op_desc) { const auto tensor_desc = op_desc->MutableInputDesc(static_cast(idx)); if ((tensor_desc == nullptr) || (tensor_desc->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "MutableInputDesc index:%d return nullptr, op:%s, attr:%s", - idx, op_desc->GetName().c_str(), attr_name_for_input_desc.c_str()); + REPORT_INNER_ERR_MSG("E18888", "MutableInputDesc index:%d return nullptr, op:%s, attr:%s", idx, + op_desc->GetName().c_str(), attr_name_for_input_desc.c_str()); GELOGE(GRAPH_FAILED, "[Invoke][MutableInputDesc] index:%d return nullptr, op name %s, attr name %s", idx, op_desc->GetName().c_str(), attr_name_for_input_desc.c_str()); return; @@ -1094,8 +1094,8 @@ void OnnxUtils::DecodeNodeAttributeForOpOutDesc(const onnx::AttributeProto &attr const int32_t index, const OpDescPtr &op_desc) { const auto tensor_desc = op_desc->MutableOutputDesc(static_cast(index)); if ((tensor_desc == nullptr) || (tensor_desc->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "MutableOutputDesc index:%d return nullptr, op:%s, attr:%s", - index, op_desc->GetName().c_str(), attr_name_for_output_desc.c_str()); + REPORT_INNER_ERR_MSG("E18888", "MutableOutputDesc index:%d return nullptr, op:%s, attr:%s", index, + op_desc->GetName().c_str(), attr_name_for_output_desc.c_str()); GELOGE(GRAPH_FAILED, "[Invoke][MutableOutputDesc] index:%d return nullptr, op name %s, attr name %s", index, op_desc->GetName().c_str(), attr_name_for_output_desc.c_str()); return; @@ -1137,7 +1137,7 @@ void OnnxUtils::DecodeNodeAttributeForOpInAndOutDesc(const onnx::AttributeProto const int32_t idx, const OpDescPtr &op_desc) { if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "param op_desc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param op_desc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] op_desc is nullptr"); return; } @@ -1152,7 +1152,7 @@ void OnnxUtils::DecodeNodeAttributeForOpInAndOutDesc(const onnx::AttributeProto void OnnxUtils::DecodeNodeAttributeForOpDesc(const onnx::AttributeProto &attr_proto, OpDescPtr &op_desc) { if ((op_desc == nullptr) || (op_desc->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param op_desc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param op_desc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] DecodeNodeAttributeForOpDesc: op_desc is nullptr"); return; } @@ -1205,7 +1205,7 @@ void OnnxUtils::DecodeNodeAttributeForOpDesc(const onnx::AttributeProto &attr_pr bool OnnxUtils::DecodeNodeDesc(const onnx::NodeProto *const node_proto, OpDescPtr &op_desc) { if ((op_desc == nullptr) || (node_proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param op_desc or node_proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param op_desc or node_proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Op_desc is nullptr or node_proto is nullptr"); return false; } @@ -1250,7 +1250,7 @@ bool OnnxUtils::AddInputAndOutputNodesForGraph(const onnx::GraphProto &graph_pro const auto &input_node_name = input.name(); const auto input_node_item = node_map.find(input_node_name); if (input_node_item == node_map.end()) { - REPORT_INNER_ERROR("E18888", "cannot find graph's input node %s in node_", input_node_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "cannot find graph's input node %s in node_", input_node_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] cannot find graph's input node %s in node_", input_node_name.c_str()); return false; } @@ -1263,7 +1263,7 @@ bool OnnxUtils::AddInputAndOutputNodesForGraph(const onnx::GraphProto &graph_pro const auto &output_name = output.name(); const auto output_node_item = node_map.find(output_name); if (output_node_item == node_map.end()) { - REPORT_INNER_ERROR("E18888", "cannot find graph's output node %s in node_", output_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "cannot find graph's output node %s in node_", output_name.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] cannot find graph's output node %s in node_", output_name.c_str()); return false; } @@ -1279,15 +1279,15 @@ bool OnnxUtils::AddInputAndOutputNodesForGraph(const onnx::GraphProto &graph_pro bool OnnxUtils::DecodeGraph(const int32_t recursion_depth, const onnx::GraphProto &graph_proto, ComputeGraphPtr &graph) { if (recursion_depth > kMaxRecursiveDepth) { - REPORT_INNER_ERROR("E18888", "param recursion_depth:%d is bigger than kMaxRecursiveDepth:%d", - recursion_depth, kMaxRecursiveDepth); + REPORT_INNER_ERR_MSG("E18888", "param recursion_depth:%d is bigger than kMaxRecursiveDepth:%d", recursion_depth, + kMaxRecursiveDepth); GELOGE(GRAPH_FAILED, "[Check][Param] DecodeGraph: recursion depth is too large, abort"); return false; } graph = ComGraphMakeShared(graph_proto.name()); GE_CHK_BOOL_EXEC(graph != nullptr, - REPORT_CALL_ERROR("E18888", "create ComputeGraph failed."); + REPORT_INNER_ERR_MSG("E18888", "create ComputeGraph failed."); return false, "[Create][ComputeGraph]ComputeGraph make shared failed"); /// 1. Decode all nodes first, node should include input /// and output nodes and nodes which represent sub graphs @@ -1303,8 +1303,8 @@ bool OnnxUtils::DecodeGraph(const int32_t recursion_depth, (DecodeGraph(recursion_depth + 1, node_attr.g(), compute_graph))) { (void)graph->AddSubGraph(compute_graph); } else { - REPORT_INNER_ERROR("E18888", "Decode sub graph %s failed with node type:%d", node_proto.name().c_str(), - node_attr.type()); + REPORT_INNER_ERR_MSG("E18888", "Decode sub graph %s failed with node type:%d", node_proto.name().c_str(), + node_attr.type()); GELOGE(GRAPH_FAILED, "[Check][Param] Decode sub graph %s failed with node type:%d", node_proto.name().c_str(), node_attr.type()); return false; diff --git a/graph/utils/graph_utils.cc b/graph/utils/graph_utils.cc index 7930ae4bf8..798fc966c1 100644 --- a/graph/utils/graph_utils.cc +++ b/graph/utils/graph_utils.cc @@ -176,7 +176,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::AddEdge(c if ((src != nullptr) && (src->LinkTo(dst) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "addedge failed because param src is nullptr or run LinkTo failed."); + REPORT_INNER_ERR_MSG("E18888", "addedge failed because param src is nullptr or run LinkTo failed."); GELOGE(GRAPH_FAILED, "[Add][Edge] Failed."); return GRAPH_FAILED; } @@ -199,7 +199,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::AddEdge(c if ((src_control != nullptr) && (dst_data != nullptr) && (src_control->LinkTo(dst_data) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "AddEdge failed because src or dst is nullptr or run LinkTo failed."); + REPORT_INNER_ERR_MSG("E18888", "AddEdge failed because src or dst is nullptr or run LinkTo failed."); GELOGE(GRAPH_FAILED, "[Add][Edge] Failed."); return GRAPH_FAILED; } @@ -209,7 +209,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::AddEdge(c if ((src != nullptr) && (src->LinkTo(dst) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "AddEdge failed because src is nullptr or run LinkTo failed."); + REPORT_INNER_ERR_MSG("E18888", "AddEdge failed because src is nullptr or run LinkTo failed."); GELOGE(GRAPH_FAILED, "[Add][Edge] Failed."); return GRAPH_FAILED; } @@ -219,7 +219,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::AddEdge(c if ((src != nullptr) && (src->LinkTo(dst) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "AddEdge failed because src is nullptr or run LinkTo failed."); + REPORT_INNER_ERR_MSG("E18888", "AddEdge failed because src is nullptr or run LinkTo failed."); GELOGE(GRAPH_FAILED, "[Add][Edge] Failed."); return GRAPH_FAILED; } @@ -229,7 +229,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RemoveEdg if ((src != nullptr) && (src->Unlink(dst) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "RemoveEdge failed because src is nullptr or run Unlink failed."); + REPORT_INNER_ERR_MSG("E18888", "RemoveEdge failed because src is nullptr or run Unlink failed."); GELOGE(GRAPH_FAILED, "[Remove][Edge] Failed."); return GRAPH_FAILED; } @@ -239,7 +239,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RemoveEdg if ((src != nullptr) && (src->Unlink(dst) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "RemoveEdge failed because src is nullptr or run Unlink failed."); + REPORT_INNER_ERR_MSG("E18888", "RemoveEdge failed because src is nullptr or run Unlink failed."); GELOGE(GRAPH_FAILED, "[Remove][Edge] Failed."); return GRAPH_FAILED; } @@ -249,7 +249,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RemoveEdg if ((src != nullptr) && (src->Unlink(dst) == GRAPH_SUCCESS)) { return GRAPH_SUCCESS; } - REPORT_CALL_ERROR("E18888", "RemoveEdge failed because src is nullptr or run Unlink failed."); + REPORT_INNER_ERR_MSG("E18888", "RemoveEdge failed because src is nullptr or run Unlink failed."); GELOGE(GRAPH_FAILED, "[Remove][Edge] Failed."); return GRAPH_FAILED; } @@ -367,8 +367,8 @@ GraphUtils::RemoveSubgraphRecursively(const ComputeGraphPtr &compute_graph, cons // Remove all subgraph for (const auto &remove_graph : subgraphs) { if (root_graph->RemoveSubGraph(remove_graph) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "RemoveSubGraph failed, sub graph name is %s, compute graph is %s.", - remove_node->GetName().c_str(), compute_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "RemoveSubGraph failed, sub graph name is %s, compute graph is %s.", + remove_node->GetName().c_str(), compute_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Remove][SubGraph] failed, sub graph name is %s, compute graph is %s.", remove_node->GetName().c_str(), compute_graph->GetName().c_str()); return GRAPH_FAILED; @@ -424,7 +424,7 @@ GraphUtils::RemoveNodeWithoutRelink(const ComputeGraphPtr &compute_graph, const GE_CHECK_NOTNULL(compute_graph); GE_CHECK_NOTNULL(compute_graph->impl_); if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should not be null."); return GRAPH_FAILED; } @@ -522,15 +522,15 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::InsertNod const auto src_node = src->GetOwnerNodeBarePtr(); GE_CHECK_NOTNULL(src_node); if (src_node->GetOwnerComputeGraph() != insert_node->GetOwnerComputeGraph()) { - REPORT_INNER_ERROR("E18888", "src:%s and insert_node:%s does not exist in the same graph.", - src_node->GetName().c_str(), insert_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src:%s and insert_node:%s does not exist in the same graph.", + src_node->GetName().c_str(), insert_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] src:%s and insert_node:%s does not exist in the same graph.", src_node->GetName().c_str(), insert_node->GetName().c_str()); return GRAPH_FAILED; } if (AddEdge(src, insert_node->GetInDataAnchor(static_cast(input_index))) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "AddEdge %s->%s failed.", src_node->GetName().c_str(), insert_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddEdge %s->%s failed.", src_node->GetName().c_str(), insert_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][Edge] %s->%s failed.", src_node->GetName().c_str(), insert_node->GetName().c_str()); return GRAPH_FAILED; } @@ -550,8 +550,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::InsertNod GELOGI("Insert node %s between %s->%s.", insert_node->GetName().c_str(), src_node->GetName().c_str(), dst_node->GetName().c_str()); if (src_node->GetOwnerComputeGraph() != dst_node->GetOwnerComputeGraph()) { - REPORT_INNER_ERROR("E18888", "src:%s and dst:%s does not exist in the same graph.", - src_node->GetName().c_str(), dst_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "src:%s and dst:%s does not exist in the same graph.", src_node->GetName().c_str(), + dst_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] src:%s and dst:%s does not exist in the same graph.", src_node->GetName().c_str(), dst_node->GetName().c_str()); return GRAPH_FAILED; @@ -559,8 +559,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::InsertNod (void)RemoveEdge(src, dst); if (AddEdge(insert_node->GetOutDataAnchor(static_cast(output_index)), dst) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "ReplaceEdge from %s->%s to %s->%s failed.", src_node->GetName().c_str(), - dst_node->GetName().c_str(), insert_node->GetName().c_str(), dst_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "ReplaceEdge from %s->%s to %s->%s failed.", src_node->GetName().c_str(), + dst_node->GetName().c_str(), insert_node->GetName().c_str(), dst_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Replace][Edge] from %s->%s to %s->%s failed.", src_node->GetName().c_str(), dst_node->GetName().c_str(), insert_node->GetName().c_str(), dst_node->GetName().c_str()); return GRAPH_FAILED; @@ -570,9 +570,9 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::InsertNod for (const InControlAnchorPtr& peer_in_ctrl_anchor : src_out_ctrl_anchor->GetPeerInControlAnchors()) { if ((RemoveEdge(src_out_ctrl_anchor, peer_in_ctrl_anchor) != GRAPH_SUCCESS) || (AddEdge(insert_node->GetOutControlAnchor(), peer_in_ctrl_anchor) != GRAPH_SUCCESS)) { - REPORT_CALL_ERROR("E18888", "ReplaceEdge from %s->%s to %s->%s failed.", - src_node->GetName().c_str(), peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), - insert_node->GetName().c_str(), peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "ReplaceEdge from %s->%s to %s->%s failed.", src_node->GetName().c_str(), + peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), insert_node->GetName().c_str(), + peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Replace][Edge] from %s->%s to %s->%s failed.", src_node->GetName().c_str(), peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str(), insert_node->GetName().c_str(), peer_in_ctrl_anchor->GetOwnerNode()->GetName().c_str()); @@ -662,12 +662,12 @@ graphStatus GraphUtils::InsertNodeBefore(const InDataAnchorPtr &dst, GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RemoveJustNode(ComputeGraph &compute_graph, const NodePtr &node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] The node ptr should be not null."); return GRAPH_FAILED; } if (compute_graph.impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "The compute graph impl should be not null, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "The compute graph impl should be not null, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] The compute graph impl should be not null."); return GRAPH_FAILED; } @@ -688,7 +688,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RemoveJus } void GraphUtils::RecordOriginalNames(const std::vector original_nodes, const ge::NodePtr &node) { - GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); return, "[Check][Param] node is null."); std::vector original_names; std::vector original_types; @@ -718,16 +718,16 @@ void GraphUtils::RecordOriginalNames(const std::vector original_nod } } GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(node->GetOpDesc(), ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, original_names), - REPORT_INNER_ERROR("E18888", "Set original_op_names to node:%s fail.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Set original_op_names to node:%s fail.", node->GetName().c_str()); return, "[Invoke][SetListStr] Set original_op_names to node:%s fail.", node->GetName().c_str()); GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(node->GetOpDesc(), ATTR_NAME_DATA_DUMP_ORIGIN_OP_TYPES, original_types), - REPORT_INNER_ERROR("E18888", "Set original_op_types to node:%s fail.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Set original_op_types to node:%s fail.", node->GetName().c_str()); return, "[Invoke][SetListStr] Set original_op_types to node:%s fail.", node->GetName().c_str()); } GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void GraphUtils::RecordOriginalNames(std::vector names_tmp, const ge::NodePtr &node) { - GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); return, "[Check][Param] node is null."); std::vector original_names; if (names_tmp.size() != 0UL) { @@ -737,7 +737,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void GraphUtils::RecordOriginalNa original_names.push_back(tmp); } GE_CHK_BOOL_EXEC(ge::AttrUtils::SetListStr(node->GetOpDesc(), ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, original_names), - REPORT_INNER_ERROR("E18888", "Set original_op_names to node %s fail.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Set original_op_names to node %s fail.", node->GetName().c_str()); return, "[Invoke][SetListStr] Set original_op_names to node %s fail.", node->GetName().c_str()); } @@ -1054,16 +1054,16 @@ GraphUtils::DumpGEGraphByPath(const ge::ComputeGraphPtr &graph, const std::strin const ge::DumpLevel dump_level) { const auto sep = file_path.rfind(MMPA_PATH_SEPARATOR_STR); if (sep == std::string::npos) { - REPORT_INPUT_ERROR("E19026", std::vector({"pathname", "reason"}), - std::vector({file_path.c_str(), "Separator is not found in file_path."})); + REPORT_PREDEFINED_ERR_MSG("E19026", std::vector({"pathname", "reason"}), + std::vector({file_path.c_str(), "Separator is not found in file_path."})); GELOGE(GRAPH_FAILED, "[CheckParam] Separator is not found in file_path.file_path:%s", file_path.c_str()); return GRAPH_FAILED; } const std::string file_name = file_path.substr(sep + 1UL, file_path.length()); const std::string path_dir = file_path.substr(0UL, sep + 1UL); if ((file_name.length() == 0UL) || (path_dir.length() == 0UL)) { - REPORT_INPUT_ERROR("E19026", std::vector({"pathname", "reason"}), - std::vector({file_path.c_str(), "Path or filename is not set."})); + REPORT_PREDEFINED_ERR_MSG("E19026", std::vector({"pathname", "reason"}), + std::vector({file_path.c_str(), "Path or filename is not set."})); GELOGE(GRAPH_FAILED, "[Invalid]path or name invalid.file_path:%s", file_path.c_str()); return GRAPH_FAILED; } @@ -1080,8 +1080,8 @@ GraphUtils::DumpGEGraphByPath(const ge::ComputeGraphPtr &graph, const std::strin // Write file char_t real_path[MMPA_MAX_PATH] = {}; if (mmRealPath(path_dir.c_str(), &(real_path[0U]), MMPA_MAX_PATH) != EN_OK) { - REPORT_INPUT_ERROR("E19026", std::vector({"pathname", "reason"}), - std::vector({path_dir.c_str(), "Directory does not exist."})); + REPORT_PREDEFINED_ERR_MSG("E19026", std::vector({"pathname", "reason"}), + std::vector({path_dir.c_str(), "Directory does not exist."})); GELOGE(GRAPH_FAILED, "[Get][RealPath]Directory %s does not exist.", path_dir.c_str()); return GRAPH_FAILED; } @@ -1114,8 +1114,9 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons ge::proto::ModelDef model_def; // Get ModelDef object from file generated by DumpGEGraph() if (!ReadProtoFromTextFile(file, &model_def)) { - REPORT_INPUT_ERROR("E19003", std::vector({"file", "errmsg"}), - std::vector({((file == nullptr) ? "" : file), "Read proto from file failed"})); + REPORT_PREDEFINED_ERR_MSG( + "E19003", std::vector({"file", "errmsg"}), + std::vector({((file == nullptr) ? "" : file), "Read proto from file failed"})); GELOGE(GRAPH_FAILED, "[Get][ModelDef] failed from file:%s", (file == nullptr) ? "" : file); return false; } @@ -1123,13 +1124,13 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons // Get Model object from ModelDef by deserialize ModelDef if (model.Load(model_def) == GRAPH_SUCCESS) { GE_CHK_BOOL_EXEC(model.GetGraph() != nullptr, - REPORT_INNER_ERROR("E18888", "Get computer graph is nullptr, model file:%s.", file); + REPORT_INNER_ERR_MSG("E18888", "Get computer graph is nullptr, model file:%s.", file); return false, "[Get][ComputerGraph] is nullptr"); compute_graph = *model.GetGraph(); return true; } else { - REPORT_INPUT_ERROR("E19003", std::vector({"file", "errmsg"}), - std::vector({file, "Get Model failed from ModelDef"})); + REPORT_PREDEFINED_ERR_MSG("E19003", std::vector({"file", "errmsg"}), + std::vector({file, "Get Model failed from ModelDef"})); GELOGE(GRAPH_FAILED, "[Get][Model] failed from ModelDef:%s", file); return false; } @@ -1140,8 +1141,9 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons ge::proto::ModelDef model_def; // Get ModelDef object from file generated by DumpGEGraph() if (!ReadProtoFromTextFile(file, &model_def)) { - REPORT_INPUT_ERROR("E19003", std::vector({"file", "errmsg"}), - std::vector({((file == nullptr) ? "" : file), "Read proto from file failed"})); + REPORT_PREDEFINED_ERR_MSG( + "E19003", std::vector({"file", "errmsg"}), + std::vector({((file == nullptr) ? "" : file), "Read proto from file failed"})); GELOGE(GRAPH_FAILED, "[Get][ModelDef] failed from file:%s", (file == nullptr) ? "" : file); return false; } @@ -1149,18 +1151,18 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons // Get Model object from ModelDef by deserialize ModelDef if (model.Load(model_def) == GRAPH_SUCCESS) { GE_CHK_BOOL_EXEC(model.GetGraph() != nullptr, - REPORT_INNER_ERROR("E18888", "Get computer graph is nullptr, model file:%s.", file); + REPORT_INNER_ERR_MSG("E18888", "Get computer graph is nullptr, model file:%s.", file); return false, "[Get][ComputerGraph] is nullptr"); compute_graph = model.GetGraph(); for (const auto &node : compute_graph->GetDirectNode()) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "ModeDef %s has nullptr node.", file); + REPORT_INNER_ERR_MSG("E18888", "ModeDef %s has nullptr node.", file); GELOGE(GRAPH_FAILED, "[Get][Node]Nullptr node in graph:%s, model:%s", compute_graph->GetName().c_str(), file); return false; } GELOGI("Node %s set owner graph", node->GetName().c_str()); if (node->SetOwnerComputeGraph(compute_graph) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "SetOwnerComputeGraph failed for node:%s", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "SetOwnerComputeGraph failed for node:%s", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][SetGraph]Node %s set owner graph failed", node->GetName().c_str()); return false; } @@ -1168,8 +1170,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons GE_ASSERT_GRAPH_SUCCESS(ConvertFileConstToConst(compute_graph)); return true; } else { - REPORT_INPUT_ERROR("E19003", std::vector({"file", "errmsg"}), - std::vector({file, "Get Model failed from ModelDef"})); + REPORT_PREDEFINED_ERR_MSG("E19003", std::vector({"file", "errmsg"}), + std::vector({file, "Get Model failed from ModelDef"})); GELOGE(GRAPH_FAILED, "[Get][Model] failed from ModelDef:%s", file); return false; } @@ -1252,37 +1254,37 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void GraphUtils::WriteProtoToText static_cast(M_WRONLY) | static_cast(M_CREAT) | static_cast(O_TRUNC)), FILE_AUTHORITY); if (fd < 0) { - REPORT_CALL_ERROR("E18888", "open file:%s failed, errormessage:%s", real_path, strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "open file:%s failed, errormessage:%s", real_path, strerror(errno)); GELOGE(GRAPH_FAILED, "[Open][File] failed for %s, reason:%s", real_path, strerror(errno)); return; } auto output = ComGraphMakeUnique(fd); if (output == nullptr) { - REPORT_CALL_ERROR("E18888", "create FileOutputStream failed."); + REPORT_INNER_ERR_MSG("E18888", "create FileOutputStream failed."); GELOGE(GRAPH_FAILED, "[Create][FileOutputStream] Output is nullptr"); if (mmClose(fd) != 0) { - REPORT_CALL_ERROR("E18888", "close FileOutputStream failed, reason:%s.", strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "close FileOutputStream failed, reason:%s.", strerror(errno)); GELOGE(GRAPH_FAILED, "[Close][FileOutputStream] failed, reason:%s", strerror(errno)); } return; } const bool ret = google::protobuf::TextFormat::Print(proto, output.get()); if (!ret) { - REPORT_CALL_ERROR("E18888", "write file:%s failed.", real_path); + REPORT_INNER_ERR_MSG("E18888", "write file:%s failed.", real_path); GELOGE(GRAPH_FAILED, "[Invoke][Print] Fail to write the file: %s", real_path); GE_CHK_BOOL_EXEC(mmClose(fd) == 0, - REPORT_CALL_ERROR("E18888", "close FileOutputStream failed, reason:%s.", strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "close FileOutputStream failed, reason:%s.", strerror(errno)); return, "[Close][FileOutputStream] failed, reason:%s", strerror(errno)); return; } output.reset(); GE_CHK_BOOL_EXEC(mmClose(fd) == 0, - REPORT_CALL_ERROR("E18888", "close FileOutputStream failed, reason:%s.", strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "close FileOutputStream failed, reason:%s.", strerror(errno)); return, "[Close][FileOutputStream] failed, reason:%s.", strerror(errno)); FILE *const file = fopen(real_path, "rb"); if (file == nullptr) { - REPORT_CALL_ERROR("E18888", "open file:%s failed, errormessage:%s", real_path, strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "open file:%s failed, errormessage:%s", real_path, strerror(errno)); GELOGE(GRAPH_FAILED, "[Invoke][FOpen] fail to open the file: %s, %s", real_path, strerror(errno)); return; } @@ -1300,13 +1302,13 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void GraphUtils::WriteProtoToText " max_dump_file_num=%" PRId64, fileSize, max_dump_file_size); GE_IF_BOOL_EXEC(remove(real_path) != 0, GELOGW("[WriteProto][RemovePath] Remove path %s failed", real_path)); GE_CHK_BOOL_EXEC(fclose(file) == 0, - REPORT_CALL_ERROR("E18888", "close file:%s failed, error:%s", real_path, strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "close file:%s failed, error:%s", real_path, strerror(errno)); return, "[FClose][File] %s failed error:%s", real_path, strerror(errno)); return; } } GE_CHK_BOOL_EXEC(fclose(file) == 0, - REPORT_CALL_ERROR("E18888", "close file:%s failed error:%s", real_path, strerror(errno)); + REPORT_INNER_ERR_MSG("E18888", "close file:%s failed error:%s", real_path, strerror(errno)); return, "[FClose][File] %s failed error:%s", real_path, strerror(errno)); #else (void)proto; @@ -1318,20 +1320,20 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void GraphUtils::WriteProtoToText GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::ReadProtoFromTextFile( const char_t *const file, google::protobuf::Message *const proto) { if ((file == nullptr) || (proto == nullptr)) { - REPORT_INNER_ERROR("E18888", "param file or proto is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param file or proto is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] incorrect parameter. file path or message is invalid"); return false; } std::ifstream fs(file, std::ifstream::in); if (!fs.is_open()) { - REPORT_CALL_ERROR("E18888", "open file:%s failed.", file); + REPORT_INNER_ERR_MSG("E18888", "open file:%s failed.", file); GELOGE(GRAPH_FAILED, "[Invoke][OpenFile]proto file '%s' open fail.", file); return false; } google::protobuf::io::IstreamInputStream input(&fs); const bool ret = google::protobuf::TextFormat::Parse(&input, proto); if (!ret) { - REPORT_INNER_ERROR("E18888", "parse proto from text ret fail, please check your text file '%s'.", file); + REPORT_INNER_ERR_MSG("E18888", "parse proto from text ret fail, please check your text file '%s'.", file); GELOGE(GRAPH_FAILED, "[Parse][Proto] from text ret fail, please check your text file '%s'.", file); } fs.close(); @@ -1470,7 +1472,7 @@ using OutNodesToIn = InNodesToOut; inline std::string GetNodeNameByAnchor(const Anchor *const anchor) { if (anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "param anchor is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param anchor is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Anchor is nullptr"); return "Null"; } @@ -1481,7 +1483,7 @@ inline std::string GetNodeNameByAnchor(const Anchor *const anchor) { graphStatus ReplaceOutDataAnchor(const OutDataAnchorPtr &new_anchor, const OutDataAnchorPtr &old_anchor, InNodesToOut *const in_nodes_to_out = nullptr, OutNodesToIn *const out_nodes_to_in = nullptr) { if ((new_anchor == nullptr) || (old_anchor == nullptr)) { - REPORT_INNER_ERROR("E18888", "param new_anchor or old_anchor is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param new_anchor or old_anchor is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] new_anchor or old_anchor is nullptr"); return GRAPH_PARAM_INVALID; } @@ -1489,9 +1491,9 @@ graphStatus ReplaceOutDataAnchor(const OutDataAnchorPtr &new_anchor, const OutDa for (const auto &peer_in_anchor : old_anchor->GetPeerInDataAnchors()) { auto ret = peer_in_anchor->Unlink(old_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to unlink old anchor link from %s(%d) to %s(%d)", - GetNodeNameByAnchor(old_anchor.get()).c_str(), old_anchor->GetIdx(), - GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "Failed to unlink old anchor link from %s(%d) to %s(%d)", + GetNodeNameByAnchor(old_anchor.get()).c_str(), old_anchor->GetIdx(), + GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Remove][Link] Failed to unlink old anchor link from %s(%d) to %s(%d)", GetNodeNameByAnchor(old_anchor.get()).c_str(), old_anchor->GetIdx(), GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx()); @@ -1499,9 +1501,9 @@ graphStatus ReplaceOutDataAnchor(const OutDataAnchorPtr &new_anchor, const OutDa } ret = peer_in_anchor->LinkFrom(new_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "[Create][Link] Failed to relink new anchors from %s(%d) to %s(%d)", - GetNodeNameByAnchor(new_anchor.get()).c_str(), new_anchor->GetIdx(), - GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "[Create][Link] Failed to relink new anchors from %s(%d) to %s(%d)", + GetNodeNameByAnchor(new_anchor.get()).c_str(), new_anchor->GetIdx(), + GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Create][Link] Failed to relink new anchors from %s(%d) to %s(%d)", GetNodeNameByAnchor(new_anchor.get()).c_str(), new_anchor->GetIdx(), GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx()); @@ -1525,8 +1527,8 @@ graphStatus RelinkDataIO(const NodePtr &node, const std::vector &io_map, In auto out_data_anchors = node->GetAllOutDataAnchors(); const size_t out_data_anchors_size = out_data_anchors.size(); if (out_data_anchors_size < io_map.size()) { - REPORT_INNER_ERROR("E18888", "param io_map size:%zu > the actual size:%zu, node:%s type:%s", - io_map.size(), out_data_anchors.size(), node->GetName().c_str(), node->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "param io_map size:%zu > the actual size:%zu, node:%s type:%s", io_map.size(), + out_data_anchors.size(), node->GetName().c_str(), node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] The io_map specified for node %s type %s is larger %zu than " "the actual size %zu", node->GetName().c_str(), node->GetType().c_str(), io_map.size(), out_data_anchors.size()); @@ -1536,8 +1538,10 @@ graphStatus RelinkDataIO(const NodePtr &node, const std::vector &io_map, In for (size_t i = 0U; i < out_data_anchors_size; ++i) { const auto out_data_anchor = out_data_anchors.at(i); if (out_data_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to relink for node %s type %s, the out data anchor " - "at index %zu is null", node->GetName().c_str(), node->GetType().c_str(), i); + REPORT_INNER_ERR_MSG("E18888", + "Failed to relink for node %s type %s, the out data anchor " + "at index %zu is null", + node->GetName().c_str(), node->GetType().c_str(), i); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to relink for node %s type %s, the out data anchor " "at index %zu is null", node->GetName().c_str(), node->GetType().c_str(), i); return GRAPH_FAILED; @@ -1551,8 +1555,9 @@ graphStatus RelinkDataIO(const NodePtr &node, const std::vector &io_map, In out_data_anchor->UnlinkAll(); } else { if (in_index >= static_cast(in_data_anchors.size())) { - REPORT_INNER_ERROR("E18888", "Failed to relink for node %s type %s, invalid index %d specified for input(%zu)", - node->GetName().c_str(), node->GetType().c_str(), in_index, in_data_anchors.size()); + REPORT_INNER_ERR_MSG("E18888", + "Failed to relink for node %s type %s, invalid index %d specified for input(%zu)", + node->GetName().c_str(), node->GetType().c_str(), in_index, in_data_anchors.size()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Failed to relink for node %s type %s, invalid index %d " "specified for input(%zu)", node->GetName().c_str(), node->GetType().c_str(), in_index, in_data_anchors.size()); @@ -1587,7 +1592,7 @@ InNodesToOut GetFullConnectIONodes(const NodePtr &node, std::set &in_no std::set &out_nodes_set) { InNodesToOut in_nodes_to_out; if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Node is nullptr"); return in_nodes_to_out; } @@ -1628,9 +1633,9 @@ graphStatus RelinkControlNodeIfNeed(const NodePtr &node, const InNodesToOut &in_ } const auto ret = GraphUtils::AddEdge(in_node->GetOutControlAnchor(), out_node->GetInControlAnchor()); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Add ControlEdge from %s to %s failed, when isolating node %s type %s", - in_node->GetName().c_str(), out_node->GetName().c_str(), node->GetName().c_str(), - node->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add ControlEdge from %s to %s failed, when isolating node %s type %s", + in_node->GetName().c_str(), out_node->GetName().c_str(), node->GetName().c_str(), + node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Add][ControlEdge] from %s to %s failed, when isolating node %s type %s", in_node->GetName().c_str(), out_node->GetName().c_str(), node->GetName().c_str(), node->GetType().c_str()); @@ -1647,8 +1652,10 @@ graphStatus ReplaceOutDataAnchors(const OutDataAnchorVisitor &new_outs, const std::vector &outputs_map) { const auto new_out_size = new_outs.size(); if (new_out_size < outputs_map.size()) { - REPORT_INNER_ERROR("E18888", "Failed to replace out data anchors, the actual size %zu is less than " - "the mapping size %zu", new_out_size, outputs_map.size()); + REPORT_INNER_ERR_MSG("E18888", + "Failed to replace out data anchors, the actual size %zu is less than " + "the mapping size %zu", + new_out_size, outputs_map.size()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Failed to replace out data anchors, the actual size %zu is less than " "the mapping size %zu", new_out_size, outputs_map.size()); return GRAPH_PARAM_INVALID; @@ -1656,8 +1663,10 @@ graphStatus ReplaceOutDataAnchors(const OutDataAnchorVisitor &new_outs, for (size_t i = 0U; i < new_out_size; ++i) { auto &new_out_anchor = new_outs.at(i); if (new_out_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to replace out data anchors, " - "the out data anchor on new node is null, index %zu", i); + REPORT_INNER_ERR_MSG("E18888", + "Failed to replace out data anchors, " + "the out data anchor on new node is null, index %zu", + i); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to replace out data anchors, " "the out data anchor on new node is null, index %zu", i); return GRAPH_FAILED; @@ -1672,8 +1681,10 @@ graphStatus ReplaceOutDataAnchors(const OutDataAnchorVisitor &new_outs, const OutDataAnchorPtr &old_out_anchor = old_outs.at(static_cast(old_index)); if (old_out_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to replace out data anchors, " - "the out data anchor on old node is null, index %d", old_index); + REPORT_INNER_ERR_MSG("E18888", + "Failed to replace out data anchors, " + "the out data anchor on old node is null, index %d", + old_index); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to replace out data anchors, " "the out data anchor on old node is null, index %d", old_index); return GRAPH_FAILED; @@ -1692,8 +1703,10 @@ graphStatus DoReplaceInDataAnchors(const InDataAnchorVisitor &new_ins, const std::vector &inputs_map, bool need_keep_origin = false) { const auto new_in_size = new_ins.size(); if (new_in_size < inputs_map.size()) { - REPORT_INNER_ERROR("E18888", "Failed to replace in data anchors, " - "the actual size %zu is less than the mapping size %zu", new_in_size, inputs_map.size()); + REPORT_INNER_ERR_MSG("E18888", + "Failed to replace in data anchors, " + "the actual size %zu is less than the mapping size %zu", + new_in_size, inputs_map.size()); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to replace in data anchors, " "the actual size %zu is less than the mapping size %zu", new_in_size, inputs_map.size()); return GRAPH_PARAM_INVALID; @@ -1702,8 +1715,10 @@ graphStatus DoReplaceInDataAnchors(const InDataAnchorVisitor &new_ins, for (size_t i = 0U; i < new_in_size; ++i) { auto &new_in_anchor = new_ins.at(i); if (new_in_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to replace in data anchors, " - "the out data anchor on new node is null, index %zu", i); + REPORT_INNER_ERR_MSG("E18888", + "Failed to replace in data anchors, " + "the out data anchor on new node is null, index %zu", + i); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to replace in data anchors, " "the out data anchor on new node is null, index %zu", i); return GRAPH_FAILED; @@ -1717,8 +1732,10 @@ graphStatus DoReplaceInDataAnchors(const InDataAnchorVisitor &new_ins, } const InDataAnchorPtr &old_in_anchor = old_ins.at(static_cast(old_index)); if (old_in_anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to replace in data anchors, " - "the out data anchor on old node is null, index %d", old_index); + REPORT_INNER_ERR_MSG("E18888", + "Failed to replace in data anchors, " + "the out data anchor on old node is null, index %d", + old_index); GELOGE(GRAPH_FAILED, "[Check][Param] Failed to replace in data anchors, " "the out data anchor on old node is null, index %d", old_index); return GRAPH_FAILED; @@ -1732,9 +1749,9 @@ graphStatus DoReplaceInDataAnchors(const InDataAnchorVisitor &new_ins, if (!need_keep_origin) { ret = peer_out_anchor->Unlink(old_in_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to unlink old anchors, unlink from %s(%d) to %s(%d)", - GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), - GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "Failed to unlink old anchors, unlink from %s(%d) to %s(%d)", + GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), + GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Remove][Link] Failed to unlink old anchors, unlink from %s(%d) to %s(%d)", GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); @@ -1743,9 +1760,9 @@ graphStatus DoReplaceInDataAnchors(const InDataAnchorVisitor &new_ins, } ret = peer_out_anchor->LinkTo(new_in_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to link new anchors, link from %s(%d) to %s(%d)", - GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), - GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); + REPORT_INNER_ERR_MSG("E18888", "Failed to link new anchors, link from %s(%d) to %s(%d)", + GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), + GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); GELOGE(GRAPH_FAILED, "[Create][Link]Failed to link new anchors, link from %s(%d) to %s(%d)", GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); @@ -1773,9 +1790,9 @@ graphStatus ReplaceControlAnchors(const NodePtr &new_node, const NodePtr &old_no } const auto ret = GraphUtils::AddEdge(peer_out_anchor, new_in_control_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Add edge from %s to %s failed, ret:%d", - peer_out_anchor->GetOwnerNode()->GetName().c_str(), - new_in_control_anchor->GetOwnerNode()->GetName().c_str(), ret); + REPORT_INNER_ERR_MSG("E18888", "Add edge from %s to %s failed, ret:%d", + peer_out_anchor->GetOwnerNode()->GetName().c_str(), + new_in_control_anchor->GetOwnerNode()->GetName().c_str(), ret); GELOGE(GRAPH_FAILED, "[Add][Edge] from %s to %s failed, ret:%d", peer_out_anchor->GetOwnerNode()->GetName().c_str(), new_in_control_anchor->GetOwnerNode()->GetName().c_str(), ret); @@ -1798,9 +1815,9 @@ graphStatus ReplaceControlAnchors(const NodePtr &new_node, const NodePtr &old_no } const auto ret = GraphUtils::AddEdge(new_out_control_anchor, peer_in_anchor); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "AddEdge from %s to %s failed, ret:%d", - new_out_control_anchor->GetOwnerNode()->GetName().c_str(), - peer_in_anchor->GetOwnerNode()->GetName().c_str(), ret); + REPORT_INNER_ERR_MSG("E18888", "AddEdge from %s to %s failed, ret:%d", + new_out_control_anchor->GetOwnerNode()->GetName().c_str(), + peer_in_anchor->GetOwnerNode()->GetName().c_str(), ret); GELOGE(GRAPH_FAILED, "[Add][Edge] from %s to %s failed, ret:%d", new_out_control_anchor->GetOwnerNode()->GetName().c_str(), peer_in_anchor->GetOwnerNode()->GetName().c_str(), ret); @@ -1930,7 +1947,7 @@ graphStatus RelinkControlNodeWithNoOpOptimize(const NodePtr &node, const std::se GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::IsolateNode(const NodePtr &node, const std::vector &io_map) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Failed to isolate node(null)"); return GRAPH_PARAM_INVALID; } @@ -1969,7 +1986,7 @@ GraphUtils::IsolateNode(const NodePtr &node, const std::initializer_list &inputs_map, const std::vector &outputs_map) { if ((new_node == nullptr) || (old_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param new_node or old_node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param new_node or old_node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_PARAM_INVALID; } @@ -2026,7 +2043,7 @@ GraphUtils::ReplaceNodeDataAnchors(const NodePtr &new_node, const NodePtr &old_n const std::vector &inputs_map, const std::vector &outputs_map) { if ((new_node == nullptr) || (old_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param new_node or old_node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param new_node or old_node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_PARAM_INVALID; } @@ -2238,8 +2255,8 @@ graphStatus AddCtrlEdges(const vector> &src_nodes, } const auto ret = GraphUtils::AddEdge(in_node->GetOutControlAnchor(), dst_ctrl); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Add ControlEdge from %s to %s failed", - in_node->GetName().c_str(), dst_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add ControlEdge from %s to %s failed", in_node->GetName().c_str(), + dst_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][ControlEdge] from %s to %s failed", in_node->GetName().c_str(), dst_node->GetName().c_str()); return ret; @@ -2253,7 +2270,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::CopyInCtr const NodePtr &dst_node, const NodeFilter &node_filter) { if ((src_node == nullptr) || (dst_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node or dst_node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param src_node or dst_node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_PARAM_INVALID; } @@ -2267,7 +2284,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::CopyInCtr GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::MoveInCtrlEdges(const NodePtr &src_node, const NodePtr &dst_node) { if ((src_node == nullptr) || (dst_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node or dst_node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param src_node or dst_node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_FAILED; } @@ -2291,7 +2308,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::CopyOutCt const NodePtr &dst_node, const NodeFilter &node_filter) { if ((src_node == nullptr) || (dst_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node or dst_node is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param src_node or dst_node is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_FAILED; } @@ -2305,7 +2322,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::CopyOutCt GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::MoveOutCtrlEdges(NodePtr &src_node, NodePtr &dst_node) { if ((src_node == nullptr) || (dst_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node or dst_node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param src_node or dst_node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_FAILED; } @@ -2322,7 +2339,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::ConvertIn const NodePtr &dst_node, const NodeFilter &node_filter) { if ((src_node == nullptr) || (dst_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node or dst_node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param src_node or dst_node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Parameter is nullptr"); return GRAPH_PARAM_INVALID; } @@ -2337,7 +2354,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::ConvertOu const NodePtr &dst_node, const NodeFilter &node_filter) { if ((src_node == nullptr) || (dst_node == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node or dst_node is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param src_node or dst_node is nullptr, check invalid"); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Parameter is nullptr"); return GRAPH_PARAM_INVALID; } @@ -2435,8 +2452,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::ExpandNod GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::AppendInputNode(const ComputeGraphPtr &graph, const NodePtr &node) { if (graph->AddInputNode(node) == nullptr) { - REPORT_CALL_ERROR("E18888", "AddInputNode %s(%s) failed, graph:%s", node->GetName().c_str(), - node->GetType().c_str(), graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddInputNode %s(%s) failed, graph:%s", node->GetName().c_str(), + node->GetType().c_str(), graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][InputNode] %s(%s) failed, graph:%s", node->GetName().c_str(), node->GetType().c_str(), graph->GetName().c_str()); return GRAPH_FAILED; @@ -2494,7 +2511,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY OpDescPtr GraphUtils::CloneOpDesc imp.SetProtobufOwner(op_def); OpDescPtr op_desc = nullptr; GE_CHK_BOOL_EXEC(imp.UnserializeOpDesc(op_desc, *op_def), - REPORT_CALL_ERROR("E18888", "UnserializeOpDesc failed"); + REPORT_INNER_ERR_MSG("E18888", "UnserializeOpDesc failed"); return op_desc, "[Call][UnserializeOpDesc] op_desc unserialize failed"); GE_CHECK_NOTNULL_EXEC(op_desc->impl_, return nullptr); @@ -2595,8 +2612,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::CopyOpAnd const NodePtr node = dst_compute_graph->AddNode(op_desc, n->GetOpDesc()->GetId()); if (node == nullptr) { - REPORT_CALL_ERROR("E18888", "AddNode %s to graph:%s failed", - op_desc->GetName().c_str(), dst_compute_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddNode %s to graph:%s failed", op_desc->GetName().c_str(), + dst_compute_graph->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][Node][%s] to graph:%s failed", op_desc->GetName().c_str(), dst_compute_graph->GetName().c_str()); return GRAPH_FAILED; @@ -2650,7 +2667,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::CopyCompu GE_CHECK_NOTNULL(src_compute_graph); if (depth >= kCopyGraphMaxRecursionDepth) { - REPORT_INNER_ERROR("E18888", "param depth:%d >= %d(allow max subgraphs)", depth, kCopyGraphMaxRecursionDepth); + REPORT_INNER_ERR_MSG("E18888", "param depth:%d >= %d(allow max subgraphs)", depth, kCopyGraphMaxRecursionDepth); GELOGE(GRAPH_FAILED, "[Check][Param]exist too much subgraphs:%d > %d(allow max subgraphs)", depth, kCopyGraphMaxRecursionDepth); return GRAPH_FAILED; @@ -2706,12 +2723,12 @@ graphStatus GraphUtils::CopyMembers(const ComputeGraphPtr &src_compute_graph, ComputeGraphPtr &dst_compute_graph, const std::unordered_map &all_new_nodes) { if ((src_compute_graph == nullptr) || (src_compute_graph->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "Param src_compute_graph is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Param src_compute_graph is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Src compute graph is nullptr."); return GRAPH_FAILED; } if ((dst_compute_graph == nullptr) || (dst_compute_graph->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "Param dst_compute_graph is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Param dst_compute_graph is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Dst compute graph is nullptr."); return GRAPH_FAILED; } @@ -2778,18 +2795,18 @@ graphStatus GraphUtils::CopyMembers(const ComputeGraphPtr &src_compute_graph, GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY ComputeGraphPtr GraphUtils::CloneGraph(const ComputeGraphPtr &graph, const std::string &suffix, std::vector &input_nodes, std::vector &output_nodes) { - GE_CHK_BOOL_EXEC(graph != nullptr, REPORT_INNER_ERROR("E18888", "param graph is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(graph != nullptr, REPORT_INNER_ERR_MSG("E18888", "param graph is nullptr, check invalid."); return nullptr, "[Check][Param] Original graph is null"); ComputeGraphPtr new_graph = ComGraphMakeShared(graph->GetName()); GE_CHK_BOOL_EXEC(new_graph != nullptr, - REPORT_CALL_ERROR("E18888", "create computegraph %s failed.", graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "create computegraph %s failed.", graph->GetName().c_str()); return nullptr, "[Create][ComputeGraph] %s failed", graph->GetName().c_str()); std::unordered_map all_new_nodes; for (const auto &n : graph->GetDirectNode()) { const OpDescPtr op_desc = GraphUtils::CopyOpDesc(n->GetOpDesc()); GE_CHK_BOOL_EXEC(op_desc != nullptr, - REPORT_CALL_ERROR("E18888", "Create node:%s failed.", n->GetOpDesc()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Create node:%s failed.", n->GetOpDesc()->GetName().c_str()); return nullptr, "[Create][Node] %s failed", n->GetOpDesc()->GetName().c_str()); if (CopyTensorAttrs(op_desc, n) != GRAPH_SUCCESS) { @@ -2805,7 +2822,7 @@ ComputeGraphPtr GraphUtils::CloneGraph(const ComputeGraphPtr &graph, const std:: } const GeTensor copy_weight = weight->Clone(); if (!AttrUtils::SetTensor(op_desc, ATTR_NAME_WEIGHTS, copy_weight)) { - REPORT_CALL_ERROR("E18888", "Clone ATTR_NAME_WEIGHTS for node:%s failed.", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Clone ATTR_NAME_WEIGHTS for node:%s failed.", op_desc->GetName().c_str()); GELOGE(INTERNAL_ERROR, "[Set][Tensor] Clone ATTR_NAME_WEIGHTS for node:%s failed.", op_desc->GetName().c_str()); return nullptr; } @@ -2815,8 +2832,8 @@ ComputeGraphPtr GraphUtils::CloneGraph(const ComputeGraphPtr &graph, const std:: op_desc->SetName(n->GetName() + suffix); NodePtr node = new_graph->AddNode(op_desc); GE_CHK_BOOL_EXEC(node != nullptr, - REPORT_CALL_ERROR("E18888", "add node %s to graph:%s failed", - op_desc->GetName().c_str(), new_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add node %s to graph:%s failed", op_desc->GetName().c_str(), + new_graph->GetName().c_str()); return nullptr, "[Add][Node] [%s] to graph:%s failed", op_desc->GetName().c_str(), new_graph->GetName().c_str()); all_new_nodes[node->GetName()] = node; @@ -2858,12 +2875,12 @@ ComputeGraphPtr GraphUtils::CloneGraph(const ComputeGraphPtr &graph, const std:: /// @return success: GRAPH_SUCESS graphStatus GraphUtils::CopyTensorAttrs(const OpDescPtr &dst_desc, const NodePtr &src_node) { if (dst_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "param dst_desc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param dst_desc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Input param dst node not valid"); return GRAPH_FAILED; } if ((src_node == nullptr) || (src_node->GetOpDesc() == nullptr)) { - REPORT_INNER_ERROR("E18888", "param src_node is nullptr or it's opdesc is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param src_node is nullptr or it's opdesc is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Input param src node not valid"); return GRAPH_FAILED; } @@ -2882,8 +2899,8 @@ graphStatus GraphUtils::CopyTensorAttrs(const OpDescPtr &dst_desc, const NodePtr for (uint32_t i = 0U; i < src_node->GetAllOutDataAnchorsSize(); ++i) { const auto output_desc = dst_desc->MutableOutputDesc(i); if (output_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Param dst node:%s not valid, output_desc[%d] is nullptr", - dst_desc->GetName().c_str(), i); + REPORT_INNER_ERR_MSG("E18888", "Param dst node:%s not valid, output_desc[%d] is nullptr", + dst_desc->GetName().c_str(), i); GELOGE(GRAPH_FAILED, "[Check][Param] Param dst node:%s not valid", dst_desc->GetName().c_str()); return GRAPH_FAILED; } @@ -2902,14 +2919,14 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::RelinkGraphEdges(const NodePtr &node, const std::string &suffix, const std::unordered_map &all_nodes) { if ((node == nullptr) || (node->GetOpDesc() == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node is nullptr or it's opdesc is nullptr. check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr or it's opdesc is nullptr. check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Input node not valid"); return GRAPH_FAILED; } auto it = all_nodes.find(node->GetName() + suffix); if (it == all_nodes.end()) { - REPORT_INNER_ERROR("E18888", "all_nodes not contain node:%s.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "all_nodes not contain node:%s.", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] node[%s] not found", node->GetName().c_str()); return GRAPH_FAILED; } @@ -2918,12 +2935,12 @@ graphStatus GraphUtils::RelinkGraphEdges(const NodePtr &node, const std::string // traversing from the parent node can be completely restored in the original one-to-many order. for (const auto &out_anchor : node->GetAllOutDataAnchors()) { GE_CHK_BOOL_EXEC(out_anchor != nullptr, - REPORT_INNER_ERROR("E18888", "out data anchor is null, node:%s.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "out data anchor is null, node:%s.", node->GetName().c_str()); return GRAPH_FAILED, "[Check][Param] Out data anchor is null, node:%s", node->GetName().c_str()); for (const auto &peer_in_anchor : out_anchor->GetPeerInDataAnchors()) { GE_CHECK_NOTNULL(peer_in_anchor); GE_CHK_BOOL_EXEC(peer_in_anchor->GetOwnerNodeBarePtr() != nullptr, - REPORT_INNER_ERROR("E18888", "Peer in node:%s is null", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Peer in node:%s is null", node->GetName().c_str()); return GRAPH_FAILED, "Peer in node:%s is null", node->GetName().c_str()); it = all_nodes.find(peer_in_anchor->GetOwnerNodeBarePtr()->GetName() + suffix); if (it == all_nodes.end()) { @@ -2934,8 +2951,8 @@ graphStatus GraphUtils::RelinkGraphEdges(const NodePtr &node, const std::string const auto ret = GraphUtils::AddEdge(new_node->GetOutAnchor(out_anchor->GetIdx()), new_peer_in_node->GetInAnchor(peer_in_anchor->GetIdx())); GE_CHK_BOOL_EXEC(ret == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add data edge from %s to %s failed", - new_node->GetName().c_str(), new_peer_in_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add data edge from %s to %s failed", new_node->GetName().c_str(), + new_peer_in_node->GetName().c_str()); return GRAPH_FAILED, "[Invoke][AddEdge] link data edge failed[%s to %s]", new_node->GetName().c_str(), new_peer_in_node->GetName().c_str()); } @@ -2945,7 +2962,7 @@ graphStatus GraphUtils::RelinkGraphEdges(const NodePtr &node, const std::string for (const auto peer_in_control_anchor : node->GetOutControlAnchor()->GetPeerAnchorsPtr()) { GE_CHECK_NOTNULL(peer_in_control_anchor); GE_CHK_BOOL_EXEC(peer_in_control_anchor->GetOwnerNodeBarePtr() != nullptr, - REPORT_INNER_ERROR("E18888", "Peer out node is null"); + REPORT_INNER_ERR_MSG("E18888", "Peer out node is null"); return GRAPH_FAILED, "[Invoke][GetOwnerNode] Peer out node is null"); it = all_nodes.find(peer_in_control_anchor->GetOwnerNodeBarePtr()->GetName() + suffix); if (it == all_nodes.end()) { @@ -2956,8 +2973,8 @@ graphStatus GraphUtils::RelinkGraphEdges(const NodePtr &node, const std::string const auto ret = GraphUtils::AddEdge(new_node->GetOutControlAnchor(), new_peer_in_node->GetInAnchor(peer_in_control_anchor->GetIdx())); GE_CHK_BOOL_EXEC(ret == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "add control edge from %s to %s failed.", - new_node->GetName().c_str(), new_peer_in_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "add control edge from %s to %s failed.", + new_node->GetName().c_str(), new_peer_in_node->GetName().c_str()); return GRAPH_FAILED, "[Invoke][AddEdge] link control edge failed[%s to %s]", new_node->GetName().c_str(), new_peer_in_node->GetName().c_str()); } @@ -3070,7 +3087,7 @@ graphStatus GraphUtils::HandleSubgraphInput(const NodePtr &node, // Data in subgraph uint32_t index = 0U; if (!ge::AttrUtils::GetInt(node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, index)) { - REPORT_CALL_ERROR("E18888", "Get Attr ATTR_NAME_PARENT_NODE_INDEX failed, node:%s.", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get Attr ATTR_NAME_PARENT_NODE_INDEX failed, node:%s.", node->GetName().c_str()); GE_LOGE("[Get][Attr] ATTR_NAME_PARENT_NODE_INDEX failed, node:%s.", node->GetName().c_str()); return GRAPH_FAILED; } @@ -3213,7 +3230,7 @@ graphStatus GraphUtils::UnionSymbolMapping(const NodeIndexIO &exist_node_info1, const auto iter1 = symbol_to_anchors.find(symbol1); const auto iter2 = symbol_to_anchors.find(symbol2); if ((iter1 == symbol_to_anchors.end()) || (iter2 == symbol_to_anchors.end())) { - REPORT_INNER_ERROR("E18888", "symbol %s or %s does not exist.", symbol1.c_str(), symbol2.c_str()); + REPORT_INNER_ERR_MSG("E18888", "symbol %s or %s does not exist.", symbol1.c_str(), symbol2.c_str()); GE_LOGE("[Check][Param] symbol %s or %s does not exist.", symbol1.c_str(), symbol2.c_str()); return GRAPH_FAILED; } @@ -3245,8 +3262,8 @@ graphStatus GraphUtils::UpdateRefMapping(const NodeIndexIO &cur_node_info, const AnchorToSymbol &anchor_to_symbol) { const auto iter1 = anchor_to_symbol.find(exist_node_info.ToString()); if (iter1 == anchor_to_symbol.end()) { - REPORT_INNER_ERROR("E18888", "data_anchor %s is not visible before data_anchor %s, maybe TopoSorting is missing.", - exist_node_info.ToString().c_str(), cur_node_info.ToString().c_str()); + REPORT_INNER_ERR_MSG("E18888", "data_anchor %s is not visible before data_anchor %s, maybe TopoSorting is missing.", + exist_node_info.ToString().c_str(), cur_node_info.ToString().c_str()); GE_LOGE("[Check][Param] data_anchor %s is not visible before data_anchor %s, maybe TopoSorting is missing.", exist_node_info.ToString().c_str(), cur_node_info.ToString().c_str()); return GRAPH_FAILED; @@ -3255,7 +3272,7 @@ graphStatus GraphUtils::UpdateRefMapping(const NodeIndexIO &cur_node_info, const const std::string &symbol = iter1->second; const auto iter2 = symbol_to_anchors.find(symbol); if (iter2 == symbol_to_anchors.end()) { - REPORT_INNER_ERROR("E18888", "symbol %s does not exist in symbol_to_anchors.", symbol.c_str()); + REPORT_INNER_ERR_MSG("E18888", "symbol %s does not exist in symbol_to_anchors.", symbol.c_str()); GE_LOGE("[Check][Param] symbol %s not found.", symbol.c_str()); return GRAPH_FAILED; } @@ -3272,7 +3289,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY NodePtr GraphUtils::FindNodeFromAllNodes(ComputeGraphPtr &graph, const std::string &name) { const auto root_graph = FindRootGraph(graph); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "param graph is nullptr,check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param graph is nullptr,check invalid."); GE_LOGE("[Check][Param] param graph is nullptr, check invalid"); return nullptr; } @@ -3311,7 +3328,7 @@ std::vector GraphUtils::FindNodesByTypeFromAllNodes(ComputeGraphPtr &gr std::vector nodes; const auto &root_graph = FindRootGraph(graph); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "param graph is nullptr,check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param graph is nullptr,check invalid."); GE_LOGE("[Check][Param] param graph is nullptr, check invalid"); return nodes; } @@ -3345,7 +3362,7 @@ std::vector GraphUtils::FindBareNodesByTypeFromAllNodes(ComputeGraphPtr graphStatus GraphUtils::GetSubgraphsRecursively(const ComputeGraphPtr &graph, std::vector &subgraphs) { const auto root_graph = GraphUtils::FindRootGraph(graph); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to find root graph"); + REPORT_INNER_ERR_MSG("E18888", "Failed to find root graph"); GELOGE(GRAPH_FAILED, "[Get][Graph] Failed to find root graph"); return GRAPH_FAILED; } @@ -3514,7 +3531,7 @@ bool GraphUtils::IsUnknownShapeGraph(const ComputeGraphPtr &graph) { ComputeGraphPtr GraphUtils::BuildSubgraphWithNodes(const ComputeGraphPtr &graph, const std::set &nodes, const std::string &subgraph_name) { if (graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Graph is null"); + REPORT_INNER_ERR_MSG("E18888", "Graph is null"); GELOGE(FAILED, "[Check][Param] graph is null"); return nullptr; } @@ -3533,26 +3550,26 @@ ComputeGraphPtr GraphUtils::BuildSubgraphWithNodes(ComputeGraph &graph, const st const NodePtr graph_node = BuildSubgraphNode(graph, subgraph_name, graph_info); if (graph_node == nullptr) { - REPORT_CALL_ERROR("E18888", "Build SubgraphNode failed, subgraph_name:%s.", subgraph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Build SubgraphNode failed, subgraph_name:%s.", subgraph_name.c_str()); GELOGE(FAILED, "[Build][SubgraphNode] failed, subgraph_name:%s.", subgraph_name.c_str()); return nullptr; } const ComputeGraphPtr subgraph = BuildSubgraph(graph_node, graph_info, subgraph_name); if (subgraph == nullptr) { - REPORT_CALL_ERROR("E18888", "Build Subgraph %s failed", subgraph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Build Subgraph %s failed", subgraph_name.c_str()); GELOGE(FAILED, "[Build][Subgraph] %s failed", subgraph_name.c_str()); return nullptr; } const auto &root_graph = GraphUtils::FindRootGraph(graph_node->GetOwnerComputeGraph()); if (root_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "Find root graph failed, graph:%s", graph.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Find root graph failed, graph:%s", graph.GetName().c_str()); GELOGE(FAILED, "[Find][RootGraph] failed, graph:%s", graph.GetName().c_str()); return nullptr; } if (root_graph->AddSubgraph(subgraph) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Add subgraph %s failed, root graph:%s", subgraph->GetName().c_str(), - root_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add subgraph %s failed, root graph:%s", subgraph->GetName().c_str(), + root_graph->GetName().c_str()); GELOGE(FAILED, "[Add][SubGraph] %s failed, root graph:%s", subgraph->GetName().c_str(), root_graph->GetName().c_str()); return nullptr; @@ -3560,8 +3577,8 @@ ComputeGraphPtr GraphUtils::BuildSubgraphWithNodes(ComputeGraph &graph, const st if ((RelinkDataEdges(graph_node, graph_info) != GRAPH_SUCCESS) || (RelinkCtrlEdges(graph_node, graph_info) != GRAPH_SUCCESS)) { - REPORT_CALL_ERROR("E18888", "ReLink edges for graph %s failed, graph_node:%s", graph.GetName().c_str(), - graph_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "ReLink edges for graph %s failed, graph_node:%s", graph.GetName().c_str(), + graph_node->GetName().c_str()); GELOGE(FAILED, "[ReLink][Edges] for graph %s failed, graph_node:%s", graph.GetName().c_str(), graph_node->GetName().c_str()); return nullptr; @@ -3660,7 +3677,7 @@ NodePtr GraphUtils::BuildSubgraphNode(ComputeGraph &graph, const std::string &gr for (const auto &in_data_anchor : item.second.second) { const auto input_desc = in_data_anchor->GetOwnerNodeBarePtr()->GetOpDesc(); if (input_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "op_desc is null, node:%s", in_data_anchor->GetOwnerNode()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "op_desc is null, node:%s", in_data_anchor->GetOwnerNode()->GetName().c_str()); GELOGE(PARAM_INVALID, "[Check][Param] op_desc is null, node:%s", in_data_anchor->GetOwnerNode()->GetName().c_str()); return nullptr; @@ -3673,8 +3690,7 @@ NodePtr GraphUtils::BuildSubgraphNode(ComputeGraph &graph, const std::string &gr for (const auto &item : graph_info.data_outputs_) { const auto output_desc = item.second.first->GetOwnerNodeBarePtr()->GetOpDesc(); if (output_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "op_desc is null, node:%s", - item.second.first->GetOwnerNode()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "op_desc is null, node:%s", item.second.first->GetOwnerNode()->GetName().c_str()); GELOGE(PARAM_INVALID, "[Check][Param] op_desc is null, node:%s", item.second.first->GetOwnerNode()->GetName().c_str()); return nullptr; @@ -3685,7 +3701,7 @@ NodePtr GraphUtils::BuildSubgraphNode(ComputeGraph &graph, const std::string &gr const OpDescPtr op_desc = op_desc_builder.Build(); if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "Create op_desc for subgraph node failed, name:%s.", graph_name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Create op_desc for subgraph node failed, name:%s.", graph_name.c_str()); GELOGE(FAILED, "[Create][OpDesc] for subgraph node failed, name:%s.", graph_name.c_str()); return nullptr; } @@ -3779,7 +3795,7 @@ graphStatus GraphUtils::UnfoldGraph(const ComputeGraphPtr &graph, const ComputeG const NodePtr &target_node, const function &filter, int32_t depth) { if (depth >= kCopyGraphMaxRecursionDepth) { - REPORT_INNER_ERROR("E18888", "param depth:%d >= %d(allow max subgraphs)", depth, kCopyGraphMaxRecursionDepth); + REPORT_INNER_ERR_MSG("E18888", "param depth:%d >= %d(allow max subgraphs)", depth, kCopyGraphMaxRecursionDepth); GELOGE(GRAPH_FAILED, "[Check][Param]exist too much subgraphs:%d > %d(allow max subgraphs)", depth, kCopyGraphMaxRecursionDepth); return GRAPH_FAILED; @@ -3854,8 +3870,8 @@ graphStatus GraphUtils::MergeInputNodes(const ComputeGraphPtr &graph, const Node uint32_t parent_index = 0U; if ((!AttrUtils::GetInt(node->GetOpDesc(), ATTR_NAME_PARENT_NODE_INDEX, parent_index)) && (!AttrUtils::GetInt(node->GetOpDesc(), "index", parent_index))) { - REPORT_CALL_ERROR("E18888", "Get attr {%s} or {index} failed, node:%s", ATTR_NAME_PARENT_NODE_INDEX.c_str(), - node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get attr {%s} or {index} failed, node:%s", ATTR_NAME_PARENT_NODE_INDEX.c_str(), + node->GetName().c_str()); GELOGE(FAILED, "[Get][Attr] {%s} or {index} failed, node:%s", ATTR_NAME_PARENT_NODE_INDEX.c_str(), node->GetName().c_str()); return GRAPH_FAILED; @@ -4168,7 +4184,7 @@ void ComputeGraphBuilder::BuildCtrlLinks(graphStatus &error_code, std::string &e NodePtr ComputeGraphBuilder::GetNode(const std::string &name) { const auto iter = node_names_.find(name); if (iter == node_names_.end()) { - REPORT_INNER_ERROR("E18888", "node %s does not exist.", name.c_str()); + REPORT_INNER_ERR_MSG("E18888", "node %s does not exist.", name.c_str()); GE_LOGE("[Check][Param] node %s does not exist.", name.c_str()); return nullptr; } @@ -5011,7 +5027,7 @@ ComputeGraphPtr GraphUtils::BuildGraphInternal(const GraphUtils::GraphInfo &grap std::string error_msg; auto graph = graph_builder.Build(error_code, error_msg); if (graph == nullptr) { - REPORT_CALL_ERROR("E18888", "Build graph %s failed:%s.", name.c_str(), error_msg.c_str()); + REPORT_INNER_ERR_MSG("E18888", "Build graph %s failed:%s.", name.c_str(), error_msg.c_str()); GELOGE(error_code, "[Build][Graph] %s failed:%s.", name.c_str(), error_msg.c_str()); } return graph; diff --git a/graph/utils/graph_utils_ex.cc b/graph/utils/graph_utils_ex.cc index e215845f59..dde8b27552 100644 --- a/graph/utils/graph_utils_ex.cc +++ b/graph/utils/graph_utils_ex.cc @@ -39,7 +39,7 @@ graphStatus GraphUtilsEx::InferShapeInNeed(const ComputeGraphPtr &graph) { (void)AttrUtils::GetBool(op_desc, NEED_INFER, is_need_infer); if (is_need_infer) { if (NodeUtilsEx::Verify(node_ptr) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Verifying %s failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Verifying %s failed.", node_ptr->GetName().c_str()); GELOGE(FAILED, "[Call][Verify] Verifying %s failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } @@ -52,7 +52,7 @@ graphStatus GraphUtilsEx::InferShapeInNeed(const ComputeGraphPtr &graph) { break; } if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Inferring %s failed.", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Inferring %s failed.", node_ptr->GetName().c_str()); GELOGE(FAILED, "[Call][InferShapeAndType] Inferring %s failed.", node_ptr->GetName().c_str()); return GRAPH_FAILED; } diff --git a/graph/utils/inference_rule.cc b/graph/utils/inference_rule.cc index 054d1462e5..990b191e9f 100644 --- a/graph/utils/inference_rule.cc +++ b/graph/utils/inference_rule.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/graph/utils/node_utils.cc b/graph/utils/node_utils.cc index b10c4de3ab..8c02b0ed74 100644 --- a/graph/utils/node_utils.cc +++ b/graph/utils/node_utils.cc @@ -77,7 +77,7 @@ bool IsComputableOp(const NodePtr &node) { graphStatus NodeUtils::ClearInDataAnchor(const NodePtr &node_ptr, const InDataAnchorPtr &in_data_anchor) { GE_CHK_BOOL_EXEC((node_ptr != nullptr) && (node_ptr->impl_ != nullptr) && (in_data_anchor != nullptr), - REPORT_INNER_ERROR("E18888", "param node or in_data_anchor is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node or in_data_anchor is nullptr, check invalid."); return GRAPH_FAILED, "[Check][Param] node or in_data_anchor is nullptr"); bool find_flag = false; uint32_t index = 0U; @@ -106,17 +106,17 @@ graphStatus NodeUtils::ClearInDataAnchor(const NodePtr &node_ptr, const InDataAn } GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::SetAllAnchorStatus(const NodePtr &node_ptr) { - GE_CHK_BOOL_EXEC(node_ptr != nullptr, REPORT_INNER_ERROR("E18888", "param node_ptr is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(node_ptr != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node_ptr is nullptr, check invalid"); return GRAPH_FAILED, "[Check][Param] node is nullptr"); GE_CHK_BOOL_EXEC(SetAllAnchorStatus(*node_ptr) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "SetAllAnchorStatus failed, node:%s", node_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "SetAllAnchorStatus failed, node:%s", node_ptr->GetName().c_str()); return GRAPH_FAILED, "[Set][AllAnchorStatus] failed, node:%s", node_ptr->GetName().c_str()); return GRAPH_SUCCESS; } graphStatus NodeUtils::SetAllAnchorStatus(Node &node) { if (node.impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Param node impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Param node impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Node impl is nullptr."); return GRAPH_FAILED; } @@ -125,14 +125,14 @@ graphStatus NodeUtils::SetAllAnchorStatus(Node &node) { } GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool NodeUtils::IsAnchorStatusSet(const NodePtr &node_ptr) { - GE_CHK_BOOL_EXEC(node_ptr != nullptr, REPORT_INNER_ERROR("E18888", "param node_ptr is nullptr, check invalid"); + GE_CHK_BOOL_EXEC(node_ptr != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node_ptr is nullptr, check invalid"); return false, "[Check][Param] node is nullptr"); return IsAnchorStatusSet(*node_ptr); } bool NodeUtils::IsAnchorStatusSet(const Node &node) { if (node.impl_ == nullptr) { - REPORT_INNER_ERROR("E18888", "Param node impl is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Param node impl is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Node impl is nullptr."); return false; } @@ -154,22 +154,22 @@ graphStatus NodeUtils::MoveOutputEdges(const NodePtr &origin_node, const NodePtr for (const auto &peer_anchor : origin_out_data_anchors.at(i)->GetPeerInDataAnchors()) { GE_CHK_BOOL_EXEC( origin_out_data_anchors.at(i)->Unlink(peer_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "unlink peer_dataanchor failed, node:%s", origin_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "unlink peer_dataanchor failed, node:%s", origin_node->GetName().c_str()); continue, "[Unlink][PeerAnchor] failed, node:%s", origin_node->GetName().c_str()); GE_CHK_BOOL_EXEC( new_out_data_anchors.at(i)->LinkTo(peer_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "LinkTo peer_dataanchor failed, node:%s", new_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "LinkTo peer_dataanchor failed, node:%s", new_node->GetName().c_str()); continue, "[LinkTo][PeerAnchor] failed, node:%s", new_node->GetName().c_str()); } for (const auto &peer_anchor : origin_out_data_anchors.at(i)->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC( origin_out_data_anchors.at(i)->Unlink(peer_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "unlink peer_controlanchor failed, node:%s", origin_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "unlink peer_controlanchor failed, node:%s", origin_node->GetName().c_str()); continue, "[Unlink][PeerAnchor] failed, node:%s", origin_node->GetName().c_str()); GE_CHK_BOOL_EXEC( new_out_data_anchors.at(i)->LinkTo(peer_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "LinkTo peer_controlanchor failed, node:%s", new_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "LinkTo peer_controlanchor failed, node:%s", new_node->GetName().c_str()); continue, "[LinkTo][PeerAnchor] failed, node:%s", new_node->GetName().c_str()); } } @@ -180,18 +180,18 @@ graphStatus NodeUtils::MoveOutputEdges(const NodePtr &origin_node, const NodePtr GE_CHECK_NOTNULL(new_out_control_anchor); for (const auto &peer_anchor : origin_out_control_anchor->GetPeerInControlAnchors()) { GE_CHK_BOOL_EXEC(new_out_control_anchor->LinkTo(peer_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "linkto peer_anchor from %s to %s failed.", - new_out_control_anchor->GetOwnerNode()->GetName().c_str(), - peer_anchor->GetOwnerNode()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "linkto peer_anchor from %s to %s failed.", + new_out_control_anchor->GetOwnerNode()->GetName().c_str(), + peer_anchor->GetOwnerNode()->GetName().c_str()); continue, "[LinkTo][PeerAnchor] from %s to %s failed", new_out_control_anchor->GetOwnerNode()->GetName().c_str(), peer_anchor->GetOwnerNode()->GetName().c_str()); } for (const auto &peer_anchor : origin_out_control_anchor->GetPeerInDataAnchors()) { GE_CHK_BOOL_EXEC(new_out_control_anchor->LinkTo(peer_anchor) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "linkto peer_anchor from %s to %s failed.", - new_out_control_anchor->GetOwnerNode()->GetName().c_str(), - peer_anchor->GetOwnerNode()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "linkto peer_anchor from %s to %s failed.", + new_out_control_anchor->GetOwnerNode()->GetName().c_str(), + peer_anchor->GetOwnerNode()->GetName().c_str()); continue, "[LinkTo][PeerAnchor] from %s to %s failed", new_out_control_anchor->GetOwnerNode()->GetName().c_str(), peer_anchor->GetOwnerNode()->GetName().c_str()); @@ -209,7 +209,7 @@ bool NodeUtils::IsConst(const Node &node) { void NodeUtils::UpdateIsInputConst(const NodePtr &node_ptr) { if (node_ptr == nullptr) { - REPORT_INNER_ERROR("E18888", "param node_ptr is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node_ptr is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] node is null"); return; } @@ -245,7 +245,7 @@ void NodeUtils::UpdateIsInputConst(Node &node) { } } if (node.GetOpDesc() == nullptr) { - REPORT_INNER_ERROR("E18888", "node has no opdesc."); + REPORT_INNER_ERR_MSG("E18888", "node has no opdesc."); GELOGE(GRAPH_FAILED, "[Check][Param] Node get opdesc is nullptr"); return; } @@ -264,7 +264,7 @@ void NodeUtils::UnlinkAll(const Node &node) { GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendInputAnchor(const NodePtr &node, const uint32_t num) { if ((node == nullptr) || (node->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Input node is null"); return GRAPH_FAILED; } @@ -273,7 +273,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendInpu const auto &op_desc = node->GetOpDesc(); for (size_t i = op_desc->GetAllInputsSize(); i < num; ++i) { if (op_desc->AddInputDesc(data_desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "AddInputDesc failed, op:%s", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddInputDesc failed, op:%s", op_desc->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][InputDesc] failed, op:%s", op_desc->GetName().c_str()); return GRAPH_FAILED; } @@ -282,7 +282,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendInpu for (size_t i = node->impl_->in_data_anchors_.size(); i < num; ++i) { const auto anchor = ComGraphMakeShared(node, i); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Current in data anchor is null, make shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "Current in data anchor is null, make shared_ptr failed."); GELOGE(OUT_OF_MEMORY, "[Create][InDataAnchor] Current in data anchor is null, make shared_ptr failed."); return GRAPH_FAILED; } @@ -295,10 +295,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendInpu GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool NodeUtils::ClearInputDesc(const OpDescPtr &op_desc, const uint32_t index) { GE_CHK_BOOL_EXEC((op_desc != nullptr) && (op_desc->impl_ != nullptr), - REPORT_INNER_ERROR("E18888", "op_desc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "op_desc is nullptr, check invalid"); return false, "[Check][Param] op_desc is nullptr"); GE_CHK_BOOL_EXEC(index < op_desc->impl_->inputs_desc_.size(), - REPORT_INNER_ERROR("E18888", "index %u is invalid, out of range(0, %zu).", + REPORT_INNER_ERR_MSG("E18888", "index %u is invalid, out of range(0, %zu).", index, op_desc->impl_->inputs_desc_.size()); return false, "[Check][Param] index %u is invalid, out of range(0, %zu).", @@ -316,10 +316,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool NodeUtils::ClearInputDesc(co GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool NodeUtils::ClearOutputDesc(const OpDescPtr &op_desc, const uint32_t index) { GE_CHK_BOOL_EXEC((op_desc != nullptr) && (op_desc->impl_ != nullptr), - REPORT_INNER_ERROR("E18888", "param op_desc is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "param op_desc is nullptr, check invalid"); return false, "[Check][Param] op_desc is nullptr"); GE_CHK_BOOL_EXEC(index < op_desc->impl_->outputs_desc_.size(), - REPORT_INNER_ERROR("E18888", "index %u is invalid. out of range(0, %zu)", + REPORT_INNER_ERR_MSG("E18888", "index %u is invalid. out of range(0, %zu)", index, op_desc->impl_->outputs_desc_.size()); return false, "[Check][Param] index %u is invalid. out of range(0, %zu)", @@ -336,7 +336,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool NodeUtils::ClearOutputDesc(c GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::RemoveInputAnchor(const NodePtr &node, const uint32_t num) { if ((node == nullptr) || (node->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "param node is null, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "param node is null, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Input node is null"); return GRAPH_FAILED; } @@ -364,7 +364,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::RemoveInpu GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendOutputAnchor(const NodePtr &node, const uint32_t num) { if ((node == nullptr) || (node->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "Input node is null, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "Input node is null, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Input node is null"); return GRAPH_FAILED; } @@ -373,7 +373,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendOutp const OpDescPtr &op_desc = node->GetOpDesc(); for (size_t i = op_desc->GetOutputsSize(); i < num; ++i) { if (op_desc->AddOutputDesc(data_desc) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Add output desc failed, op:%s", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Add output desc failed, op:%s", op_desc->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Add][OutputDesc] failed, op:%s", op_desc->GetName().c_str()); return GRAPH_FAILED; } @@ -382,7 +382,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendOutp for (size_t i = node->impl_->out_data_anchors_.size(); i < num; ++i) { const auto anchor = ComGraphMakeShared(node, i); if (anchor == nullptr) { - REPORT_CALL_ERROR("E18888", "Current out data anchor is null, make shared_ptr failed."); + REPORT_INNER_ERR_MSG("E18888", "Current out data anchor is null, make shared_ptr failed."); GELOGE(OUT_OF_MEMORY, "[Create][OutDataAnchor] Current out data anchor is null, make shared_ptr failed."); return GRAPH_FAILED; } @@ -395,7 +395,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::AppendOutp GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus NodeUtils::RemoveOutputAnchor(const NodePtr &node, const uint32_t num) { if ((node == nullptr) || (node->impl_ == nullptr)) { - REPORT_INNER_ERROR("E18888", "Input node is null, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Input node is null, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Input node is null"); return GRAPH_FAILED; } @@ -448,7 +448,7 @@ graphStatus NodeUtils::GetNodeUnknownShapeStatus(const Node &node, bool &is_unkn GELOGD("src graph is %s, owner graph name is %s", src_graph->GetName().c_str(), owner_graph->GetName().c_str()); const auto root_graph = GraphUtils::FindRootGraph(src_graph); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "node:%s has no root graph.", node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node:%s has no root graph.", node.GetName().c_str()); GE_LOGE("[Get][Graph] Node %s gets null root graph", node.GetName().c_str()); return GRAPH_PARAM_INVALID; } @@ -461,8 +461,8 @@ graphStatus NodeUtils::GetNodeUnknownShapeStatus(const Node &node, bool &is_unkn for (const auto &node_ptr : sub_graph->GetDirectNode()) { const auto status = GetNodeUnknownShapeStatus(*node_ptr, is_unknow); if (status != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "GetNodeUnknownShapeStatus failed, node:%s, status:%u", - node_ptr->GetName().c_str(), status); + REPORT_INNER_ERR_MSG("E18888", "GetNodeUnknownShapeStatus failed, node:%s, status:%u", + node_ptr->GetName().c_str(), status); GE_LOGE("[Get][NodeUnknownShapeStatus] failed! node:%s, status:%u", node_ptr->GetName().c_str(), status); return status; } @@ -491,14 +491,14 @@ std::string NodeUtils::GetNodeType(const NodePtr &node) { graphStatus NodeUtils::GetDirectSubgraphs(const NodePtr &node, std::vector &subgraphs) { if ((node == nullptr) || (node->GetOpDesc() == nullptr)) { - REPORT_INNER_ERROR("E18888", "node or op_desc is null"); + REPORT_INNER_ERR_MSG("E18888", "node or op_desc is null"); GELOGE(GRAPH_FAILED, "[Check][Param] node or op_desc is null"); return GRAPH_FAILED; } const auto &root_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph()); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to find root graph from node %s ", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to find root graph from node %s ", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] Failed to find root graph from node %s ", node->GetName().c_str()); return GRAPH_FAILED; } @@ -529,8 +529,8 @@ ComputeGraphPtr NodeUtils::GetSubgraph(const Node &node, const uint32_t index) { graphStatus NodeUtils::SetSubgraph(Node &node, const uint32_t index, const ComputeGraphPtr &subgraph) { if (subgraph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to set subgraph to node %s index %u, null subgraph", node.GetName().c_str(), - index); + REPORT_INNER_ERR_MSG("E18888", "Failed to set subgraph to node %s index %u, null subgraph", node.GetName().c_str(), + index); GE_LOGE("[Check][Param] Failed to set subgraph to node %s index %u, null subgraph", node.GetName().c_str(), index); return GRAPH_PARAM_INVALID; } @@ -540,13 +540,13 @@ graphStatus NodeUtils::SetSubgraph(Node &node, const uint32_t index, const Compu } const auto root_graph = GraphUtils::FindRootGraph(node.GetOwnerComputeGraph()); if (root_graph == nullptr) { - REPORT_INNER_ERROR("E18888", "Failed to add subgraph to node %s, null root graph", node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to add subgraph to node %s, null root graph", node.GetName().c_str()); GE_LOGE("[Get][Graph] Failed to add subgraph to node %s, null root graph", node.GetName().c_str()); return GRAPH_PARAM_INVALID; } const auto ret = op_desc->SetSubgraphInstanceName(index, subgraph->GetName()); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "Failed to set subgraph to node %s index %u", node.GetName().c_str(), index); + REPORT_INNER_ERR_MSG("E18888", "Failed to set subgraph to node %s index %u", node.GetName().c_str(), index); GE_LOGE("[Set][Name] Failed to set subgraph to node %s index %u", node.GetName().c_str(), index); return ret; } @@ -977,13 +977,13 @@ NodePtr NodeUtils::GetInNodeCrossSubgraph(const NodePtr &node) { NodePtr NodeUtils::CreatNodeWithoutGraph(const OpDescPtr op_desc) { if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "The OpDesc ptr should not be null."); + REPORT_INNER_ERR_MSG("E18888", "The OpDesc ptr should not be null."); GELOGE(GRAPH_FAILED, "[Check][Param] The OpDesc ptr should not be null."); return nullptr; } auto node_ptr = shared_ptr(new (std::nothrow) Node(op_desc, nullptr)); if (node_ptr == nullptr) { - REPORT_CALL_ERROR("E18888", "create node failed."); + REPORT_INNER_ERR_MSG("E18888", "create node failed."); GELOGE(GRAPH_FAILED, "[Create][Node] node_ptr is NULL!"); return nullptr; } @@ -1080,7 +1080,7 @@ graphStatus NodeUtils::GetInNodeCrossPartionedCallNode(const NodePtr &node, uint graphStatus NodeUtils::SetNodeParallelGroup(Node &node, const char_t *const group_name) { if (group_name == nullptr) { GE_LOGE("[Check][Parameter]Get nullptr when set parallel group on node:%s", node.GetName().c_str()); - REPORT_INNER_ERROR("E18888", "Get nullptr when set parallel group on node:%s", node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Get nullptr when set parallel group on node:%s", node.GetName().c_str()); return GRAPH_FAILED; } std::string current_group; @@ -1089,15 +1089,15 @@ graphStatus NodeUtils::SetNodeParallelGroup(Node &node, const char_t *const grou if (new_group != current_group) { GE_LOGE("[Compare][Attr]Failed to set parallel group name %s on node %s, group conflict with existing %s", new_group.c_str(), node.GetName().c_str(), group_name); - REPORT_INNER_ERROR("E18888", "Failed to set parallel group name %s on node %s, group conflict with existing %s", - new_group.c_str(), node.GetName().c_str(), group_name); + REPORT_INNER_ERR_MSG("E18888", "Failed to set parallel group name %s on node %s, group conflict with existing %s", + new_group.c_str(), node.GetName().c_str(), group_name); return GRAPH_FAILED; } return GRAPH_SUCCESS; } if (!AttrUtils::SetStr(node.GetOpDesc(), ATTR_NAME_PARALLEL_GROUP, new_group)) { GE_LOGE("[Set][Attr] Failed to set parallel group name %s on node %s", group_name, node.GetName().c_str()); - REPORT_INNER_ERROR("E18888", "Failed to set parallel group name %s on node %s", group_name, node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Failed to set parallel group name %s on node %s", group_name, node.GetName().c_str()); return GRAPH_FAILED; } return GRAPH_SUCCESS; diff --git a/graph/utils/node_utils_ex.cc b/graph/utils/node_utils_ex.cc index 13a711cb6c..a4183d87e6 100644 --- a/graph/utils/node_utils_ex.cc +++ b/graph/utils/node_utils_ex.cc @@ -133,8 +133,8 @@ graphStatus NodeUtilsEx::Verify(const NodePtr &node) { GELOGD("get op from OperatorFactory success. opType: %s", node->GetType().c_str()); const auto temp_op_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op); if (temp_op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "GetOpDescFromOperator failed, as return nullptr, type:%s", - node->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "GetOpDescFromOperator failed, as return nullptr, type:%s", + node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Get][OpDesc] temp op desc is null, type:%s", node->GetType().c_str()); return GRAPH_FAILED; } @@ -163,7 +163,7 @@ graphStatus NodeUtilsEx::Verify(const NodePtr &node) { } return GRAPH_SUCCESS; } else { - REPORT_CALL_ERROR("E18888", "%s(%s) Verify failed.", node->GetName().c_str(), node->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "%s(%s) Verify failed.", node->GetName().c_str(), node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Call][CommonVerify] %s(%s) failed.", node->GetName().c_str(), node->GetType().c_str()); return GRAPH_FAILED; } diff --git a/graph/utils/op_desc_utils.cc b/graph/utils/op_desc_utils.cc index 2c8623c346..0cd451f8b7 100644 --- a/graph/utils/op_desc_utils.cc +++ b/graph/utils/op_desc_utils.cc @@ -82,9 +82,9 @@ std::string InputsNamesStr(const OpDescPtr &op_desc) { } bool OpDescUtils::ClearInputDesc(const NodePtr &node) { - GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERROR("E18888", "param node is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node is nullptr, check invalid."); return false, "[Check][Param] node is nullptr"); - GE_CHK_BOOL_EXEC(node->GetOpDesc() != nullptr, REPORT_INNER_ERROR("E18888", "opdesc is nullptr."); + GE_CHK_BOOL_EXEC(node->GetOpDesc() != nullptr, REPORT_INNER_ERR_MSG("E18888", "opdesc is nullptr."); return false, "[Check][Param] opdesc is nullptr"); std::vector index_list; for (const auto &in_anchor : node->GetAllInDataAnchors()) { @@ -124,9 +124,9 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool OpDescUtils::HasQuantizeFact } bool OpDescUtils::ClearOutputDesc(const NodePtr &node) { - GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERROR("E18888", "node is nullptr, check invalid."); + GE_CHK_BOOL_EXEC(node != nullptr, REPORT_INNER_ERR_MSG("E18888", "node is nullptr, check invalid."); return false, "[Check][Param] node is nullptr"); - GE_CHK_BOOL_EXEC(node->GetOpDesc() != nullptr, REPORT_INNER_ERROR("E18888", "opdesc is nullptr."); + GE_CHK_BOOL_EXEC(node->GetOpDesc() != nullptr, REPORT_INNER_ERR_MSG("E18888", "opdesc is nullptr."); return false, "[Check][Param] opdesc is nullptr"); std::vector index_list; for (const auto &out_anchor : node->GetAllOutDataAnchors()) { @@ -167,7 +167,7 @@ GeTensorPtr OpDescUtils::MutableWeights(OpDesc &op_desc) { GE_FUNC_HOST_VISIBILITY GeTensorPtr OpDescUtils::MutableWeights(const OpDescPtr op_desc) { if (op_desc == nullptr) { - REPORT_INNER_ERROR("E18888", "op_desc is null, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "op_desc is null, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] op_desc is null"); return nullptr; } @@ -176,7 +176,7 @@ GE_FUNC_HOST_VISIBILITY GeTensorPtr OpDescUtils::MutableWeights(const OpDescPtr graphStatus OpDescUtils::SetWeights(OpDesc &op_desc, const GeTensorPtr weight) { if (weight == nullptr) { - REPORT_INNER_ERROR("E18888", "weight is null, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "weight is null, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] weight is null"); return GRAPH_FAILED; } @@ -305,7 +305,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY std::vector OpD for (const auto &input_node : input_nodes) { const auto temp_weight = MutableWeights(input_node->GetOpDesc()); if (temp_weight == nullptr) { - REPORT_CALL_ERROR("E18888", "const op's weight is null, name: %s", input_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "const op's weight is null, name: %s", input_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][MutableWeights] const op's weight is null, name: %s", input_node->GetName().c_str()); return std::vector(); @@ -326,7 +326,7 @@ vector OpDescUtils::GetWeightsFromNodes( static_cast(input_node_2_anchor.second->GetIdx()), temp_weight); if (temp_weight == nullptr) { - REPORT_CALL_ERROR("E18888", "const op's weight is null, name: %s", input_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "const op's weight is null, name: %s", input_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][MutableWeights] const op's weight is null, name: %s", input_node->GetName().c_str()); return std::vector(); @@ -349,7 +349,7 @@ size_t OpDescUtils::GetNonConstInputsSize(const ge::Node &node) { } else { GE_IF_BOOL_EXEC( node.GetInDataNodesSize() < GetConstInputs(node).size(), - REPORT_INNER_ERROR("E18888", "InDataNodes size:%zu is smaller than ConstInputs size:%zu", + REPORT_INNER_ERR_MSG("E18888", "InDataNodes size:%zu is smaller than ConstInputs size:%zu", node.GetInDataNodes().size(), GetConstInputs(node).size()); GELOGE(GRAPH_FAILED, "[Check][Param] %zu is smaller than %zu", node.GetInDataNodes().size(), GetConstInputs(node).size()); @@ -360,7 +360,7 @@ size_t OpDescUtils::GetNonConstInputsSize(const ge::Node &node) { GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY size_t OpDescUtils::GetNonConstInputsSize(const ge::ConstNodePtr node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "node is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "node is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] Node is nullptr"); return 0UL; } @@ -368,7 +368,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY size_t OpDescUtils::GetNonConstIn } GeTensorDesc OpDescUtils::GetNonConstInputTensorDesc(const ge::Node &node, const size_t index_non_const) { - GE_CHK_BOOL_EXEC(node.GetOpDesc() != nullptr, REPORT_CALL_ERROR("E18888", "node.GetOpDesc() is nullptr!"); + GE_CHK_BOOL_EXEC(node.GetOpDesc() != nullptr, REPORT_INNER_ERR_MSG("E18888", "node.GetOpDesc() is nullptr!"); return GeTensorDesc(), "[Check][Param] node.GetOpDesc() is nullptr!"); size_t i = 0UL; if (NodeUtils::IsAnchorStatusSet(node)) { @@ -557,8 +557,8 @@ std::vector OpDescUtils::GetConstInputs(const ge::Node &node, const graphStatus OpDescUtils::SetNoneConstNodeWeights(ge::Node &node, const std::vector &weights) { const auto input_nodes = GetConstInputs(node); if (weights.size() < input_nodes.size()) { - REPORT_INNER_ERROR("E18888", "weights count:%zu can't be less than const input count:%zu, node:%s(%s)", - weights.size(), input_nodes.size(), node.GetName().c_str(), node.GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "weights count:%zu can't be less than const input count:%zu, node:%s(%s)", + weights.size(), input_nodes.size(), node.GetName().c_str(), node.GetType().c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] weights count:%zu can't be less than const input count:%zu", weights.size(), input_nodes.size()); return GRAPH_PARAM_INVALID; @@ -572,8 +572,8 @@ graphStatus OpDescUtils::SetNoneConstNodeWeights(ge::Node &node, const std::vect for (size_t i = 0UL; i < input_nodes.size(); ++i) { if (input_nodes[i]->GetOpDesc() != nullptr) { if (SetWeights(input_nodes[i]->GetOpDesc(), copy_weights[i]) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "set weights failed, node:%s(%s)", - input_nodes[i]->GetName().c_str(), input_nodes[i]->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "set weights failed, node:%s(%s)", input_nodes[i]->GetName().c_str(), + input_nodes[i]->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Set][Weights] failed, node:%s(%s)", input_nodes[i]->GetName().c_str(), input_nodes[i]->GetType().c_str()); return GRAPH_FAILED; @@ -589,13 +589,13 @@ graphStatus OpDescUtils::SetNoneConstNodeWeights(ge::Node &node, const std::vect const auto owner_graph = node.GetOwnerComputeGraph(); if (owner_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "node's graph is empty, node name: %s", node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node's graph is empty, node name: %s", node.GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] node's graph is empty, name: %s", node.GetName().c_str()); return GRAPH_PARAM_INVALID; } const auto const_node = owner_graph->AddNodeFront(const_opdesc); GE_CHK_BOOL_EXEC(node.AddLinkFrom(const_node) == GRAPH_SUCCESS, - REPORT_CALL_ERROR("E18888", "node:%s add link failed.", node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node:%s add link failed.", node.GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][AddLinkFrom] graph add link failed! node:%s", node.GetName().c_str()); return GRAPH_FAILED); @@ -610,7 +610,7 @@ graphStatus OpDescUtils::SetNoneConstNodeWeights(ge::Node &node, const std::map< const auto idx = pair.first; // idx = in data anchor size is valid, it meant to add a new const node if ((idx < 0) || (static_cast(idx) > node.GetAllInDataAnchorsSize())) { - REPORT_CALL_ERROR("E18888", "Invalid map key: %d of node[%s].", idx, node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Invalid map key: %d of node[%s].", idx, node.GetName().c_str()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Invalid map key: %d of node[%s].", idx, node.GetName().c_str()); return GRAPH_PARAM_INVALID; } @@ -618,15 +618,15 @@ graphStatus OpDescUtils::SetNoneConstNodeWeights(ge::Node &node, const std::map< if (peer_node != nullptr) { // a. update const input node if (peer_node->GetType() != CONSTANT) { - REPORT_INNER_ERROR("E18888", "op %s [%d]'s input node should be const, but is %s type:%s ", - node.GetName().c_str(), pair.first, - peer_node->GetName().c_str(), peer_node->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "op %s [%d]'s input node should be const, but is %s type:%s ", + node.GetName().c_str(), pair.first, peer_node->GetName().c_str(), + peer_node->GetType().c_str()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] op %s [%d]'s input node should be const, but is %s type:%s ", node.GetName().c_str(), pair.first, peer_node->GetName().c_str(), peer_node->GetType().c_str()); } if (SetWeights(peer_node->GetOpDesc(), pair.second) != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "set weights failed, node:%s(%s)", - peer_node->GetName().c_str(), peer_node->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "set weights failed, node:%s(%s)", peer_node->GetName().c_str(), + peer_node->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Set][Weights] failed, node:%s(%s)", peer_node->GetName().c_str(), peer_node->GetType().c_str()); return GRAPH_FAILED; @@ -637,13 +637,13 @@ graphStatus OpDescUtils::SetNoneConstNodeWeights(ge::Node &node, const std::map< GE_CHECK_NOTNULL(const_opdesc); const auto owner_graph = node.GetOwnerComputeGraph(); if (owner_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "node's graph is empty, node name: %s", node.GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node's graph is empty, node name: %s", node.GetName().c_str()); GELOGE(GRAPH_PARAM_INVALID, "[Get][Graph] node's graph is empty, name: %s", node.GetName().c_str()); return GRAPH_PARAM_INVALID; } const auto const_node = owner_graph->AddNodeFront(const_opdesc); if (node.AddLinkFrom(static_cast(pair.first), const_node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "op %s add const to input index[%d] failed", node.GetName().c_str(), pair.first); + REPORT_INNER_ERR_MSG("E18888", "op %s add const to input index[%d] failed", node.GetName().c_str(), pair.first); GELOGE(GRAPH_FAILED, "[Invoke][AddLinkFrom] op %s add const to input index[%d] failed", node.GetName().c_str(), pair.first); return GRAPH_FAILED; @@ -657,7 +657,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY std::vector OpDescUtils::MutableWeights(const ge::Node &node) { std::vector ret; auto op_desc = node.GetOpDesc(); - GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERROR("E18888", "param node's op_desc is nullptr."); + GE_CHK_BOOL_EXEC(op_desc != nullptr, REPORT_INNER_ERR_MSG("E18888", "param node's op_desc is nullptr."); return ret, "[Check][Param] op_desc is nullptr!"); // Const operator, take the weight directly if ((op_desc->GetType() == CONSTANT) || (op_desc->GetType() == CONSTANTOP)) { @@ -696,7 +696,7 @@ std::vector OpDescUtils::MutableWeights(const ge::Node &node) { for (const auto &input_node : input_nodes) { const auto temp_weight = MutableWeights(input_node->GetOpDesc()); if (temp_weight == nullptr) { - REPORT_INNER_ERROR("E18888", "const op's weight is null, name: %s", input_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "const op's weight is null, name: %s", input_node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Invoke][MutableWeights] const op's weight is null, name: %s", input_node->GetName().c_str()); return std::vector(); @@ -710,7 +710,7 @@ std::vector OpDescUtils::MutableWeights(const ge::Node &node) { GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY std::vector OpDescUtils::MutableWeights(const ge::NodePtr node) { if (node == nullptr) { - REPORT_INNER_ERROR("E18888", "node is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "node is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Node is nullptr"); return std::vector(); } @@ -719,7 +719,7 @@ std::vector OpDescUtils::MutableWeights(const ge::NodePtr node) { GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus OpDescUtils::SetWeights(ge::Node &node, const std::vector &weights) { - GE_CHK_BOOL_EXEC(node.GetOpDesc() != nullptr, REPORT_CALL_ERROR("E18888", "opdesc of node is nullptr."); + GE_CHK_BOOL_EXEC(node.GetOpDesc() != nullptr, REPORT_INNER_ERR_MSG("E18888", "opdesc of node is nullptr."); return GRAPH_PARAM_INVALID, "[Check][Param] node.GetOpDesc is nullptr!"); if (node.GetOpDesc()->GetType() == CONSTANT) { if (weights.size() == CONST_OP_NORMAL_WEIGHT_SIZE) { @@ -740,7 +740,8 @@ OpDescUtils::SetWeights(ge::Node &node, const std::map &we if (weights_map.size() == CONST_OP_NORMAL_WEIGHT_SIZE) { return SetWeights(node.GetOpDesc(), weights_map.begin()->second); } - REPORT_INNER_ERROR("E18888", "const op %s weight size %zu should be 1", node.GetName().c_str(), weights_map.size()); + REPORT_INNER_ERR_MSG("E18888", "const op %s weight size %zu should be 1", node.GetName().c_str(), + weights_map.size()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] const op %s weight size %zu should be 1", node.GetName().c_str(), weights_map.size()); return GRAPH_PARAM_INVALID; @@ -801,15 +802,15 @@ OpDescUtils::AddConstOpToAnchor(const InDataAnchorPtr in_anchor, const GeTensorP GE_CHECK_NOTNULL(in_node); const auto owner_graph = in_node->GetOwnerComputeGraph(); if (owner_graph == nullptr) { - REPORT_CALL_ERROR("E18888", "node's graph is empty, name: %s", in_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "node's graph is empty, name: %s", in_node->GetName().c_str()); GELOGE(GRAPH_PARAM_INVALID, "[Get][Graph] node's graph is empty, name: %s", in_node->GetName().c_str()); return GRAPH_PARAM_INVALID; } const auto const_node = in_node->GetOwnerComputeGraph()->AddNodeFront(const_opdesc); GE_CHECK_NOTNULL(const_node); if (GraphUtils::AddEdge(const_node->GetOutDataAnchor(0), in_anchor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "AddEdge const %s to node %s failed", const_node->GetName().c_str(), - in_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "AddEdge const %s to node %s failed", const_node->GetName().c_str(), + in_node->GetName().c_str()); GELOGE(GRAPH_PARAM_INVALID, "[Add][Edge] const %s to node %s failed.", const_node->GetName().c_str(), in_node->GetName().c_str()); return GRAPH_PARAM_INVALID; @@ -828,7 +829,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus OpDescUtils::ClearWei const auto const_ops = GetConstInputs(node); const auto graph = node->GetOwnerComputeGraph(); if (graph == nullptr) { - REPORT_CALL_ERROR("E18888", "GetOwnerComputeGraph failed, graph is nullptr, node:%s", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "GetOwnerComputeGraph failed, graph is nullptr, node:%s", node->GetName().c_str()); GELOGE(GRAPH_FAILED, "[Get][Graph] Graph is nullptr"); return GRAPH_PARAM_INVALID; } @@ -849,10 +850,9 @@ graphStatus OpDescUtils::SetSubgraphInstanceName(const std::string &subgraph_nam const auto &subgraph_names_to_index = op_desc->GetSubgraphNameIndexes(); const auto iter = subgraph_names_to_index.find(subgraph_name); if (iter == subgraph_names_to_index.end()) { - REPORT_INNER_ERROR("E18888", - "Failed to set subgraph instance %s for node %s type %s, the subgraph name %s does not exist", - subgraph_instance_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), - subgraph_name.c_str()); + REPORT_INNER_ERR_MSG( + "E18888", "Failed to set subgraph instance %s for node %s type %s, the subgraph name %s does not exist", + subgraph_instance_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), subgraph_name.c_str()); GELOGE(GRAPH_PARAM_INVALID, "[Check][Param] Failed to set subgraph instance %s for node %s type %s, the subgraph name %s does not exist", subgraph_instance_name.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), subgraph_name.c_str()); diff --git a/graph/utils/op_desc_utils_ex.cc b/graph/utils/op_desc_utils_ex.cc index 3caef349ec..9c5e97623c 100644 --- a/graph/utils/op_desc_utils_ex.cc +++ b/graph/utils/op_desc_utils_ex.cc @@ -141,9 +141,10 @@ graphStatus OpDescUtilsEx::CallInferFunc(const OpDescPtr &op_desc, Operator &op) if (enable_fast_ignore_infer_error) { ret = (ret == GRAPH_SUCCESS) ? GRAPH_SUCCESS : GRAPH_PARAM_INVALID; } else if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR( + REPORT_INNER_ERR_MSG( "EZ9999", - "Call InferShapeAndType for node:%s(%s) failed. You can ignore this validation by exporting IGNORE_INFER_ERROR=1 if necessary, but it is highly recommended to fix this problem.", + "Call InferShapeAndType for node:%s(%s) failed. You can ignore this validation by exporting " + "IGNORE_INFER_ERROR=1 if necessary, but it is highly recommended to fix this problem.", op_desc->GetNamePtr(), op_desc->GetTypePtr()); } } @@ -227,15 +228,15 @@ graphStatus OpDescUtilsEx::CallInferValueRangeFunc(const OpDescPtr &op_desc, Ope const InferValueRangePara infer_value_range_param = OperatorFactoryImpl::GetInferValueRangePara(op_desc->GetType()); if (!infer_value_range_param.is_initialized) { - REPORT_CALL_ERROR("E18888", "Node %s does not register func to infer value range.", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Node %s does not register func to infer value range.", op_desc->GetName().c_str()); GELOGE(GRAPH_PARAM_INVALID, "Node %s does not register func to infer value range.", op_desc->GetName().c_str()); return GRAPH_PARAM_INVALID; } infer_value_range_func = infer_value_range_param.infer_value_func; if (infer_value_range_func == nullptr) { - REPORT_CALL_ERROR("E18888", "Value range infer func of node %s has been registered, but infer func is nullptr.", - op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Value range infer func of node %s has been registered, but infer func is nullptr.", + op_desc->GetName().c_str()); GELOGE(GRAPH_PARAM_INVALID, "Value range infer func of node %s has been registered, but infer func is nullptr.", op_desc->GetName().c_str()); return GRAPH_PARAM_INVALID; diff --git a/graph/utils/op_type_utils.cc b/graph/utils/op_type_utils.cc index 80de0840cc..579ed479d7 100644 --- a/graph/utils/op_type_utils.cc +++ b/graph/utils/op_type_utils.cc @@ -133,8 +133,8 @@ graphStatus OpTypeUtils::GetOriginalType(const ge::OpDescPtr &op_desc, std::stri GE_IF_BOOL_EXEC(type != FRAMEWORKOP, return GRAPH_SUCCESS); const bool ret = ge::AttrUtils::GetStr(op_desc, ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE, type); if (!ret) { - REPORT_INNER_ERROR("E19999", "Get Attr:%s fail from op:%s(%s)", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str()); + REPORT_INNER_ERR_MSG("E19999", "Get Attr:%s fail from op:%s(%s)", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GELOGE(INTERNAL_ERROR, "[Get][Attr] %s fail from op:%s(%s)", ATTR_NAME_FRAMEWORK_ORIGINAL_TYPE.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); return INTERNAL_ERROR; diff --git a/graph/utils/tensor_utils.cc b/graph/utils/tensor_utils.cc index 2d9261df52..d95bf8ae4f 100644 --- a/graph/utils/tensor_utils.cc +++ b/graph/utils/tensor_utils.cc @@ -75,8 +75,8 @@ static graphStatus CalcElementCntByDims(const std::vector &dims, int64_ element_cnt = 1; for (const int64_t dim : dims) { if (CheckMultiplyOverflowInt64(element_cnt, dim)) { - REPORT_INNER_ERROR("E18888", "result will overflow when multiplying %" PRId64 " and %" PRId64 ".", element_cnt, - dim); + REPORT_INNER_ERR_MSG("E18888", "result will overflow when multiplying %" PRId64 " and %" PRId64 ".", element_cnt, + dim); GELOGE(GRAPH_FAILED, "[Check][Overflow] CalcElementCntByDims failed, when multiplying %" PRId64 " and %" PRId64 ".", element_cnt, dim); @@ -116,7 +116,7 @@ static graphStatus GetMaxShapeDimsFromNoTilingTensor(const GeTensorDesc &tensor_ output_dims = std::move(max_shape_list); return GRAPH_SUCCESS; } - REPORT_INNER_ERROR("E18888", "invalid input shape range."); + REPORT_INNER_ERR_MSG("E18888", "invalid input shape range."); GELOGE(PARAM_INVALID, "[Check][Param]tensor invalid max_shape_list size[%zu], dim size[%zu].", max_shape_list.size(), dims.size()); return PARAM_INVALID; @@ -125,12 +125,12 @@ static graphStatus GetMaxShapeDimsFromNoTilingTensor(const GeTensorDesc &tensor_ std::vector> range; const graphStatus graph_status = tensor_desc.GetShapeRange(range); if (graph_status != GRAPH_SUCCESS) { - REPORT_INNER_ERROR("E18888", "Get shape range failed."); + REPORT_INNER_ERR_MSG("E18888", "Get shape range failed."); GELOGE(PARAM_INVALID, "[Check][Param] GetShapeRange failed."); return graph_status; } if (dims.size() != range.size()) { - REPORT_INNER_ERROR("E18888", "Error shape range size."); + REPORT_INNER_ERR_MSG("E18888", "Error shape range size."); GELOGE(PARAM_INVALID, "[Check][Param] size not matched dims_size[%zu] range_size[%zu].", dims.size(), range.size()); return PARAM_INVALID; } @@ -212,7 +212,7 @@ static graphStatus CalcTensorElementCnt(const std::vector &dims, const graph_status = CalcElementCntByDims(dims, element_cnt); break; default: - REPORT_INNER_ERROR("E18888", "unsupported format, format=%d(%s).", format, format_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "unsupported format, format=%d(%s).", format, format_str.c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] unsupported format, format=%d(%s).", format, format_str.c_str()); graph_status = GRAPH_FAILED; break; @@ -224,8 +224,8 @@ static graphStatus CalcTensorElementCnt(const std::vector &dims, const "CalcTensorElementCnt end, format=%d(%s), data_type=%d(%s), element_cnt=%" PRId64 ".", format, format_str.c_str(), data_type, type_str.c_str(), element_cnt); } else { - REPORT_INNER_ERROR("E18888", "CalcTensorElementCnt failed, format=%d(%s), data_type=%d(%s).", - format, format_str.c_str(), data_type, type_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "CalcTensorElementCnt failed, format=%d(%s), data_type=%d(%s).", format, + format_str.c_str(), data_type, type_str.c_str()); GELOGE(GRAPH_FAILED, "[Calc][TensorElementCnt] failed, format=%d(%s), data_type=%d(%s).", format, format_str.c_str(), data_type, type_str.c_str()); } @@ -267,7 +267,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus TensorUtils::CalcTens uint32_t type_size = 0U; const bool result = TypeUtils::GetDataTypeLength(data_type, type_size); if (!result) { - REPORT_CALL_ERROR("E18888", "GetDataTypeLength failed, data_type=%d(%s).", data_type, type_str.c_str()); + REPORT_INNER_ERR_MSG("E18888", "GetDataTypeLength failed, data_type=%d(%s).", data_type, type_str.c_str()); GELOGE(GRAPH_FAILED, "[Get][DataTypeLength] failed, data_type=%d(%s).", data_type, type_str.c_str()); return GRAPH_FAILED; } @@ -341,10 +341,10 @@ TensorUtils::GetTensorSizeInBytes(const GeTensorDesc &desc_temp, int64_t &size_t } if (output_mem_size < 0) { - REPORT_INNER_ERROR("E18888", - "After calc concat tensor memory size, output_mem_size = %" PRId64 "," - " out of data range [0, %" PRId64 "]", - output_mem_size, std::numeric_limits::max()); + REPORT_INNER_ERR_MSG("E18888", + "After calc concat tensor memory size, output_mem_size = %" PRId64 "," + " out of data range [0, %" PRId64 "]", + output_mem_size, std::numeric_limits::max()); GELOGW("[Check][Param] After calc concat tensor memory size, " "output_mem_size = %" PRId64 ", out of data range [0, %" PRId64 "]", output_mem_size, std::numeric_limits::max()); diff --git a/graph/utils/transformer_utils.cc b/graph/utils/transformer_utils.cc index d6df2bf9c6..9a2f170246 100644 --- a/graph/utils/transformer_utils.cc +++ b/graph/utils/transformer_utils.cc @@ -38,7 +38,7 @@ bool SameCurrentAndOrigin(const GeTensorDescPtr &tensor_desc) { } bool NodeShapeTransUtils::Init() { if (op_desc_ == nullptr) { - REPORT_INNER_ERROR("E18888", "op_desc_ is nullptr, check invalid."); + REPORT_INNER_ERR_MSG("E18888", "op_desc_ is nullptr, check invalid."); GELOGE(GRAPH_FAILED, "[Check][Param] input op_desc_ is nullptr!"); return false; } @@ -135,7 +135,7 @@ bool NodeShapeTransUtils::UpdateFormatAndShape() { const bool is_success = transformer::ExpandDimension(op_desc_->GetType(), ori_format, curr_format, i, infer_reshape_type, ori_shape); if (!is_success) { - REPORT_CALL_ERROR("E18888", "ExpandDimension failed, op type:%s", op_desc_->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "ExpandDimension failed, op type:%s", op_desc_->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Call][ExpandDimension] failed, op type:%s", op_desc_->GetType().c_str()); return false; } @@ -160,10 +160,11 @@ bool NodeShapeTransUtils::UpdateFormatAndShape() { auto &ori_shape = tensor_desc_output->MutableShape(); const auto curr_format = tensor_desc_output->GetFormat(); if (curr_format != map_ori_format_out_[i]) { - REPORT_INNER_ERROR("E18888", "Node is %s, out tensor idx is %zu. format: %s, " - "recorded origin format: %s is not same", op_desc_->GetName().c_str(), i, - TypeUtils::FormatToSerialString(curr_format).c_str(), - TypeUtils::FormatToSerialString(map_ori_format_out_[i]).c_str()); + REPORT_INNER_ERR_MSG("E18888", + "Node is %s, out tensor idx is %zu. format: %s, " + "recorded origin format: %s is not same", + op_desc_->GetName().c_str(), i, TypeUtils::FormatToSerialString(curr_format).c_str(), + TypeUtils::FormatToSerialString(map_ori_format_out_[i]).c_str()); GELOGE(GRAPH_FAILED, "[Check][Param] Node is %s, out tensor idx is %zu. format: %s, " "recorded origin format: %s is not same", op_desc_->GetName().c_str(), i, TypeUtils::FormatToSerialString(curr_format).c_str(), @@ -187,7 +188,7 @@ bool NodeShapeTransUtils::UpdateFormatAndShape() { const bool is_success = transformer::ExpandDimension(op_desc_->GetType(), curr_format, saved_format, i, infer_reshape_type, ori_shape); if (!is_success) { - REPORT_CALL_ERROR("E18888", "ExpandDimension failed, op type:%s.", op_desc_->GetType().c_str()); + REPORT_INNER_ERR_MSG("E18888", "ExpandDimension failed, op type:%s.", op_desc_->GetType().c_str()); GELOGE(GRAPH_FAILED, "[Call][ExpandDimension] failed, op type:%s.", op_desc_->GetType().c_str()); return false; } diff --git a/graph/utils/tuning_utils.cc b/graph/utils/tuning_utils.cc index a3b75575fe..0ca443522e 100644 --- a/graph/utils/tuning_utils.cc +++ b/graph/utils/tuning_utils.cc @@ -91,7 +91,7 @@ std::string TuningUtils::PrintCheckLog() { std::string TuningUtils::GetNodeNameByAnchor(const Anchor * const anchor) { if (anchor == nullptr) { - REPORT_INNER_ERROR("E18888", "Anchor is nullptr, check invalid"); + REPORT_INNER_ERR_MSG("E18888", "Anchor is nullptr, check invalid"); GELOGE(GRAPH_FAILED, "[Check][Param] Anchor is nullptr"); return "Null"; } @@ -150,7 +150,7 @@ graphStatus TuningUtils::ConvertConstToWeightAttr(const ComputeGraphPtr &exe_gra continue; } if (!ge::AttrUtils::SetTensor(op_desc, ATTR_NAME_WEIGHTS, weight[0U])) { - REPORT_CALL_ERROR("E18888", "Set tensor to node[%s] failed", op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Set tensor to node[%s] failed", op_desc->GetName().c_str()); GELOGE(FAILED, "[Set][Tensor] to node[%s] failed", op_desc->GetName().c_str()); return FAILED; } @@ -186,8 +186,8 @@ graphStatus TuningUtils::MakeExeGraph(ComputeGraphPtr &exe_graph, graphStatus ret = exe_graph->TopologicalSortingGraph(true); if (ret != SUCCESS) { GraphUtils::DumpGEGraphToOnnx(*exe_graph, "black_box"); - REPORT_CALL_ERROR("E18888", "TopologicalSortingGraph [%s] failed, saved to file black_box ret:%u.", - exe_graph->GetName().c_str(), ret); + REPORT_INNER_ERR_MSG("E18888", "TopologicalSortingGraph [%s] failed, saved to file black_box ret:%u.", + exe_graph->GetName().c_str(), ret); GELOGE(ret, "[Sort][Graph] Graph[%s] topological sort failed, saved to file black_box ret:%u.", exe_graph->GetName().c_str(), ret); return ret; @@ -198,7 +198,7 @@ graphStatus TuningUtils::MakeExeGraph(ComputeGraphPtr &exe_graph, // if not make exe, just dump and return if (!help_info.exe_flag_) { if (ConvertConstToWeightAttr(exe_graph) != SUCCESS) { - REPORT_CALL_ERROR("E18888", "Convert const to weight attr of graph %s failed", exe_graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "Convert const to weight attr of graph %s failed", exe_graph->GetName().c_str()); GELOGE(FAILED, "[Convert][Const] to weight attr of graph %s failed", exe_graph->GetName().c_str()); return FAILED; } @@ -435,7 +435,7 @@ graphStatus TuningUtils::CreateDataNode(NodePtr &node, const std::string &aoe_pa GE_CHECK_NOTNULL(data_node); if (data_node->GetType() == CONSTANT) { if (OpDescUtils::SetWeights(data_node, weight) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:const node %s add weight failed", data_op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:const node %s add weight failed", data_op_desc->GetName().c_str()); GELOGE(FAILED, "[Set][Weights] TUU:const node %s add weight failed", data_op_desc->GetName().c_str()); return FAILED; } @@ -454,7 +454,7 @@ graphStatus TuningUtils::AddAttrToDataNodeForMergeGraph(const NodePtr &pld, cons // a. set `end's input node type` as attr std::string parent_op_type; if (!AttrUtils::GetStr(pld_desc, "parentOpType", parent_op_type)) { - REPORT_CALL_ERROR("E18888", "TUU:pld %s get parentOpType failed", pld_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get parentOpType failed", pld_desc->GetName().c_str()); GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get parentOpType failed", pld_desc->GetName().c_str()); return FAILED; } @@ -462,7 +462,7 @@ graphStatus TuningUtils::AddAttrToDataNodeForMergeGraph(const NodePtr &pld, cons // b. set `end's input node name` as attr std::string parent_op_name; if (!AttrUtils::GetStr(pld_desc, parent_node_name_attr, parent_op_name)) { - REPORT_CALL_ERROR("E18888", "TUU:pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); return FAILED; } @@ -470,7 +470,7 @@ graphStatus TuningUtils::AddAttrToDataNodeForMergeGraph(const NodePtr &pld, cons // c. set `end's input node's out anchor index` as attr int32_t parent_node_anchor_index; if (!AttrUtils::GetInt(pld_desc, "anchorIndex", parent_node_anchor_index)) { - REPORT_CALL_ERROR("E18888", "TUU:pld %s get anchorIndex failed", pld_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get anchorIndex failed", pld_desc->GetName().c_str()); GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get anchorIndex failed", pld_desc->GetName().c_str()); return FAILED; } @@ -480,7 +480,7 @@ graphStatus TuningUtils::AddAttrToDataNodeForMergeGraph(const NodePtr &pld, cons // d. set `end node name` as attr std::string peer_end_name; if (!AttrUtils::GetStr(pld_desc, peer_node_name_attr, peer_end_name)) { - REPORT_CALL_ERROR("E18888", "TUU:pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); return FAILED; } @@ -494,8 +494,8 @@ graphStatus TuningUtils::ChangePld2Data(const NodePtr &node, const NodePtr &data const auto type_pld = node->GetType(); const auto type_data = data_node->GetType(); if ((type_pld != PLACEHOLDER) || (kExeTypes.count(type_data) == 0U)) { - REPORT_INNER_ERROR("E18888", "TUU:Failed to change node %s from type %s to type %s", - node->GetName().c_str(), type_pld.c_str(), type_data.c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to change node %s from type %s to type %s", node->GetName().c_str(), + type_pld.c_str(), type_data.c_str()); GELOGE(FAILED, "[Check][Param] TUU:Failed to change node %s from type %s to type %s", node->GetName().c_str(), type_pld.c_str(), type_data.c_str()); return FAILED; @@ -509,8 +509,8 @@ graphStatus TuningUtils::ChangePld2Data(const NodePtr &node, const NodePtr &data const auto ret = GraphUtils::ReplaceNodeAnchors(data_node, node, {}, output_map); if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:Failed to replace node %s by node %s, ret:%u", - node->GetName().c_str(), data_node->GetName().c_str(), ret); + REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to replace node %s by node %s, ret:%u", node->GetName().c_str(), + data_node->GetName().c_str(), ret); GELOGE(FAILED, "[Replace][Node] %s by node %s failed, ret:%u", node->GetName().c_str(), data_node->GetName().c_str(), ret); return FAILED; @@ -557,8 +557,8 @@ graphStatus TuningUtils::CreateNetOutput(const NodePtr &node, NodePtr &out_node) GE_CHECK_NOTNULL(graph); const auto search = create_output_.find(graph); if (search == create_output_.end()) { - REPORT_INNER_ERROR("E18888", "TUU:node %s's owner sub graph %s does not exist in create_output map", - node->GetName().c_str(), graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:node %s's owner sub graph %s does not exist in create_output map", + node->GetName().c_str(), graph->GetName().c_str()); GELOGE(FAILED, "[Check][Param] TUU:node %s's owner sub graph %s does not exist in create_output map", node->GetName().c_str(), graph->GetName().c_str()); return FAILED; @@ -573,7 +573,7 @@ graphStatus TuningUtils::CreateNetOutput(const NodePtr &node, NodePtr &out_node) out_node = graph->AddNode(out_op_desc); GE_CHECK_NOTNULL(out_node); if (out_node->SetOwnerComputeGraph(graph) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); GELOGE(FAILED, "[Set][Graph] TUU:SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); return FAILED; } @@ -612,11 +612,12 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) const auto src_anchor = end_in_anchor->GetFirstPeerAnchor(); // src_anchor should be only 1 GE_CHECK_NOTNULL(src_anchor); if (GraphUtils::RemoveEdge(src_anchor, end_in_anchor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:remove end input edge from from %s(%d) to %s(%d) failed. " - "node_name:%s, graph_name:%s", - GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), - GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), - end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "TUU:remove end input edge from from %s(%d) to %s(%d) failed. " + "node_name:%s, graph_name:%s", + GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), + GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), + end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); GELOGE(FAILED, "[Remove][Edge] TUU:remove end input edge from from %s(%d) to %s(%d) failed. " "node_name:%s, graph_name:%s", GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), @@ -631,10 +632,10 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) GE_CHECK_NOTNULL(out_node->impl_); out_node->impl_->in_data_anchors_.push_back(anchor); if (GraphUtils::AddEdge(src_anchor, anchor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", - GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), - GetNodeNameByAnchor(anchor.get()).c_str(), anchor->GetIdx(), - end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", + GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), + GetNodeNameByAnchor(anchor.get()).c_str(), anchor->GetIdx(), end_node->GetName().c_str(), + end_node->GetOwnerComputeGraph()->GetName().c_str()); GELOGE(FAILED, "[Add][Edge] from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), GetNodeNameByAnchor(anchor.get()).c_str(), anchor->GetIdx(), @@ -647,7 +648,7 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) GE_CHECK_NOTNULL(out_node_op_desc); // end node always has one input if (out_node_op_desc->AddInputDesc(end_op_desc->GetInputDesc(0U)) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:node %s add input desc failed.", out_node_op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:node %s add input desc failed.", out_node_op_desc->GetName().c_str()); GELOGE(FAILED, "[Add][InputDesc] failed, TUU:node %s .", out_node_op_desc->GetName().c_str()); return FAILED; } @@ -666,11 +667,11 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) const auto out_in_anchor = out_node->GetInControlAnchor(); if ((GraphUtils::AddEdge(src_anchor, noop_node->GetInControlAnchor()) != GRAPH_SUCCESS) || (GraphUtils::AddEdge(noop_node->GetOutControlAnchor(), out_in_anchor) != GRAPH_SUCCESS)) { - REPORT_CALL_ERROR("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", - GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), - GetNodeNameByAnchor(noop_node->GetInControlAnchor().get()).c_str(), - noop_node->GetInControlAnchor()->GetIdx(), end_node->GetName().c_str(), - end_node->GetOwnerComputeGraph()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", + GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), + GetNodeNameByAnchor(noop_node->GetInControlAnchor().get()).c_str(), + noop_node->GetInControlAnchor()->GetIdx(), end_node->GetName().c_str(), + end_node->GetOwnerComputeGraph()->GetName().c_str()); GELOGE(FAILED, "[Add][Edge] from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), GetNodeNameByAnchor(noop_node->GetInControlAnchor().get()).c_str(), @@ -685,8 +686,8 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) return FAILED; } } else { - REPORT_INNER_ERROR("E18888", "TUU: node_name:%s, graph_name:%s handled failed", - end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU: node_name:%s, graph_name:%s handled failed", end_node->GetName().c_str(), + end_node->GetOwnerComputeGraph()->GetName().c_str()); GELOGE(FAILED, "[Handle][Node] TUU: node_name:%s, graph_name:%s handled failed", end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); return FAILED; @@ -701,8 +702,8 @@ graphStatus TuningUtils::ChangeEnd2NetOutput(NodePtr &end_node, NodePtr &out_nod const auto type_end = end_node->GetType(); const auto type_out = out_node->GetType(); if ((type_end != END) || (type_out != NETOUTPUT)) { - REPORT_INNER_ERROR("E18888", "TUU:Failed to change end_node %s from type %s to type %s", - end_node->GetName().c_str(), type_end.c_str(), type_out.c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to change end_node %s from type %s to type %s", + end_node->GetName().c_str(), type_end.c_str(), type_out.c_str()); GELOGE(FAILED, "[Check][Param] TUU:Failed to change end_node %s from type %s to type %s", end_node->GetName().c_str(), type_end.c_str(), type_out.c_str()); return FAILED; @@ -795,8 +796,8 @@ graphStatus TuningUtils::LinkSubgraph(ComputeGraphPtr &root_graph, const Compute for (const auto &subgraph_name : op_desc->GetSubgraphInstanceNames()) { const auto iter = name_to_merged_subgraph.find(subgraph_name); if (iter == name_to_merged_subgraph.end()) { - REPORT_CALL_ERROR("E18888", "TUU:can not find subgraph with name:%s for op:%s.", - subgraph_name.c_str(), op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:can not find subgraph with name:%s for op:%s.", subgraph_name.c_str(), + op_desc->GetName().c_str()); GELOGE(GRAPH_FAILED, "can not find subgraph with name:%s for op:%s", subgraph_name.c_str(), op_desc->GetName().c_str()); return GRAPH_FAILED; @@ -838,7 +839,7 @@ graphStatus TuningUtils::LoadGraphFromFile(const std::map for (const auto &pair : options) { auto compute_graph = ComGraphMakeShared(std::to_string(pair.first)); if (!ge::GraphUtils::LoadGEGraph(pair.second.c_str(), compute_graph)) { - REPORT_CALL_ERROR("E18888", "LoadGEGraph from file:%s failed", pair.second.c_str()); + REPORT_INNER_ERR_MSG("E18888", "LoadGEGraph from file:%s failed", pair.second.c_str()); GELOGE(FAILED, "[Load][Graph] from file:%s failed", pair.second.c_str()); } bool is_root_graph = false; @@ -848,7 +849,7 @@ graphStatus TuningUtils::LoadGraphFromFile(const std::map } else { std::string parent_graph_name; if (!ge::AttrUtils::GetStr(compute_graph, ATTR_NAME_PARENT_GRAPH_NAME, parent_graph_name)) { - REPORT_CALL_ERROR("E18888", "TUU:get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph."); + REPORT_INNER_ERR_MSG("E18888", "TUU:get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph."); GELOGE(GRAPH_FAILED, "get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph:%s", compute_graph->GetName().c_str()); return GRAPH_FAILED; @@ -858,7 +859,7 @@ graphStatus TuningUtils::LoadGraphFromFile(const std::map } if (root_graphs.empty()) { - REPORT_CALL_ERROR("E18888", "TUU:root graph has no subgraphs, can not merge."); + REPORT_INNER_ERR_MSG("E18888", "TUU:root graph has no subgraphs, can not merge."); GELOGE(GRAPH_FAILED, "root graph has no subgraphs, can not merge"); return GRAPH_FAILED; } @@ -927,8 +928,8 @@ graphStatus TuningUtils::MergeAllSubGraph(const std::vector &su } const graphStatus ret = output_merged_compute_graph->TopologicalSorting(); if (ret != SUCCESS) { - REPORT_CALL_ERROR("E18888", "Graph[%s] topological sort failed, ret:%u.", - output_merged_compute_graph->GetName().c_str(), ret); + REPORT_INNER_ERR_MSG("E18888", "Graph[%s] topological sort failed, ret:%u.", + output_merged_compute_graph->GetName().c_str(), ret); GELOGE(ret, "[Sort][Graph] Graph[%s] topological sort failed, ret:%u.", output_merged_compute_graph->GetName().c_str(), ret); return ret; @@ -941,7 +942,7 @@ graphStatus TuningUtils::MergeAllSubGraph(const std::vector &su graphStatus TuningUtils::MergeSubGraph(const ComputeGraphPtr &subgraph) { for (auto &node : subgraph->GetDirectNode()) { if (kPartitionOpTypes.count(node->GetType()) > 0UL) { - REPORT_INNER_ERROR("E18888", "TUU:subgraph passed in should not contain nodes of end or pld type"); + REPORT_INNER_ERR_MSG("E18888", "TUU:subgraph passed in should not contain nodes of end or pld type"); GELOGE(FAILED, "[Check][Param] TUU:subgraph passed in should not contain nodes of end or pld type"); return FAILED; } @@ -1035,8 +1036,8 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { // remove noop node NodeUtils::UnlinkAll(*noop_node); if (GraphUtils::RemoveJustNode(graph, noop_node) != SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:noop node [%s] RemoveNodeWithoutRelink failed.", - noop_node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:noop node [%s] RemoveNodeWithoutRelink failed.", + noop_node->GetName().c_str()); GELOGE(FAILED, "[Remove][Node]TUU:noop node [%s] RemoveNodeWithoutRelink failed.", noop_node->GetName().c_str()); return FAILED; @@ -1056,11 +1057,12 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { GE_CHECK_NOTNULL(data_out_anchor); for (const auto &peer_in_anchor : data_out_anchor->GetPeerAnchors()) { if (GraphUtils::RemoveEdge(data_out_anchor, peer_in_anchor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "[Remove][Edge] from %s(%d) to %s(%d) failed. " - "node_name:(data:%s;netoutput:%s), graph_name:%s", - GetNodeNameByAnchor(data_out_anchor.get()).c_str(), data_out_anchor->GetIdx(), - GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), - data_node->GetName().c_str(), netoutput_node->GetName().c_str(), graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "[Remove][Edge] from %s(%d) to %s(%d) failed. " + "node_name:(data:%s;netoutput:%s), graph_name:%s", + GetNodeNameByAnchor(data_out_anchor.get()).c_str(), data_out_anchor->GetIdx(), + GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), + data_node->GetName().c_str(), netoutput_node->GetName().c_str(), graph->GetName().c_str()); GELOGE(FAILED, "[Remove][Edge] from %s(%d) to %s(%d) failed. node_name:(data:%s;netoutput:%s), graph_name:%s", GetNodeNameByAnchor(data_out_anchor.get()).c_str(), data_out_anchor->GetIdx(), GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), @@ -1068,11 +1070,12 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { return FAILED; } if (GraphUtils::AddEdge(src_out_anchor, peer_in_anchor) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. " - "node_name:(data:%s;netoutput:%s), graph_name:%s", - GetNodeNameByAnchor(src_out_anchor.get()).c_str(), src_out_anchor->GetIdx(), - GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), - data_node->GetName().c_str(), netoutput_node->GetName().c_str(), graph->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", + "TUU:add edge from %s(%d) to %s(%d) failed. " + "node_name:(data:%s;netoutput:%s), graph_name:%s", + GetNodeNameByAnchor(src_out_anchor.get()).c_str(), src_out_anchor->GetIdx(), + GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), + data_node->GetName().c_str(), netoutput_node->GetName().c_str(), graph->GetName().c_str()); GELOGE(FAILED, "[Add][Edge] from %s(%d) to %s(%d) failed. node_name:(data:%s;netoutput:%s), graph_name:%s", GetNodeNameByAnchor(src_out_anchor.get()).c_str(), src_out_anchor->GetIdx(), GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), @@ -1085,7 +1088,7 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { for (auto &node: netoutput_nodes_) { NodeUtils::UnlinkAll(*node); if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E18888", "TUU:Failed to remove node %s from graph", node->GetName().c_str()); + REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to remove node %s from graph", node->GetName().c_str()); GELOGE(FAILED, "[Remove][Node] %s from graph failed.", node->GetName().c_str()); return FAILED; } diff --git a/graph/utils/type_utils.cc b/graph/utils/type_utils.cc index 7214eb8ca7..e2c17cb1b5 100644 --- a/graph/utils/type_utils.cc +++ b/graph/utils/type_utils.cc @@ -115,8 +115,8 @@ std::string TypeUtilsInner::ImplyTypeToSerialString(const domi::ImplyType imply_ if (it != kImplyTypeToString.end()) { return it->second; } else { - REPORT_INNER_ERROR("E18888", "ImplyTypeToSerialString: imply_type not support %u", - static_cast(imply_type)); + REPORT_INNER_ERR_MSG("E18888", "ImplyTypeToSerialString: imply_type not support %u", + static_cast(imply_type)); GELOGE(GRAPH_FAILED, "[Check][Param] ImplyTypeToSerialString: imply_type not support %u", static_cast(imply_type)); return "UNDEFINED"; diff --git a/inc/common/checker.h b/inc/common/checker.h index bab5fb8c49..fb7461ecaa 100644 --- a/inc/common/checker.h +++ b/inc/common/checker.h @@ -75,7 +75,7 @@ inline std::vector CreateErrorMsg() { if (xv != yv) { \ std::stringstream ss; \ ss << "Assert (" << #x << " == " << #y << ") failed, expect " << yv << " actual " << xv; \ - REPORT_INNER_ERROR("E19999", "%s", ss.str().c_str()); \ + REPORT_INNER_ERR_MSG("E19999", "%s", ss.str().c_str()); \ GELOGE(ge::FAILED, "%s", ss.str().c_str()); \ return ::ErrorResult(); \ } \ @@ -95,10 +95,10 @@ inline std::vector CreateErrorMsg() { if (!(exp)) { \ auto msg = CreateErrorMsg(__VA_ARGS__); \ if (msg.empty()) { \ - REPORT_INNER_ERROR("E19999", "Assert %s failed", #exp); \ + REPORT_INNER_ERR_MSG("E19999", "Assert %s failed", #exp); \ GELOGE(ge::FAILED, "Assert %s failed", #exp); \ } else { \ - REPORT_INNER_ERROR("E19999", "%s", msg.data()); \ + REPORT_INNER_ERR_MSG("E19999", "%s", msg.data()); \ GELOGE(ge::FAILED, "%s", msg.data()); \ } \ return ::ErrorResult(); \ diff --git a/inc/common/ge_common/debug/ge_log.h b/inc/common/ge_common/debug/ge_log.h index ea198f6b72..9cd98350f6 100644 --- a/inc/common/ge_common/debug/ge_log.h +++ b/inc/common/ge_common/debug/ge_log.h @@ -12,9 +12,11 @@ #include #include - +#include +#include #include "common/ge_common/ge_inner_error_codes.h" #include "common/util/error_manager/error_manager.h" +#include "base/err_msg.h" #include "toolchain/slog.h" #ifdef __GNUC__ #include @@ -61,45 +63,43 @@ inline bool IsLogPrintStdout() { return (stdout_flag == 1) ? true : false; } -#define GELOGE(ERROR_CODE, fmt, ...) \ - do { \ - dlog_error(GE_MODULE_NAME, "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s) %s" fmt, \ - GeLog::GetTid(), &__FUNCTION__[0U], \ - (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), \ - ErrorManager::GetInstance().GetLogHeader().c_str(), ##__VA_ARGS__); \ +#define GELOGE(ERROR_CODE, fmt, ...) \ + do { \ + dlog_error(GE_MODULE_NAME, "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s)" fmt, GeLog::GetTid(), &__FUNCTION__[0U], \ + (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ##__VA_ARGS__); \ } while (false) -#define GELOGW(fmt, ...) \ - do { \ - dlog_warn(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ +#define GELOGW(fmt, ...) \ + do { \ + dlog_warn(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ } while (false) -#define GELOGI(fmt, ...) \ - do { \ - dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ +#define GELOGI(fmt, ...) \ + do { \ + dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ } while (false) -#define GELOGD(fmt, ...) \ - do { \ - dlog_debug(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ +#define GELOGD(fmt, ...) \ + do { \ + dlog_debug(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ } while (false) -#define GEEVENT(fmt, ...) \ - do { \ - dlog_info(static_cast(static_cast(RUN_LOG_MASK) | static_cast(GE_MODULE_NAME)), \ - "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ - if (!IsLogPrintStdout()) { \ - dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ - } \ +#define GEEVENT(fmt, ...) \ + do { \ + dlog_info(static_cast(static_cast(RUN_LOG_MASK) | static_cast(GE_MODULE_NAME)), \ + "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ + if (!IsLogPrintStdout()) { \ + dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ + } \ } while (false) -#define GERUNINFO(fmt, ...) \ - do { \ - dlog_info(static_cast(static_cast(RUN_LOG_MASK) | static_cast(GE_MODULE_NAME)), \ - "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ - if (!IsLogPrintStdout()) { \ - dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ - } \ +#define GERUNINFO(fmt, ...) \ + do { \ + dlog_info(static_cast(static_cast(RUN_LOG_MASK) | static_cast(GE_MODULE_NAME)), \ + "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ + if (!IsLogPrintStdout()) { \ + dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ + } \ } while (false) #define GELOGT(VALUE, fmt, ...) \ @@ -111,29 +111,28 @@ inline bool IsLogPrintStdout() { "[status:%s]%" PRIu64 " %s:" fmt, v, GeLog::GetTid(), &__FUNCTION__[0U], ##__VA_ARGS__); \ } while (false) -#define GE_LOG_ERROR(MOD_NAME, ERROR_CODE, fmt, ...) \ - do { \ - dlog_error((MOD_NAME), "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s) %s" fmt, GeLog::GetTid(), \ - &__FUNCTION__[0U], (ERROR_CODE), \ - ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ErrorManager::GetInstance().GetLogHeader().c_str(), \ - ##__VA_ARGS__); \ +#define GE_LOG_ERROR(MOD_NAME, ERROR_CODE, fmt, ...) \ + do { \ + dlog_error((MOD_NAME), "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s)" fmt, GeLog::GetTid(), &__FUNCTION__[0U], \ + (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ##__VA_ARGS__); \ } while (false) // print memory when it is greater than 1KB. -#define GE_PRINT_DYNAMIC_MEMORY(FUNC, PURPOSE, SIZE) \ - do { \ - if (static_cast(SIZE) > 1024UL) { \ - GELOGI("MallocMemory, func=%s, size=%zu, purpose=%s", (#FUNC), static_cast(SIZE), (PURPOSE)); \ - } \ +#define GE_PRINT_DYNAMIC_MEMORY(FUNC, PURPOSE, SIZE) \ + do { \ + if (static_cast(SIZE) > 1024UL) { \ + GELOGI("MallocMemory, func=%s, size=%zu, purpose=%s", (#FUNC), static_cast(SIZE), (PURPOSE)); \ + } \ } while (false) -#define GELOG_DEPRECATED(option) \ - do { \ - std::cout << "[WARNING][GE] Option " << (option) << " is deprecated and will be removed in future version." \ - " Please do not configure this option in the future." << std::endl; \ +#define GELOG_DEPRECATED(option) \ + do { \ + std::cout << "[WARNING][GE] Option " << (option) \ + << " is deprecated and will be removed in future version." \ + " Please do not configure this option in the future." \ + << std::endl; \ } while (false) - #ifdef __cplusplus } #endif diff --git a/inc/common/ge_common/debug/log.h b/inc/common/ge_common/debug/log.h index 7795c359c9..67dd6c9300 100644 --- a/inc/common/ge_common/debug/log.h +++ b/inc/common/ge_common/debug/log.h @@ -16,6 +16,7 @@ #include "common/ge_common/string_util.h" #include "common/ge_common/util.h" #include "common/ge_common/debug/ge_log.h" +#include "base/err_msg.h" #include "external/ge_common/ge_api_error_codes.h" #if !defined(__ANDROID__) && !defined(ANDROID) @@ -79,7 +80,7 @@ #define GE_CHK_GRAPH_STATUS_RET(expr, ...) \ do { \ if ((expr) != ge::GRAPH_SUCCESS) { \ - REPORT_CALL_ERROR("E19999", "Operator graph failed"); \ + REPORT_INNER_ERR_MSG("E19999", "Operator graph failed"); \ GELOGE(ge::FAILED, __VA_ARGS__); \ return (ge::FAILED); \ } \ @@ -97,7 +98,7 @@ do { \ const bool b = (expr); \ if (!b) { \ - REPORT_INNER_ERROR("E19999", __VA_ARGS__); \ + REPORT_INNER_ERR_MSG("E19999", __VA_ARGS__); \ GELOGE((_status), __VA_ARGS__); \ return (_status); \ } \ @@ -157,7 +158,7 @@ do { \ const rtError_t _rt_ret = (expr); \ if (_rt_ret != RT_ERROR_NONE) { \ - REPORT_CALL_ERROR("E19999", "Call %s fail, ret: 0x%X", #expr, static_cast(_rt_ret)); \ + REPORT_INNER_ERR_MSG("E19999", "Call %s fail, ret: 0x%X", #expr, static_cast(_rt_ret)); \ GELOGE(ge::RT_FAILED, "Call rt api failed, ret: 0x%X", static_cast(_rt_ret)); \ return RT_ERROR_TO_GE_STATUS(_rt_ret); \ } \ @@ -183,13 +184,14 @@ #define GE_ERRORLOG_AND_ERRORMSG(_status, errormsg) \ do { \ GELOGE((_status), "[Check][InnerData]%s", (errormsg)); \ - REPORT_INNER_ERROR("E19999", "%s", (errormsg)); \ + REPORT_INNER_ERR_MSG("E19999", "%s", (errormsg)); \ } while (false) #define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \ do { \ GELOGW("%s", (errormsg)); \ - ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ + REPORT_PREDEFINED_ERR_MSG("E10052", std::vector({"reason"}), \ + std::vector({(errormsg)})); \ } while (false) #define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \ @@ -197,7 +199,8 @@ const bool b = (expr); \ if (!b) { \ GELOGE((_status), "%s", (errormsg)); \ - ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ + REPORT_PREDEFINED_ERR_MSG("E10052", std::vector({"reason"}), \ + std::vector({(errormsg)})); \ return (_status); \ } \ } while (false) diff --git a/inc/common/ge_common/util.h b/inc/common/ge_common/util.h index 530ab00993..cbc997f267 100644 --- a/inc/common/ge_common/util.h +++ b/inc/common/ge_common/util.h @@ -112,7 +112,7 @@ #define GE_CHECK_NOTNULL(val, ...) \ do { \ if ((val) == nullptr) { \ - REPORT_INNER_ERROR("E19999", "Param:" #val " is nullptr, check invalid" __VA_ARGS__); \ + REPORT_INNER_ERR_MSG("E19999", "Param:" #val " is nullptr, check invalid" __VA_ARGS__); \ GELOGE(ge::FAILED, "[Check][Param:" #val "]null is invalid" __VA_ARGS__); \ return ge::PARAM_INVALID; \ } \ diff --git a/inc/graph/ascendc_ir/ascendc_ir_check.h b/inc/graph/ascendc_ir/ascendc_ir_check.h index bd4115a929..104850ede7 100644 --- a/inc/graph/ascendc_ir/ascendc_ir_check.h +++ b/inc/graph/ascendc_ir/ascendc_ir_check.h @@ -60,11 +60,11 @@ inline bool IsVarNameValidAllowEmpty(const std::string &str) { if (!(exp)) { \ auto msg = CreateErrorMsg(__VA_ARGS__); \ if (msg.empty()) { \ - REPORT_INNER_ERROR("E19999", "Assert %s failed", #exp); \ + REPORT_INNER_ERR_MSG("E19999", "Assert %s failed", #exp); \ GELOGE(ge::FAILED, "Assert %s failed", #exp); \ throw ge::AscIRException({ge::FAILED, #exp}); \ } else { \ - REPORT_INNER_ERROR("E19999", "%s", msg.data()); \ + REPORT_INNER_ERR_MSG("E19999", "%s", msg.data()); \ GELOGE(ge::FAILED, "%s", msg.data()); \ throw ge::AscIRException({ge::FAILED, msg.data()}); \ } \ diff --git a/inc/graph/attribute_group/attr_group_shape_env.h b/inc/graph/attribute_group/attr_group_shape_env.h index fcd1e278c4..9ab0145fc8 100644 --- a/inc/graph/attribute_group/attr_group_shape_env.h +++ b/inc/graph/attribute_group/attr_group_shape_env.h @@ -12,6 +12,7 @@ #include #include +#include #include "attr_group_base.h" #include "graph/symbolizer/symbolic.h" #include "graph/symbolizer/symbolic_utils.h" diff --git a/register/CMakeLists.txt b/register/CMakeLists.txt index a09f38a181..275405fd11 100644 --- a/register/CMakeLists.txt +++ b/register/CMakeLists.txt @@ -130,6 +130,7 @@ target_link_libraries(register slog platform graph + error_manager opp_registry static_mmpa -Wl,--as-needed diff --git a/register/ascendc/ascendc_py.cc b/register/ascendc/ascendc_py.cc index b3aee1fb5d..7fd9e2f49e 100644 --- a/register/ascendc/ascendc_py.cc +++ b/register/ascendc/ascendc_py.cc @@ -101,7 +101,7 @@ void ParseConstShapeDescV2(const nlohmann::json &shape_json, ge::Operator &op_pa return; } if (!shape_json.contains("name")) { - REPORT_CALL_ERROR("E19999", "const tensor has no name"); + REPORT_INNER_ERR_MSG("E19999", "const tensor has no name"); return; } std::string name = shape_json["name"]; @@ -119,7 +119,7 @@ void ParseConstShapeDescV2(const nlohmann::json &shape_json, ge::Operator &op_pa std::vector value; const bool bres = CopyConstData(dtype_str, shape_json["const_value"], value); if (!bres) { - REPORT_CALL_ERROR("E19999", "CopyConstData faild. buffer is null"); + REPORT_INNER_ERR_MSG("E19999", "CopyConstData faild. buffer is null"); return; } auto res = const_values.emplace(name, std::move(value)); @@ -265,7 +265,7 @@ const std::map parse_attr_dtype_map = { void ParseAndSetAttr(const nlohmann::json &attr, ge::Operator &op) { if ((!attr.contains("name")) || (!attr.contains("dtype")) || (!attr.contains("value"))) { - REPORT_CALL_ERROR("E19999", "cur attr does not contain name or dtype or value."); + REPORT_INNER_ERR_MSG("E19999", "cur attr does not contain name or dtype or value."); return; } std::string attr_name; @@ -274,7 +274,7 @@ void ParseAndSetAttr(const nlohmann::json &attr, ge::Operator &op) { dtype = attr["dtype"].get(); auto iter = parse_attr_dtype_map.find(dtype); if (iter == parse_attr_dtype_map.end()) { - REPORT_CALL_ERROR("E19999", "Unknown dtype[%s], which is unsupported.", dtype.c_str()); + REPORT_INNER_ERR_MSG("E19999", "Unknown dtype[%s], which is unsupported.", dtype.c_str()); return; } ParseAndSetAttrValuePtr func_ptr = iter->second; @@ -340,9 +340,9 @@ extern "C" int32_t AscendCPyInterfaceCheckOp(const char *check_type, const char ParseInputsAndOutputs(inputs, outputs, op_desc_ptr, operator_param, const_values); CheckAndSetAttr(attrs, operator_param); } catch (...) { - REPORT_CALL_ERROR("E19999", - "Failed to parse json in AscendCPyInterfaceCheckOp. inputs = %s, outputs = %s, attrs = %s", - inputs, outputs, attrs); + REPORT_INNER_ERR_MSG("E19999", + "Failed to parse json in AscendCPyInterfaceCheckOp. inputs = %s, outputs = %s, attrs = %s", + inputs, outputs, attrs); return 0; } @@ -361,7 +361,7 @@ extern "C" int32_t AscendCPyInterfaceCheckOp(const char *check_type, const char std::string std_str = result.GetString(); bool dump_res = DumpResultInfo(std_str, result_info, result_info_len); if (!dump_res) { - REPORT_CALL_ERROR("E19999", "DumpResultInfo failed. result = %s", std_str.c_str()); + REPORT_INNER_ERR_MSG("E19999", "DumpResultInfo failed. result = %s", std_str.c_str()); return 0; } return 1; @@ -413,7 +413,7 @@ extern "C" int32_t AscendCPyInterfaceGeneralized(const char *optype, const char std::string result_str = result.GetString(); bool dump_res = DumpResultInfo(result_str, result_info, result_info_len); if (!dump_res) { - REPORT_CALL_ERROR("E19999", "DumpResultInfo failed. result = %s", result_str.c_str()); + REPORT_INNER_ERR_MSG("E19999", "DumpResultInfo failed. result = %s", result_str.c_str()); return 0; } return 1; diff --git a/register/exe_res_generation_context.cc b/register/exe_res_generation_context.cc index 7324ca4118..2ca71b634c 100644 --- a/register/exe_res_generation_context.cc +++ b/register/exe_res_generation_context.cc @@ -127,7 +127,7 @@ bool ExeResGenerationContext::CheckContextValid() const { auto node_ptr = MutableInputPointer(0); if (node_ptr == nullptr) { GE_LOGE("Op exe res context node is null."); - REPORT_INNER_ERROR("E29999", "Node create exe context failed with null node."); + REPORT_INNER_ERR_MSG("E29999", "Node create exe context failed with null node."); return false; } return true; @@ -154,8 +154,8 @@ bool ExeResGenerationContext::IsConstInput(const ge::AscendString &name) const { if (index < 0) { GE_LOGE("Op[%s][%s] get invalid index[%d] by ir name[%s].", node_ptr->GetNamePtr(), node_ptr->GetTypePtr(), index, name.GetString()); - REPORT_INNER_ERROR("E29999", "Node[%s][%s] get invalid index[%d] by ir name[%s].", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr(), index, name.GetString()); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] get invalid index[%d] by ir name[%s].", node_ptr->GetNamePtr(), + node_ptr->GetTypePtr(), index, name.GetString()); return false; } const bool ret = (op_desc->GetInputDesc(static_cast(index)).IsValid() == ge::GRAPH_SUCCESS) && @@ -171,8 +171,8 @@ const gert::StorageShape* ExeResGenerationContext::GetInputShape(int64_t index) GELOGD("Node[%s] input index[%ld] with input num:%zu.", node_ptr->GetNamePtr(), index, input_num); if (index < 0 || static_cast(index) >= input_num) { GE_LOGE("Op[%s] input index %ld is invalid, input num is %zu.", node_ptr->GetNamePtr(), index, input_num); - REPORT_INNER_ERROR("E29999", "Node[%s][%s] input index %ld is invalid, input num is %zu.", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr(), index, input_num); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] input index %ld is invalid, input num is %zu.", node_ptr->GetNamePtr(), + node_ptr->GetTypePtr(), index, input_num); return nullptr; } return GetInputPointer(static_cast(InputType::kShapeStart) + static_cast(index)); @@ -187,8 +187,8 @@ const gert::StorageShape* ExeResGenerationContext::GetOutputShape(int64_t index) output_num); if (index < 0 || static_cast(index) >= output_num) { GE_LOGE("Op[%s] output index %ld is invalid, output num is %zu.", node_ptr->GetNamePtr(), index, output_num); - REPORT_INNER_ERROR("E29999", "Node[%s][%s] output index %ld is invalid, output num is %zu.", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr(), index, output_num); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] output index %ld is invalid, output num is %zu.", + node_ptr->GetNamePtr(), node_ptr->GetTypePtr(), index, output_num); return nullptr; } return GetInputPointer(static_cast(InputType::kShapeStart) + input_num + static_cast(index)); @@ -205,8 +205,8 @@ ge::graphStatus ExeResGenerationContext::SetAttachedStreamInfos(std::vector attached_stream_info; for (const auto &stream_info : stream_info_vec) { if (stream_info.name.GetLength() == 0) { - REPORT_INNER_ERROR("E29999", "Node[%s][%s] stream info using name is empty.", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr()); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] stream info using name is empty.", node_ptr->GetNamePtr(), + node_ptr->GetTypePtr()); return ge::GRAPH_FAILED; } ge::GeAttrValue::NAMED_ATTRS attached_stream; @@ -311,8 +311,8 @@ ge::graphStatus ExeResGenerationContext::SetSyncResInfos(std::vector sync_info_attrs; for (const auto &sync_info : sync_info_vec) { if (sync_info.name.GetLength() == 0) { - REPORT_INNER_ERROR("E29999", "Node[%s][%s] sync info using name is empty.", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr()); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] sync info using name is empty.", node_ptr->GetNamePtr(), + node_ptr->GetTypePtr()); return ge::GRAPH_FAILED; } ge::GeAttrValue::NAMED_ATTRS sync_info_attr; @@ -403,8 +403,8 @@ const StorageShape* OpCheckContext::GetInputShape(int64_t index) const { GELOGD("Node[%s] input index[%ld] with input num:%zu.", node_ptr->GetNamePtr(), index, input_num); if (index < 0 || static_cast(index) >= input_num) { GE_LOGE("Op[%s] input index %ld is invalid, input num is %zu.", node_ptr->GetNamePtr(), index, input_num); - REPORT_INNER_ERROR("E29999", "Node[%s][%s] input index %ld is invalid, input num is %zu.", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr(), index, input_num); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] input index %ld is invalid, input num is %zu.", node_ptr->GetNamePtr(), + node_ptr->GetTypePtr(), index, input_num); return nullptr; } return GetInputPointer(static_cast(InputType::kShapeStart) + static_cast(index)); @@ -419,8 +419,8 @@ const StorageShape* OpCheckContext::GetOutputShape(int64_t index) const { output_num); if (index < 0 || static_cast(index) >= output_num) { GE_LOGE("Op[%s] output index %ld is invalid, output num is %zu.", node_ptr->GetNamePtr(), index, output_num); - REPORT_INNER_ERROR("E29999", "Node[%s][%s] output index %ld is invalid, output num is %zu.", node_ptr->GetNamePtr(), - node_ptr->GetTypePtr(), index, output_num); + REPORT_INNER_ERR_MSG("E29999", "Node[%s][%s] output index %ld is invalid, output num is %zu.", + node_ptr->GetNamePtr(), node_ptr->GetTypePtr(), index, output_num); return nullptr; } return GetInputPointer(static_cast(InputType::kShapeStart) + input_num + static_cast(index)); @@ -430,7 +430,7 @@ bool OpCheckContext::CheckContextValid() const { auto node_ptr = MutableInputPointer(0); if (node_ptr == nullptr) { GE_LOGE("Op exe res context node is null."); - REPORT_INNER_ERROR("E29999", "Node create exe context failed with null node."); + REPORT_INNER_ERR_MSG("E29999", "Node create exe context failed with null node."); return false; } return true; diff --git a/register/op_tiling/op_tiling.cc b/register/op_tiling/op_tiling.cc index 8cb654aa98..7d49971b29 100644 --- a/register/op_tiling/op_tiling.cc +++ b/register/op_tiling/op_tiling.cc @@ -10,7 +10,6 @@ #include "register/op_tiling.h" #include -#include "common/util/error_manager/error_manager.h" #include "external/graph/operator.h" #include "graph/debug/ge_log.h" #include "graph/debug/ge_util.h" @@ -323,8 +322,8 @@ ge::graphStatus TurnToOpParaCalculateV1(const ge::Operator &op, OpRunInfoV2 &run (void)op.GetOpType(op_type); ge::AscendString op_name; (void)op.GetName(op_name); - REPORT_CALL_ERROR("E19999", "OpParaCalculate failed, op_type[%s], op_name[%s]", - op_type.GetString(), op_name.GetString()); + REPORT_INNER_ERR_MSG("E19999", "OpParaCalculate failed, op_type[%s], op_name[%s]", op_type.GetString(), + op_name.GetString()); return ge::GRAPH_FAILED; } @@ -390,8 +389,8 @@ ge::graphStatus TurnToOpParaCalculateV3(const ge::Operator &op_param, OpRunInfoV const ge::AscendString compile_info_json_str = op_compile_info_json->c_str(); op_compile_json_ptr = (parse_func)(op_param, compile_info_json_str); if (op_compile_json_ptr == nullptr) { - REPORT_CALL_ERROR("E19999", "Failed to parse compile json[%s] for op [%s, %s].", op_compile_info_json->c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str()); + REPORT_INNER_ERR_MSG("E19999", "Failed to parse compile json[%s] for op [%s, %s].", op_compile_info_json->c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GE_LOGE("Failed to parse compile json[%s] for op [%s, %s].", op_compile_info_json->c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); return ge::GRAPH_FAILED; @@ -433,8 +432,8 @@ ge::graphStatus TurnToOpParaCalculateV4(const ge::Operator &op_param, OpRunInfoV const ge::AscendString compile_info_json_str = op_compile_info_json->c_str(); op_compile_info_ptr = (parse_func)(op_param, compile_info_json_str); if (op_compile_info_ptr == nullptr) { - REPORT_CALL_ERROR("E19999", "Failed to parse compile json[%s] for op [%s, %s].", op_compile_info_json->c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str()); + REPORT_INNER_ERR_MSG("E19999", "Failed to parse compile json[%s] for op [%s, %s].", op_compile_info_json->c_str(), + op_desc->GetName().c_str(), op_desc->GetType().c_str()); GE_LOGE("Failed to parse compile json[%s] for op [%s, %s].", op_compile_info_json->c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); return ge::GRAPH_FAILED; @@ -492,7 +491,7 @@ ge::graphStatus PostProcCalculateV2(const ge::Operator &op, OpRunInfoV2 &run_inf OpTilingFuncInfo *GetOpTilingInfo(const ge::OpDescPtr &op_desc) { if (op_desc == nullptr) { GE_LOGE("[Get][OpTilingInfo] failed, op_desc is nullptr."); - REPORT_CALL_ERROR("EZ9999", "[Get][OpTilingInfo] failed, op_desc is nullptr."); + REPORT_INNER_ERR_MSG("EZ9999", "[Get][OpTilingInfo] failed, op_desc is nullptr."); return nullptr; } if (op_desc->GetTilingFuncInfo() == nullptr) { @@ -504,7 +503,7 @@ OpTilingFuncInfo *GetOpTilingInfo(const ge::OpDescPtr &op_desc) { iter = op_func_map.find(OP_TYPE_AUTO_TILING); if (iter == op_func_map.end()) { GE_LOGE("Optiling function of op type[%s] is not found by Autotiling.", op_type.c_str()); - REPORT_CALL_ERROR("EZ9999", "Optiling function not found. op_type[%s].", op_type.c_str()); + REPORT_INNER_ERR_MSG("EZ9999", "Optiling function not found. op_type[%s].", op_type.c_str()); return nullptr; } } @@ -543,8 +542,9 @@ ge::graphStatus PostProcMemoryCheck(const ge::Operator &op, OpRunInfoV2 &run_inf if (ge::AttrUtils::GetInt(op_desc, kOriOpParaSize, ori_op_para_size)) { GELOGD("The ori_op_para_size of node [%s] is %lu.", op_desc->GetName().c_str(), ori_op_para_size); if (!run_info.SetMemCheckBaseOffset(ori_op_para_size)) { - REPORT_CALL_ERROR("E19999", "[register][op_tiling][PostProcMemoryCheck]Node:%s set mem check offset:%lu failed.", - op_desc->GetName().c_str(), ori_op_para_size); + REPORT_INNER_ERR_MSG("E19999", + "[register][op_tiling][PostProcMemoryCheck]Node:%s set mem check offset:%lu failed.", + op_desc->GetName().c_str(), ori_op_para_size); return ge::GRAPH_FAILED; } } else { @@ -557,8 +557,8 @@ ge::graphStatus PostProcMemoryCheck(const ge::Operator &op, OpRunInfoV2 &run_inf } int64_t clean_size = 0; if (ge::TensorUtils::GetSize(*tensor, clean_size) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "[register][op_tiling][PostProcMemoryCheck]Get op:%s tensor:%zu size failed.", - op_desc->GetName().c_str(), i); + REPORT_INNER_ERR_MSG("E19999", "[register][op_tiling][PostProcMemoryCheck]Get op:%s tensor:%zu size failed.", + op_desc->GetName().c_str(), i); return ge::GRAPH_FAILED; } GELOGD("Op input tensor: %zu has a size of %ld.", i, clean_size); @@ -571,8 +571,8 @@ ge::graphStatus PostProcMemoryCheck(const ge::Operator &op, OpRunInfoV2 &run_inf } int64_t clean_size = 0; if (ge::TensorUtils::GetSize(*tensor, clean_size) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "[register][op_tiling][PostProcMemoryCheck]Get op:%s tensor:%zu size failed.", - op_desc->GetName().c_str(), j); + REPORT_INNER_ERR_MSG("E19999", "[register][op_tiling][PostProcMemoryCheck]Get op:%s tensor:%zu size failed.", + op_desc->GetName().c_str(), j); return ge::GRAPH_FAILED; } GELOGD("Op output tensor: %zu with size %ld.", j, clean_size); @@ -599,7 +599,7 @@ extern "C" ge::graphStatus OpParaCalculateV2(const ge::Operator &op, OpRunInfoV2 OpTilingFuncInfo *op_func_info = GetOpTilingInfo(op_desc); if (op_func_info == nullptr) { GE_LOGE("Optiling function not found."); - REPORT_CALL_ERROR("EZ9999", "Optiling function not found."); + REPORT_INNER_ERR_MSG("EZ9999", "Optiling function not found."); return ge::GRAPH_FAILED; } ge::graphStatus ret = ge::GRAPH_FAILED; @@ -643,8 +643,9 @@ ge::graphStatus AssembleCompileInfoJson(const ge::OpDescPtr &op_desc_ptr, try { compile_info_json = nlohmann::json::parse(op_compile_info_json); } catch (nlohmann::json::parse_error& ex) { - REPORT_CALL_ERROR("E19999", "Failed to set compile_info_value to the json format for op[%s]. op_compile_info_json: %s", - op_desc_ptr->GetName().c_str(), op_compile_info_json.c_str()); + REPORT_INNER_ERR_MSG("E19999", + "Failed to set compile_info_value to the json format for op[%s]. op_compile_info_json: %s", + op_desc_ptr->GetName().c_str(), op_compile_info_json.c_str()); GE_LOGE("Failed to set compile_info_value to the json format for op[%s]. op_compile_info_json: %s", op_desc_ptr->GetName().c_str(), op_compile_info_json.c_str()); return ge::GRAPH_FAILED; @@ -761,8 +762,8 @@ ge::graphStatus TurnToOpAtomicCalculateV1(const ge::OpDescPtr &op_desc_ptr, OpRu run_info_struct.clear_atomic = run_info.GetClearAtomic(); run_info_struct.tiling_key = run_info.GetTilingKey(); if (OpAtomicCalculateV1(op_desc_ptr, run_info_struct, tiling_func) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Do OpAtomicCalculateV1 failed, op_type[%s], op_name[%s]", - op_desc_ptr->GetType().c_str(), op_desc_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E19999", "Do OpAtomicCalculateV1 failed, op_type[%s], op_name[%s]", + op_desc_ptr->GetType().c_str(), op_desc_ptr->GetName().c_str()); return ge::GRAPH_FAILED; } run_info.InternelSetTiling(run_info_struct.tiling_data); @@ -786,9 +787,9 @@ ge::graphStatus AssembleWorkspaceList(const ge::OpDescPtr &op_desc_ptr, atomic_workspace_info = op_desc_ptr->TryGetExtAttr(ge::EXT_ATTR_ATOMIC_WORKSPACE_INFO, atomic_workspace_info); const bool atomic_flag = atomic_output_indices.empty() && atomic_workspace_info.empty(); if (atomic_flag) { - REPORT_CALL_ERROR("E19999", - "No ATOMIC_ATTR_OUTPUT_INDEX and EXT_ATTR_ATOMIC_WORKSPACE_INFO found,op_type:%s, op_name:%s", - OP_TYPE_DYNAMIC_ATOMIC_ADDR_CLEAN.c_str(), op_desc_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E19999", + "No ATOMIC_ATTR_OUTPUT_INDEX and EXT_ATTR_ATOMIC_WORKSPACE_INFO found,op_type:%s, op_name:%s", + OP_TYPE_DYNAMIC_ATOMIC_ADDR_CLEAN.c_str(), op_desc_ptr->GetName().c_str()); return ge::GRAPH_FAILED; } @@ -798,16 +799,14 @@ ge::graphStatus AssembleWorkspaceList(const ge::OpDescPtr &op_desc_ptr, const ge::ConstGeTensorDescPtr tensor = op_desc_ptr->GetOutputDescPtr(static_cast(atomic_output_indice)); if (tensor == nullptr) { - REPORT_CALL_ERROR("E19999", - "Get MutableOutputDesc failed. op_type:%s, op_name:%s", - OP_TYPE_DYNAMIC_ATOMIC_ADDR_CLEAN.c_str(), op_desc_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E19999", "Get MutableOutputDesc failed. op_type:%s, op_name:%s", + OP_TYPE_DYNAMIC_ATOMIC_ADDR_CLEAN.c_str(), op_desc_ptr->GetName().c_str()); return ge::GRAPH_FAILED; } int64_t clean_size = 0; if (ge::TensorUtils::GetSize(*tensor, clean_size) != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", - "Get size of tensor desc failed. op_type:%s, op_name:%s", - OP_TYPE_DYNAMIC_ATOMIC_ADDR_CLEAN.c_str(), op_desc_ptr->GetName().c_str()); + REPORT_INNER_ERR_MSG("E19999", "Get size of tensor desc failed. op_type:%s, op_name:%s", + OP_TYPE_DYNAMIC_ATOMIC_ADDR_CLEAN.c_str(), op_desc_ptr->GetName().c_str()); return ge::GRAPH_FAILED; } workspace_size_list.push_back(clean_size); @@ -1033,7 +1032,7 @@ ge::graphStatus UpDateNodeShapeBySliceInfo(const ffts::ThreadSliceMapDyPtr slice { if ((thread_id >= slice_info_ptr->input_tensor_slice.size()) || (thread_id >= slice_info_ptr->output_tensor_slice.size())) { - REPORT_CALL_ERROR("E19999", "Update node shape thread id(%u) err.", thread_id); + REPORT_INNER_ERR_MSG("E19999", "Update node shape thread id(%u) err.", thread_id); return ge::GRAPH_FAILED; } ge::GeTensorDescPtr tensor_ptr = nullptr; @@ -1080,7 +1079,7 @@ ge::graphStatus UpDateNodeShapeBack(const ge::OpDescPtr op_desc, const ffts::Thr if (slice_info_ptr == nullptr || ori_shape.size() != (slice_info_ptr->input_tensor_indexes.size() + slice_info_ptr->output_tensor_indexes.size())) { - REPORT_CALL_ERROR("E19999", "Update back node shape size err."); + REPORT_INNER_ERR_MSG("E19999", "Update back node shape size err."); return ge::GRAPH_FAILED; } size_t idx = 0; @@ -1113,7 +1112,7 @@ extern "C" ge::graphStatus OpFftsPlusCalculate(const ge::Operator &op, std::vect GE_CHECK_NOTNULL(slice_info_ptr); if (slice_info_ptr->slice_instance_num != slice_info_ptr->input_tensor_slice.size() || slice_info_ptr->slice_instance_num != slice_info_ptr->output_tensor_slice.size()) { - REPORT_CALL_ERROR("E19999", "Slice num not equal."); + REPORT_INNER_ERR_MSG("E19999", "Slice num not equal."); return ge::GRAPH_FAILED; } vector ori_shape; // save original shape @@ -1123,14 +1122,14 @@ extern "C" ge::graphStatus OpFftsPlusCalculate(const ge::Operator &op, std::vect for (size_t i = 0U; i < static_cast(ffts::kSgtTillingNum); i++) { // update node shape by thread slice info if (UpDateNodeShapeBySliceInfo(slice_info_ptr, op_desc, thread_id, ori_shape, same_shape) == ge::GRAPH_FAILED) { - REPORT_CALL_ERROR("E19999", "Update shape failed."); + REPORT_INNER_ERR_MSG("E19999", "Update shape failed."); return ge::GRAPH_FAILED; } // call original interface const ge::graphStatus rc = OpParaCalculateV2(op, op_run_info[i]); if (rc != ge::GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "OpParaCalculateV2 failed, op_type:%s, op_name:%s", op_desc->GetType().c_str(), - op_desc->GetName().c_str()); + REPORT_INNER_ERR_MSG("E19999", "OpParaCalculateV2 failed, op_type:%s, op_name:%s", op_desc->GetType().c_str(), + op_desc->GetName().c_str()); return rc; } if (same_shape) { diff --git a/register/op_tiling/op_tiling_info.cc b/register/op_tiling/op_tiling_info.cc index 68964551c0..2275fb7824 100644 --- a/register/op_tiling/op_tiling_info.cc +++ b/register/op_tiling/op_tiling_info.cc @@ -10,7 +10,6 @@ #include "register/op_tiling_info.h" #include #include "graph/debug/ge_log.h" -#include "common/util/error_manager/error_manager.h" #include "graph/def_types.h" namespace optiling { @@ -75,8 +74,8 @@ public: if (memcpy_s(addr, static_cast(max_size_ - offset_), value, size) != EOK) { GELOGE(ge::GRAPH_FAILED, "[Add][TilingData] Memcpy tiling data failed, " "dst size = %zu, src size = %zu.", static_cast(max_size_ - offset_), size); - REPORT_INNER_ERROR("E19999", "[Add][TilingData] Memcpy tiling data failed, dst size = %zu, src size = %zu.", - static_cast(max_size_ - offset_), size); + REPORT_INNER_ERR_MSG("E19999", "[Add][TilingData] Memcpy tiling data failed, dst size = %zu, src size = %zu.", + static_cast(max_size_ - offset_), size); return; } offset_ += size; diff --git a/register/op_tiling/op_tiling_py.cc b/register/op_tiling/op_tiling_py.cc index e0baecdeb2..643e335e35 100644 --- a/register/op_tiling/op_tiling_py.cc +++ b/register/op_tiling/op_tiling_py.cc @@ -24,6 +24,7 @@ #include "register/op_impl_registry.h" #include "register/op_impl_registry_base.h" #include "exe_graph/runtime/storage_shape.h" +#include "common/util/error_manager/error_manager.h" #include "exe_graph/lowering/kernel_run_context_builder.h" #include "exe_graph/runtime/tiling_context.h" #include "common/checker.h" @@ -125,7 +126,7 @@ bool FindImplFuncsOld(const ge::char_t *op_type, const gert::OpImplKernelRegistr if (funcs == nullptr || funcs->tiling == nullptr || funcs->tiling_parse == nullptr) { GELOGE(ge::GRAPH_FAILED, "failed to find implfuncs in 1.0 way, funcs/tiling/tiling_parse is null. op type is %s.", op_type); - REPORT_CALL_ERROR("E19999", "old funcs/tiling/tiling_parse is null. op type is %s.", op_type); + REPORT_INNER_ERR_MSG("E19999", "old funcs/tiling/tiling_parse is null. op type is %s.", op_type); return false; } GELOGD("Finding default implfuncs in 1.0 way, op type is %s.", op_type); @@ -898,7 +899,7 @@ void ParseShapeDescV2(const nlohmann::json &shape, ge::OpDescPtr &op_desc, const void ParseAndSetAttr(const nlohmann::json &attr, ge::Operator &op) { if (!attr.contains("name") || !attr.contains("dtype") || !attr.contains("value")) { - REPORT_CALL_ERROR("E19999", "cur attr does not contain name or dtype or value."); + REPORT_INNER_ERR_MSG("E19999", "cur attr does not contain name or dtype or value."); return; } std::string attr_name; @@ -907,7 +908,7 @@ void ParseAndSetAttr(const nlohmann::json &attr, ge::Operator &op) { dtype = attr["dtype"].get(); auto iter = parse_attr_dtype_map.find(dtype); if (iter == parse_attr_dtype_map.end()) { - REPORT_CALL_ERROR("E19999", "Unknown dtype[%s], which is unsupported.", dtype.c_str()); + REPORT_INNER_ERR_MSG("E19999", "Unknown dtype[%s], which is unsupported.", dtype.c_str()); return; } ParseAndSetAttrValuePtr func_ptr = iter->second; @@ -1074,7 +1075,7 @@ void ParseConstShapeDescV2(const nlohmann::json &shape_json, ge::Operator &op_pa return; } if (!shape_json.contains("name")) { - REPORT_CALL_ERROR("E19999", "const tensor has no name"); + REPORT_INNER_ERR_MSG("E19999", "const tensor has no name"); return; } std::string name = shape_json["name"]; @@ -1092,7 +1093,7 @@ void ParseConstShapeDescV2(const nlohmann::json &shape_json, ge::Operator &op_pa std::vector value; const bool bres = CopyConstData(dtype_str, shape_json["const_value"], value); if (!bres) { - REPORT_CALL_ERROR("E19999", "CopyConstData faild. buffer is null"); + REPORT_INNER_ERR_MSG("E19999", "CopyConstData faild. buffer is null"); return; } auto res = const_values.emplace(name, std::move(value)); @@ -1173,7 +1174,7 @@ bool DumpRunInfo(const OpRunInfo &run_info, char *run_info_json, const size_t &r bool DumpRunInfoV2(const OpRunInfoV2 &run_info, char *run_info_json, const size_t &run_info_len) { if (run_info_json == nullptr) { - REPORT_CALL_ERROR("E19999", "run_info buffer is null"); + REPORT_INNER_ERR_MSG("E19999", "run_info buffer is null"); return false; } @@ -1192,7 +1193,7 @@ bool DumpRunInfoV2(const OpRunInfoV2 &run_info, char *run_info_json, const size_ const std::string str = json_obj.dump(); if (str.size() >= run_info_len) { - REPORT_CALL_ERROR("E19999", "runinfo too large. %zu/%zu", str.size(), run_info_len); + REPORT_INNER_ERR_MSG("E19999", "runinfo too large. %zu/%zu", str.size(), run_info_len); return false; } return memcpy_s(run_info_json, str.size() + 1, str.c_str(), str.size() + 1) == EOK; @@ -1203,8 +1204,8 @@ int TbeOpTilingPyInterfaceEx2BackUpInner(const char *const optype, const char *c size_t run_info_len, const char *const compile_info_hash, uint64_t *elapse, const OpTilingFunc &tiling_func) { if ((optype == nullptr) || (compile_info == nullptr) || (inputs == nullptr) || (outputs == nullptr)) { - REPORT_CALL_ERROR("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, - inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, + inputs, outputs); return 0; } @@ -1220,7 +1221,7 @@ int TbeOpTilingPyInterfaceEx2BackUpInner(const char *const optype, const char *c ParseShapeDescList(outputs_json, op_params.outputs); ParseConstTensorList(inputs_json, op_params.const_inputs, const_values); } catch (...) { - REPORT_CALL_ERROR("E19999", "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); return 0; } GELOGI("Optiling func found, op_type:%s", optype); @@ -1283,8 +1284,8 @@ int TbeOpTilingPyInterfaceEx2NewInner(const char *const optype, const char *cons size_t run_info_len, const char *const compile_info_hash, uint64_t *elapse, const OpTilingFuncV2 &tiling_func, const char *const attrs) { if ((optype == nullptr) || (compile_info == nullptr) || (inputs == nullptr) || (outputs == nullptr)) { - REPORT_CALL_ERROR("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, - inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, + inputs, outputs); return 0; } GELOGI("Optiling func v2 found, op_type: %s", optype); @@ -1300,7 +1301,7 @@ int TbeOpTilingPyInterfaceEx2NewInner(const char *const optype, const char *cons ParseInputsAndOutputs(inputs, outputs, op_desc, operator_param, const_values); CheckAndSetAttr(attrs, operator_param); } catch (...) { - REPORT_CALL_ERROR("E19999", "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); return 0; } @@ -1343,8 +1344,8 @@ int TbeOpTilingPyInterfaceEx3Inner(const char *const optype, const char *const c const OpTilingFuncV3 &tiling_func, const OpParseFuncV3 &parse_func, const char *const attrs) { if ((optype == nullptr) || (compile_info == nullptr) || (inputs == nullptr) || (outputs == nullptr)) { - REPORT_CALL_ERROR("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, - inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, + inputs, outputs); return 0; } GELOGI("Optiling func v3 found, op_type: %s", optype); @@ -1360,7 +1361,7 @@ int TbeOpTilingPyInterfaceEx3Inner(const char *const optype, const char *const c CheckAndSetAttr(attrs, operator_param); } catch (...) { GELOGE(ge::FAILED, "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); - REPORT_CALL_ERROR("E19999", "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "Failed to parse json_str. %s, %s, %s", compile_info, inputs, outputs); return 0; } if (compile_info_hash == nullptr) { @@ -1402,8 +1403,8 @@ int TbeOpTilingPyInterfaceEx4Inner(const char *const optype, const char *const c const OpTilingFuncV4 &tiling_func, const OpParseFuncV4 &parse_func, const char *const attrs) { if ((optype == nullptr) || (compile_info == nullptr) || (inputs == nullptr) || (outputs == nullptr)) { - REPORT_CALL_ERROR("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, - inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "optype/compile_info/inputs/outputs is null, %s, %s, %s, %s", optype, compile_info, + inputs, outputs); return 0; } GELOGI("Optiling func v4 found, op_type:%s", optype); @@ -1418,7 +1419,7 @@ int TbeOpTilingPyInterfaceEx4Inner(const char *const optype, const char *const c ParseInputsAndOutputs(inputs, outputs, op_desc_ptr, operator_param, const_values); CheckAndSetAttr(attrs, operator_param); } catch (...) { - REPORT_CALL_ERROR("E19999", "Failed to parse json during tiling v4. %s, %s, %s", compile_info, inputs, outputs); + REPORT_INNER_ERR_MSG("E19999", "Failed to parse json during tiling v4. %s, %s, %s", compile_info, inputs, outputs); return 0; } if (compile_info_hash == nullptr) { @@ -1631,22 +1632,22 @@ ge::graphStatus ParseJson(const char *const inputs, const char *const outputs, c const char *const extra_info, ContextComponent &context_com) { if (ParseInputs(inputs, context_com) != ge::GRAPH_SUCCESS) { GELOGE(ge::GRAPH_FAILED, "Parse inputs failed."); - REPORT_CALL_ERROR("E19999", "Parse inputs failed."); + REPORT_INNER_ERR_MSG("E19999", "Parse inputs failed."); return ge::GRAPH_FAILED; } if (ParseOutputs(outputs, context_com) != ge::GRAPH_SUCCESS) { GELOGE(ge::GRAPH_FAILED, "Parse outputs failed."); - REPORT_CALL_ERROR("E19999", "Parse outputs failed."); + REPORT_INNER_ERR_MSG("E19999", "Parse outputs failed."); return ge::GRAPH_FAILED; } if (ParseAttrs(attrs, context_com.op_desc) != ge::GRAPH_SUCCESS) { GELOGE(ge::GRAPH_FAILED, "Parse attrs failed."); - REPORT_CALL_ERROR("E19999", "Parse attrs failed."); + REPORT_INNER_ERR_MSG("E19999", "Parse attrs failed."); return ge::GRAPH_FAILED; } if (ParseExtraInfos(extra_info, context_com.op_desc) != ge::GRAPH_SUCCESS) { GELOGE(ge::GRAPH_FAILED, "Parse extra info failed."); - REPORT_CALL_ERROR("E19999", "Parse extra info failed."); + REPORT_INNER_ERR_MSG("E19999", "Parse extra info failed."); return ge::GRAPH_FAILED; } return ge::GRAPH_SUCCESS; @@ -1705,13 +1706,13 @@ int32_t GetPlatformInfo(const char *compile_info, fe::PlatFormInfos &platform_in if (fe::PlatformInfoManager::Instance().InitializePlatformInfo() != 0U) { GELOGE(ge::GRAPH_FAILED, "InitializePlatformInfo failed."); - REPORT_CALL_ERROR("E19999", "InitializePlatformInfo failed."); + REPORT_INNER_ERR_MSG("E19999", "InitializePlatformInfo failed."); return 0; } if (fe::PlatformInfoManager::Instance().GetPlatformInstanceByDevice(device_id, platform_info) != 0) { GELOGE(ge::GRAPH_FAILED, "GetPlatformInstanceByDevice failed."); - REPORT_CALL_ERROR("E19999", "GetPlatformInstanceByDevice failed."); + REPORT_INNER_ERR_MSG("E19999", "GetPlatformInstanceByDevice failed."); return 0; } platform_info.SetCoreNumByCoreType(core_type); @@ -1739,7 +1740,7 @@ int TbeOptilingPyInterfaceNew(const char *const op_type, const char *const compi const char *const attrs, const char *const extra_info) { if ((compile_info == nullptr) || (inputs == nullptr) || (outputs == nullptr)) { GELOGE(ge::GRAPH_FAILED, "compile_info/inputs/outputs is null."); - REPORT_CALL_ERROR("E19999", "compile_info/inputs/outputs is null."); + REPORT_INNER_ERR_MSG("E19999", "compile_info/inputs/outputs is null."); return 0; } @@ -1764,7 +1765,7 @@ int TbeOptilingPyInterfaceNew(const char *const op_type, const char *const compi platform_info, funcs); if (DoTilingParse(funcs, tiling_parse_context_holder) != ge::GRAPH_SUCCESS) { GELOGE(ge::GRAPH_FAILED, "Op %s tiling parse failed", op_type); - REPORT_CALL_ERROR("E19999", "Op %s tiling parse failed", op_type); + REPORT_INNER_ERR_MSG("E19999", "Op %s tiling parse failed", op_type); return 0; } @@ -1805,13 +1806,13 @@ int TbeOptilingPyInterfaceNew(const char *const op_type, const char *const compi *tiling_context_holder.GetKernelContext()->GetOutputPointer(gert::TilingContext::kOutputScheduleMode) = 0; if (DoTilingWithTiming(funcs, elapse, tiling_context_holder) != ge::GRAPH_SUCCESS) { GELOGE(ge::GRAPH_FAILED, "Op %s tiling failed", op_type); - REPORT_CALL_ERROR("E19999", "Op %s tiling failed", op_type); + REPORT_INNER_ERR_MSG("E19999", "Op %s tiling failed", op_type); return 0; } if (!DumpRunInfo(tiling_context_holder.context_, run_info_json, run_info_len)) { GELOGE(ge::GRAPH_FAILED, "Dump op %s tiling result failed", op_type); - REPORT_CALL_ERROR("E19999", "Dump op %s tiling result failed", op_type); + REPORT_INNER_ERR_MSG("E19999", "Dump op %s tiling result failed", op_type); return 0; } GELOGI("Op tiling succeed. op_type:%s", op_type); @@ -1860,7 +1861,7 @@ extern "C" int OpTilingForCompile(const char *optype, const char *compile_info, size_t run_info_len, uint64_t *elapse, const char *extra_info) { if (optype == nullptr) { GELOGE(ge::GRAPH_FAILED, "op type is null."); - REPORT_CALL_ERROR("E19999", "op type is null."); + REPORT_INNER_ERR_MSG("E19999", "op type is null."); return 0; } @@ -1885,7 +1886,7 @@ extern "C" const char *DoOpTilingForCompile(const char *optype, const char *extra_info) { if (optype == nullptr) { GELOGE(ge::GRAPH_FAILED, "op type is null."); - REPORT_CALL_ERROR("E19999", "op type is null."); + REPORT_INNER_ERR_MSG("E19999", "op type is null."); error_string = GetRawErrorMessage(); return error_string.data(); } @@ -1895,7 +1896,7 @@ extern "C" const char *DoOpTilingForCompile(const char *optype, if (TbeOptilingPyInterfaceNew(optype, compile_info, inputs, outputs, run_info_json, run_info_len, elapse, attrs, extra_info) == 0) { GELOGE(ge::GRAPH_FAILED, "TbeOptilingPyInterfaceNew failed."); - REPORT_CALL_ERROR("E19999", "TbeOptilingPyInterfaceNew failed."); + REPORT_INNER_ERR_MSG("E19999", "TbeOptilingPyInterfaceNew failed."); } error_string = GetRawErrorMessage(); return error_string.data(); @@ -1903,7 +1904,7 @@ extern "C" const char *DoOpTilingForCompile(const char *optype, if (TbeOpTilingPyInterfaceOld(optype, compile_info, compile_info_hash, inputs, outputs, attrs, run_info_json, run_info_len, elapse, extra_info) == 0) { GELOGE(ge::GRAPH_FAILED, "TbeOpTilingPyInterfaceOld failed."); - REPORT_CALL_ERROR("E19999", "TbeOpTilingPyInterfaceOld failed."); + REPORT_INNER_ERR_MSG("E19999", "TbeOpTilingPyInterfaceOld failed."); } error_string = GetRawErrorMessage(); return error_string.data(); @@ -1915,7 +1916,7 @@ extern "C" int TbeOpTilingPyInterface(const char *optype, const char *compile_in GELOGW("Deprecated api, use OpTilingForCompile instead."); if (optype == nullptr) { GELOGE(ge::GRAPH_FAILED, "op type is null."); - REPORT_CALL_ERROR("E19999", "op type is null."); + REPORT_INNER_ERR_MSG("E19999", "op type is null."); return 0; } diff --git a/register/prototype_pass_registry.cc b/register/prototype_pass_registry.cc index 2e2b94f55b..fb5e4b1836 100644 --- a/register/prototype_pass_registry.cc +++ b/register/prototype_pass_registry.cc @@ -7,6 +7,7 @@ * See LICENSE in the root of the software repository for the full text of the License. * ===================================================================================================================*/ +#include "mutex" #include "register/prototype_pass_registry.h" #include "graph/debug/ge_log.h" diff --git a/register/register_custom_pass.cpp b/register/register_custom_pass.cpp index e6db725f62..4a872da96b 100644 --- a/register/register_custom_pass.cpp +++ b/register/register_custom_pass.cpp @@ -45,8 +45,8 @@ Status RunAllocateStreamPass(const PassRegistrationData ®_data, const GraphPt std::stringstream reason; reason << "It is required CustomAllocateStreamPassFunc in stage " << CustomPassStageToString(reg_data.GetStage()) << ", but got nullptr"; - REPORT_INPUT_ERROR("E19030", std::vector({"passname", "reason"}), - std::vector({reg_data.GetPassName(), reason.str()})); + REPORT_PREDEFINED_ERR_MSG("E19030", std::vector({"passname", "reason"}), + std::vector({reg_data.GetPassName().c_str(), reason.str().c_str()})); return FAILED; } @@ -64,9 +64,10 @@ Status RunAllocateStreamPass(const PassRegistrationData ®_data, const GraphPt if (ret != SUCCESS) { GE_LOGE("Execution of custom pass [%s] failed! Reason: %s.", reg_data.GetPassName().c_str(), custom_pass_context.GetErrorMessage().GetString()); - REPORT_INPUT_ERROR("E19028", std::vector({"passname", "retcode", "reason"}), - std::vector({reg_data.GetPassName(), std::to_string(ret), - std::string(custom_pass_context.GetErrorMessage().GetString())})); + REPORT_PREDEFINED_ERR_MSG( + "E19028", std::vector({"passname", "retcode", "reason"}), + std::vector({reg_data.GetPassName().c_str(), std::to_string(ret).c_str(), + std::string(custom_pass_context.GetErrorMessage().GetString()).c_str()})); return FAILED; } return SUCCESS; @@ -83,9 +84,10 @@ Status RunCustomPass(const PassRegistrationData ®_data, GraphPtr &graph, Cust if (ret != SUCCESS) { GE_LOGE("Execution of custom pass [%s] failed! Reason: %s.", reg_data.GetPassName().c_str(), custom_pass_context.GetErrorMessage().GetString()); - REPORT_INPUT_ERROR("E19028", std::vector({"passname", "retcode", "reason"}), - std::vector({reg_data.GetPassName(), std::to_string(ret), - std::string(custom_pass_context.GetErrorMessage().GetString())})); + REPORT_PREDEFINED_ERR_MSG( + "E19028", std::vector({"passname", "retcode", "reason"}), + std::vector({reg_data.GetPassName().c_str(), std::to_string(ret).c_str(), + std::string(custom_pass_context.GetErrorMessage().GetString()).c_str()})); return FAILED; } return SUCCESS; @@ -251,8 +253,9 @@ Status CustomPassHelper::Load() { void *handle = dlopen(so_file.c_str(), RTLD_NOW | RTLD_LOCAL); if (handle == nullptr) { const char* error = dlerror(); - REPORT_INPUT_ERROR("E19029", std::vector({"passlibname", "reason"}), - std::vector({so_file, error})); + REPORT_PREDEFINED_ERR_MSG( + "E19029", std::vector({"passlibname", "reason"}), + std::vector({so_file.c_str(), error})); GELOGE(ge::FAILED, "Failed to load %s: %s", so_file.c_str(), error); return ge::FAILED; } diff --git a/register/shape_inference.cc b/register/shape_inference.cc index 98999adb5d..59d6fa31d5 100644 --- a/register/shape_inference.cc +++ b/register/shape_inference.cc @@ -538,11 +538,11 @@ ge::graphStatus InferShapeByRegisteredFuncOrRule(const OpImplKernelRegistry::OpI } const auto shape_infer_rule = ge::ShapeInferenceRule::FromOpDesc(op_desc); if (shape_infer_rule == nullptr) { - REPORT_CALL_ERROR("EZ9999", - "Can not find infer_shape func of node %s[%s]. Please confirm whether the op_proto shared " - "library (.so) has been loaded " - "successfully, and that you have already developed the infer_shape func.", - op_desc->GetNamePtr(), op_desc->GetTypePtr()); + REPORT_INNER_ERR_MSG("EZ9999", + "Can not find infer_shape func of node %s[%s]. Please confirm whether the op_proto shared " + "library (.so) has been loaded " + "successfully, and that you have already developed the infer_shape func.", + op_desc->GetNamePtr(), op_desc->GetTypePtr()); GELOGE(ge::GRAPH_FAILED, "Can not find infer_shape func of node %s[%s]. Please confirm whether the op_proto shared library (.so) " "has been loaded " @@ -551,7 +551,7 @@ ge::graphStatus InferShapeByRegisteredFuncOrRule(const OpImplKernelRegistry::OpI return ge::GRAPH_FAILED; } if (!shape_infer_rule->IsValid()) { - REPORT_CALL_ERROR( + REPORT_INNER_ERR_MSG( "EZ9999", "No infer shape func registered for node %s[%s], and inference rule: %s is set but failed to parse: %s.", op_desc->GetNamePtr(), op_desc->GetTypePtr(), ge::InferenceRule::GetInferenceRule(op_desc).c_str(), @@ -575,12 +575,12 @@ ge::graphStatus InferDtypeByRegisteredFuncOrRule(const OpImplKernelRegistry::OpI } const auto dtype_infer_rule = ge::DtypeInferenceRule::FromOpDesc(op_desc); if (dtype_infer_rule == nullptr) { - REPORT_CALL_ERROR("EZ9999", - "Can not find Node %s[%s] custom infer_datatype func. Please confirm whether the op_proto " - "shared library (.so) has been " - "loaded successfully, and that you have already developed the infer_datatype func or marked " - "the T-derivation rules on the IR.", - op_desc->GetNamePtr(), op_desc->GetTypePtr()); + REPORT_INNER_ERR_MSG("EZ9999", + "Can not find Node %s[%s] custom infer_datatype func. Please confirm whether the op_proto " + "shared library (.so) has been " + "loaded successfully, and that you have already developed the infer_datatype func or marked " + "the T-derivation rules on the IR.", + op_desc->GetNamePtr(), op_desc->GetTypePtr()); GELOGE(ge::GRAPH_FAILED, "Can not find Node %s[%s] custom infer_datatype func. Please confirm whether the op_proto shared library " "(.so) has been " @@ -590,7 +590,7 @@ ge::graphStatus InferDtypeByRegisteredFuncOrRule(const OpImplKernelRegistry::OpI return ge::GRAPH_FAILED; } if (!dtype_infer_rule->IsValid()) { - REPORT_CALL_ERROR( + REPORT_INNER_ERR_MSG( "EZ9999", "No infer dtype func registered for node %s[%s], and inference rule: %s is set but failed to parse: %s.", op_desc->GetNamePtr(), op_desc->GetTypePtr(), ge::InferenceRule::GetInferenceRule(op_desc).c_str(), @@ -714,11 +714,11 @@ ge::graphStatus InferFormatOnCompile(const ge::Operator &op, const ge::OpDescPtr const auto &functions = space_registry->GetOpImpl(op_desc->GetType()); if ((functions == nullptr) || (functions->infer_format_func == nullptr)) { - REPORT_CALL_ERROR( - "EZ9999", - "Can not find infer_format func of node %s[%s]. Please confirm whether the op_proto shared library (.so) has been loaded " - "successfully, and that you have already developed the infer_format func.", - op_desc->GetNamePtr(), op_desc->GetTypePtr()); + REPORT_INNER_ERR_MSG("EZ9999", + "Can not find infer_format func of node %s[%s]. Please confirm whether the op_proto shared " + "library (.so) has been loaded " + "successfully, and that you have already developed the infer_format func.", + op_desc->GetNamePtr(), op_desc->GetTypePtr()); GELOGE( ge::GRAPH_FAILED, "Can not find infer_format func of node %s[%s]. Please confirm whether the op_proto shared library (.so) has been loaded " diff --git a/tests/run_test.sh b/tests/run_test.sh index 91b5e2b08a..6d951bd202 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -194,7 +194,7 @@ main() { cp ${BUILD_PATH}/tests/ut/ascendc_ir/ut_ascendc_ir ${OUTPUT_PATH} cp ${BUILD_PATH}/tests/ut/expression/ut_expression ${OUTPUT_PATH} cp ${BUILD_PATH}/tests/ut/sc_check/ut_sc_check ${OUTPUT_PATH} - + export ASAN_OPTIONS=detect_container_overflow=0 RUN_TEST_CASE=${OUTPUT_PATH}/ut_metadef && ${RUN_TEST_CASE} && RUN_TEST_CASE=${OUTPUT_PATH}/ut_graph && ${RUN_TEST_CASE} && RUN_TEST_CASE=${OUTPUT_PATH}/ut_register && ${RUN_TEST_CASE} && @@ -203,6 +203,7 @@ main() { RUN_TEST_CASE=${OUTPUT_PATH}/ut_ascendc_ir && ${RUN_TEST_CASE} && RUN_TEST_CASE=${OUTPUT_PATH}/ut_expression && ${RUN_TEST_CASE} && RUN_TEST_CASE=${OUTPUT_PATH}/ut_sc_check && ${RUN_TEST_CASE} + unset ASAN_OPTIONS if [[ "$?" -ne 0 ]]; then echo "!!! UT FAILED, PLEASE CHECK YOUR CHANGES !!!" echo -e "\033[31m${RUN_TEST_CASE}\033[0m" diff --git a/tests/ut/error_manager/testcase/error_manager_unittest.cc b/tests/ut/error_manager/testcase/error_manager_unittest.cc index 8dc64ff1ab..799e4a65f9 100644 --- a/tests/ut/error_manager/testcase/error_manager_unittest.cc +++ b/tests/ut/error_manager/testcase/error_manager_unittest.cc @@ -427,10 +427,10 @@ TEST_F(UtestErrorManager, TestReportInnerErrorFail) { std::shared_ptr msg(new (std::nothrow) char[LIMIT_PER_MESSAGE]()); std::fill_n(msg.get(), LIMIT_PER_MESSAGE, 'T'); msg[LIMIT_PER_MESSAGE - 1U] = '\0'; - EXPECT_NO_THROW(REPORT_INNER_ERROR("E19999", "error is %s", msg.get())); + EXPECT_NO_THROW(REPORT_INNER_ERR_MSG("E19999", "error is %s", msg.get())); msg[LIMIT_PER_MESSAGE - 15U] = '\0'; - EXPECT_NO_THROW(REPORT_INNER_ERROR("E19999", "error is %s", msg.get())); + EXPECT_NO_THROW(REPORT_INNER_ERR_MSG("E19999", "error is %s", msg.get())); } std::mutex mu; diff --git a/tests/ut/register/testcase/op_impl_space_registry_v2_unittest.cc b/tests/ut/register/testcase/op_impl_space_registry_v2_unittest.cc index f22991f05b..acfbd4ee83 100644 --- a/tests/ut/register/testcase/op_impl_space_registry_v2_unittest.cc +++ b/tests/ut/register/testcase/op_impl_space_registry_v2_unittest.cc @@ -10,7 +10,7 @@ #include #include "register/op_impl_registry.h" #include "graph/any_value.h" - +#include "inc/common/util/error_manager/error_manager.h" #include "common/util/mem_utils.h" #include "mmpa/mmpa_api.h" #include "tests/depends/mmpa/src/mmpa_stub.h" -- Gitee