From 53536ea8f7f42e665d2bac237ce1a1a4d35dc665 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Mon, 29 Mar 2021 16:55:23 +0800 Subject: [PATCH 01/11] common formats log optimize --- .../formats/format_transfers/datatype_transfer.cc | 3 +- .../format_transfer_c1hwncoc0_hwcn.cc | 30 ++++--- .../format_transfer_dhwcn_fracz3D.cc | 11 ++- .../format_transfer_dhwnc_fracz3D_transpose.cc | 10 ++- .../format_transfers/format_transfer_fractal_nz.cc | 100 ++++++++++++++------- .../format_transfers/format_transfer_fractal_z.cc | 76 ++++++++-------- .../format_transfers/format_transfer_fractal_zz.cc | 85 ++++++++++++------ 7 files changed, 201 insertions(+), 114 deletions(-) diff --git a/ge/common/formats/format_transfers/datatype_transfer.cc b/ge/common/formats/format_transfers/datatype_transfer.cc index b1df4f53..d6773823 100644 --- a/ge/common/formats/format_transfers/datatype_transfer.cc +++ b/ge/common/formats/format_transfers/datatype_transfer.cc @@ -155,7 +155,8 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result std::shared_ptr dst(new (std::nothrow) uint8_t[total_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to alloc the memory for dst buf %zu, data size %zu", total_size, args.src_data_size); + "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); + REPORT_INNER_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", total_size, args.src_data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index 20f493d7..c3779834 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -49,11 +49,13 @@ Status CheckArgsForC1hwncoc0ToHwcn(const TransArgs &args) { return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShapeValid(src_shape, kC1hwncoc0DimsNum)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check src shape %s", ShapeToString(src_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][SrcShape]Failed, src shape %s", ShapeToString(src_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check src shape %s", ShapeToString(src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } if (!CheckShapeValid(dst_shape, kHwcnDimsNum)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s.", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s.", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } auto cube_size = GetCubeSizeByDataType(args.src_data_type); @@ -74,9 +76,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size std::shared_ptr dst(new (std::nothrow) uint8_t[total_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld, shape %s", + "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld, shape %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), total_size, ShapeToString(args.dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld, shape %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), total_size, ShapeToString(args.dst_shape).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -116,10 +121,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size static_cast(size)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " + "[Operate][Memory]Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", - c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, - ret); + c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " + "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", + c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -145,8 +152,8 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu result.length = static_cast(total_size); return SUCCESS; } - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Get %ld total size from dst shape %s, src shape %s.", total_size, - ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Get %ld total size from dst shape %s, src shape %s.", + total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from C1HWNCoC0 to HWCN, src shape %s, data type %s, dst shape %s, memory size %ld.", @@ -154,9 +161,12 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu ShapeToString(args.dst_shape).c_str(), total_size); ret = GetDstDataAfterTrans(args, result, size, total_size); if (ret != SUCCESS) { - GELOGE(ret, "Failed to get data after trans, src shape %s, data type %s, dst shape %s, memory size %ld", + GELOGE(ret, "[Get][Data]Failed when after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), - ShapeToString(args.dst_shape).c_str(), total_size); + ShapeToString(args.dst_shape).c_str(), total_size, ret); + REPORT_INNER_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), + ShapeToString(args.dst_shape).c_str(), total_size, ret); return ret; } return SUCCESS; diff --git a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc index 0508a1a5..4c09268c 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc @@ -1,4 +1,4 @@ -/** +/**` * Copyright 2020 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,9 +95,12 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -123,9 +126,9 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { args.data + src_idx * data_size, static_cast(data_size)); } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d, pad mode %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc index 8dd1757b..e3244b8a 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc @@ -95,10 +95,12 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate[DSTMemory]]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -124,9 +126,9 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul args.data + src_idx * data_size, static_cast(data_size)); } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d, pad mode %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index fccdb57b..9e846726 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -87,7 +87,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(DIM_DEFAULT_VALUE); hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -106,7 +107,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -117,10 +119,14 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { ShapeVector expect_src_shape; auto ret = TransShapeToFracNz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { - GELOGE(ret, "Trans shape from %s to %s, shape %s to %s, data type %s failed", + GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); + REPORT_INNER_ERROR("E19999", "Failed to tranfer shape from %s to %s, shape %s to %s, data type %s, error_code:%u", + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { @@ -139,10 +145,12 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -176,8 +184,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -191,8 +199,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -213,10 +221,12 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -250,8 +260,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -265,8 +275,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -281,18 +291,26 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "Trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "Trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -315,16 +333,26 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector Format dst_format, ShapeVector &dst_shape) { if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "Trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "Trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -334,19 +362,27 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "Trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "Trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index c629a381..6893aecb 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -73,8 +73,8 @@ Status TransShapeToFz(int64_t n, int64_t c, int64_t h, int64_t w, DataType data_ dst_shape.push_back(kNiSize); dst_shape.push_back(c0); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s", - ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -102,8 +102,8 @@ Status TransShapeToFzWithGroups(int64_t n, int64_t c, int64_t h, int64_t w, Data dst_shape.push_back(16); dst_shape.push_back(cube_k); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s", - ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -190,10 +190,12 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t vfi = 0; vfi < vf_cnt; vfi++) { @@ -237,9 +239,9 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d pad mode %d", offset, - ret, need_pad_zero); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", + offset, ret, need_pad_zero); + REPORT_INNER_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -260,8 +262,10 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, int64_t cin_ori = c_dim; int64_t cout_ori = n_dim / groups; if (cin_ori == 0 || cout_ori == 0) { - GELOGE(GRAPH_FAILED, "Cin_ori, cout_ori must not be equal 0, and current cin_ori, cout_ori," - "groups are %ld %ld %ld",cin_ori, cout_ori, groups); + GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, cout_ori, groups are %ld %ld %ld", + cin_ori, cout_ori, groups); + REPORT_INNER_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," + "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); return GRAPH_FAILED; } const int64_t cube_k = GetCubeSizeByDataType(args.src_data_type); @@ -282,14 +286,18 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, errno_t ret = EOK; std::shared_ptr dst(new (std::nothrow) uint8_t[size_output_data], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), size_output_data); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), size_output_data); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), size_output_data); return ACL_ERROR_GE_MEMORY_ALLOCATION; } ret = memset_s(dst.get(), static_cast(size_output_data), 0, static_cast(size_output_data)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "Failed to operate the dst memory, ret is %d", ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, ret is %d", ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory, ret is %d", ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } for (int64_t g = 0; g < groups; g++) { @@ -352,10 +360,12 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t c1i = 0; c1i < c1; c1i++) { @@ -375,9 +385,8 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID, - "Failed to operate the dst memory, protected_size is %ld and size is %ld", - protected_size, data_size); + GELOGE(ACL_ERROR_GE_PARAM_INVALID,"[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); + REPORT_INNER_ERROR("E19999","Operate dst memory failed, protected_size is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = hi * wcn + wi * cn + (c1i * c0 + c0i) * n + n1n0i; @@ -388,10 +397,9 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d, pad mode %d", - dst_offset, ret, pad_zero); - return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, at offset %ld, error-code %d, pad mode %d", + dst_offset, ret, pad_zero); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memoery at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } @@ -430,10 +438,11 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t c1i = 0; c1i < c1; c1i++) { @@ -453,10 +462,8 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID, - "Failed to operate the dst memory, protected_size is %ld and size is %ld", - protected_size, data_size); - return ACL_ERROR_GE_PARAM_INVALID; + GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory, protected_size is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = n1n0i * hwc + hi * wc + wi * c + (c1i * c0 + c0i); char *dst_data = reinterpret_cast(dst.get() + dst_offset); @@ -466,10 +473,9 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d, pad mode %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); - return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index c36bffb5..32e31582 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -86,8 +86,8 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(DIM_DEFAULT_VALUE); hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s", - ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -106,8 +106,8 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Failed to check dst shape %s", - ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -118,10 +118,14 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { ShapeVector expect_src_shape; auto ret = TransShapeToFracZz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { - GELOGE(ret, "Trans shape from %s to %s, shape %s to %s, data type %s failed", + GELOGE(ret, "[Transfer][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s, error_code %u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); + REPORT_INNER_ERROR(ret, "Failed to transfer shape from %s to %s, shape %s to %s, data type %s, error_code %u", + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { @@ -140,10 +144,12 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D @@ -180,8 +186,8 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -197,8 +203,8 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -220,10 +226,12 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "Failed to trans format from %s to %s, can not alloc the memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allcoate memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -261,8 +269,8 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -278,8 +286,8 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "Failed to operate the dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -295,18 +303,26 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "Not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } - if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { + if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "Not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -329,16 +345,22 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector Format dst_format, ShapeVector &dst_shape) { if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "Not support trans format from %s to %s, src shape %s, data type %s", + "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype Failed, not support trans format from %s to %s, src shape %s, data type %s", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "Not support trans format from %s to %s, src shape %s, data type %s", + "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, data type %s", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -348,19 +370,26 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "Not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "Not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", From 1e610379dbb41a298ee5adf6d6c00f1dc441531e Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Mon, 29 Mar 2021 17:28:06 +0800 Subject: [PATCH 02/11] common formats log optimize --- .../formats/format_transfers/format_transfer_fractal_nz.cc | 11 +++++++---- .../formats/format_transfers/format_transfer_fractal_zz.cc | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index 9e846726..eda3a5a9 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -225,7 +225,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(); + TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -295,7 +295,8 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", + "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); @@ -337,7 +338,8 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", + "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); @@ -366,7 +368,8 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", + "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index 32e31582..a19f3fcf 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -313,7 +313,7 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } - if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape) { + if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), From 6f08d5f0bb338fd3d2fdfa583a866cae36af9bef Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Mon, 29 Mar 2021 19:34:19 +0800 Subject: [PATCH 03/11] common formats log optimize --- .../format_transfers/format_transfer_fractal_nz.cc | 28 ++++++++++------------ .../format_transfers/format_transfer_fractal_zz.cc | 8 +++---- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index eda3a5a9..d647b7f5 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -334,27 +334,23 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector Format dst_format, ShapeVector &dst_shape) { if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", - "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index a19f3fcf..bca25e78 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -118,14 +118,14 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { ShapeVector expect_src_shape; auto ret = TransShapeToFracZz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { - GELOGE(ret, "[Transfer][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s, error_code %u", + GELOGE(ret, "[Transfer][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); - REPORT_INNER_ERROR(ret, "Failed to transfer shape from %s to %s, shape %s to %s, data type %s, error_code %u", + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR(ret, "Failed to transfer shape from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { From 2abae40cc1cae1e9c5cbddefae2c29fdf8a9465e Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Mon, 29 Mar 2021 19:45:35 +0800 Subject: [PATCH 04/11] common formats log optimize --- ge/common/formats/format_transfers/format_transfer_fractal_nz.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index d647b7f5..ea8f2516 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -336,7 +336,7 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), @@ -349,7 +349,7 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } From ae84215d0159efef6437076f049701aca699d588 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Tue, 30 Mar 2021 11:20:20 +0800 Subject: [PATCH 05/11] common formats log optimize --- .../formats/format_transfers/datatype_transfer.cc | 2 +- .../format_transfer_c1hwncoc0_hwcn.cc | 28 ++++----- .../format_transfer_dhwcn_fracz3D.cc | 14 ++--- .../format_transfer_dhwnc_fracz3D_transpose.cc | 13 ++--- .../format_transfers/format_transfer_fractal_nz.cc | 31 ++++------ .../format_transfers/format_transfer_fractal_z.cc | 61 +++++++++----------- .../format_transfers/format_transfer_fractal_zz.cc | 66 +++++++--------------- 7 files changed, 87 insertions(+), 128 deletions(-) diff --git a/ge/common/formats/format_transfers/datatype_transfer.cc b/ge/common/formats/format_transfers/datatype_transfer.cc index d6773823..df2434d6 100644 --- a/ge/common/formats/format_transfers/datatype_transfer.cc +++ b/ge/common/formats/format_transfers/datatype_transfer.cc @@ -156,7 +156,7 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); - REPORT_INNER_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", total_size, args.src_data_size); + REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", total_size, args.src_data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index c3779834..1244b221 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -50,12 +50,12 @@ Status CheckArgsForC1hwncoc0ToHwcn(const TransArgs &args) { } if (!CheckShapeValid(src_shape, kC1hwncoc0DimsNum)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][SrcShape]Failed, src shape %s", ShapeToString(src_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check src shape %s", ShapeToString(src_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check src shape %s", ShapeToString(src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } if (!CheckShapeValid(dst_shape, kHwcnDimsNum)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s.", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } auto cube_size = GetCubeSizeByDataType(args.src_data_type); @@ -76,12 +76,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size std::shared_ptr dst(new (std::nothrow) uint8_t[total_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld, shape %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), total_size, ShapeToString(args.dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld, shape %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), total_size, ShapeToString(args.dst_shape).c_str()); + "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", + total_size, ShapeToString(args.dst_shape).c_str(), + TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", + total_size, ShapeToString(args.dst_shape).c_str(), + TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -124,7 +124,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size "[Operate][Memory]Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " + REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; @@ -152,8 +152,10 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu result.length = static_cast(total_size); return SUCCESS; } - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "Get %ld total size from dst shape %s, src shape %s.", + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, src shape %s.", total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Get shape faield, total size %la from dst shape %s, src shape %s.", + total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from C1HWNCoC0 to HWCN, src shape %s, data type %s, dst shape %s, memory size %ld.", @@ -164,9 +166,9 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu GELOGE(ret, "[Get][Data]Failed when after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ShapeToString(args.dst_shape).c_str(), total_size, ret); - REPORT_INNER_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), - ShapeToString(args.dst_shape).c_str(), total_size, ret); + REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), + ShapeToString(args.dst_shape).c_str(), total_size, ret); return ret; } return SUCCESS; diff --git a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc index 4c09268c..958bede0 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc @@ -94,14 +94,10 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - return ACL_ERROR_GE_MEMORY_ALLOCATION; + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } for (int64_t di = 0; di < d; di++) { @@ -128,7 +124,7 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc index e3244b8a..1f2df2b9 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc @@ -95,13 +95,10 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate[DSTMemory]]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - return ACL_ERROR_GE_MEMORY_ALLOCATION; + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } for (int64_t di = 0; di < d; di++) { @@ -128,7 +125,7 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index ea8f2516..8cb468ba 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -88,7 +88,7 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -108,7 +108,7 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -123,10 +123,6 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); - REPORT_INNER_ERROR("E19999", "Failed to tranfer shape from %s to %s, shape %s to %s, data type %s, error_code:%u", - TypeUtils::FormatToSerialString(args.dst_format).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { @@ -148,7 +144,7 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -185,7 +181,7 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con static_cast(size * w0)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -200,7 +196,7 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con static_cast(size)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -224,7 +220,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -261,7 +257,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con static_cast(size * w0)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -276,7 +272,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con static_cast(size)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -291,12 +287,11 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", - "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); @@ -337,8 +332,7 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", - "Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; @@ -364,8 +358,7 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", - "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index 6893aecb..2a29489a 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -74,7 +74,7 @@ Status TransShapeToFz(int64_t n, int64_t c, int64_t h, int64_t w, DataType data_ dst_shape.push_back(c0); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -103,7 +103,7 @@ Status TransShapeToFzWithGroups(int64_t n, int64_t c, int64_t h, int64_t w, Data dst_shape.push_back(cube_k); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -190,12 +190,11 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t vfi = 0; vfi < vf_cnt; vfi++) { @@ -241,7 +240,7 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); - REPORT_INNER_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); + REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -264,7 +263,7 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, if (cin_ori == 0 || cout_ori == 0) { GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); - REPORT_INNER_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," + REPORT_CALL_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); return GRAPH_FAILED; } @@ -286,18 +285,17 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, errno_t ret = EOK; std::shared_ptr dst(new (std::nothrow) uint8_t[size_output_data], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), size_output_data); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), size_output_data); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } ret = memset_s(dst.get(), static_cast(size_output_data), 0, static_cast(size_output_data)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, ret is %d", ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory, ret is %d", ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory, ret is %d", ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } for (int64_t g = 0; g < groups; g++) { @@ -360,12 +358,11 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t c1i = 0; c1i < c1; c1i++) { @@ -386,7 +383,6 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { } else { if (protected_size < data_size) { GELOGE(ACL_ERROR_GE_PARAM_INVALID,"[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); - REPORT_INNER_ERROR("E19999","Operate dst memory failed, protected_size is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = hi * wcn + wi * cn + (c1i * c0 + c0i) * n + n1n0i; @@ -399,7 +395,7 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memoery at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + REPORT_CALL_ERROR("E19999", "Failed to operate dst memoery at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } @@ -438,11 +434,11 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t c1i = 0; c1i < c1; c1i++) { @@ -462,8 +458,7 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory, protected_size is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; + GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = n1n0i * hwc + hi * wc + wi * c + (c1i * c0 + c0i); char *dst_data = reinterpret_cast(dst.get() + dst_offset); @@ -475,7 +470,7 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index bca25e78..830a4a7e 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -87,7 +87,7 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -107,7 +107,7 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_INNER_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -118,11 +118,11 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { ShapeVector expect_src_shape; auto ret = TransShapeToFracZz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { - GELOGE(ret, "[Transfer][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s", + GELOGE(ret, "[Trans][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR(ret, "Failed to transfer shape from %s to %s, shape %s to %s, data type %s", + REPORT_CALL_ERROR("E19999", "Failed to trans shape from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); @@ -144,13 +144,10 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - return ACL_ERROR_GE_MEMORY_ALLOCATION; + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D auto times = hw_shape.at(kNdDimIndexN); @@ -187,7 +184,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con static_cast(size * w0)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -204,7 +201,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con static_cast(size)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -226,13 +223,10 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_INNER_ERROR("E19999", "Failed to trans format from %s to %s and allcoate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - return ACL_ERROR_GE_MEMORY_ALLOCATION; + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D @@ -270,7 +264,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con static_cast(size * w0)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -287,7 +281,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con static_cast(size)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_INNER_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -306,11 +300,7 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { @@ -318,11 +308,7 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -347,10 +333,7 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype Failed, not support trans format from %s to %s, src shape %s, data type %s", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { @@ -358,9 +341,6 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, data type %s", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -373,11 +353,7 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } @@ -386,7 +362,7 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); From 1e04494d0e10387be302943ec7a892a66e151da5 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Tue, 30 Mar 2021 11:26:47 +0800 Subject: [PATCH 06/11] common formats log optimize --- ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index 1244b221..1cd5786e 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -154,7 +154,7 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu } GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, src shape %s.", total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Get shape faield, total size %la from dst shape %s, src shape %s.", + REPORT_CALL_ERROR("E19999", "Get shape faield, total size %ld from dst shape %s, src shape %s.", total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } From e143d7e829b7801b4634d9c74ceeec86171e1efe Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Thu, 1 Apr 2021 11:36:38 +0800 Subject: [PATCH 07/11] common formats log optimize --- .../formats/format_transfers/datatype_transfer.cc | 3 +- .../format_transfer_c1hwncoc0_hwcn.cc | 15 ++++-- .../format_transfer_dhwcn_fracz3D.cc | 17 ++++--- .../format_transfer_dhwnc_fracz3D_transpose.cc | 17 ++++--- .../format_transfers/format_transfer_fractal_nz.cc | 56 +++++++++++++--------- .../format_transfers/format_transfer_fractal_z.cc | 53 +++++++++++++------- .../format_transfers/format_transfer_fractal_zz.cc | 51 ++++++++++++-------- 7 files changed, 135 insertions(+), 77 deletions(-) diff --git a/ge/common/formats/format_transfers/datatype_transfer.cc b/ge/common/formats/format_transfers/datatype_transfer.cc index df2434d6..48200980 100644 --- a/ge/common/formats/format_transfers/datatype_transfer.cc +++ b/ge/common/formats/format_transfers/datatype_transfer.cc @@ -156,7 +156,8 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); - REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", total_size, args.src_data_size); + REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", + total_size, args.src_data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index 1cd5786e..fcb488af 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -78,10 +78,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", total_size, ShapeToString(args.dst_shape).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", total_size, ShapeToString(args.dst_shape).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -126,7 +128,8 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", - c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); + c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, + h_idx, w_idx, c_idx, n_idx, dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -163,10 +166,12 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu ShapeToString(args.dst_shape).c_str(), total_size); ret = GetDstDataAfterTrans(args, result, size, total_size); if (ret != SUCCESS) { - GELOGE(ret, "[Get][Data]Failed when after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", + GELOGE(ret, "[Get][Data]Failed when after trans, src shape %s, data type %s, dst shape %s, " + "memory size %ld, error_code %u", ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ShapeToString(args.dst_shape).c_str(), total_size, ret); - REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, dst shape %s, memory size %ld, error_code %u", + REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, " + "dst shape %s, memory size %ld, error_code %u", ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ShapeToString(args.dst_shape).c_str(), total_size, ret); return ret; diff --git a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc index 958bede0..ad1e8af7 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc @@ -94,10 +94,14 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); + return ACL_ERROR_GE_MEMORY_ALLOCATION; } for (int64_t di = 0; di < d; di++) { @@ -122,9 +126,10 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { args.data + src_idx * data_size, static_cast(data_size)); } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", - dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc index 1f2df2b9..d8a49e41 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc @@ -95,10 +95,14 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); + return ACL_ERROR_GE_MEMORY_ALLOCATION; } for (int64_t di = 0; di < d; di++) { @@ -123,9 +127,10 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul args.data + src_idx * data_size, static_cast(data_size)); } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", - dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index 8cb468ba..75e400a4 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -87,7 +87,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(DIM_DEFAULT_VALUE); hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } @@ -107,7 +108,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } @@ -119,8 +121,8 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { ShapeVector expect_src_shape; auto ret = TransShapeToFracNz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { - GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, data type %s, error_code:%u", - TypeUtils::FormatToSerialString(args.dst_format).c_str(), + GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, " + "data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); return ret; @@ -141,8 +143,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, " + "memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), @@ -180,8 +182,10 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -195,8 +199,10 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -217,7 +223,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, " + "memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", @@ -256,7 +263,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -271,7 +279,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -287,12 +296,12 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, " + "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; @@ -303,8 +312,8 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " + "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; @@ -332,7 +341,8 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " + "data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; @@ -358,7 +368,8 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); @@ -371,7 +382,8 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " + "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index 2a29489a..b2924600 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -190,8 +190,10 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); @@ -240,7 +242,8 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); - REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); + REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", + offset, ret, need_pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -261,7 +264,8 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, int64_t cin_ori = c_dim; int64_t cout_ori = n_dim / groups; if (cin_ori == 0 || cout_ori == 0) { - GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, cout_ori, groups are %ld %ld %ld", + GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, " + "cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); REPORT_CALL_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); @@ -285,8 +289,10 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, errno_t ret = EOK; std::shared_ptr dst(new (std::nothrow) uint8_t[size_output_data], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); @@ -358,8 +364,10 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); @@ -382,7 +390,8 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID,"[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); + GELOGE(ACL_ERROR_GE_PARAM_INVALID,"[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", + protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = hi * wcn + wi * cn + (c1i * c0 + c0i) * n + n1n0i; @@ -393,9 +402,11 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, at offset %ld, error-code %d, pad mode %d", - dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memoery at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, at offset %ld, error-code %d, " + "pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memoery at offset %ld, error-code %d, pad mode %d", + dst_offset, ret, pad_zero); + return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } @@ -434,8 +445,10 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); @@ -458,7 +471,9 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; + GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", + protected_size, data_size); + return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = n1n0i * hwc + hi * wc + wi * c + (c1i * c0 + c0i); char *dst_data = reinterpret_cast(dst.get() + dst_offset); @@ -468,9 +483,11 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d, pad mode %d", - dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", + dst_offset, ret, pad_zero); + return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index 830a4a7e..7930748d 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -87,7 +87,7 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -107,7 +107,7 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -144,10 +144,14 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); + return ACL_ERROR_GE_MEMORY_ALLOCATION; } // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D auto times = hw_shape.at(kNdDimIndexN); @@ -183,7 +187,8 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -200,7 +205,8 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -223,10 +229,14 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); + return ACL_ERROR_GE_MEMORY_ALLOCATION; } // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D @@ -263,7 +273,8 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -280,7 +291,8 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -306,8 +318,8 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } @@ -358,14 +370,15 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult } if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", From 123e9a43e2e090aa46d2b835473ef090e20ed5a4 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Thu, 1 Apr 2021 15:08:50 +0800 Subject: [PATCH 08/11] common formats log optimize --- .../formats/format_transfers/datatype_transfer.cc | 2 +- .../format_transfer_c1hwncoc0_hwcn.cc | 24 +++---- .../format_transfer_dhwcn_fracz3D.cc | 14 ++-- .../format_transfer_dhwnc_fracz3D_transpose.cc | 14 ++-- .../format_transfers/format_transfer_fractal_nz.cc | 82 +++++++++++----------- .../format_transfers/format_transfer_fractal_z.cc | 33 +++++---- .../format_transfers/format_transfer_fractal_zz.cc | 56 ++++++++++----- 7 files changed, 122 insertions(+), 103 deletions(-) diff --git a/ge/common/formats/format_transfers/datatype_transfer.cc b/ge/common/formats/format_transfers/datatype_transfer.cc index 48200980..e5f49fe6 100644 --- a/ge/common/formats/format_transfers/datatype_transfer.cc +++ b/ge/common/formats/format_transfers/datatype_transfer.cc @@ -157,7 +157,7 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", - total_size, args.src_data_size); + total_size, args.src_data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index fcb488af..fcd30772 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -78,12 +78,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", total_size, ShapeToString(args.dst_shape).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", total_size, ShapeToString(args.dst_shape).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -126,10 +126,10 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size "[Operate][Memory]Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " - "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", - c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, - h_idx, w_idx, c_idx, n_idx, dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " + "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", + c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, + h_idx, w_idx, c_idx, n_idx, dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -158,7 +158,7 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, src shape %s.", total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); REPORT_CALL_ERROR("E19999", "Get shape faield, total size %ld from dst shape %s, src shape %s.", - total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); + total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from C1HWNCoC0 to HWCN, src shape %s, data type %s, dst shape %s, memory size %ld.", @@ -171,9 +171,9 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ShapeToString(args.dst_shape).c_str(), total_size, ret); REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, " - "dst shape %s, memory size %ld, error_code %u", - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), - ShapeToString(args.dst_shape).c_str(), total_size, ret); + "dst shape %s, memory size %ld, error_code %u", + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), + ShapeToString(args.dst_shape).c_str(), total_size, ret); return ret; } return SUCCESS; diff --git a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc index ad1e8af7..0ac2ea73 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc @@ -1,4 +1,4 @@ -/**` +/** * Copyright 2020 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -97,10 +97,10 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -127,9 +127,9 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { } if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc index d8a49e41..7f3878ab 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc @@ -96,12 +96,12 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -128,9 +128,9 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul } if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index 75e400a4..005c715d 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -88,8 +88,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", - ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -108,9 +108,9 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", - ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -122,7 +122,7 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { auto ret = TransShapeToFracNz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); if (ret != SUCCESS) { GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, " - "data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), + "data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); return ret; @@ -147,8 +147,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con "memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -184,7 +184,7 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -199,9 +199,9 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -228,8 +228,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -265,7 +265,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -279,9 +279,9 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -297,13 +297,13 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, " - "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), + "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { @@ -314,8 +314,8 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -339,22 +339,22 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " "data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -365,28 +365,28 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " "dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " "data type %s is not supported", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index b2924600..2b36a943 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -193,10 +193,10 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t vfi = 0; vfi < vf_cnt; vfi++) { @@ -241,7 +241,7 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { } if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", - offset, ret, need_pad_zero); + offset, ret, need_pad_zero); REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", offset, ret, need_pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; @@ -265,10 +265,9 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, int64_t cout_ori = n_dim / groups; if (cin_ori == 0 || cout_ori == 0) { GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, " - "cout_ori, groups are %ld %ld %ld", - cin_ori, cout_ori, groups); + "cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); REPORT_CALL_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," - "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); + "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); return GRAPH_FAILED; } const int64_t cube_k = GetCubeSizeByDataType(args.src_data_type); @@ -291,11 +290,11 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", - size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } ret = memset_s(dst.get(), static_cast(size_output_data), 0, static_cast(size_output_data)); @@ -367,10 +366,10 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t c1i = 0; c1i < c1; c1i++) { @@ -448,10 +447,10 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); for (int64_t c1i = 0; c1i < c1; c1i++) { diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index 7930748d..3c9f5cf9 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -123,9 +123,9 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_CALL_ERROR("E19999", "Failed to trans shape from %s to %s, shape %s to %s, data type %s", - TypeUtils::FormatToSerialString(args.dst_format).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { @@ -147,10 +147,10 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D @@ -189,7 +189,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -207,7 +207,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -232,9 +232,9 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str()); REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", - dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -275,7 +275,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -293,7 +293,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -312,7 +312,11 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { @@ -320,7 +324,11 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -345,7 +353,11 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, data type %s", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { @@ -353,6 +365,10 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, data type %s", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -365,7 +381,11 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype Failed, not support trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s",TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } @@ -377,8 +397,8 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", From ff31cd4d15a263e042d42d529c5f689ecd19bba5 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Thu, 1 Apr 2021 16:18:34 +0800 Subject: [PATCH 09/11] common formats log optimize --- .../formats/format_transfers/datatype_transfer.cc | 3 +- .../format_transfer_c1hwncoc0_hwcn.cc | 33 ++-- .../format_transfer_dhwcn_fracz3D.cc | 11 +- .../format_transfers/format_transfer_fractal_nz.cc | 152 +++++++++++------- .../format_transfers/format_transfer_fractal_z.cc | 69 ++++---- .../format_transfers/format_transfer_fractal_zz.cc | 173 +++++++++++++-------- 6 files changed, 281 insertions(+), 160 deletions(-) diff --git a/ge/common/formats/format_transfers/datatype_transfer.cc b/ge/common/formats/format_transfers/datatype_transfer.cc index e5f49fe6..5aaa8fd5 100644 --- a/ge/common/formats/format_transfers/datatype_transfer.cc +++ b/ge/common/formats/format_transfers/datatype_transfer.cc @@ -155,7 +155,8 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result std::shared_ptr dst(new (std::nothrow) uint8_t[total_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); + "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", + total_size, args.src_data_size); REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", total_size, args.src_data_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index fcd30772..18c9e9d8 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -49,12 +49,14 @@ Status CheckArgsForC1hwncoc0ToHwcn(const TransArgs &args) { return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShapeValid(src_shape, kC1hwncoc0DimsNum)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][SrcShape]Failed, src shape %s", ShapeToString(src_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][SrcShape]Failed, src shape %s", + ShapeToString(src_shape).c_str()); REPORT_CALL_ERROR("E19999", "Failed to check src shape %s", ShapeToString(src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } if (!CheckShapeValid(dst_shape, kHwcnDimsNum)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s.", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s.", + ShapeToString(dst_shape).c_str()); REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } @@ -76,11 +78,13 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size std::shared_ptr dst(new (std::nothrow) uint8_t[total_size], std::default_delete()); if (dst == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, - "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", + "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, " + "shape %s when trans format from %s to %s", total_size, ShapeToString(args.dst_shape).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, " + "shape %s when trans format from %s to %s", total_size, ShapeToString(args.dst_shape).c_str(), TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); @@ -123,10 +127,13 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size static_cast(size)); if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, - "[Operate][Memory]Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " + "[Operate][Memory]Failed to copy data from " + "C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", - c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " + c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, + h_idx, w_idx, c_idx, n_idx, dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to copy data from " + "C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); @@ -155,10 +162,12 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu result.length = static_cast(total_size); return SUCCESS; } - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, src shape %s.", + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, " + "src shape %s.", total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); REPORT_CALL_ERROR("E19999", "Get shape faield, total size %ld from dst shape %s, src shape %s.", - total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); + total_size, ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from C1HWNCoC0 to HWCN, src shape %s, data type %s, dst shape %s, memory size %ld.", @@ -168,11 +177,13 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu if (ret != SUCCESS) { GELOGE(ret, "[Get][Data]Failed when after trans, src shape %s, data type %s, dst shape %s, " "memory size %ld, error_code %u", - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), + ShapeToString(args.src_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ShapeToString(args.dst_shape).c_str(), total_size, ret); REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, " "dst shape %s, memory size %ld, error_code %u", - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), + ShapeToString(args.src_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ShapeToString(args.dst_shape).c_str(), total_size, ret); return ret; } diff --git a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc index 0ac2ea73..4854fdd2 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc @@ -94,11 +94,12 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -126,8 +127,8 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { args.data + src_idx * data_size, static_cast(data_size)); } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at " + "offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " "error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index 005c715d..ae84ec7b 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -89,7 +89,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", + ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -110,7 +111,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap if (!IsShapeValid(dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", + ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -123,8 +125,10 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { if (ret != SUCCESS) { GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, " "data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { @@ -143,10 +147,12 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, " - "memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format " + "from %s to %s, memory for dst buf %ld", + TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and " + "allocate memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -182,8 +188,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", - dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; @@ -199,8 +205,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", - dst_offset, ret); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; @@ -223,11 +229,12 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format from %s to %s, " - "memory for dst buf %ld", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format " + "from %s to %s, memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", + REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory " + "for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -263,9 +270,11 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -279,9 +288,11 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -297,25 +308,37 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, " - "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " - "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + "dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + "[Check][Shape]Failed, trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " - "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s is not supported", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -338,23 +361,34 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector Format dst_format, ShapeVector &dst_shape) { if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, " + "data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " "data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, " + "data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, " + "data type %s is not supported", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -364,29 +398,39 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, " + "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", + "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, " + "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " - "data type %s is not supported", + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, " + "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index 2b36a943..cdc1d700 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -73,7 +73,8 @@ Status TransShapeToFz(int64_t n, int64_t c, int64_t h, int64_t w, DataType data_ dst_shape.push_back(kNiSize); dst_shape.push_back(c0); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } @@ -102,7 +103,8 @@ Status TransShapeToFzWithGroups(int64_t n, int64_t c, int64_t h, int64_t w, Data dst_shape.push_back(16); dst_shape.push_back(cube_k); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } @@ -190,11 +192,12 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); @@ -240,9 +243,11 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d pad mode %d", offset, ret, need_pad_zero); - REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", + REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, " + "error-code %d pad mode %d", offset, ret, need_pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } @@ -264,10 +269,11 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, int64_t cin_ori = c_dim; int64_t cout_ori = n_dim / groups; if (cin_ori == 0 || cout_ori == 0) { - GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, " - "cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); + GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, " + "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); REPORT_CALL_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," - "and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); + "and current cin_ori, cout_ori, groups are %ld %ld %ld", + cin_ori, cout_ori, groups); return GRAPH_FAILED; } const int64_t cube_k = GetCubeSizeByDataType(args.src_data_type); @@ -288,11 +294,12 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, errno_t ret = EOK; std::shared_ptr dst(new (std::nothrow) uint8_t[size_output_data], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -363,11 +370,12 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); @@ -389,7 +397,8 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID,"[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", + GELOGE(ACL_ERROR_GE_PARAM_INVALID,"[Operate][DSTMemory]Failed, protected_size " + "is %ld and size is %ld", protected_size, data_size); return ACL_ERROR_GE_PARAM_INVALID; } @@ -401,11 +410,12 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, at offset %ld, error-code %d, " - "pad mode %d", dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memoery at offset %ld, error-code %d, pad mode %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed, " + "at offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memoery at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); - return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } @@ -444,11 +454,12 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( dst == nullptr, - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION;); @@ -470,9 +481,10 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { static_cast(data_size)); } else { if (protected_size < data_size) { - GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size is %ld and size is %ld", + GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Operate][DSTMemory]Failed, protected_size " + "is %ld and size is %ld", protected_size, data_size); - return ACL_ERROR_GE_PARAM_INVALID; + return ACL_ERROR_GE_PARAM_INVALID; } int64_t src_idx = n1n0i * hwc + hi * wc + wi * c + (c1i * c0 + c0i); char *dst_data = reinterpret_cast(dst.get() + dst_offset); @@ -484,9 +496,10 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { if (ret != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " "error-code %d, pad mode %d", dst_offset, ret, pad_zero); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d, pad mode %d", + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " + "error-code %d, pad mode %d", dst_offset, ret, pad_zero); - return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; + return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } } diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc index 3c9f5cf9..e3d54e74 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_zz.cc @@ -86,8 +86,10 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(DIM_DEFAULT_VALUE); hw_shape.push_back(src_shape[kNdDimIndexN]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", + ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -106,8 +108,10 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); if (!IsShapeValid(dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", ShapeToString(dst_shape).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", + ShapeToString(dst_shape).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", + ShapeToString(dst_shape).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } return SUCCESS; @@ -120,12 +124,16 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { if (ret != SUCCESS) { GELOGE(ret, "[Trans][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_CALL_ERROR("E19999", "Failed to trans shape from %s to %s, shape %s to %s, data type %s", TypeUtils::FormatToSerialString(args.dst_format).c_str(), - TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), - ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.src_format).c_str(), + ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ret; } if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { @@ -144,11 +152,12 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -187,9 +196,11 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -205,9 +216,11 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -229,11 +242,12 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -273,9 +287,11 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size * w0)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -291,9 +307,11 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con auto ret = memcpy_s(dst.get() + dst_offset, static_cast(protected_size), args.data + src_offset, static_cast(size)); if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " + "error-code %d", dst_offset, ret); - REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); + REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", + dst_offset, ret); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; } } @@ -309,26 +327,38 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + "[Check][Datatype]Failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, " - "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format " + "from %s to %s, src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + "[Check][Shape]Failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " - "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", @@ -351,24 +381,34 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector Format dst_format, ShapeVector &dst_shape) { if (!IsDataTypeSupport(data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, data type %s", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, data type %s", + "[Check][Datatype]Failed, not support trans format from %s to %s, " + "src shape %s, data type %s", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, " + "src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!CheckShape(src_format, src_shape)) { GELOGE(ACL_ERROR_GE_SHAPE_INVALID, - "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, data type %s", - TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, data type %s", + "[Check][Shape]Failed, not support trans format from %s to %s, " + "src shape %s, data type %s", + TypeUtils::FormatToSerialString(src_format).c_str(), + TypeUtils::FormatToSerialString(dst_format).c_str(), + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, " + "src shape %s, data type %s", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), - ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); + ShapeToString(src_shape).c_str(), + TypeUtils::DataTypeToSerialString(data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } ShapeVector hw_shape; @@ -378,27 +418,38 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult &result) { if (!IsDataTypeSupport(args.src_data_type)) { GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, - "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", + "[Check][Datatype]Failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check datatype Failed, not support trans format from %s to %s, src shape %s, " - "dst shape %s, data type %s",TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_INNER_ERROR("E19999", "Check datatype Failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_DATATYPE_INVALID; } if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { - GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format from %s to %s, " - "src shape %s, dst shape %s, data type %s", + GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, not support trans format " + "from %s to %s, src shape %s, dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " - "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), - ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); + REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, " + "src shape %s, dst shape %s, data type %s", + TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str(), + ShapeToString(args.src_shape).c_str(), + ShapeToString(args.dst_shape).c_str(), + TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); return ACL_ERROR_GE_SHAPE_INVALID; } GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", From 1b34f373112e1e2ad468bcf60cf82d7bb97f6575 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Thu, 1 Apr 2021 16:26:51 +0800 Subject: [PATCH 10/11] common formats log optimize --- .../format_transfers/format_transfer_c1hwncoc0_hwcn.cc | 3 ++- .../format_transfer_dhwnc_fracz3D_transpose.cc | 11 ++++++----- .../formats/format_transfers/format_transfer_fractal_nz.cc | 2 +- .../formats/format_transfers/format_transfer_fractal_z.cc | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc index 18c9e9d8..ce271c6d 100644 --- a/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc +++ b/ge/common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc @@ -164,7 +164,8 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu } GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, " "src shape %s.", - total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); + total_size, ShapeToString(args.dst_shape).c_str(), + ShapeToString(args.src_shape).c_str()); REPORT_CALL_ERROR("E19999", "Get shape faield, total size %ld from dst shape %s, src shape %s.", total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); diff --git a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc index 7f3878ab..04ce299a 100644 --- a/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc +++ b/ge/common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc @@ -95,11 +95,12 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size], std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " - "when trans format from %s to %s", + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory " + "for dst buf %ld when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); - REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", + REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld " + "when trans format from %s to %s", dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -127,8 +128,8 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul args.data + src_idx * data_size, static_cast(data_size)); } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at " + "offset %ld, error-code %d, pad mode %d", dst_offset, ret, pad_zero); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " "error-code %d, pad mode %d", dst_offset, ret, pad_zero); return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index ae84ec7b..f0322d6d 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -315,7 +315,7 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " - "dst shape %s, data type %s is not supported", + "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index cdc1d700..ddce348b 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -494,8 +494,8 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { } } if (ret != EOK) { - GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " - "error-code %d, pad mode %d", dst_offset, ret, pad_zero); + GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld," + " error-code %d, pad mode %d", dst_offset, ret, pad_zero); REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " "error-code %d, pad mode %d", dst_offset, ret, pad_zero); From ab134d9d5730c73d5ef2293ee22819caa1e2cf92 Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Thu, 1 Apr 2021 16:59:31 +0800 Subject: [PATCH 11/11] common formats log optimize --- .../format_transfers/format_transfer_fractal_nz.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc index f0322d6d..d01c763e 100755 --- a/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_nz.cc @@ -147,14 +147,14 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con std::shared_ptr dst(new (std::nothrow) uint8_t[dst_size](), std::default_delete()); if (dst == nullptr) { - GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to trans format " - "from %s to %s, memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); - REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and " - "allocate memory for dst buf %ld", - TypeUtils::FormatToSerialString(args.src_format).c_str(), - TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); + GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allocate memory " + "for dst buf %ld when trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); + REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %ld " + "trans format from %s to %s", + dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), + TypeUtils::FormatToSerialString(args.dst_format).c_str()); return ACL_ERROR_GE_MEMORY_ALLOCATION; } @@ -332,7 +332,7 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, " + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, " "src shape %s, dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(), @@ -383,7 +383,7 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector TypeUtils::FormatToSerialString(dst_format).c_str(), ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, " + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, " "data type %s is not supported", TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), @@ -424,7 +424,7 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult ShapeToString(args.src_shape).c_str(), ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); - REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, " + REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, " "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), TypeUtils::FormatToSerialString(args.dst_format).c_str(),