已合并
修复日志质量扫描发现不合理日志 #1297
liu-wei创建于 12 天前
修复日志质量扫描发现不合理日志 #1297
已合并
共 44 个文件变更+168-213
| @@ -46,7 +46,7 @@ static Status ParseOnnxParamsPSROIPoolingV2(const ge::Operator& op_src, ge::Oper | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | if (attr_num != ATTR_NUM) { | 48 | if (attr_num != ATTR_NUM) { |
| 49 | - OP_LOGE(GetOpName(op_dest).c_str(), "Node must have attr spatial_scale、output_dim、group_size"); | 49 | + OP_LOGE(GetOpName(op_dest).c_str(), "Node must have attr spatial_scale, output_dim, group_size"); |
| 50 | return FAILED; | 50 | return FAILED; |
| 51 | } | 51 | } |
| 52 | op_dest.SetAttr("spatial_scale", spatial_scale); | 52 | op_dest.SetAttr("spatial_scale", spatial_scale); |
| @@ -71,4 +71,4 @@ REGISTER_CUSTOM_OP("PSROIPoolingV2") | |||
| 71 | ge::AscendString("ai.onnx::16::PSROIPooling")}) | 71 | ge::AscendString("ai.onnx::16::PSROIPooling")}) |
| 72 | .ParseParamsByOperatorFn(ParseOnnxParamsPSROIPoolingV2) | 72 | .ParseParamsByOperatorFn(ParseOnnxParamsPSROIPoolingV2) |
| 73 | .ImplyType(ImplyType::TVM); | 73 | .ImplyType(ImplyType::TVM); |
| 74 | -} // namespace domi | 74 | +} // namespace domi |
| @@ -72,9 +72,8 @@ static inline bool IsNullptr(const aclBoolArray* boolArr, const char* name) | |||
| 72 | static inline bool IsNullptr(const aclFloatArray* floatArr, const char* name) | 72 | static inline bool IsNullptr(const aclFloatArray* floatArr, const char* name) |
| 73 | { | 73 | { |
| 74 | if (floatArr == nullptr) { | 74 | if (floatArr == nullptr) { |
| 75 | - OP_LOGE(ACLNN_ERR_PARAM_NULLPTR, "Expected a value of type List[float] for argument %s but instead found type \ | 75 | + OP_LOGE(ACLNN_ERR_PARAM_NULLPTR, |
| 76 | - null.", | 76 | + "Expected a value of type List[float] for argument %s but instead found type null.", name); |
| 77 | - name); | ||
| 78 | return true; | 77 | return true; |
| 79 | } | 78 | } |
| 80 | return false; | 79 | return false; |
| @@ -257,4 +256,4 @@ static inline bool CheckNCDimValid(const aclTensor* self, const aclTensor* out) | |||
| 257 | retExpr; \ | 256 | retExpr; \ |
| 258 | } | 257 | } |
| 259 | 258 | ||
| 260 | -#endif | 259 | +#endif |
| @@ -210,7 +210,7 @@ static ge::graphStatus AddExampleTilingFunc(gert::TilingContext* context) | |||
| 210 | 210 | ||
| 211 | // 初始化tiling数据为0 | 211 | // 初始化tiling数据为0 |
| 212 | OP_CHECK_IF(memset_s(tiling, sizeof(AddExampleTilingData), 0, sizeof(AddExampleTilingData)) != EOK, | 212 | OP_CHECK_IF(memset_s(tiling, sizeof(AddExampleTilingData), 0, sizeof(AddExampleTilingData)) != EOK, |
| 213 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 213 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 214 | 214 | ||
| 215 | // 优先做核切分,尽量用更多的核并行计算 | 215 | // 优先做核切分,尽量用更多的核并行计算 |
| 216 | // 计算每个AI Core处理的元素数量 | 216 | // 计算每个AI Core处理的元素数量 |
| @@ -1,21 +1,11 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * This file is part of the OpenBOAT project at Harbin Institute of Technology (HIT) | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * and is contributed to the CANN Open Software. | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Copyright (c) 2025 AISS Group, Harbin Institute of Technology (HIT). | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * All Rights Reserved. | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * | ||
| 8 | - * Authors (accounts): | ||
| 9 | - * - Shi Xiangyang <@shi-xiangyang225> | ||
| 10 | - * - Su Tonghua <@sutonghua> | ||
| 11 | - * | ||
| 12 | - * This program is free software: you can redistribute it and/or modify it. | ||
| 13 | - * Licensed under the CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 14 | - * You may not use this file except in compliance with the License. | ||
| 15 | - * See the LICENSE file at the root of the repository for the full text of the License. | ||
| 16 | - * | ||
| 17 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, | ||
| 18 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | + * See LICENSE in the root of the software repository for the full text of the License. | ||
| 19 | */ | 9 | */ |
| 20 | 10 | ||
| 21 | /*! | 11 | /*! |
| @@ -132,7 +122,7 @@ static ge::graphStatus NMSWithMaskTilingFunc(gert::TilingContext* context) | |||
| 132 | NMSWithMaskTilingData* tiling = context->GetTilingData<NMSWithMaskTilingData>(); | 122 | NMSWithMaskTilingData* tiling = context->GetTilingData<NMSWithMaskTilingData>(); |
| 133 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 123 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 134 | OP_CHECK_IF(memset_s(tiling, sizeof(NMSWithMaskTilingData), 0, sizeof(NMSWithMaskTilingData)) != EOK, | 124 | OP_CHECK_IF(memset_s(tiling, sizeof(NMSWithMaskTilingData), 0, sizeof(NMSWithMaskTilingData)) != EOK, |
| 135 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 125 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 136 | tiling->totalLength = totalIdx; | 126 | tiling->totalLength = totalIdx; |
| 137 | tiling->iou_threshold = *context->GetAttrs()->GetAttrPointer<float>(ATTRPOS0); | 127 | tiling->iou_threshold = *context->GetAttrs()->GetAttrPointer<float>(ATTRPOS0); |
| 138 | tiling->scores_threshold = *context->GetAttrs()->GetAttrPointer<float>(ATTRPOS1); | 128 | tiling->scores_threshold = *context->GetAttrs()->GetAttrPointer<float>(ATTRPOS1); |
| @@ -26,8 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | namespace optiling { | 27 | namespace optiling { |
| 28 | 28 | ||
| 29 | - | ||
| 30 | - | ||
| 31 | constexpr uint32_t DCACHE_SIZE = 128 * 1024; | 29 | constexpr uint32_t DCACHE_SIZE = 128 * 1024; |
| 32 | constexpr uint32_t STATIC_UB_ESTIMATE = 0; | 30 | constexpr uint32_t STATIC_UB_ESTIMATE = 0; |
| 33 | constexpr int64_t PER_CORE_MIN = 1024; | 31 | constexpr int64_t PER_CORE_MIN = 1024; |
| @@ -55,37 +53,36 @@ static int64_t Product(const gert::Shape& shape, size_t begin, size_t end) | |||
| 55 | return prod; | 53 | return prod; |
| 56 | } | 54 | } |
| 57 | 55 | ||
| 58 | -static ge::graphStatus GetShapeInfo(gert::TilingContext* context, const std::string& dataFormat, | 56 | +static ge::graphStatus GetShapeInfo(gert::TilingContext* context, const std::string& dataFormat, int64_t& H, int64_t& W, |
| 59 | - int64_t& H, int64_t& W, int64_t& outerDims) | 57 | + int64_t& outerDims) |
| 60 | { | 58 | { |
| 61 | auto inputShape = context->GetInputShape(0); | 59 | auto inputShape = context->GetInputShape(0); |
| 62 | OP_CHECK_NULL_WITH_CONTEXT(context, inputShape); | 60 | OP_CHECK_NULL_WITH_CONTEXT(context, inputShape); |
| 63 | auto storageShape = inputShape->GetStorageShape(); | 61 | auto storageShape = inputShape->GetStorageShape(); |
| 64 | size_t rank = storageShape.GetDimNum(); | 62 | size_t rank = storageShape.GetDimNum(); |
| 65 | 63 | ||
| 66 | - OP_CHECK_IF(rank < 3, | 64 | + OP_CHECK_IF(rank < 3, OP_LOGE(context, "Input must have at least 3 dimensions, got rank %zu", rank), |
| 67 | - OP_LOGE(context, "Input must have at least 3 dimensions, got rank %zu", rank), | 65 | + return ge::GRAPH_FAILED); |
| 68 | - return ge::GRAPH_FAILED); | ||
| 69 | 66 | ||
| 70 | if (dataFormat == "NHWC") { | 67 | if (dataFormat == "NHWC") { |
| 71 | OP_CHECK_IF(storageShape.GetDim(rank - 1) != 3, | 68 | OP_CHECK_IF(storageShape.GetDim(rank - 1) != 3, |
| 72 | - OP_LOGE(context, "Input channel dimension must be 3, got %ld", storageShape.GetDim(rank - 1)), | 69 | + OP_LOGE(context, "Input channel dimension must be 3, got %ld", storageShape.GetDim(rank - 1)), |
| 73 | - return ge::GRAPH_FAILED); | 70 | + return ge::GRAPH_FAILED); |
| 74 | H = static_cast<int32_t>(storageShape.GetDim(rank - 3)); | 71 | H = static_cast<int32_t>(storageShape.GetDim(rank - 3)); |
| 75 | W = static_cast<int32_t>(storageShape.GetDim(rank - 2)); | 72 | W = static_cast<int32_t>(storageShape.GetDim(rank - 2)); |
| 76 | outerDims = Product(storageShape, 0, rank - 3); | 73 | outerDims = Product(storageShape, 0, rank - 3); |
| 77 | } else { | 74 | } else { |
| 78 | if (rank == 3) { | 75 | if (rank == 3) { |
| 79 | OP_CHECK_IF(storageShape.GetDim(0) != 3, | 76 | OP_CHECK_IF(storageShape.GetDim(0) != 3, |
| 80 | - OP_LOGE(context, "Input channel dimension must be 3, got %ld", storageShape.GetDim(0)), | 77 | + OP_LOGE(context, "Input channel dimension must be 3, got %ld", storageShape.GetDim(0)), |
| 81 | - return ge::GRAPH_FAILED); | 78 | + return ge::GRAPH_FAILED); |
| 82 | H = static_cast<int32_t>(storageShape.GetDim(1)); | 79 | H = static_cast<int32_t>(storageShape.GetDim(1)); |
| 83 | W = static_cast<int32_t>(storageShape.GetDim(2)); | 80 | W = static_cast<int32_t>(storageShape.GetDim(2)); |
| 84 | outerDims = 1; | 81 | outerDims = 1; |
| 85 | } else { | 82 | } else { |
| 86 | OP_CHECK_IF(storageShape.GetDim(rank - 3) != 3, | 83 | OP_CHECK_IF(storageShape.GetDim(rank - 3) != 3, |
| 87 | - OP_LOGE(context, "Input channel dimension must be 3, got %ld", storageShape.GetDim(rank - 3)), | 84 | + OP_LOGE(context, "Input channel dimension must be 3, got %ld", storageShape.GetDim(rank - 3)), |
| 88 | - return ge::GRAPH_FAILED); | 85 | + return ge::GRAPH_FAILED); |
| 89 | H = static_cast<int32_t>(storageShape.GetDim(rank - 2)); | 86 | H = static_cast<int32_t>(storageShape.GetDim(rank - 2)); |
| 90 | W = static_cast<int32_t>(storageShape.GetDim(rank - 1)); | 87 | W = static_cast<int32_t>(storageShape.GetDim(rank - 1)); |
| 91 | outerDims = Product(storageShape, 0, rank - 3); | 88 | outerDims = Product(storageShape, 0, rank - 3); |
| @@ -109,9 +106,8 @@ static ge::graphStatus Rgb2yuv422TilingFunc(gert::TilingContext* context) | |||
| 109 | { | 106 | { |
| 110 | uint64_t ubSize; | 107 | uint64_t ubSize; |
| 111 | int64_t maxCoreNum; | 108 | int64_t maxCoreNum; |
| 112 | - OP_CHECK_IF( | 109 | + OP_CHECK_IF(GetPlatformInfo(context, ubSize, maxCoreNum) != ge::GRAPH_SUCCESS, |
| 113 | - GetPlatformInfo(context, ubSize, maxCoreNum) != ge::GRAPH_SUCCESS, | 110 | + OP_LOGE(context, "GetPlatformInfo error"), return ge::GRAPH_FAILED); |
| 114 | - OP_LOGE(context, "GetPlatformInfo error"), return ge::GRAPH_FAILED); | ||
| 115 | 111 | ||
| 116 | const char* dataFormat = "NHWC"; | 112 | const char* dataFormat = "NHWC"; |
| 117 | auto attrs = context->GetAttrs(); | 113 | auto attrs = context->GetAttrs(); |
| @@ -120,17 +116,15 @@ static ge::graphStatus Rgb2yuv422TilingFunc(gert::TilingContext* context) | |||
| 120 | } | 116 | } |
| 121 | 117 | ||
| 122 | OP_CHECK_IF(strcmp(dataFormat, "NHWC") != 0 && strcmp(dataFormat, "NCHW") != 0, | 118 | OP_CHECK_IF(strcmp(dataFormat, "NHWC") != 0 && strcmp(dataFormat, "NCHW") != 0, |
| 123 | - OP_LOGE(context, "data_format must be 'NHWC' or 'NCHW', got '%s'", dataFormat), | 119 | + OP_LOGE(context, "data_format must be 'NHWC' or 'NCHW', got '%s'", dataFormat), |
| 124 | - return ge::GRAPH_FAILED); | 120 | + return ge::GRAPH_FAILED); |
| 125 | 121 | ||
| 126 | int64_t H, W, outerDims; | 122 | int64_t H, W, outerDims; |
| 127 | - OP_CHECK_IF( | 123 | + OP_CHECK_IF(GetShapeInfo(context, dataFormat, H, W, outerDims) != ge::GRAPH_SUCCESS, |
| 128 | - GetShapeInfo(context, dataFormat, H, W, outerDims) != ge::GRAPH_SUCCESS, | 124 | + OP_LOGE(context, "GetShapeInfo error"), return ge::GRAPH_FAILED); |
| 129 | - OP_LOGE(context, "GetShapeInfo error"), return ge::GRAPH_FAILED); | ||
| 130 | 125 | ||
| 131 | - OP_CHECK_IF( | 126 | + OP_CHECK_IF(GetWorkspaceSize(context) != ge::GRAPH_SUCCESS, OP_LOGE(context, "GetWorkspaceSize error"), |
| 132 | - GetWorkspaceSize(context) != ge::GRAPH_SUCCESS, | 127 | + return ge::GRAPH_FAILED); |
| 133 | - OP_LOGE(context, "GetWorkspaceSize error"), return ge::GRAPH_FAILED); | ||
| 134 | 128 | ||
| 135 | int64_t totalRows = outerDims * H; | 129 | int64_t totalRows = outerDims * H; |
| 136 | int32_t pairsPerRow = (static_cast<int32_t>(W) + 1) / 2; | 130 | int32_t pairsPerRow = (static_cast<int32_t>(W) + 1) / 2; |
| @@ -138,30 +132,27 @@ static ge::graphStatus Rgb2yuv422TilingFunc(gert::TilingContext* context) | |||
| 138 | if (totalRows <= 0 || W <= 0) { | 132 | if (totalRows <= 0 || W <= 0) { |
| 139 | Rgb2yuv422TilingData* tiling = context->GetTilingData<Rgb2yuv422TilingData>(); | 133 | Rgb2yuv422TilingData* tiling = context->GetTilingData<Rgb2yuv422TilingData>(); |
| 140 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 134 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 141 | - OP_CHECK_IF( | 135 | + OP_CHECK_IF(memset_s(tiling, sizeof(Rgb2yuv422TilingData), 0, sizeof(Rgb2yuv422TilingData)) != EOK, |
| 142 | - memset_s(tiling, sizeof(Rgb2yuv422TilingData), 0, sizeof(Rgb2yuv422TilingData)) != EOK, | 136 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 143 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | ||
| 144 | 137 | ||
| 145 | tiling->needCoreNum = 1; | 138 | tiling->needCoreNum = 1; |
| 146 | - tiling->totalRows = 0; | 139 | + tiling->totalRows = 0; |
| 147 | tiling->perCoreRows = 0; | 140 | tiling->perCoreRows = 0; |
| 148 | - tiling->W = static_cast<int32_t>(W); | 141 | + tiling->W = static_cast<int32_t>(W); |
| 149 | - tiling->outerDims = static_cast<int32_t>(outerDims); | 142 | + tiling->outerDims = static_cast<int32_t>(outerDims); |
| 150 | - tiling->dataFormat = (std::string(dataFormat) == "NCHW") ? 1 : 0; | 143 | + tiling->dataFormat = (std::string(dataFormat) == "NCHW") ? 1 : 0; |
| 151 | tiling->pairsPerRow = pairsPerRow; | 144 | tiling->pairsPerRow = pairsPerRow; |
| 152 | 145 | ||
| 153 | context->SetBlockDim(1); | 146 | context->SetBlockDim(1); |
| 154 | - uint64_t tilingKey = (std::string(dataFormat) == "NCHW") | 147 | + uint64_t tilingKey = (std::string(dataFormat) == "NCHW") ? GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NCHW) : |
| 155 | - ? GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NCHW) | 148 | + GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NHWC); |
| 156 | - : GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NHWC); | ||
| 157 | context->SetTilingKey(tilingKey); | 149 | context->SetTilingKey(tilingKey); |
| 158 | 150 | ||
| 159 | OP_CHECK_IF((ubSize <= DCACHE_SIZE + STATIC_UB_ESTIMATE), | 151 | OP_CHECK_IF((ubSize <= DCACHE_SIZE + STATIC_UB_ESTIMATE), |
| 160 | - OP_LOGE(context, "ubSize %lu <= DCACHE_SIZE + STATIC_UB_ESTIMATE", ubSize), | 152 | + OP_LOGE(context, "ubSize %lu <= DCACHE_SIZE + STATIC_UB_ESTIMATE", ubSize), |
| 161 | - return ge::GRAPH_FAILED); | 153 | + return ge::GRAPH_FAILED); |
| 162 | auto res = context->SetLocalMemorySize(static_cast<uint32_t>(ubSize - DCACHE_SIZE - STATIC_UB_ESTIMATE)); | 154 | auto res = context->SetLocalMemorySize(static_cast<uint32_t>(ubSize - DCACHE_SIZE - STATIC_UB_ESTIMATE)); |
| 163 | - OP_CHECK_IF((res != ge::GRAPH_SUCCESS), | 155 | + OP_CHECK_IF((res != ge::GRAPH_SUCCESS), OP_LOGE(context, "SetLocalMemorySize failed"), return ge::GRAPH_FAILED); |
| 164 | - OP_LOGE(context, "SetLocalMemorySize failed"), return ge::GRAPH_FAILED); | ||
| 165 | return ge::GRAPH_SUCCESS; | 156 | return ge::GRAPH_SUCCESS; |
| 166 | } | 157 | } |
| 167 | 158 | ||
| @@ -177,33 +168,31 @@ static ge::graphStatus Rgb2yuv422TilingFunc(gert::TilingContext* context) | |||
| 177 | 168 | ||
| 178 | Rgb2yuv422TilingData* tiling = context->GetTilingData<Rgb2yuv422TilingData>(); | 169 | Rgb2yuv422TilingData* tiling = context->GetTilingData<Rgb2yuv422TilingData>(); |
| 179 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 170 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 180 | - OP_CHECK_IF( | 171 | + OP_CHECK_IF(memset_s(tiling, sizeof(Rgb2yuv422TilingData), 0, sizeof(Rgb2yuv422TilingData)) != EOK, |
| 181 | - memset_s(tiling, sizeof(Rgb2yuv422TilingData), 0, sizeof(Rgb2yuv422TilingData)) != EOK, | 172 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 182 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | ||
| 183 | 173 | ||
| 184 | int32_t dataFmt = (std::string(dataFormat) == "NCHW") ? 1 : 0; | 174 | int32_t dataFmt = (std::string(dataFormat) == "NCHW") ? 1 : 0; |
| 185 | 175 | ||
| 186 | tiling->needCoreNum = needCoreNum; | 176 | tiling->needCoreNum = needCoreNum; |
| 187 | - tiling->totalRows = totalRows; | 177 | + tiling->totalRows = totalRows; |
| 188 | tiling->perCoreRows = perCoreRows; | 178 | tiling->perCoreRows = perCoreRows; |
| 189 | - tiling->W = static_cast<int32_t>(W); | 179 | + tiling->W = static_cast<int32_t>(W); |
| 190 | - tiling->outerDims = static_cast<int32_t>(outerDims); | 180 | + tiling->outerDims = static_cast<int32_t>(outerDims); |
| 191 | - tiling->dataFormat = dataFmt; | 181 | + tiling->dataFormat = dataFmt; |
| 192 | tiling->pairsPerRow = pairsPerRow; | 182 | tiling->pairsPerRow = pairsPerRow; |
| 193 | 183 | ||
| 194 | context->SetBlockDim(needCoreNum); | 184 | context->SetBlockDim(needCoreNum); |
| 195 | - uint64_t tilingKey = (dataFmt == 0) ? GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NHWC) | 185 | + uint64_t tilingKey = (dataFmt == 0) ? GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NHWC) : |
| 196 | - : GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NCHW); | 186 | + GET_TPL_TILING_KEY(RGB2YUV422_TPL_SCH_MODE_NCHW); |
| 197 | context->SetTilingKey(tilingKey); | 187 | context->SetTilingKey(tilingKey); |
| 198 | 188 | ||
| 199 | OP_CHECK_IF((ubSize <= DCACHE_SIZE + STATIC_UB_ESTIMATE), | 189 | OP_CHECK_IF((ubSize <= DCACHE_SIZE + STATIC_UB_ESTIMATE), |
| 200 | - OP_LOGE(context, "ubSize %lu <= DCACHE_SIZE + STATIC_UB_ESTIMATE", ubSize), | 190 | + OP_LOGE(context, "ubSize %lu <= DCACHE_SIZE + STATIC_UB_ESTIMATE", ubSize), return ge::GRAPH_FAILED); |
| 201 | - return ge::GRAPH_FAILED); | ||
| 202 | auto res = context->SetLocalMemorySize(static_cast<uint32_t>(ubSize - DCACHE_SIZE - STATIC_UB_ESTIMATE)); | 191 | auto res = context->SetLocalMemorySize(static_cast<uint32_t>(ubSize - DCACHE_SIZE - STATIC_UB_ESTIMATE)); |
| 203 | OP_CHECK_IF((res != ge::GRAPH_SUCCESS), | 192 | OP_CHECK_IF((res != ge::GRAPH_SUCCESS), |
| 204 | - OP_LOGE(context, "SetLocalMemorySize failed, ubSize=%lu, DCACHE_SIZE=%u, STATIC_UB_ESTIMATE=%u", | 193 | + OP_LOGE(context, "SetLocalMemorySize failed, ubSize=%lu, DCACHE_SIZE=%u, STATIC_UB_ESTIMATE=%u", ubSize, |
| 205 | - ubSize, DCACHE_SIZE, STATIC_UB_ESTIMATE), | 194 | + DCACHE_SIZE, STATIC_UB_ESTIMATE), |
| 206 | - return ge::GRAPH_FAILED); | 195 | + return ge::GRAPH_FAILED); |
| 207 | 196 | ||
| 208 | return ge::GRAPH_SUCCESS; | 197 | return ge::GRAPH_SUCCESS; |
| 209 | } | 198 | } |
| @@ -213,7 +202,5 @@ static ge::graphStatus TilingParseForRgb2yuv422([[maybe_unused]] gert::TilingPar | |||
| 213 | return ge::GRAPH_SUCCESS; | 202 | return ge::GRAPH_SUCCESS; |
| 214 | } | 203 | } |
| 215 | 204 | ||
| 216 | -IMPL_OP_OPTILING(Rgb2yuv422) | 205 | +IMPL_OP_OPTILING(Rgb2yuv422).Tiling(Rgb2yuv422TilingFunc).TilingParse<Rgb2yuv422CompileInfo>(TilingParseForRgb2yuv422); |
| 217 | - .Tiling(Rgb2yuv422TilingFunc) | ||
| 218 | - .TilingParse<Rgb2yuv422CompileInfo>(TilingParseForRgb2yuv422); | ||
| 219 | } // namespace optiling | 206 | } // namespace optiling |
| @@ -26,8 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | namespace optiling { | 27 | namespace optiling { |
| 28 | 28 | ||
| 29 | - | ||
| 30 | - | ||
| 31 | constexpr uint32_t DCACHE_SIZE = 128 * 1024; | 29 | constexpr uint32_t DCACHE_SIZE = 128 * 1024; |
| 32 | constexpr uint32_t STATIC_UB_ESTIMATE = 0; | 30 | constexpr uint32_t STATIC_UB_ESTIMATE = 0; |
| 33 | constexpr int64_t PER_CORE_MIN = 1024; | 31 | constexpr int64_t PER_CORE_MIN = 1024; |
| @@ -53,13 +51,12 @@ static ge::graphStatus GetShapeInfo(gert::TilingContext* context, int64_t& h, in | |||
| 53 | auto storageShape = inputShape->GetStorageShape(); | 51 | auto storageShape = inputShape->GetStorageShape(); |
| 54 | 52 | ||
| 55 | OP_CHECK_IF(storageShape.GetDimNum() != 3, | 53 | OP_CHECK_IF(storageShape.GetDimNum() != 3, |
| 56 | - OP_LOGE(context, "Input must be 3D (h, w, 4), got %zu dims", storageShape.GetDimNum()), | 54 | + OP_LOGE(context, "Input must be 3D (h, w, 4), got %zu dims", storageShape.GetDimNum()), |
| 57 | - return ge::GRAPH_FAILED); | 55 | + return ge::GRAPH_FAILED); |
| 58 | 56 | ||
| 59 | int64_t channels = storageShape.GetDim(2); | 57 | int64_t channels = storageShape.GetDim(2); |
| 60 | - OP_CHECK_IF(channels != 4, | 58 | + OP_CHECK_IF(channels != 4, OP_LOGE(context, "Input channels must be 4, got %ld", channels), |
| 61 | - OP_LOGE(context, "Input channels must be 4, got %ld", channels), | 59 | + return ge::GRAPH_FAILED); |
| 62 | - return ge::GRAPH_FAILED); | ||
| 63 | 60 | ||
| 64 | h = storageShape.GetDim(0); | 61 | h = storageShape.GetDim(0); |
| 65 | w = storageShape.GetDim(1); | 62 | w = storageShape.GetDim(1); |
| @@ -84,21 +81,15 @@ static ge::graphStatus Yuv444ToYuv422TilingFunc(gert::TilingContext* context) | |||
| 84 | { | 81 | { |
| 85 | uint64_t ubSize; | 82 | uint64_t ubSize; |
| 86 | int64_t maxCoreNum; | 83 | int64_t maxCoreNum; |
| 87 | - OP_CHECK_IF( | 84 | + OP_CHECK_IF(GetPlatformInfo(context, ubSize, maxCoreNum) != ge::GRAPH_SUCCESS, |
| 88 | - GetPlatformInfo(context, ubSize, maxCoreNum) != ge::GRAPH_SUCCESS, | 85 | + OP_LOGE(context, "GetPlatformInfo error"), return ge::GRAPH_FAILED); |
| 89 | - OP_LOGE(context, "GetPlatformInfo error"), | ||
| 90 | - return ge::GRAPH_FAILED); | ||
| 91 | 86 | ||
| 92 | int64_t h, w, totalPairs; | 87 | int64_t h, w, totalPairs; |
| 93 | - OP_CHECK_IF( | 88 | + OP_CHECK_IF(GetShapeInfo(context, h, w, totalPairs) != ge::GRAPH_SUCCESS, OP_LOGE(context, "GetShapeInfo error"), |
| 94 | - GetShapeInfo(context, h, w, totalPairs) != ge::GRAPH_SUCCESS, | 89 | + return ge::GRAPH_FAILED); |
| 95 | - OP_LOGE(context, "GetShapeInfo error"), | ||
| 96 | - return ge::GRAPH_FAILED); | ||
| 97 | 90 | ||
| 98 | - OP_CHECK_IF( | 91 | + OP_CHECK_IF(GetWorkspaceSize(context) != ge::GRAPH_SUCCESS, OP_LOGE(context, "GetWorkspaceSize error"), |
| 99 | - GetWorkspaceSize(context) != ge::GRAPH_SUCCESS, | 92 | + return ge::GRAPH_FAILED); |
| 100 | - OP_LOGE(context, "GetWorkspaceSize error"), | ||
| 101 | - return ge::GRAPH_FAILED); | ||
| 102 | 93 | ||
| 103 | int64_t perCorePairs = Ops::Base::CeilDiv(totalPairs, maxCoreNum); | 94 | int64_t perCorePairs = Ops::Base::CeilDiv(totalPairs, maxCoreNum); |
| 104 | if (perCorePairs < PER_CORE_MIN) { | 95 | if (perCorePairs < PER_CORE_MIN) { |
| @@ -108,10 +99,8 @@ static ge::graphStatus Yuv444ToYuv422TilingFunc(gert::TilingContext* context) | |||
| 108 | 99 | ||
| 109 | Yuv444ToYuv422TilingData* tiling = context->GetTilingData<Yuv444ToYuv422TilingData>(); | 100 | Yuv444ToYuv422TilingData* tiling = context->GetTilingData<Yuv444ToYuv422TilingData>(); |
| 110 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 101 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 111 | - OP_CHECK_IF( | 102 | + OP_CHECK_IF(memset_s(tiling, sizeof(Yuv444ToYuv422TilingData), 0, sizeof(Yuv444ToYuv422TilingData)) != EOK, |
| 112 | - memset_s(tiling, sizeof(Yuv444ToYuv422TilingData), 0, sizeof(Yuv444ToYuv422TilingData)) != EOK, | 103 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 113 | - OP_LOGE(context, "set tiling data error"), | ||
| 114 | - return ge::GRAPH_FAILED); | ||
| 115 | 104 | ||
| 116 | tiling->totalPairs = totalPairs; | 105 | tiling->totalPairs = totalPairs; |
| 117 | tiling->h = h; | 106 | tiling->h = h; |
| @@ -122,13 +111,12 @@ static ge::graphStatus Yuv444ToYuv422TilingFunc(gert::TilingContext* context) | |||
| 122 | context->SetTilingKey(GET_TPL_TILING_KEY(YUV444_TO_YUV422_TPL_SCH_MODE_0)); | 111 | context->SetTilingKey(GET_TPL_TILING_KEY(YUV444_TO_YUV422_TPL_SCH_MODE_0)); |
| 123 | 112 | ||
| 124 | OP_CHECK_IF((ubSize <= DCACHE_SIZE + STATIC_UB_ESTIMATE), | 113 | OP_CHECK_IF((ubSize <= DCACHE_SIZE + STATIC_UB_ESTIMATE), |
| 125 | - OP_LOGE(context, "ubSize %lu <= DCACHE_SIZE + STATIC_UB_ESTIMATE", ubSize), | 114 | + OP_LOGE(context, "ubSize %lu <= DCACHE_SIZE + STATIC_UB_ESTIMATE", ubSize), return ge::GRAPH_FAILED); |
| 126 | - return ge::GRAPH_FAILED); | ||
| 127 | auto res = context->SetLocalMemorySize(static_cast<uint32_t>(ubSize - DCACHE_SIZE - STATIC_UB_ESTIMATE)); | 115 | auto res = context->SetLocalMemorySize(static_cast<uint32_t>(ubSize - DCACHE_SIZE - STATIC_UB_ESTIMATE)); |
| 128 | OP_CHECK_IF((res != ge::GRAPH_SUCCESS), | 116 | OP_CHECK_IF((res != ge::GRAPH_SUCCESS), |
| 129 | - OP_LOGE(context, "SetLocalMemorySize failed, ubSize=%lu, DCACHE_SIZE=%u, STATIC_UB_ESTIMATE=%u", | 117 | + OP_LOGE(context, "SetLocalMemorySize failed, ubSize=%lu, DCACHE_SIZE=%u, STATIC_UB_ESTIMATE=%u", ubSize, |
| 130 | - ubSize, DCACHE_SIZE, STATIC_UB_ESTIMATE), | 118 | + DCACHE_SIZE, STATIC_UB_ESTIMATE), |
| 131 | - return ge::GRAPH_FAILED); | 119 | + return ge::GRAPH_FAILED); |
| 132 | 120 | ||
| 133 | return ge::GRAPH_SUCCESS; | 121 | return ge::GRAPH_SUCCESS; |
| 134 | } | 122 | } |
| @@ -138,5 +126,7 @@ static ge::graphStatus TilingParseForYuv444ToYuv422([[maybe_unused]] gert::Tilin | |||
| 138 | return ge::GRAPH_SUCCESS; | 126 | return ge::GRAPH_SUCCESS; |
| 139 | } | 127 | } |
| 140 | 128 | ||
| 141 | -IMPL_OP_OPTILING(Yuv444ToYuv422).Tiling(Yuv444ToYuv422TilingFunc).TilingParse<Yuv444ToYuv422CompileInfo>(TilingParseForYuv444ToYuv422); | 129 | +IMPL_OP_OPTILING(Yuv444ToYuv422) |
| 130 | + .Tiling(Yuv444ToYuv422TilingFunc) | ||
| 131 | + .TilingParse<Yuv444ToYuv422CompileInfo>(TilingParseForYuv444ToYuv422); | ||
| 142 | } // namespace optiling | 132 | } // namespace optiling |
| @@ -1,24 +1,11 @@ | |||
| 1 | /** | 1 | /** |
| 2 | - * This file is part of the OpenBOAT project at Harbin Institute of Technology (HIT) | 2 | + * Copyright (c) 2025 Huawei Technologies Co., Ltd. |
| 3 | - * and is contributed to the CANN Open Software. | 3 | + * This program is free software, you can redistribute it and/or modify it under the terms and conditions of |
| 4 | - * | 4 | + * CANN Open Software License Agreement Version 2.0 (the "License"). |
| 5 | - * Copyright (c) 2025 AISS Group, Harbin Institute of Technology (HIT). | 5 | + * Please refer to the License for details. You may not use this file except in compliance with the License. |
| 6 | - * All Rights Reserved. | 6 | + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 7 | - * | ||
| 8 | - # Authors (accounts): | ||
| 9 | - # - Liu Jun <@kbryantttt> | ||
| 10 | - # - Tu Yuanhang <@TuYHAAAAAA> | ||
| 11 | - # - Zhou Jianhua<@LePenseur> | ||
| 12 | - # - Liang Yanglin <@liang-yanglin> | ||
| 13 | - # - Su Tonghua <@sutonghua> | ||
| 14 | - * | ||
| 15 | - * This program is free software: you can redistribute it and/or modify it. | ||
| 16 | - * Licensed under the CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 17 | - * You may not use this file except in compliance with the License. | ||
| 18 | - * See the LICENSE file at the root of the repository for the full text of the License. | ||
| 19 | - * | ||
| 20 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, | ||
| 21 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | + * See LICENSE in the root of the software repository for the full text of the License. | ||
| 22 | */ | 9 | */ |
| 23 | 10 | ||
| 24 | /*! | 11 | /*! |
| @@ -74,7 +61,7 @@ static ge::graphStatus RoiAlignV2TilingFunc(gert::TilingContext* context) | |||
| 74 | RoiAlignV2TilingData* tiling = context->GetTilingData<RoiAlignV2TilingData>(); | 61 | RoiAlignV2TilingData* tiling = context->GetTilingData<RoiAlignV2TilingData>(); |
| 75 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 62 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 76 | OP_CHECK_IF(memset_s(tiling, sizeof(RoiAlignV2TilingData), 0, sizeof(RoiAlignV2TilingData)) != EOK, | 63 | OP_CHECK_IF(memset_s(tiling, sizeof(RoiAlignV2TilingData), 0, sizeof(RoiAlignV2TilingData)) != EOK, |
| 77 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 64 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 78 | auto features_shape = context->GetInputShape(0)->GetStorageShape(); | 65 | auto features_shape = context->GetInputShape(0)->GetStorageShape(); |
| 79 | auto rois_shape = context->GetInputShape(1)->GetStorageShape(); | 66 | auto rois_shape = context->GetInputShape(1)->GetStorageShape(); |
| 80 | 67 | ||
| @@ -181,7 +181,7 @@ inline std::uint32_t ComputeAdjustSaturation(const CpuKernelContext& ctx) | |||
| 181 | { | 181 | { |
| 182 | std::uint32_t result{ComputeAdjustSaturationKernel<T>(ctx)}; | 182 | std::uint32_t result{ComputeAdjustSaturationKernel<T>(ctx)}; |
| 183 | if (result != KERNEL_STATUS_OK) { | 183 | if (result != KERNEL_STATUS_OK) { |
| 184 | - KERNEL_LOG_ERROR("AdjustSaturation compute failed."); | 184 | + KERNEL_LOG_ERROR("AdjustSaturation computation failed."); |
| 185 | } | 185 | } |
| 186 | return result; | 186 | return result; |
| 187 | } | 187 | } |
| @@ -125,7 +125,7 @@ ge::graphStatus AippTiling::GetShapeAttrsInfo() | |||
| 125 | OP_LOGI(context_->GetNodeName(), "aippConfigData is: %s", configData); | 125 | OP_LOGI(context_->GetNodeName(), "aippConfigData is: %s", configData); |
| 126 | aippCfg = parseAippConfig(configData); | 126 | aippCfg = parseAippConfig(configData); |
| 127 | } else { | 127 | } else { |
| 128 | - OP_LOGI(context_->GetNodeName(), "aippConfigPath is: %s", configData); | 128 | + OP_LOGI(context_->GetNodeName(), "aippConfigPath is: %s", "config_path"); |
| 129 | if (parseAippCfgFromPath(configData, aippCfg) == ge::GRAPH_FAILED) { | 129 | if (parseAippCfgFromPath(configData, aippCfg) == ge::GRAPH_FAILED) { |
| 130 | return ge::GRAPH_FAILED; | 130 | return ge::GRAPH_FAILED; |
| 131 | } | 131 | } |
| @@ -1005,4 +1005,4 @@ static ge::graphStatus TilingPrepareForAipp(gert::TilingParseContext* context) | |||
| 1005 | REGISTER_TILING_TEMPLATE("Aipp", AippTiling, 1000); | 1005 | REGISTER_TILING_TEMPLATE("Aipp", AippTiling, 1000); |
| 1006 | 1006 | ||
| 1007 | IMPL_OP_OPTILING(Aipp).Tiling(TilingForAipp).TilingParse<AippCompileInfo>(TilingPrepareForAipp); | 1007 | IMPL_OP_OPTILING(Aipp).Tiling(TilingForAipp).TilingParse<AippCompileInfo>(TilingPrepareForAipp); |
| 1008 | -} // namespace optiling | 1008 | +} // namespace optiling |
| @@ -155,7 +155,7 @@ static ge::graphStatus BlendFaceBgPartTwoTilingFunc(gert::TilingContext* context | |||
| 155 | BlendFaceBgPartTwoTilingData* tiling = context->GetTilingData<BlendFaceBgPartTwoTilingData>(); | 155 | BlendFaceBgPartTwoTilingData* tiling = context->GetTilingData<BlendFaceBgPartTwoTilingData>(); |
| 156 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 156 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 157 | OP_CHECK_IF(memset_s(tiling, sizeof(BlendFaceBgPartTwoTilingData), 0, sizeof(BlendFaceBgPartTwoTilingData)) != EOK, | 157 | OP_CHECK_IF(memset_s(tiling, sizeof(BlendFaceBgPartTwoTilingData), 0, sizeof(BlendFaceBgPartTwoTilingData)) != EOK, |
| 158 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 158 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 159 | tiling->epsilon = GetEpsilonAttr(context); | 159 | tiling->epsilon = GetEpsilonAttr(context); |
| 160 | 160 | ||
| 161 | // 5) 多核切分(每核至少 4KB,blockFormer 512 元素对齐) | 161 | // 5) 多核切分(每核至少 4KB,blockFormer 512 元素对齐) |
| @@ -221,7 +221,7 @@ static ge::graphStatus CropTilingFunc(gert::TilingContext* context) | |||
| 221 | CropTilingData* tiling = context->GetTilingData<CropTilingData>(); | 221 | CropTilingData* tiling = context->GetTilingData<CropTilingData>(); |
| 222 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 222 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 223 | OP_CHECK_IF(memset_s(tiling, sizeof(CropTilingData), 0, sizeof(CropTilingData)) != EOK, | 223 | OP_CHECK_IF(memset_s(tiling, sizeof(CropTilingData), 0, sizeof(CropTilingData)) != EOK, |
| 224 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 224 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 225 | 225 | ||
| 226 | FillTilingData(tiling, needCoreNum, totalElements, rank, static_cast<int32_t>(axis), xStridesArr, yStridesArr, | 226 | FillTilingData(tiling, needCoreNum, totalElements, rank, static_cast<int32_t>(axis), xStridesArr, yStridesArr, |
| 227 | offsetsArr, perCoreElements, tailElements); | 227 | offsetsArr, perCoreElements, tailElements); |
| @@ -168,7 +168,7 @@ static ge::graphStatus ComputeAndSetTiling(gert::TilingContext* context, const S | |||
| 168 | auto* tiling = context->GetTilingData<ExtractGlimpseV2TilingData>(); | 168 | auto* tiling = context->GetTilingData<ExtractGlimpseV2TilingData>(); |
| 169 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 169 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 170 | OP_CHECK_IF(memset_s(tiling, sizeof(ExtractGlimpseV2TilingData), 0, sizeof(ExtractGlimpseV2TilingData)) != EOK, | 170 | OP_CHECK_IF(memset_s(tiling, sizeof(ExtractGlimpseV2TilingData), 0, sizeof(ExtractGlimpseV2TilingData)) != EOK, |
| 171 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 171 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 172 | tiling->needCoreNum = needCoreNum; | 172 | tiling->needCoreNum = needCoreNum; |
| 173 | tiling->batchSize = info.batchSize; | 173 | tiling->batchSize = info.batchSize; |
| 174 | tiling->inputH = info.inputH; | 174 | tiling->inputH = info.inputH; |
| @@ -137,8 +137,8 @@ static bool CheckShape(const aclTensor* input, const aclTensor* grid, const aclT | |||
| 137 | } | 137 | } |
| 138 | if (gridShape.GetDim(SECOND_DIM) != outShape.GetDim(THIRD_DIM) || | 138 | if (gridShape.GetDim(SECOND_DIM) != outShape.GetDim(THIRD_DIM) || |
| 139 | gridShape.GetDim(THIRD_DIM) != outShape.GetDim(FOURTH_DIM)) { | 139 | gridShape.GetDim(THIRD_DIM) != outShape.GetDim(FOURTH_DIM)) { |
| 140 | - OP_LOGE(ACLNN_ERR_PARAM_INVALID, "expect grid and out to have same H and W size, but got grid with shape [%s] \ | 140 | + OP_LOGE(ACLNN_ERR_PARAM_INVALID, |
| 141 | - and out with shape [%s]", | 141 | + "expect grid and out to have same H and W size, but got grid with shape [%s] and out with shape [%s]", |
| 142 | op::ToString(gridShape).GetString(), op::ToString(outShape).GetString()); | 142 | op::ToString(gridShape).GetString(), op::ToString(outShape).GetString()); |
| 143 | return false; | 143 | return false; |
| 144 | } | 144 | } |
| @@ -352,4 +352,4 @@ aclnnStatus aclnnGridSampler2D(void* workspace, uint64_t workspaceSize, aclOpExe | |||
| 352 | 352 | ||
| 353 | 353 | ||
| 354 | } | 354 | } |
| 355 | -#endif | 355 | +#endif |
| @@ -171,8 +171,8 @@ static bool CheckShape(const aclTensor* input, const aclTensor* grid, const aclT | |||
| 171 | if ((gridShape.GetDim(SECOND_DIM) != outShape.GetDim(deepIndex)) || | 171 | if ((gridShape.GetDim(SECOND_DIM) != outShape.GetDim(deepIndex)) || |
| 172 | (gridShape.GetDim(THIRD_DIM) != outShape.GetDim(heightIndex)) || | 172 | (gridShape.GetDim(THIRD_DIM) != outShape.GetDim(heightIndex)) || |
| 173 | (gridShape.GetDim(FOURTH_DIM) != outShape.GetDim(widthIndex))) { | 173 | (gridShape.GetDim(FOURTH_DIM) != outShape.GetDim(widthIndex))) { |
| 174 | - OP_LOGE(ACLNN_ERR_PARAM_INVALID, "expect grid and out to have same D H W size, but got grid with shape [%s] \ | 174 | + OP_LOGE(ACLNN_ERR_PARAM_INVALID, |
| 175 | - and out with shape [%s]", | 175 | + "expect grid and out to have same D H W size, but got grid with shape [%s] and out with shape [%s]", |
| 176 | op::ToString(gridShape).GetString(), op::ToString(outShape).GetString()); | 176 | op::ToString(gridShape).GetString(), op::ToString(outShape).GetString()); |
| 177 | return false; | 177 | return false; |
| 178 | } | 178 | } |
| @@ -229,7 +229,7 @@ static ge::graphStatus GridSampler2dTilingFunc(gert::TilingContext* context) | |||
| 229 | GridSampler2DTilingData* tiling = context->GetTilingData<GridSampler2DTilingData>(); | 229 | GridSampler2DTilingData* tiling = context->GetTilingData<GridSampler2DTilingData>(); |
| 230 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 230 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 231 | OP_CHECK_IF(memset_s(tiling, sizeof(GridSampler2DTilingData), 0, sizeof(GridSampler2DTilingData)) != EOK, | 231 | OP_CHECK_IF(memset_s(tiling, sizeof(GridSampler2DTilingData), 0, sizeof(GridSampler2DTilingData)) != EOK, |
| 232 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 232 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 233 | 233 | ||
| 234 | int64_t totalPixels = N * HOut * WOut; | 234 | int64_t totalPixels = N * HOut * WOut; |
| 235 | 235 | ||
| @@ -606,7 +606,7 @@ static ge::graphStatus Tiling4GridSampler2DGrad(gert::TilingContext* tilingConte | |||
| 606 | availableUb, deterministic); | 606 | availableUb, deterministic); |
| 607 | } | 607 | } |
| 608 | OP_CHECK_IF(tilingData.get_ubFactorElement() <= 0, | 608 | OP_CHECK_IF(tilingData.get_ubFactorElement() <= 0, |
| 609 | - OP_LOGE(tilingContext->GetNodeName(), "ub space is not enough, please check input."), | 609 | + OP_LOGE(tilingContext->GetNodeName(), "ub space is insufficient, please check input."), |
| 610 | return ge::GRAPH_FAILED); | 610 | return ge::GRAPH_FAILED); |
| 611 | // set tilingdata | 611 | // set tilingdata |
| 612 | tilingContext->SetTilingKey(params.tilingKey); | 612 | tilingContext->SetTilingKey(params.tilingKey); |
| @@ -646,4 +646,4 @@ IMPL_OP_OPTILING(GridSampler2DGrad) | |||
| 646 | .Tiling(Tiling4GridSampler2DGrad) | 646 | .Tiling(Tiling4GridSampler2DGrad) |
| 647 | .TilingParse<Tiling4GridSampler2DGradCompileInfo>(TilingPrepare4GridSampler2DGrad); | 647 | .TilingParse<Tiling4GridSampler2DGradCompileInfo>(TilingPrepare4GridSampler2DGrad); |
| 648 | 648 | ||
| 649 | -} // namespace optiling | 649 | +} // namespace optiling |
| @@ -128,8 +128,9 @@ static bool CheckShape(const aclTensor* gradOutput, const aclTensor* input, cons | |||
| 128 | OP_CHECK_WRONG_DIMENSION(gradOutput, SPATIAL_DIM_NUM, return false); | 128 | OP_CHECK_WRONG_DIMENSION(gradOutput, SPATIAL_DIM_NUM, return false); |
| 129 | if (inputShape.GetDim(FIRST_DIM) != gridShape.GetDim(FIRST_DIM) || | 129 | if (inputShape.GetDim(FIRST_DIM) != gridShape.GetDim(FIRST_DIM) || |
| 130 | inputShape.GetDim(FIRST_DIM) != gradOutputShape.GetDim(FIRST_DIM)) { | 130 | inputShape.GetDim(FIRST_DIM) != gradOutputShape.GetDim(FIRST_DIM)) { |
| 131 | - OP_LOGE(ACLNN_ERR_PARAM_INVALID, "expect input grid and gradOutput to have same batch size, but got input with \ | 131 | + OP_LOGE(ACLNN_ERR_PARAM_INVALID, |
| 132 | - shape [%s] grid with shape [%s] and gradOutput with shape [%s]", | 132 | + "expect input grid and gradOutput to have same batch size, but got input with shape [%s] grid with " |
| 133 | + "shape [%s] and gradOutput with shape [%s]", | ||
| 133 | op::ToString(inputShape).GetString(), op::ToString(gridShape).GetString(), | 134 | op::ToString(inputShape).GetString(), op::ToString(gridShape).GetString(), |
| 134 | op::ToString(gradOutputShape).GetString()); | 135 | op::ToString(gradOutputShape).GetString()); |
| 135 | return false; | 136 | return false; |
| @@ -358,4 +359,4 @@ aclnnStatus aclnnGridSampler2DBackward(void* workspace, uint64_t workspaceSize, | |||
| 358 | 359 | ||
| 359 | 360 | ||
| 360 | } | 361 | } |
| 361 | -#endif | 362 | +#endif |
| @@ -164,7 +164,7 @@ static ge::graphStatus Lut3DTilingFunc(gert::TilingContext* context) | |||
| 164 | Lut3DTilingData* tiling = context->GetTilingData<Lut3DTilingData>(); | 164 | Lut3DTilingData* tiling = context->GetTilingData<Lut3DTilingData>(); |
| 165 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 165 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 166 | OP_CHECK_IF(memset_s(tiling, sizeof(Lut3DTilingData), 0, sizeof(Lut3DTilingData)) != EOK, | 166 | OP_CHECK_IF(memset_s(tiling, sizeof(Lut3DTilingData), 0, sizeof(Lut3DTilingData)) != EOK, |
| 167 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 167 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 168 | tiling->totalPixels = totalPixels; | 168 | tiling->totalPixels = totalPixels; |
| 169 | tiling->lutN = static_cast<int32_t>(lutN); | 169 | tiling->lutN = static_cast<int32_t>(lutN); |
| 170 | 170 | ||
| @@ -72,7 +72,7 @@ ge::graphStatus NMSWithMaskRegbaseTiling::CheckOutputShape() | |||
| 72 | return ge::GRAPH_FAILED); | 72 | return ge::GRAPH_FAILED); |
| 73 | OP_CHECK_IF( | 73 | OP_CHECK_IF( |
| 74 | selectedBoxesShape.GetDim(INDEX_ZERO) != boxesNum_, | 74 | selectedBoxesShape.GetDim(INDEX_ZERO) != boxesNum_, |
| 75 | - OP_LOGE(tilingContext_, "Output selected_boxes' first dim must be equal to box_scores' first dim, got :%lu.", | 75 | + OP_LOGE(tilingContext_, "Output selected_boxes' first dim must be equal to box_scores' first dim, got :%lu.", |
| 76 | selectedBoxesShape.GetDim(INDEX_ZERO)), | 76 | selectedBoxesShape.GetDim(INDEX_ZERO)), |
| 77 | return ge::GRAPH_FAILED); | 77 | return ge::GRAPH_FAILED); |
| 78 | OP_CHECK_IF(selectedBoxesShape.GetDim(INDEX_ONE) != ELEMENT_NUM, | 78 | OP_CHECK_IF(selectedBoxesShape.GetDim(INDEX_ONE) != ELEMENT_NUM, |
| @@ -268,4 +268,4 @@ static ge::graphStatus Tiling4NMSWithMask(gert::TilingContext* context) | |||
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | IMPL_OP_OPTILING(NMSWithMask).Tiling(Tiling4NMSWithMask).TilingParse<NMSWithMaskCompileInfo>(TilingPrepare4NMSWithMask); | 270 | IMPL_OP_OPTILING(NMSWithMask).Tiling(Tiling4NMSWithMask).TilingParse<NMSWithMaskCompileInfo>(TilingPrepare4NMSWithMask); |
| 271 | -} // namespace optiling | 271 | +} // namespace optiling |
| @@ -262,7 +262,7 @@ uint32_t NonMaxSuppressionV3CpuKernel::Compute(CpuKernelContext& ctx) | |||
| 262 | res = DoCompute<float, float>(); | 262 | res = DoCompute<float, float>(); |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | - KERNEL_CHECK_FALSE((res == KERNEL_STATUS_OK), res, "Compute failed."); | 265 | + KERNEL_CHECK_FALSE((res == KERNEL_STATUS_OK), res, "Computation failed."); |
| 266 | 266 | ||
| 267 | KERNEL_LOG_INFO("Compute end!!"); | 267 | KERNEL_LOG_INFO("Compute end!!"); |
| 268 | return KERNEL_STATUS_OK; | 268 | return KERNEL_STATUS_OK; |
| @@ -314,8 +314,9 @@ int64_t ResizeNearestNeighborV2AscendCTilingImpl::CalcUnitWCountPerUB(int64_t un | |||
| 314 | int64_t unitLocationBytes = Ops::Base::CeilAlign(static_cast<int64_t>(1 * GetSizeByDataType(ge::DT_FLOAT)), | 314 | int64_t unitLocationBytes = Ops::Base::CeilAlign(static_cast<int64_t>(1 * GetSizeByDataType(ge::DT_FLOAT)), |
| 315 | ubBlockSize_); | 315 | ubBlockSize_); |
| 316 | int64_t unitWTotalBytes = unitDesWBytes + unitSrcBytes + unitLocationBytes; | 316 | int64_t unitWTotalBytes = unitDesWBytes + unitSrcBytes + unitLocationBytes; |
| 317 | - OP_LOGI(context_->GetNodeName(), "CalcUnitWCountPerUB: srcWFactor: %ld, srcHFactor: %ld, \ | 317 | + OP_LOGI(context_->GetNodeName(), |
| 318 | - unitDesWBytes: %ld, unitSrcBytes: %ld, unitLocationBytes: %ld", | 318 | + "CalcUnitWCountPerUB: srcWFactor: %ld, srcHFactor: %ld, unitDesWBytes: %ld, unitSrcBytes: %ld, " |
| 319 | + "unitLocationBytes: %ld", | ||
| 319 | procUnitSrcWCount, unitSrcHCount, unitDesWBytes, unitSrcBytes, unitLocationBytes); | 320 | procUnitSrcWCount, unitSrcHCount, unitDesWBytes, unitSrcBytes, unitLocationBytes); |
| 320 | return Ops::Base::FloorDiv((ubSize_ - ubBlockSize_) / NUM_2, unitWTotalBytes); | 321 | return Ops::Base::FloorDiv((ubSize_ - ubBlockSize_) / NUM_2, unitWTotalBytes); |
| 321 | } | 322 | } |
| @@ -516,7 +517,7 @@ bool ResizeNearestNeighborV2AscendCTilingImpl::IsMatchTiling_NCHW_Gather() | |||
| 516 | int32_t dstWUb = lenDesWAlign_ * dtypeSize_ * NUM_2; | 517 | int32_t dstWUb = lenDesWAlign_ * dtypeSize_ * NUM_2; |
| 517 | int32_t srcWUb = lenSrcWAlign_ * dtypeSize_ * NUM_2; | 518 | int32_t srcWUb = lenSrcWAlign_ * dtypeSize_ * NUM_2; |
| 518 | int32_t leastUb = idsUbSize + dstWUb + srcWUb + ubBlockSize_ * NUM_2; | 519 | int32_t leastUb = idsUbSize + dstWUb + srcWUb + ubBlockSize_ * NUM_2; |
| 519 | - OP_CHECK_IF(leastUb > ubSize_, OP_LOGI(context_->GetNodeName(), "ub is not enough"), return false); | 520 | + OP_CHECK_IF(leastUb > ubSize_, OP_LOGI(context_->GetNodeName(), "ub is insufficient"), return false); |
| 520 | return true; | 521 | return true; |
| 521 | } | 522 | } |
| 522 | 523 | ||
| @@ -652,7 +653,7 @@ bool ResizeNearestNeighborV2AscendCTilingImpl::IsMatchTiling_NHWC_UB2UB() | |||
| 652 | OP_CHECK_IF((lenC_ * dtypeSize_ < MIN_C_SIZE) && (lenCAlign_ != lenC_), | 653 | OP_CHECK_IF((lenC_ * dtypeSize_ < MIN_C_SIZE) && (lenCAlign_ != lenC_), |
| 653 | OP_LOGI(context_->GetNodeName(), "c is not align and small"), return false); | 654 | OP_LOGI(context_->GetNodeName(), "c is not align and small"), return false); |
| 654 | int64_t needUb = (lenSrcW_ + lenDesW_) * lenCAlign_ * dtypeSize_ * NUM_2; | 655 | int64_t needUb = (lenSrcW_ + lenDesW_) * lenCAlign_ * dtypeSize_ * NUM_2; |
| 655 | - OP_CHECK_IF(needUb > ubSize_, OP_LOGI(context_->GetNodeName(), "ub is not enough"), return false); | 656 | + OP_CHECK_IF(needUb > ubSize_, OP_LOGI(context_->GetNodeName(), "ub is insufficient"), return false); |
| 656 | int64_t xSize = xShape_.GetShapeSize(); | 657 | int64_t xSize = xShape_.GetShapeSize(); |
| 657 | int64_t ySize = yShape_.GetShapeSize(); | 658 | int64_t ySize = yShape_.GetShapeSize(); |
| 658 | OP_CHECK_IF(xSize >= UINT32_MAX || ySize >= UINT32_MAX, | 659 | OP_CHECK_IF(xSize >= UINT32_MAX || ySize >= UINT32_MAX, |
| @@ -119,7 +119,7 @@ static ge::graphStatus FillTilingData(gert::TilingContext* context, int32_t need | |||
| 119 | Rgb2yuv422TilingData* tiling = context->GetTilingData<Rgb2yuv422TilingData>(); | 119 | Rgb2yuv422TilingData* tiling = context->GetTilingData<Rgb2yuv422TilingData>(); |
| 120 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 120 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 121 | OP_CHECK_IF(memset_s(tiling, sizeof(Rgb2yuv422TilingData), 0, sizeof(Rgb2yuv422TilingData)) != EOK, | 121 | OP_CHECK_IF(memset_s(tiling, sizeof(Rgb2yuv422TilingData), 0, sizeof(Rgb2yuv422TilingData)) != EOK, |
| 122 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 122 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 123 | 123 | ||
| 124 | tiling->needCoreNum = needCoreNum; | 124 | tiling->needCoreNum = needCoreNum; |
| 125 | tiling->totalRows = totalRows; | 125 | tiling->totalRows = totalRows; |
| @@ -25,14 +25,14 @@ const uint32_t kInputNum = 4; | |||
| 25 | constexpr int64_t kParallelDataNums = 1024; | 25 | constexpr int64_t kParallelDataNums = 1024; |
| 26 | const char* kScaleAndTranslate = "ScaleAndTranslate"; | 26 | const char* kScaleAndTranslate = "ScaleAndTranslate"; |
| 27 | 27 | ||
| 28 | -#define SCALEANDTRANSLATE_COMPUTE_CASE(DTYPE, TYPE, CTX) \ | 28 | +#define SCALEANDTRANSLATE_COMPUTE_CASE(DTYPE, TYPE, CTX) \ |
| 29 | - case (DTYPE): { \ | 29 | + case (DTYPE): { \ |
| 30 | - uint32_t result = ScaleAndTranslateCompute<TYPE>(CTX); \ | 30 | + uint32_t result = ScaleAndTranslateCompute<TYPE>(CTX); \ |
| 31 | - if (result != KERNEL_STATUS_OK) { \ | 31 | + if (result != KERNEL_STATUS_OK) { \ |
| 32 | - KERNEL_LOG_ERROR("ScaleAndTranslate kernel compute failed."); \ | 32 | + KERNEL_LOG_ERROR("ScaleAndTranslate kernel computation failed."); \ |
| 33 | - return result; \ | 33 | + return result; \ |
| 34 | - } \ | 34 | + } \ |
| 35 | - break; \ | 35 | + break; \ |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | 38 | ||
| @@ -42,7 +42,7 @@ const char* kScaleAndTranslate = "ScaleAndTranslate"; | |||
| 42 | } \ | 42 | } \ |
| 43 | } else { \ | 43 | } else { \ |
| 44 | KERNEL_HANDLE_ERROR(CpuKernelUtils::ParallelFor(ctx, end_num, 1, SHARD), \ | 44 | KERNEL_HANDLE_ERROR(CpuKernelUtils::ParallelFor(ctx, end_num, 1, SHARD), \ |
| 45 | - "ScaleAndTranslate #SHARD Compute failed.") \ | 45 | + "ScaleAndTranslate #SHARD computation failed.") \ |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | } // namespace | 48 | } // namespace |
| @@ -207,7 +207,7 @@ uint32_t ComputeSpansCore(CpuKernelContext& context, const Kernel& kernel, const | |||
| 207 | } else { | 207 | } else { |
| 208 | uint32_t parallelRet = CpuKernelUtils::ParallelFor(context, output_size, 1, shard_x); | 208 | uint32_t parallelRet = CpuKernelUtils::ParallelFor(context, output_size, 1, shard_x); |
| 209 | if (parallelRet != KERNEL_STATUS_OK) { | 209 | if (parallelRet != KERNEL_STATUS_OK) { |
| 210 | - KERNEL_LOG_ERROR("ScaleAndTranslate shard_x Compute failed."); | 210 | + KERNEL_LOG_ERROR("ScaleAndTranslate shard_x computation failed."); |
| 211 | delete spans->starts; | 211 | delete spans->starts; |
| 212 | delete spans->weights; | 212 | delete spans->weights; |
| 213 | spans->starts = nullptr; | 213 | spans->starts = nullptr; |
| @@ -424,7 +424,7 @@ uint32_t GatherColumns(CpuKernelContext& context, int spanSize, const int32_t* s | |||
| 424 | } else { | 424 | } else { |
| 425 | uint32_t ret = CpuKernelUtils::ParallelFor(context, dstHeight, 1, shardColumn); | 425 | uint32_t ret = CpuKernelUtils::ParallelFor(context, dstHeight, 1, shardColumn); |
| 426 | if (ret != KERNEL_STATUS_OK) { | 426 | if (ret != KERNEL_STATUS_OK) { |
| 427 | - KERNEL_LOG_ERROR("ScaleAndTranslate shardColumn Compute failed."); | 427 | + KERNEL_LOG_ERROR("ScaleAndTranslate shardColumn computation failed."); |
| 428 | return ret; | 428 | return ret; |
| 429 | } | 429 | } |
| 430 | } | 430 | } |
| @@ -470,7 +470,7 @@ uint32_t GatherRows(CpuKernelContext& context, int spanSize, const int32_t* star | |||
| 470 | } else { | 470 | } else { |
| 471 | uint32_t ret = CpuKernelUtils::ParallelFor(context, dstHeight, 1, shardRows); | 471 | uint32_t ret = CpuKernelUtils::ParallelFor(context, dstHeight, 1, shardRows); |
| 472 | if (ret != KERNEL_STATUS_OK) { | 472 | if (ret != KERNEL_STATUS_OK) { |
| 473 | - KERNEL_LOG_ERROR("ScaleAndTranslate shardRows Compute failed."); | 473 | + KERNEL_LOG_ERROR("ScaleAndTranslate shardRows computation failed."); |
| 474 | return ret; | 474 | return ret; |
| 475 | } | 475 | } |
| 476 | } | 476 | } |
| @@ -34,32 +34,32 @@ constexpr float kNumber2 = 2; | |||
| 34 | constexpr uint32_t kGridInedxOffset = 2; | 34 | constexpr uint32_t kGridInedxOffset = 2; |
| 35 | constexpr uint32_t kOutputNum = 1; | 35 | constexpr uint32_t kOutputNum = 1; |
| 36 | 36 | ||
| 37 | -#define STN_COMPUTE_CASE(DTYPE, TYPE, CTX) \ | 37 | +#define STN_COMPUTE_CASE(DTYPE, TYPE, CTX) \ |
| 38 | - case (DTYPE): { \ | 38 | + case (DTYPE): { \ |
| 39 | - if (DoCompute<TYPE>(CTX) != KERNEL_STATUS_OK) { \ | 39 | + if (DoCompute<TYPE>(CTX) != KERNEL_STATUS_OK) { \ |
| 40 | - KERNEL_LOG_ERROR("SpatialTransformer kernel compute failed."); \ | 40 | + KERNEL_LOG_ERROR("SpatialTransformer kernel computation failed."); \ |
| 41 | - return static_cast<uint32_t>(KERNEL_STATUS_INNER_ERROR); \ | 41 | + return static_cast<uint32_t>(KERNEL_STATUS_INNER_ERROR); \ |
| 42 | - } \ | 42 | + } \ |
| 43 | - break; \ | 43 | + break; \ |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | -#define STN_INNER_COMPUTE_CASE(DTYPE, TYPE, CTX) \ | 46 | +#define STN_INNER_COMPUTE_CASE(DTYPE, TYPE, CTX) \ |
| 47 | - case (DTYPE): { \ | 47 | + case (DTYPE): { \ |
| 48 | - uint32_t ret = static_cast<uint32_t>(KERNEL_STATUS_OK); \ | 48 | + uint32_t ret = static_cast<uint32_t>(KERNEL_STATUS_OK); \ |
| 49 | - if (date_format_ == FORMAT_NCHW) { \ | 49 | + if (date_format_ == FORMAT_NCHW) { \ |
| 50 | - ret = static_cast<uint32_t>(DoCompute4D<T, TYPE>()); \ | 50 | + ret = static_cast<uint32_t>(DoCompute4D<T, TYPE>()); \ |
| 51 | - } else if (date_format_ == FORMAT_NC1HWC0) { \ | 51 | + } else if (date_format_ == FORMAT_NC1HWC0) { \ |
| 52 | - if (stn_ori_channel_ == 1) { \ | 52 | + if (stn_ori_channel_ == 1) { \ |
| 53 | - ret = static_cast<uint32_t>(DoCompute5D_C1<T, TYPE>()); \ | 53 | + ret = static_cast<uint32_t>(DoCompute5D_C1<T, TYPE>()); \ |
| 54 | - } else { \ | 54 | + } else { \ |
| 55 | - ret = static_cast<uint32_t>(DoCompute5D<T, TYPE>()); \ | 55 | + ret = static_cast<uint32_t>(DoCompute5D<T, TYPE>()); \ |
| 56 | - } \ | 56 | + } \ |
| 57 | - } \ | 57 | + } \ |
| 58 | - if (ret != static_cast<uint32_t>(KERNEL_STATUS_OK)) { \ | 58 | + if (ret != static_cast<uint32_t>(KERNEL_STATUS_OK)) { \ |
| 59 | - KERNEL_LOG_ERROR("SpatialTransformer kernel compute failed."); \ | 59 | + KERNEL_LOG_ERROR("SpatialTransformer kernel computation failed."); \ |
| 60 | - return ret; \ | 60 | + return ret; \ |
| 61 | - } \ | 61 | + } \ |
| 62 | - break; \ | 62 | + break; \ |
| 63 | } | 63 | } |
| 64 | } // namespace | 64 | } // namespace |
| 65 | 65 | ||
| @@ -220,7 +220,7 @@ static ge::graphStatus ThreeInterpolateTilingFunc(gert::TilingContext* context) | |||
| 220 | ThreeInterpolateTilingData* tiling = context->GetTilingData<ThreeInterpolateTilingData>(); | 220 | ThreeInterpolateTilingData* tiling = context->GetTilingData<ThreeInterpolateTilingData>(); |
| 221 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 221 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 222 | OP_CHECK_IF(memset_s(tiling, sizeof(ThreeInterpolateTilingData), 0, sizeof(ThreeInterpolateTilingData)) != EOK, | 222 | OP_CHECK_IF(memset_s(tiling, sizeof(ThreeInterpolateTilingData), 0, sizeof(ThreeInterpolateTilingData)) != EOK, |
| 223 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 223 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 224 | 224 | ||
| 225 | tiling->bs = bs; | 225 | tiling->bs = bs; |
| 226 | tiling->ns = ns; | 226 | tiling->ns = ns; |
| @@ -140,7 +140,7 @@ ge::graphStatus TilingProcess(ThreeInterpolateBackwardTilingData& tiling_host, c | |||
| 140 | tiling_host.get_grad_x_move_block_size() + tiling_host.get_grad_y_move_block_size()) * | 140 | tiling_host.get_grad_x_move_block_size() + tiling_host.get_grad_y_move_block_size()) * |
| 141 | BLOCK_BYTE_SIZE; | 141 | BLOCK_BYTE_SIZE; |
| 142 | if (total_used_bytes > ub_platform_byte_size) { | 142 | if (total_used_bytes > ub_platform_byte_size) { |
| 143 | - OP_LOGD(context, "ub not enough."); | 143 | + OP_LOGD(context, "ub insufficient."); |
| 144 | return ge::GRAPH_FAILED; | 144 | return ge::GRAPH_FAILED; |
| 145 | } | 145 | } |
| 146 | return ge::GRAPH_SUCCESS; | 146 | return ge::GRAPH_SUCCESS; |
| @@ -237,7 +237,7 @@ static ge::graphStatus Tiling4ThreeInterpolateBackward(gert::TilingContext* cont | |||
| 237 | OP_CHECK_NULL_WITH_CONTEXT(context, grad_x_desc); | 237 | OP_CHECK_NULL_WITH_CONTEXT(context, grad_x_desc); |
| 238 | 238 | ||
| 239 | const auto& grad_x_format = static_cast<ge::Format>(ge::GetPrimaryFormat(grad_x_desc->GetStorageFormat())); | 239 | const auto& grad_x_format = static_cast<ge::Format>(ge::GetPrimaryFormat(grad_x_desc->GetStorageFormat())); |
| 240 | - OP_CHECK_IF(grad_x_format != ge::FORMAT_NC1HWC0, OP_LOGE(context, "input format error tiling failed."), | 240 | + OP_CHECK_IF(grad_x_format != ge::FORMAT_NC1HWC0, OP_LOGE(context, "input format invalid, tiling failed."), |
| 241 | return ge::GRAPH_FAILED); | 241 | return ge::GRAPH_FAILED); |
| 242 | 242 | ||
| 243 | auto idx_desc = context->GetInputDesc(INDEX_INPUT_IDX); | 243 | auto idx_desc = context->GetInputDesc(INDEX_INPUT_IDX); |
| @@ -162,7 +162,7 @@ ge::graphStatus Tiling4ThreeInterpolateBackwardRegbase(gert::TilingContext* cont | |||
| 162 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 162 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 163 | OP_CHECK_IF(memset_s(tiling, sizeof(ThreeInterpolateBackwardTilingData), 0, | 163 | OP_CHECK_IF(memset_s(tiling, sizeof(ThreeInterpolateBackwardTilingData), 0, |
| 164 | sizeof(ThreeInterpolateBackwardTilingData)) != EOK, | 164 | sizeof(ThreeInterpolateBackwardTilingData)) != EOK, |
| 165 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 165 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 166 | tiling->needCoreNum = needCoreNum; | 166 | tiling->needCoreNum = needCoreNum; |
| 167 | tiling->b = b; | 167 | tiling->b = b; |
| 168 | tiling->c = c; | 168 | tiling->c = c; |
| @@ -94,7 +94,7 @@ static bool CheckFormatValid(const aclTensor* self, const aclTensor* out) | |||
| 94 | 94 | ||
| 95 | OP_CHECK((out->GetStorageFormat() == op::Format::FORMAT_NCHW || | 95 | OP_CHECK((out->GetStorageFormat() == op::Format::FORMAT_NCHW || |
| 96 | out->GetStorageFormat() == op::Format::FORMAT_NHWC || out->GetStorageFormat() == op::Format::FORMAT_ND), | 96 | out->GetStorageFormat() == op::Format::FORMAT_NHWC || out->GetStorageFormat() == op::Format::FORMAT_ND), |
| 97 | - OP_LOGE(ACLNN_ERR_PARAM_INVALID, "The format must be NCHW、NHWC or ND"), return false); | 97 | + OP_LOGE(ACLNN_ERR_PARAM_INVALID, "The format must be NCHW, NHWC or ND"), return false); |
| 98 | return true; | 98 | return true; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| @@ -54,7 +54,7 @@ static ge::graphStatus GetPlatformInfo(gert::TilingContext* context, uint64_t& u | |||
| 54 | 54 | ||
| 55 | coreNum = ascendcPlatform.GetCoreNumAiv(); | 55 | coreNum = ascendcPlatform.GetCoreNumAiv(); |
| 56 | OP_CHECK_IF(coreNum == 0, OP_LOGE(context, "coreNum is 0"), return ge::GRAPH_FAILED); | 56 | OP_CHECK_IF(coreNum == 0, OP_LOGE(context, "coreNum is 0"), return ge::GRAPH_FAILED); |
| 57 | - | 57 | + |
| 58 | return ge::GRAPH_SUCCESS; | 58 | return ge::GRAPH_SUCCESS; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -155,7 +155,7 @@ static ge::graphStatus SetTilingAndCoreSplit(gert::TilingContext* context, int32 | |||
| 155 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 155 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 156 | OP_CHECK_IF(memset_s(tiling, sizeof(UpsampleBicubic2dRegBaseTilingData), 0, | 156 | OP_CHECK_IF(memset_s(tiling, sizeof(UpsampleBicubic2dRegBaseTilingData), 0, |
| 157 | sizeof(UpsampleBicubic2dRegBaseTilingData)) != EOK, | 157 | sizeof(UpsampleBicubic2dRegBaseTilingData)) != EOK, |
| 158 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 158 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 159 | 159 | ||
| 160 | int64_t totalElements = static_cast<int64_t>(batchSize) * channels * outputHeight * outputWidth; | 160 | int64_t totalElements = static_cast<int64_t>(batchSize) * channels * outputHeight * outputWidth; |
| 161 | tiling->totalElements = totalElements; | 161 | tiling->totalElements = totalElements; |
| @@ -86,7 +86,7 @@ static ge::graphStatus Upsample3dGradInferShapeImpl(gert::InferShapeContext* con | |||
| 86 | OP_CHECK_NULL_WITH_CONTEXT(context, attrs); | 86 | OP_CHECK_NULL_WITH_CONTEXT(context, attrs); |
| 87 | 87 | ||
| 88 | const gert::ContinuousVector* input_size = attrs->GetAttrPointer<gert::ContinuousVector>(INDEX_INPUT_SIZE); | 88 | const gert::ContinuousVector* input_size = attrs->GetAttrPointer<gert::ContinuousVector>(INDEX_INPUT_SIZE); |
| 89 | - OP_CHECK_IF(input_size == nullptr, OP_LOGE(context->GetNodeName(), "get attr::input_size faild!"), | 89 | + OP_CHECK_IF(input_size == nullptr, OP_LOGE(context->GetNodeName(), "get attr::input_size failed!"), |
| 90 | return ge::GRAPH_FAILED); | 90 | return ge::GRAPH_FAILED); |
| 91 | 91 | ||
| 92 | OP_CHECK_IF(input_size->GetSize() != SUPPORTED_DIM_NUM, | 92 | OP_CHECK_IF(input_size->GetSize() != SUPPORTED_DIM_NUM, |
| @@ -84,7 +84,7 @@ static ge::graphStatus Upsample3dGradInferShapeImpl(gert::InferShapeContext* con | |||
| 84 | OP_CHECK_NULL_WITH_CONTEXT(context, attrs); | 84 | OP_CHECK_NULL_WITH_CONTEXT(context, attrs); |
| 85 | 85 | ||
| 86 | const gert::ContinuousVector* input_size = attrs->GetAttrPointer<gert::ContinuousVector>(INDEX_INPUT_SIZE); | 86 | const gert::ContinuousVector* input_size = attrs->GetAttrPointer<gert::ContinuousVector>(INDEX_INPUT_SIZE); |
| 87 | - OP_CHECK_IF(input_size == nullptr, OP_LOGE(context->GetNodeName(), "Get attr::input_size faild!"), | 87 | + OP_CHECK_IF(input_size == nullptr, OP_LOGE(context->GetNodeName(), "Get attr::input_size failed!"), |
| 88 | return ge::GRAPH_FAILED); | 88 | return ge::GRAPH_FAILED); |
| 89 | 89 | ||
| 90 | OP_CHECK_IF(input_size->GetSize() != SUPPORTED_DIM_NUM, | 90 | OP_CHECK_IF(input_size->GetSize() != SUPPORTED_DIM_NUM, |
| @@ -110,7 +110,7 @@ static ge::graphStatus FillTilingData(gert::TilingContext* context, int64_t tota | |||
| 110 | Yuv4442yuv422TilingData* tiling = context->GetTilingData<Yuv4442yuv422TilingData>(); | 110 | Yuv4442yuv422TilingData* tiling = context->GetTilingData<Yuv4442yuv422TilingData>(); |
| 111 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 111 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 112 | OP_CHECK_IF(memset_s(tiling, sizeof(Yuv4442yuv422TilingData), 0, sizeof(Yuv4442yuv422TilingData)) != EOK, | 112 | OP_CHECK_IF(memset_s(tiling, sizeof(Yuv4442yuv422TilingData), 0, sizeof(Yuv4442yuv422TilingData)) != EOK, |
| 113 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 113 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 114 | 114 | ||
| 115 | tiling->totalPairs = totalPairs; | 115 | tiling->totalPairs = totalPairs; |
| 116 | tiling->h = h; | 116 | tiling->h = h; |
| @@ -130,7 +130,7 @@ static ge::graphStatus FillTilingData(gert::TilingContext* context, int64_t need | |||
| 130 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 130 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 131 | OP_CHECK_IF( | 131 | OP_CHECK_IF( |
| 132 | memset_s(tiling, sizeof(AnchorResponseFlagsTilingData), 0, sizeof(AnchorResponseFlagsTilingData)) != EOK, | 132 | memset_s(tiling, sizeof(AnchorResponseFlagsTilingData), 0, sizeof(AnchorResponseFlagsTilingData)) != EOK, |
| 133 | - OP_LOGE(context, "memset tiling data error"), return ge::GRAPH_FAILED); | 133 | + OP_LOGE(context, "Failed to memset tiling data"), return ge::GRAPH_FAILED); |
| 134 | 134 | ||
| 135 | tiling->needCoreNum = static_cast<int32_t>(needCoreNum); | 135 | tiling->needCoreNum = static_cast<int32_t>(needCoreNum); |
| 136 | tiling->n = static_cast<int32_t>(n); | 136 | tiling->n = static_cast<int32_t>(n); |
| @@ -166,7 +166,7 @@ static ge::graphStatus DIoUGradTilingFunc(gert::TilingContext* context) | |||
| 166 | DIoUGradTilingData* tiling = context->GetTilingData<DIoUGradTilingData>(); | 166 | DIoUGradTilingData* tiling = context->GetTilingData<DIoUGradTilingData>(); |
| 167 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 167 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 168 | OP_CHECK_IF(memset_s(tiling, sizeof(DIoUGradTilingData), 0, sizeof(DIoUGradTilingData)) != EOK, | 168 | OP_CHECK_IF(memset_s(tiling, sizeof(DIoUGradTilingData), 0, sizeof(DIoUGradTilingData)) != EOK, |
| 169 | - OP_LOGE(context, "DIoUGrad: memset tiling data error"), return ge::GRAPH_FAILED); | 169 | + OP_LOGE(context, "DIoUGrad: Failed to memset tiling data"), return ge::GRAPH_FAILED); |
| 170 | 170 | ||
| 171 | tiling->needCoreNum = static_cast<int32_t>(needCoreNum); | 171 | tiling->needCoreNum = static_cast<int32_t>(needCoreNum); |
| 172 | tiling->totalNum = static_cast<int32_t>(totalNum); | 172 | tiling->totalNum = static_cast<int32_t>(totalNum); |
| @@ -131,7 +131,7 @@ static ge::graphStatus GIoUGradTilingFunc(gert::TilingContext* context) | |||
| 131 | GIoUGradTilingData* tiling = context->GetTilingData<GIoUGradTilingData>(); | 131 | GIoUGradTilingData* tiling = context->GetTilingData<GIoUGradTilingData>(); |
| 132 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 132 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 133 | OP_CHECK_IF(memset_s(tiling, sizeof(GIoUGradTilingData), 0, sizeof(GIoUGradTilingData)) != EOK, | 133 | OP_CHECK_IF(memset_s(tiling, sizeof(GIoUGradTilingData), 0, sizeof(GIoUGradTilingData)) != EOK, |
| 134 | - OP_LOGE(context, "memset tiling data error"), return ge::GRAPH_FAILED); | 134 | + OP_LOGE(context, "Failed to memset tiling data"), return ge::GRAPH_FAILED); |
| 135 | tiling->totalElements = N; | 135 | tiling->totalElements = N; |
| 136 | 136 | ||
| 137 | // 7. Set block dim | 137 | // 7. Set block dim |
| @@ -134,7 +134,7 @@ static ge::graphStatus Iou3DTilingFunc(gert::TilingContext* context) | |||
| 134 | Iou3DTilingData* tiling = context->GetTilingData<Iou3DTilingData>(); | 134 | Iou3DTilingData* tiling = context->GetTilingData<Iou3DTilingData>(); |
| 135 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 135 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 136 | OP_CHECK_IF(memset_s(tiling, sizeof(Iou3DTilingData), 0, sizeof(Iou3DTilingData)) != EOK, | 136 | OP_CHECK_IF(memset_s(tiling, sizeof(Iou3DTilingData), 0, sizeof(Iou3DTilingData)) != EOK, |
| 137 | - OP_LOGE(context, "set tiling data error"), return ge::GRAPH_FAILED); | 137 | + OP_LOGE(context, "Failed to set tiling data"), return ge::GRAPH_FAILED); |
| 138 | 138 | ||
| 139 | tiling->batch = static_cast<uint32_t>(batch); | 139 | tiling->batch = static_cast<uint32_t>(batch); |
| 140 | tiling->numBboxes = static_cast<uint32_t>(numN); | 140 | tiling->numBboxes = static_cast<uint32_t>(numN); |
| @@ -42,7 +42,7 @@ const aclTensor* IouV2(const aclTensor* bBoxes, const aclTensor* gtBoxes, const | |||
| 42 | // 调用device的IouV2算子 | 42 | // 调用device的IouV2算子 |
| 43 | auto ret = ADD_TO_LAUNCHER_LIST_AICORE(IouV2, OP_INPUT(bBoxes, gtBoxes), OP_OUTPUT(out), | 43 | auto ret = ADD_TO_LAUNCHER_LIST_AICORE(IouV2, OP_INPUT(bBoxes, gtBoxes), OP_OUTPUT(out), |
| 44 | OP_ATTR(mode, eps, aligned)); | 44 | OP_ATTR(mode, eps, aligned)); |
| 45 | - OP_LOGI("IouV2 ret:%d, out:%p\n", ret, out); | 45 | + OP_LOGI("IouV2 ret:%d, out:%p", ret, out); |
| 46 | 46 | ||
| 47 | return out; | 47 | return out; |
| 48 | } | 48 | } |
| @@ -60,7 +60,7 @@ static bool CheckFormatValid(const aclTensor* self, const aclTensor* boxes, cons | |||
| 60 | { | 60 | { |
| 61 | if (self->GetStorageFormat() != op::Format::FORMAT_NCHW || boxes->GetStorageFormat() != op::Format::FORMAT_ND || | 61 | if (self->GetStorageFormat() != op::Format::FORMAT_NCHW || boxes->GetStorageFormat() != op::Format::FORMAT_ND || |
| 62 | out->GetStorageFormat() != op::Format::FORMAT_NCHW) { | 62 | out->GetStorageFormat() != op::Format::FORMAT_NCHW) { |
| 63 | - OP_LOGE(ACLNN_ERR_PARAM_INVALID, "Format error. self and out only support NCHW, boxes only support ND."); | 63 | + OP_LOGE(ACLNN_ERR_PARAM_INVALID, "Invalid format. self and out only support NCHW, boxes only support ND."); |
| 64 | return false; | 64 | return false; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| @@ -227,4 +227,4 @@ aclnnStatus aclnnRoiAlignV2(void* workspace, uint64_t workspaceSize, aclOpExecut | |||
| 227 | 227 | ||
| 228 | 228 | ||
| 229 | } | 229 | } |
| 230 | -#endif | 230 | +#endif |
| @@ -370,7 +370,7 @@ static ge::graphStatus ROIAlignGradTilingFunc(gert::TilingContext* context) | |||
| 370 | ROIAlignGradTilingData* tiling = context->GetTilingData<ROIAlignGradTilingData>(); | 370 | ROIAlignGradTilingData* tiling = context->GetTilingData<ROIAlignGradTilingData>(); |
| 371 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 371 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 372 | OP_CHECK_IF(memset_s(tiling, sizeof(ROIAlignGradTilingData), 0, sizeof(ROIAlignGradTilingData)) != EOK, | 372 | OP_CHECK_IF(memset_s(tiling, sizeof(ROIAlignGradTilingData), 0, sizeof(ROIAlignGradTilingData)) != EOK, |
| 373 | - OP_LOGE(context, "memset tiling data error"), return ge::GRAPH_FAILED); | 373 | + OP_LOGE(context, "Failed to memset tiling data"), return ge::GRAPH_FAILED); |
| 374 | 374 | ||
| 375 | if (totalYdiffElements == 0) { | 375 | if (totalYdiffElements == 0) { |
| 376 | return HandleEmptyTiling(context, ascendcPlatform, tiling, params); | 376 | return HandleEmptyTiling(context, ascendcPlatform, tiling, params); |
| @@ -117,7 +117,7 @@ static ge::graphStatus SetTilingDataAndConfig(gert::TilingContext* context, int6 | |||
| 117 | ToAbsoluteBBoxTilingData* tiling = context->GetTilingData<ToAbsoluteBBoxTilingData>(); | 117 | ToAbsoluteBBoxTilingData* tiling = context->GetTilingData<ToAbsoluteBBoxTilingData>(); |
| 118 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); | 118 | OP_CHECK_NULL_WITH_CONTEXT(context, tiling); |
| 119 | OP_CHECK_IF(memset_s(tiling, sizeof(ToAbsoluteBBoxTilingData), 0, sizeof(ToAbsoluteBBoxTilingData)) != EOK, | 119 | OP_CHECK_IF(memset_s(tiling, sizeof(ToAbsoluteBBoxTilingData), 0, sizeof(ToAbsoluteBBoxTilingData)) != EOK, |
| 120 | - OP_LOGE(context, "memset tiling data error"), return ge::GRAPH_FAILED); | 120 | + OP_LOGE(context, "Failed to memset tiling data"), return ge::GRAPH_FAILED); |
| 121 | 121 | ||
| 122 | tiling->dim0 = dim0; | 122 | tiling->dim0 = dim0; |
| 123 | tiling->coreNum = static_cast<int32_t>(coreNum); | 123 | tiling->coreNum = static_cast<int32_t>(coreNum); |