已合并
【PR】: AF日志易用性整改 #1864
sgd创建于 13 天前
【PR】: AF日志易用性整改 #1864
已合并
共 125 个文件变更+978-667
| @@ -0,0 +1,3 @@ | |||
| 1 | +[codespell] | ||
| 2 | +# SymEngine library class name, not a typo | ||
| 3 | +ignore-words-list = Unequality | ||
| @@ -180,7 +180,7 @@ __aicore__ inline void GetBrcAlignLoopNumbers(const uint32_t first_dim, const ui | |||
| 180 | constexpr uint32_t min_tmp_buf_size = min_brcb_temp_buffer_size; | 180 | constexpr uint32_t min_tmp_buf_size = min_brcb_temp_buffer_size; |
| 181 | ASCENDC_ASSERT((tmp_buf_size >= min_tmp_buf_size), { | 181 | ASCENDC_ASSERT((tmp_buf_size >= min_tmp_buf_size), { |
| 182 | KERNEL_LOG(KERNEL_ERROR, | 182 | KERNEL_LOG(KERNEL_ERROR, |
| 183 | - "tmp_buf_size can't smaller than min_tmp_buf_size, tmp_buf_size is %u, min_tmp_buf_size is %u!", | 183 | + "tmp_buf_size can't be smaller than min_tmp_buf_size, tmp_buf_size is %u, min_tmp_buf_size is %u!", |
| 184 | tmp_buf_size, min_tmp_buf_size); | 184 | tmp_buf_size, min_tmp_buf_size); |
| 185 | }); | 185 | }); |
| 186 | one_repeat_size = tmp_buf_size / min_tmp_buf_size * one_blk_num; | 186 | one_repeat_size = tmp_buf_size / min_tmp_buf_size * one_blk_num; |
| @@ -200,7 +200,7 @@ __aicore__ inline void GetBrcNotAlignLoopNumbers(const uint32_t first_dim, const | |||
| 200 | const uint32_t min_tmp_buf_size = min_brcb_temp_buffer_size + min_copy_temp_buffer_size; | 200 | const uint32_t min_tmp_buf_size = min_brcb_temp_buffer_size + min_copy_temp_buffer_size; |
| 201 | ASCENDC_ASSERT((tmp_buf_size >= min_tmp_buf_size), { | 201 | ASCENDC_ASSERT((tmp_buf_size >= min_tmp_buf_size), { |
| 202 | KERNEL_LOG(KERNEL_ERROR, | 202 | KERNEL_LOG(KERNEL_ERROR, |
| 203 | - "tmp_buf_size can't smaller than min_tmp_buf_size, tmp_buf_size is %u, min_tmp_buf_size is %u!", | 203 | + "tmp_buf_size can't be smaller than min_tmp_buf_size, tmp_buf_size is %u, min_tmp_buf_size is %u!", |
| 204 | tmp_buf_size, min_tmp_buf_size); | 204 | tmp_buf_size, min_tmp_buf_size); |
| 205 | }); | 205 | }); |
| 206 | one_repeat_size = tmp_buf_size / min_tmp_buf_size * one_blk_num; | 206 | one_repeat_size = tmp_buf_size / min_tmp_buf_size * one_blk_num; |
| @@ -279,7 +279,7 @@ inline __aicore__ void CastExtend(const AscendC::LocalTensor<OutT> &dst, const A | |||
| 279 | CastExtendWithOneTransferWithMaskMode<InT, OutT>(dst, src, first_dim, last_dim, input_last_dim_stride, | 279 | CastExtendWithOneTransferWithMaskMode<InT, OutT>(dst, src, first_dim, last_dim, input_last_dim_stride, |
| 280 | output_last_dim_stride, dtype_size, tmp_buf); // 需要一次中间转换 | 280 | output_last_dim_stride, dtype_size, tmp_buf); // 需要一次中间转换 |
| 281 | } else { | 281 | } else { |
| 282 | - ASCENDC_ASSERT(false, { KERNEL_LOG(KERNEL_ERROR, "Current conversion not support mask mode"); }); | 282 | + ASCENDC_ASSERT(false, { KERNEL_LOG(KERNEL_ERROR, "Current conversion does not support mask mode"); }); |
| 283 | } | 283 | } |
| 284 | } | 284 | } |
| 285 | 285 | ||
| @@ -198,7 +198,7 @@ __aicore__ inline void ReduceSumInt32(const LocalTensor<T> &dst, const LocalTens | |||
| 198 | LocalTensor<T> tmp_dst = tmp.ReinterpretCast<T>(); | 198 | LocalTensor<T> tmp_dst = tmp.ReinterpretCast<T>(); |
| 199 | if constexpr (IsSameType<pattern, Pattern::Reduce::AR>::value) { | 199 | if constexpr (IsSameType<pattern, Pattern::Reduce::AR>::value) { |
| 200 | ASCENDC_ASSERT((dst.GetSize() >= first), { | 200 | ASCENDC_ASSERT((dst.GetSize() >= first), { |
| 201 | - KERNEL_LOG(KERNEL_ERROR, "dstTensor must be greater than or equal to %u, current size if %u", first, | 201 | + KERNEL_LOG(KERNEL_ERROR, "dstTensor must be greater than or equal to %u, current size is %u", first, |
| 202 | dst.GetSize()); | 202 | dst.GetSize()); |
| 203 | }); | 203 | }); |
| 204 | ReduceSumByLastAxis(dst, src, tmp_dst, first, last, pad_last); | 204 | ReduceSumByLastAxis(dst, src, tmp_dst, first, last, pad_last); |
| @@ -75,8 +75,11 @@ inline __aicore__ T2 Mod(T1 a, T2 b) { | |||
| 75 | uint64_t mod_num = a_tmp % b_tmp; | 75 | uint64_t mod_num = a_tmp % b_tmp; |
| 76 | return static_cast<uint64_t>(mod_num); | 76 | return static_cast<uint64_t>(mod_num); |
| 77 | } else if constexpr (std::is_same<T1, uint64_t>::value || std::is_same<T2, uint64_t>::value) { | 77 | } else if constexpr (std::is_same<T1, uint64_t>::value || std::is_same<T2, uint64_t>::value) { |
| 78 | - ASCENDC_ASSERT(true, | 78 | + ASCENDC_ASSERT(true, { |
| 79 | - { KERNEL_LOG(KERNEL_ERROR, "does not support mix type of uint64 because of possible overflow!"); }); | 79 | + KERNEL_LOG(KERNEL_ERROR, |
| 80 | + "does not support mixed type of uint64 because of possible " | ||
| 81 | + "overflow!"); | ||
| 82 | + }); | ||
| 80 | return 0; | 83 | return 0; |
| 81 | } else { | 84 | } else { |
| 82 | ASCENDC_ASSERT(b != 0, { KERNEL_LOG(KERNEL_ERROR, "b can't be equal to 0, b is %d!", b); }); | 85 | ASCENDC_ASSERT(b != 0, { KERNEL_LOG(KERNEL_ERROR, "b can't be equal to 0, b is %d!", b); }); |
| @@ -81,7 +81,7 @@ bool IsAllStaticAligned(const AscNode &node, int32_t align_size) { | |||
| 81 | } | 81 | } |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | - GE_WARN_ASSERT(find_concat_dim, "not find concat dim in vectorized_axis, not aligned."); | 84 | + GE_WARN_ASSERT(find_concat_dim, "Failed to find concat dim in vectorized_axis, not aligned."); |
| 85 | 85 | ||
| 86 | for (uint32_t i = 0; i < node_inputs.Size(); ++i) { | 86 | for (uint32_t i = 0; i < node_inputs.Size(); ++i) { |
| 87 | const auto &input_attr = node_inputs[i].attr; | 87 | const auto &input_attr = node_inputs[i].attr; |
| @@ -48,7 +48,7 @@ class __attribute__((visibility("default"))) ApiPerfFactory { | |||
| 48 | std::lock_guard<std::mutex> lock(mutex_); | 48 | std::lock_guard<std::mutex> lock(mutex_); |
| 49 | const auto iter = creator_map_.find(api_name); | 49 | const auto iter = creator_map_.find(api_name); |
| 50 | if (iter != creator_map_.end()) { | 50 | if (iter != creator_map_.end()) { |
| 51 | - GELOGD("ApiCallFactory::RegisterCreator: %s creator already exist", api_name.c_str()); | 51 | + GELOGD("ApiCallFactory::RegisterCreator: %s creator already exists", api_name.c_str()); |
| 52 | return; | 52 | return; |
| 53 | } | 53 | } |
| 54 | creator_map_[api_name] = std::move(creator); | 54 | creator_map_[api_name] = std::move(creator); |
| @@ -17,7 +17,7 @@ Expr GetDataTypeSize(const std::string &data_type) { | |||
| 17 | constexpr int32_t kDefaultDataTypeSize = 4; | 17 | constexpr int32_t kDefaultDataTypeSize = 4; |
| 18 | const auto &iter = kDataTypeSizeMap.find(data_type); | 18 | const auto &iter = kDataTypeSizeMap.find(data_type); |
| 19 | if (iter == kDataTypeSizeMap.end()) { | 19 | if (iter == kDataTypeSizeMap.end()) { |
| 20 | - GELOGW("data type %s not support, use default %d byte", data_type.c_str(), kDefaultDataTypeSize); | 20 | + GELOGW("data type %s not supported, use default %d byte", data_type.c_str(), kDefaultDataTypeSize); |
| 21 | return CreateExpr(kDefaultDataTypeSize); | 21 | return CreateExpr(kDefaultDataTypeSize); |
| 22 | } | 22 | } |
| 23 | return iter->second; | 23 | return iter->second; |
| @@ -742,7 +742,7 @@ af::Status BroadcastApi([[maybe_unused]] const std::vector<TensorShapeInfo> &inp | |||
| 742 | input_shapes[0].GetDimExpr().c_str(), output_shapes[0].GetDimExpr().c_str()); | 742 | input_shapes[0].GetDimExpr().c_str(), output_shapes[0].GetDimExpr().c_str()); |
| 743 | } else if (input_dims.size() == 4U) { | 743 | } else if (input_dims.size() == 4U) { |
| 744 | GE_ASSERT_SUCCESS(BroadcastFourDim(input_shapes[0].data_type, input_dims, output_dims, perf_res), | 744 | GE_ASSERT_SUCCESS(BroadcastFourDim(input_shapes[0].data_type, input_dims, output_dims, perf_res), |
| 745 | - "Gen BroadcastThreeDim perf Failed, input size {%s}, output size {%s}.", | 745 | + "Gen BroadcastFourDim perf Failed, input size {%s}, output size {%s}.", |
| 746 | input_shapes[0].GetDimExpr().c_str(), output_shapes[0].GetDimExpr().c_str()); | 746 | input_shapes[0].GetDimExpr().c_str(), output_shapes[0].GetDimExpr().c_str()); |
| 747 | } else if (input_dims.size() == 1U) { | 747 | } else if (input_dims.size() == 1U) { |
| 748 | GE_ASSERT_SUCCESS(ascendcperf::DuplicatePerf( | 748 | GE_ASSERT_SUCCESS(ascendcperf::DuplicatePerf( |
| @@ -781,7 +781,7 @@ af::Status LogicalCommonApi([[maybe_unused]] const std::vector<TensorShapeInfo> | |||
| 781 | GE_ASSERT_SUCCESS( | 781 | GE_ASSERT_SUCCESS( |
| 782 | ascendcperf::CastPerf( | 782 | ascendcperf::CastPerf( |
| 783 | GenNodeDetail(output_shapes[0].data_type, "float16", {data_size - cycle_num * max_repeat_size}), cast_perf3), | 783 | GenNodeDetail(output_shapes[0].data_type, "float16", {data_size - cycle_num * max_repeat_size}), cast_perf3), |
| 784 | - "Gen node detail failed, node=[%s,%s]", node_ptr->GetNamePtr(), node_ptr->GetTypePtr()); | 784 | + "CastPerf failed, node=[%s,%s]", node_ptr->GetNamePtr(), node_ptr->GetTypePtr()); |
| 785 | GE_ASSERT_SUCCESS( | 785 | GE_ASSERT_SUCCESS( |
| 786 | ascendcperf::CastPerf(GenNodeDetail("float16", "uint8", {data_size - cycle_num * max_repeat_size}), cast_perf4), | 786 | ascendcperf::CastPerf(GenNodeDetail("float16", "uint8", {data_size - cycle_num * max_repeat_size}), cast_perf4), |
| 787 | "CastPerf failed, node=[%s,%s]", node_ptr->GetNamePtr(), node_ptr->GetTypePtr()); | 787 | "CastPerf failed, node=[%s,%s]", node_ptr->GetNamePtr(), node_ptr->GetTypePtr()); |
| @@ -322,7 +322,7 @@ void to_json(nlohmann::json &j, const ModelInfo &info) { | |||
| 322 | 322 | ||
| 323 | std::string GetRealPath(const std::string &path) { | 323 | std::string GetRealPath(const std::string &path) { |
| 324 | if (path.empty() || (path.size() >= kPathMax)) { | 324 | if (path.empty() || (path.size() >= kPathMax)) { |
| 325 | - GELOGW("Path is size[%zu] exception.", path.size()); | 325 | + GELOGW("Invalid path: size [%zu].", path.size()); |
| 326 | return ""; | 326 | return ""; |
| 327 | } | 327 | } |
| 328 | std::string root_path = af::RealPath(path.c_str()); | 328 | std::string root_path = af::RealPath(path.c_str()); |
| @@ -164,13 +164,13 @@ af::Status AscendGraphParser::ParserOriginAxis(const af::AscGraph &graph) { | |||
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | af::Status AscendGraphParser::CheckAxisIdValid(const int64_t axis_id) { | 166 | af::Status AscendGraphParser::CheckAxisIdValid(const int64_t axis_id) { |
| 167 | - GE_ASSERT_TRUE(axes_info_.find(axis_id) != axes_info_.end(), "Invalid axid id [%ld].", axis_id); | 167 | + GE_ASSERT_TRUE(axes_info_.find(axis_id) != axes_info_.end(), "Invalid axis id [%ld].", axis_id); |
| 168 | return af::SUCCESS; | 168 | return af::SUCCESS; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | af::Status AscendGraphParser::CheckAxisIdValid(std::vector<int64_t> &axis_ids) { | 171 | af::Status AscendGraphParser::CheckAxisIdValid(std::vector<int64_t> &axis_ids) { |
| 172 | for (auto &axis_id : axis_ids) { | 172 | for (auto &axis_id : axis_ids) { |
| 173 | - GE_ASSERT_TRUE(axes_info_.find(axis_id) != axes_info_.end(), "Invalid axid id [%ld].", axis_id); | 173 | + GE_ASSERT_TRUE(axes_info_.find(axis_id) != axes_info_.end(), "Invalid axis id [%ld].", axis_id); |
| 174 | } | 174 | } |
| 175 | return af::SUCCESS; | 175 | return af::SUCCESS; |
| 176 | } | 176 | } |
| @@ -514,7 +514,7 @@ af::Status AscendGraphParser::ParseTensorDims(TensorPtr &tensor, af::AscTensorAt | |||
| 514 | // 处理tensor的strides | 514 | // 处理tensor的strides |
| 515 | SetContinuesStrides(tensor, tensor_attr); | 515 | SetContinuesStrides(tensor, tensor_attr); |
| 516 | GE_ASSERT_TRUE(tensor->stride.size() == tensor->dim_info.size(), | 516 | GE_ASSERT_TRUE(tensor->stride.size() == tensor->dim_info.size(), |
| 517 | - "Tenosr [%s] stride num[%lu] not equal to dim info num[%lu].", tensor->name.c_str(), | 517 | + "Tensor [%s] stride num[%lu] not equal to dim info num[%lu].", tensor->name.c_str(), |
| 518 | tensor->stride.size(), tensor->dim_info.size()); | 518 | tensor->stride.size(), tensor->dim_info.size()); |
| 519 | GELOGD("[DFX]parse tensor %s(%s): repeats [%s], gm_stride [%s], stride [%s]", tensor->name.c_str(), | 519 | GELOGD("[DFX]parse tensor %s(%s): repeats [%s], gm_stride [%s], stride [%s]", tensor->name.c_str(), |
| 520 | tensor->node_type.c_str(), GetVecString(tensor->repeat).c_str(), GetVecString(tensor->gm_stride).c_str(), | 520 | tensor->node_type.c_str(), GetVecString(tensor->repeat).c_str(), GetVecString(tensor->gm_stride).c_str(), |
| @@ -45,7 +45,7 @@ static inline bool FindGroupCache(const std::array<uint32_t, kInputShapeSize> &k | |||
| 45 | GroupLevelCache &group_level_cache) { | 45 | GroupLevelCache &group_level_cache) { |
| 46 | auto *result = group_level_cache.Find(key); | 46 | auto *result = group_level_cache.Find(key); |
| 47 | if (result != nullptr) { | 47 | if (result != nullptr) { |
| 48 | - OP_LOGI(OP_NAME, "[Group Cache] HIT!key[%s]", [&key]()->std::string { | 48 | + OP_LOGI(OP_NAME, "[Group Cache] HIT! key=[%s]", [&key]()->std::string { |
| 49 | std::string out; | 49 | std::string out; |
| 50 | for (auto axis : key) { | 50 | for (auto axis : key) { |
| 51 | out.append(std::to_string(axis)); | 51 | out.append(std::to_string(axis)); |
| @@ -53,9 +53,9 @@ bool ArgsManager::ReplaceVars(ExprExprMap &replaced_vars, ExprExprMap &replaceme | |||
| 53 | GELOGD("obj after: %s", pipe_cost.second.Str().get()); | 53 | GELOGD("obj after: %s", pipe_cost.second.Str().get()); |
| 54 | } | 54 | } |
| 55 | for (auto &pair : ternary_op_) { | 55 | for (auto &pair : ternary_op_) { |
| 56 | - GELOGD("tenary op before: %s", pair.second.GetTernaryOpStr().c_str()); | 56 | + GELOGD("ternary op before: %s", pair.second.GetTernaryOpStr().c_str()); |
| 57 | pair.second.Replace(old_to_new_expr_replacement); | 57 | pair.second.Replace(old_to_new_expr_replacement); |
| 58 | - GELOGD("tenary op after: %s", pair.second.GetTernaryOpStr().c_str()); | 58 | + GELOGD("ternary op after: %s", pair.second.GetTernaryOpStr().c_str()); |
| 59 | } | 59 | } |
| 60 | for (auto &group : perf_breakdowns_) { | 60 | for (auto &group : perf_breakdowns_) { |
| 61 | for (auto &item : group.items) { | 61 | for (auto &item : group.items) { |
| @@ -333,7 +333,7 @@ do { | |||
| 333 | current_block_dim = next_lower_block_dim; | 333 | current_block_dim = next_lower_block_dim; |
| 334 | if (!FindNextLowerBlockDim(current_block_dim, next_lower_block_dim)) { | 334 | if (!FindNextLowerBlockDim(current_block_dim, next_lower_block_dim)) { |
| 335 | OP_LOGD(OP_NAME, | 335 | OP_LOGD(OP_NAME, |
| 336 | - "Found better solution by lower block dim, no lower block dim, current_perf: %f, " | 336 | + "Found better solution by lower block dim, no lower block dim remains, current_perf: %f, " |
| 337 | "current_block_dim: %u, input:%s", | 337 | "current_block_dim: %u, input:%s", |
| 338 | current_perf, current_block_dim, input_.DebugString().c_str()); | 338 | current_perf, current_block_dim, input_.DebugString().c_str()); |
| 339 | // 无更低档位,当前input_就是最优解,直接返回下档位的最优解 | 339 | // 无更低档位,当前input_就是最优解,直接返回下档位的最优解 |
| @@ -402,7 +402,7 @@ static std::string GenFindBetterSolutionByUpperBlockDimBodyPre() { | |||
| 402 | current_block_dim = next_upper_block_dim; | 402 | current_block_dim = next_upper_block_dim; |
| 403 | if (!FindNextUpperBlockDim(current_block_dim, next_upper_block_dim)) { | 403 | if (!FindNextUpperBlockDim(current_block_dim, next_upper_block_dim)) { |
| 404 | OP_LOGD(OP_NAME, | 404 | OP_LOGD(OP_NAME, |
| 405 | - "Found better solution by upper block dim, no upper block dim, current_perf: %f, " | 405 | + "Found better solution by upper block dim, no upper block dim remains, current_perf: %f, " |
| 406 | "current_block_dim: %u, input:%s", | 406 | "current_block_dim: %u, input:%s", |
| 407 | current_perf, current_block_dim, input_.DebugString().c_str()); | 407 | current_perf, current_block_dim, input_.DebugString().c_str()); |
| 408 | // 无更高档位,当前input_就是最优解,直接返回上档位的最优解 | 408 | // 无更高档位,当前input_就是最优解,直接返回上档位的最优解 |
| @@ -585,9 +585,9 @@ static std::string GenAutoTuningBetterSolution_CheckLower(bool enable_equal_orde | |||
| 585 | double next_lower_perf = GetPerf(); | 585 | double next_lower_perf = GetPerf(); |
| 586 | // 4.当前档位差于下档位,向下找更优解(考虑多核头开销对小Shape场景的影响和同地址冲突对多核的影响,当前更倾向于下档位) | 586 | // 4.当前档位差于下档位,向下找更优解(考虑多核头开销对小Shape场景的影响和同地址冲突对多核的影响,当前更倾向于下档位) |
| 587 | if (current_perf > next_lower_perf) { | 587 | if (current_perf > next_lower_perf) { |
| 588 | - OP_LOGD(OP_NAME, "Find lower block dim, as next_lower_perf: %f(block_dim=%u) is better than" | 588 | + OP_LOGD(OP_NAME, "Find lower block dim, as next_lower_perf: %f(block_dim=%u) is better than " |
| 589 | - "current_perf: %f(block_dim=%u), input: %s", current_perf, block_dim, next_lower_perf, | 589 | + "current_perf: %f(block_dim=%u), input: %s", next_lower_perf, next_lower_block_dim, current_perf, |
| 590 | - next_lower_block_dim, input_.DebugString().c_str()); | 590 | + block_dim, input_.DebugString().c_str()); |
| 591 | )"; | 591 | )"; |
| 592 | if (enable_equal_order_tiling) { | 592 | if (enable_equal_order_tiling) { |
| 593 | codes += " FindBetterSolutionByLowerBlockDim(next_lower_perf, next_lower_block_dim, enable_equal_order);\n"; | 593 | codes += " FindBetterSolutionByLowerBlockDim(next_lower_perf, next_lower_block_dim, enable_equal_order);\n"; |
| @@ -621,7 +621,7 @@ static std::string GenAutoTuningBetterSolution_CheckUpper(bool enable_equal_orde | |||
| 621 | if (current_perf > next_upper_perf) { | 621 | if (current_perf > next_upper_perf) { |
| 622 | OP_LOGD(OP_NAME, | 622 | OP_LOGD(OP_NAME, |
| 623 | "Find upper block dim, as next_upper_perf: %f(block_dim=%u) is better than current_perf: %f(block_dim=%u).", | 623 | "Find upper block dim, as next_upper_perf: %f(block_dim=%u) is better than current_perf: %f(block_dim=%u).", |
| 624 | - current_perf, block_dim, next_upper_perf, next_upper_block_dim); | 624 | + next_upper_perf, next_upper_block_dim, current_perf, block_dim); |
| 625 | )"; | 625 | )"; |
| 626 | if (enable_equal_order_tiling) { | 626 | if (enable_equal_order_tiling) { |
| 627 | codes += " FindBetterSolutionByUpperBlockDim(next_upper_perf, next_upper_block_dim, enable_equal_order);\n"; | 627 | codes += " FindBetterSolutionByUpperBlockDim(next_upper_perf, next_upper_block_dim, enable_equal_order);\n"; |
| @@ -123,7 +123,7 @@ std::string GenObjDrivenOptimize(bool enable_equal_order_tiling) { | |||
| 123 | 123 | ||
| 124 | std::string GenEmptyTensorCheck() { | 124 | std::string GenEmptyTensorCheck() { |
| 125 | std::string codes; | 125 | std::string codes; |
| 126 | - codes += " // 检测空tensor场景:当某个轴的upper_bound为0时,直接返回成功\n"; | 126 | + codes += " // Check empty tensor case: when the upper_bound of any axis is 0, return success directly\n"; |
| 127 | codes += " auto is_var_empty = [](const TilingVariable *var) -> bool {\n"; | 127 | codes += " auto is_var_empty = [](const TilingVariable *var) -> bool {\n"; |
| 128 | codes += " return var->upper_bound(var->upper_bound_vars) == 0;\n"; | 128 | codes += " return var->upper_bound(var->upper_bound_vars) == 0;\n"; |
| 129 | codes += " };\n"; | 129 | codes += " };\n"; |
| @@ -612,7 +612,7 @@ inline std::string GenAddVarVal() { | |||
| 612 | general_solver += "{\n"; | 612 | general_solver += "{\n"; |
| 613 | general_solver += " uint64_t rec_num = solution_num_;\n"; | 613 | general_solver += " uint64_t rec_num = solution_num_;\n"; |
| 614 | general_solver += " if (rec_num > MAX_SOLUTION) {\n"; | 614 | general_solver += " if (rec_num > MAX_SOLUTION) {\n"; |
| 615 | - general_solver += " OP_LOGW(OP_NAME, \"Too much solutions.\");\n"; | 615 | + general_solver += " OP_LOGW(OP_NAME, \"Too many solutions.\");\n"; |
| 616 | general_solver += " return false;\n"; | 616 | general_solver += " return false;\n"; |
| 617 | general_solver += " }\n"; | 617 | general_solver += " }\n"; |
| 618 | general_solver += " uint32_t cnt_num = 0;\n"; | 618 | general_solver += " uint32_t cnt_num = 0;\n"; |
| @@ -1686,7 +1686,7 @@ inline std::string GenFineTune() { | |||
| 1686 | general_solver += "template <typename SpecificCase>\n"; | 1686 | general_solver += "template <typename SpecificCase>\n"; |
| 1687 | general_solver += "inline bool GeneralSolver<SpecificCase>::FineTune()\n"; | 1687 | general_solver += "inline bool GeneralSolver<SpecificCase>::FineTune()\n"; |
| 1688 | general_solver += "{\n"; | 1688 | general_solver += "{\n"; |
| 1689 | - general_solver += " OP_LOGD(OP_NAME, \"Feasible solution, start tuning the tilling data.\");\n"; | 1689 | + general_solver += " OP_LOGD(OP_NAME, \"Feasible solution, start tuning the tiling data.\");\n"; |
| 1690 | general_solver += " double init_obj = static_cast<SpecificCase*>(this)->GetSmoothObj(var_info_->cur_vars);\n"; | 1690 | general_solver += " double init_obj = static_cast<SpecificCase*>(this)->GetSmoothObj(var_info_->cur_vars);\n"; |
| 1691 | general_solver += " double init_cons = static_cast<SpecificCase*>(this)->GetBuffCost(var_info_->cur_vars);\n"; | 1691 | general_solver += " double init_cons = static_cast<SpecificCase*>(this)->GetBuffCost(var_info_->cur_vars);\n"; |
| 1692 | general_solver += " if (!RecordBestVarVal())\n"; | 1692 | general_solver += " if (!RecordBestVarVal())\n"; |
| @@ -768,14 +768,14 @@ std::string AxesReorderSolverGen::GenUBSizeCacheLineFunc() { | |||
| 768 | GELOGD("GetCacheLineCont for %s", c.ToString().c_str()); | 768 | GELOGD("GetCacheLineCont for %s", c.ToString().c_str()); |
| 769 | codes += " // check node " + c.node_name + "\n"; | 769 | codes += " // check node " + c.node_name + "\n"; |
| 770 | codes += " if (" + Str(c.solver_cache_line_expr) + " < " + std::to_string(c.cache_line_size) + ") {\n"; | 770 | codes += " if (" + Str(c.solver_cache_line_expr) + " < " + std::to_string(c.cache_line_size) + ") {\n"; |
| 771 | - codes += " OP_LOGD(OP_NAME, \"" + c.node_name + " condition not satisfy UB size cache line\");\n"; | 771 | + codes += " OP_LOGD(OP_NAME, \"" + c.node_name + " condition does not satisfy UB size cache line\");\n"; |
| 772 | codes += " return false;\n"; | 772 | codes += " return false;\n"; |
| 773 | codes += " }\n"; | 773 | codes += " }\n"; |
| 774 | } | 774 | } |
| 775 | } | 775 | } |
| 776 | } | 776 | } |
| 777 | 777 | ||
| 778 | - codes += " OP_LOGD(OP_NAME, \"condition satisfy UB size cache line\");\n"; | 778 | + codes += " OP_LOGD(OP_NAME, \"condition satisfies UB size cache line\");\n"; |
| 779 | codes += " return true;\n"; | 779 | codes += " return true;\n"; |
| 780 | codes += "}\n"; | 780 | codes += "}\n"; |
| 781 | codes += "\n"; | 781 | codes += "\n"; |
| @@ -1146,7 +1146,7 @@ std::string GeneralSolverGen::GenSolverFuncImpl() { | |||
| 1146 | CreateConfig(); | 1146 | CreateConfig(); |
| 1147 | CreateInput(); | 1147 | CreateInput(); |
| 1148 | RunSolver(); | 1148 | RunSolver(); |
| 1149 | - invoke_codes_ += " OP_LOGW(OP_NAME, \"The solver executed failed.\");\n"; | 1149 | + invoke_codes_ += " OP_LOGW(OP_NAME, \"The solver execution failed.\");\n"; |
| 1150 | invoke_codes_ += " return false;\n"; | 1150 | invoke_codes_ += " return false;\n"; |
| 1151 | invoke_codes_ += " }\n"; | 1151 | invoke_codes_ += " }\n"; |
| 1152 | return invoke_codes_; | 1152 | return invoke_codes_; |
| @@ -1158,7 +1158,7 @@ std::string GeneralSolverGen::GenSolverDTImpl() { | |||
| 1158 | CreateConfig(); | 1158 | CreateConfig(); |
| 1159 | CreateInput(); | 1159 | CreateInput(); |
| 1160 | RunSolver(true); | 1160 | RunSolver(true); |
| 1161 | - invoke_codes_ += " OP_LOGW(OP_NAME, \"The solver for decision tree executed failed.\");\n"; | 1161 | + invoke_codes_ += " OP_LOGW(OP_NAME, \"The solver for decision tree execution failed.\");\n"; |
| 1162 | invoke_codes_ += " return false;\n"; | 1162 | invoke_codes_ += " return false;\n"; |
| 1163 | invoke_codes_ += " }\n"; | 1163 | invoke_codes_ += " }\n"; |
| 1164 | return invoke_codes_; | 1164 | return invoke_codes_; |
| @@ -271,7 +271,7 @@ void SolverPassManager::InitSolverGen(AxesReorderSolverGen &solver_gen) { | |||
| 271 | solver_gen.SetTilingCaseIdent({args_manager_.GetModelInfo().schedule_group_ident, | 271 | solver_gen.SetTilingCaseIdent({args_manager_.GetModelInfo().schedule_group_ident, |
| 272 | args_manager_.GetModelInfo().tiling_case_id, | 272 | args_manager_.GetModelInfo().tiling_case_id, |
| 273 | args_manager_.GetModelInfo().sub_case_tag}); | 273 | args_manager_.GetModelInfo().sub_case_tag}); |
| 274 | - GELOGD("[DFX]Set %s to and tiling schedule %s axes reorder solver gen", DebugString().c_str(), | 274 | + GELOGD("[DFX]Set %s and tiling schedule %s for axes reorder solver gen", DebugString().c_str(), |
| 275 | args_manager_.GetModelInfo().tiling_schedule_config.DebugString().c_str()); | 275 | args_manager_.GetModelInfo().tiling_schedule_config.DebugString().c_str()); |
| 276 | } | 276 | } |
| 277 | 277 | ||
| @@ -64,8 +64,8 @@ af::Status IsUpperBoundValid(const Expr &min_expr, const Expr &max_expr) { | |||
| 64 | T max_value{}; | 64 | T max_value{}; |
| 65 | (void)min_expr.GetConstValue(min_value); | 65 | (void)min_expr.GetConstValue(min_value); |
| 66 | (void)max_expr.GetConstValue(max_value); | 66 | (void)max_expr.GetConstValue(max_value); |
| 67 | - GE_ASSERT_TRUE(min_value <= max_value, "Args manager process failed, min[%u] cannot be less than max[%u].", min_value, | 67 | + GE_ASSERT_TRUE(min_value <= max_value, "Args manager process failed, min[%u] cannot be greater than max[%u].", |
| 68 | - max_value); | 68 | + min_value, max_value); |
| 69 | return af::SUCCESS; | 69 | return af::SUCCESS; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| @@ -659,10 +659,10 @@ inline std::string RemoveSpace(std::string str) { | |||
| 659 | af::Status TilingCodeGenImpl::GenCastReuseTilingDataCode(const ReuseScheduleGroupInfo &reuse_info, | 659 | af::Status TilingCodeGenImpl::GenCastReuseTilingDataCode(const ReuseScheduleGroupInfo &reuse_info, |
| 660 | const ReuseScheduleGroupInfo &info) { | 660 | const ReuseScheduleGroupInfo &info) { |
| 661 | GE_ASSERT_TRUE(reuse_info.reuse_input_axes.size() == info.reuse_input_axes.size(), | 661 | GE_ASSERT_TRUE(reuse_info.reuse_input_axes.size() == info.reuse_input_axes.size(), |
| 662 | - "reuse input axes size is not equal size: [%zu vs %zu]", reuse_info.reuse_input_axes.size(), | 662 | + "reuse input axes size is not equal: [%zu vs %zu]", reuse_info.reuse_input_axes.size(), |
| 663 | info.reuse_input_axes.size()); | 663 | info.reuse_input_axes.size()); |
| 664 | GE_ASSERT_TRUE(reuse_info.reuse_search_axes.size() == info.reuse_search_axes.size(), | 664 | GE_ASSERT_TRUE(reuse_info.reuse_search_axes.size() == info.reuse_search_axes.size(), |
| 665 | - "reuse search axes size is not equal size: [%zu vs %zu]", reuse_info.reuse_search_axes.size(), | 665 | + "reuse search axes size is not equal: [%zu vs %zu]", reuse_info.reuse_search_axes.size(), |
| 666 | info.reuse_search_axes.size()); | 666 | info.reuse_search_axes.size()); |
| 667 | GE_ASSERT_TRUE(reuse_info.tiling_keys.size() == info.tiling_keys.size(), | 667 | GE_ASSERT_TRUE(reuse_info.tiling_keys.size() == info.tiling_keys.size(), |
| 668 | "reuse_keys size is not equal to info, size: [%zu vs %zu]", reuse_info.tiling_keys.size(), | 668 | "reuse_keys size is not equal to info, size: [%zu vs %zu]", reuse_info.tiling_keys.size(), |
| @@ -2120,7 +2120,7 @@ af::Status TilingCodeGenImpl::GenExtraTilingData(const ModelInfo &model_info) { | |||
| 2120 | af::Status TilingCodeGenImpl::GenExtraEvalFunc(const ModelInfo &model_info) { | 2120 | af::Status TilingCodeGenImpl::GenExtraEvalFunc(const ModelInfo &model_info) { |
| 2121 | GE_ASSERT_SUCCESS(GenPipeTypeObj(model_info), "Generate PipeTypeObj failed."); | 2121 | GE_ASSERT_SUCCESS(GenPipeTypeObj(model_info), "Generate PipeTypeObj failed."); |
| 2122 | GE_ASSERT_SUCCESS(GenGetObj(model_info), "Generate GetObj failed."); | 2122 | GE_ASSERT_SUCCESS(GenGetObj(model_info), "Generate GetObj failed."); |
| 2123 | - GE_ASSERT_SUCCESS(GenCalcScore(model_info), "Generate GetObj failed, graph name %s, tiling case %u", | 2123 | + GE_ASSERT_SUCCESS(GenCalcScore(model_info), "Generate CalcScore failed, graph name %s, tiling case %u", |
| 2124 | model_info.graph_name.c_str(), model_info.tiling_case_id); | 2124 | model_info.graph_name.c_str(), model_info.tiling_case_id); |
| 2125 | return af::SUCCESS; | 2125 | return af::SUCCESS; |
| 2126 | } | 2126 | } |
| @@ -2708,7 +2708,7 @@ std::string TilingCodeGenImpl::GenPerformanceAdjustmentCode(bool enable_group_pa | |||
| 2708 | code += " const double core_ratio = (double)tiling_data.get_block_dim() / (double)core_num;\n"; | 2708 | code += " const double core_ratio = (double)tiling_data.get_block_dim() / (double)core_num;\n"; |
| 2709 | code += " cur_obj = cur_obj / 100.0 * group_num * core_ratio;\n"; | 2709 | code += " cur_obj = cur_obj / 100.0 * group_num * core_ratio;\n"; |
| 2710 | code += | 2710 | code += |
| 2711 | - " OP_LOGD(OP_NAME, \"The optimal objection for tiling_case_id %u of %s is %lf(original obj is %lf), " | 2711 | + " OP_LOGD(OP_NAME, \"The optimal objective for tiling_case_id %u of %s is %lf(original obj is %lf), " |
| 2712 | "group_num is %u, limited core num is %u, used core num is %u.\",\n"; | 2712 | "group_num is %u, limited core num is %u, used core num is %u.\",\n"; |
| 2713 | if (!is_uniq_group) { | 2713 | if (!is_uniq_group) { |
| 2714 | code += | 2714 | code += |
| @@ -2728,11 +2728,11 @@ std::string TilingCodeGenImpl::GenLogOutputCodeWithUb(const bool is_uniq_group) | |||
| 2728 | if (!is_uniq_group) { | 2728 | if (!is_uniq_group) { |
| 2729 | return " OP_LOGD(OP_NAME, \"The ub ratio for tiling_case_id %u of %s is %f.\", tiling_case_id, schedule_name, " | 2729 | return " OP_LOGD(OP_NAME, \"The ub ratio for tiling_case_id %u of %s is %f.\", tiling_case_id, schedule_name, " |
| 2730 | "cur_ub_ratio);\n" | 2730 | "cur_ub_ratio);\n" |
| 2731 | - " OP_LOGD(OP_NAME, \"The optimal objection for tiling_case_id %u of %s is %f.\", tiling_case_id, " | 2731 | + " OP_LOGD(OP_NAME, \"The optimal objective for tiling_case_id %u of %s is %f.\", tiling_case_id, " |
| 2732 | "schedule_name, cur_obj);"; | 2732 | "schedule_name, cur_obj);"; |
| 2733 | } else { | 2733 | } else { |
| 2734 | return " OP_LOGD(OP_NAME, \"The ub ratio for tiling_case_id %u is %f.\", tiling_case_id, cur_ub_ratio);\n" | 2734 | return " OP_LOGD(OP_NAME, \"The ub ratio for tiling_case_id %u is %f.\", tiling_case_id, cur_ub_ratio);\n" |
| 2735 | - " OP_LOGD(OP_NAME, \"The optimal objection for tiling_case_id %u is %f.\", tiling_case_id, cur_obj);"; | 2735 | + " OP_LOGD(OP_NAME, \"The optimal objective for tiling_case_id %u is %f.\", tiling_case_id, cur_obj);"; |
| 2736 | } | 2736 | } |
| 2737 | } | 2737 | } |
| 2738 | 2738 | ||
| @@ -2776,7 +2776,7 @@ af::Status TilingCodeGenImpl::GenFindPerfBetterTilingbyCaseIdWithoutUb(bool enab | |||
| 2776 | tiling_func_.AddLine(" const double core_ratio = (double)tiling_data.block_dim_ / (double)core_num;"); | 2776 | tiling_func_.AddLine(" const double core_ratio = (double)tiling_data.block_dim_ / (double)core_num;"); |
| 2777 | tiling_func_.AddLine(" cur_obj = cur_obj / 100.0 * group_num * core_ratio;"); | 2777 | tiling_func_.AddLine(" cur_obj = cur_obj / 100.0 * group_num * core_ratio;"); |
| 2778 | tiling_func_.AddLine( | 2778 | tiling_func_.AddLine( |
| 2779 | - " OP_LOGD(OP_NAME, \"The optimal objection for tiling_case_id %u is %lf(original obj is %lf), " | 2779 | + " OP_LOGD(OP_NAME, \"The optimal objective for tiling_case_id %u is %lf(original obj is %lf), " |
| 2780 | "group_num is %u, limited core num is %u, used core num is %u.\","); | 2780 | "group_num is %u, limited core num is %u, used core num is %u.\","); |
| 2781 | tiling_func_.AddLine(" tiling_case_id, cur_obj, org_cur_obj, group_num, core_num, tiling_data.block_dim_);"); | 2781 | tiling_func_.AddLine(" tiling_case_id, cur_obj, org_cur_obj, group_num, core_num, tiling_data.block_dim_);"); |
| 2782 | } | 2782 | } |
| @@ -2784,7 +2784,7 @@ af::Status TilingCodeGenImpl::GenFindPerfBetterTilingbyCaseIdWithoutUb(bool enab | |||
| 2784 | } | 2784 | } |
| 2785 | 2785 | ||
| 2786 | tiling_func_.AddLine( | 2786 | tiling_func_.AddLine( |
| 2787 | - " OP_LOGD(OP_NAME, \"The optimal objection for tiling_case_id %u is %f.\", tiling_case_id, cur_obj);"); | 2787 | + " OP_LOGD(OP_NAME, \"The optimal objective for tiling_case_id %u is %f.\", tiling_case_id, cur_obj);"); |
| 2788 | tiling_func_.AddLine(" if (obj < 0 || cur_obj < obj) {"); | 2788 | tiling_func_.AddLine(" if (obj < 0 || cur_obj < obj) {"); |
| 2789 | // 始终传递 workspace_map 参数,确保与 UpdateBetterTiling 签名一致 | 2789 | // 始终传递 workspace_map 参数,确保与 UpdateBetterTiling 签名一致 |
| 2790 | tiling_func_.AddLine( | 2790 | tiling_func_.AddLine( |
| @@ -4234,14 +4234,14 @@ af::Status TilingCodeGenImpl::GenGetAllSchedulesResults(const AscGraphNamepspace | |||
| 4234 | GELOGI("Force schedule result %ld for op %s", config_.force_schedule_result, config_.tiling_data_type_name.c_str()); | 4234 | GELOGI("Force schedule result %ld for op %s", config_.force_schedule_result, config_.tiling_data_type_name.c_str()); |
| 4235 | GE_ASSERT_TRUE(config_.force_schedule_result < static_cast<int32_t>(namespace_map.size()), | 4235 | GE_ASSERT_TRUE(config_.force_schedule_result < static_cast<int32_t>(namespace_map.size()), |
| 4236 | "Force schedule " | 4236 | "Force schedule " |
| 4237 | - "result[%ld] should less than result size[%zu]", | 4237 | + "result[%ld] should be less than result size[%zu]", |
| 4238 | config_.force_schedule_result, namespace_map.size()); | 4238 | config_.force_schedule_result, namespace_map.size()); |
| 4239 | tiling_func_.AddLine(" auto got_result = kScheduleResultFunctions[" + chosen_index + | 4239 | tiling_func_.AddLine(" auto got_result = kScheduleResultFunctions[" + chosen_index + |
| 4240 | "](ori_block_dim, tiling_case_id, tiling_data, cur_perf, " | 4240 | "](ori_block_dim, tiling_case_id, tiling_data, cur_perf, " |
| 4241 | "best_perf, cur_block_dim);"); | 4241 | "best_perf, cur_block_dim);"); |
| 4242 | tiling_func_.AddLine(" if (!got_result) {"); | 4242 | tiling_func_.AddLine(" if (!got_result) {"); |
| 4243 | tiling_func_.AddLine(" OP_LOGW(OP_NAME, \"Schedule result" + std::to_string(config_.force_schedule_result) + | 4243 | tiling_func_.AddLine(" OP_LOGW(OP_NAME, \"Schedule result" + std::to_string(config_.force_schedule_result) + |
| 4244 | - " cannot found for op\");"); | 4244 | + " cannot be found for op\");"); |
| 4245 | tiling_func_.AddLine(" return false;"); | 4245 | tiling_func_.AddLine(" return false;"); |
| 4246 | tiling_func_.AddLine(" }"); | 4246 | tiling_func_.AddLine(" }"); |
| 4247 | return af::SUCCESS; | 4247 | return af::SUCCESS; |
| @@ -238,7 +238,7 @@ af::Status AxesTilingDataGen::AddAxesTailSizeAndLoopNum() { | |||
| 238 | if (axis->axis_pos != AxisPosition::INNER) { | 238 | if (axis->axis_pos != AxisPosition::INNER) { |
| 239 | continue; | 239 | continue; |
| 240 | } | 240 | } |
| 241 | - GE_ASSERT_TRUE(axis->from_axis.size() == 1UL, "axis[%s] is inner axis should only has one from.", | 241 | + GE_ASSERT_TRUE(axis->from_axis.size() == 1UL, "axis[%s] is an inner axis and should only have one from_axis.", |
| 242 | axis->name.c_str()); | 242 | axis->name.c_str()); |
| 243 | // 轴对应的BaseSize | 243 | // 轴对应的BaseSize |
| 244 | const auto axis_base_size = GetArgExpr(axis->name); | 244 | const auto axis_base_size = GetArgExpr(axis->name); |
| @@ -267,7 +267,7 @@ af::Status AxesTilingDataGen::AddSplitOuterAxisTailArgs() { | |||
| 267 | if (axis->axis_pos != AxisPosition::INNER) { | 267 | if (axis->axis_pos != AxisPosition::INNER) { |
| 268 | continue; | 268 | continue; |
| 269 | } | 269 | } |
| 270 | - GE_ASSERT_TRUE(axis->from_axis.size() == 1UL, "axis[%s] is inner axis should only has one from.", | 270 | + GE_ASSERT_TRUE(axis->from_axis.size() == 1UL, "axis[%s] is an inner axis and should only have one from_axis.", |
| 271 | axis->name.c_str()); | 271 | axis->name.c_str()); |
| 272 | // INNER axis should only has one parent axis | 272 | // INNER axis should only has one parent axis |
| 273 | std::string parents_size; | 273 | std::string parents_size; |
| @@ -622,7 +622,7 @@ af::Status TilingDataGenerator::GenTilingData(const ModelInfo &model_info) { | |||
| 622 | 622 | ||
| 623 | // Init tiling data gen for MemoryTilingDataGen | 623 | // Init tiling data gen for MemoryTilingDataGen |
| 624 | auto memory_tiling_data_gen = af::MakeShared<MemoryTilingDataGen>(model_info); | 624 | auto memory_tiling_data_gen = af::MakeShared<MemoryTilingDataGen>(model_info); |
| 625 | - GE_ASSERT_NOTNULL(memory_tiling_data_gen, "Init BlockTilingDataGen failed, tiling_key[%u].", tiling_key); | 625 | + GE_ASSERT_NOTNULL(memory_tiling_data_gen, "Init MemoryTilingDataGen failed, tiling_key[%u].", tiling_key); |
| 626 | GE_ASSERT_SUCCESS(memory_tiling_data_gen->Init()); | 626 | GE_ASSERT_SUCCESS(memory_tiling_data_gen->Init()); |
| 627 | graphs_tiling_data_gens_[tiling_key].emplace_back(memory_tiling_data_gen); | 627 | graphs_tiling_data_gens_[tiling_key].emplace_back(memory_tiling_data_gen); |
| 628 | return af::SUCCESS; | 628 | return af::SUCCESS; |
| @@ -200,8 +200,8 @@ std::string DurationGenDefineCode() { | |||
| 200 | code += "void Duration::Print() {\n"; | 200 | code += "void Duration::Print() {\n"; |
| 201 | code += " if (total_count_ == 0ULL) return;\n"; | 201 | code += " if (total_count_ == 0ULL) return;\n"; |
| 202 | code += | 202 | code += |
| 203 | - " OP_EVENT(OP_NAME, \"Duration record: name[%s], total_count[%lu], total_time[%lu], max_time[%lu], " | 203 | + " OP_EVENT(OP_NAME, \"Duration record: name[%s], total_count[%lu], total_time_ns[%lu], max_time_ns[%lu], " |
| 204 | - "min_time[%lu], average_time[%lu].\",\n"; | 204 | + "min_time_ns[%lu], average_time_ns[%lu].\",\n"; |
| 205 | code += " name_.c_str(), total_count_, total_time_, max_time_, min_time_,\n"; | 205 | code += " name_.c_str(), total_count_, total_time_, max_time_, min_time_,\n"; |
| 206 | code += " static_cast<uint64_t>(total_time_ / total_count_));\n"; | 206 | code += " static_cast<uint64_t>(total_time_ / total_count_));\n"; |
| 207 | code += "}\n\n"; | 207 | code += "}\n\n"; |
| @@ -64,8 +64,8 @@ class Duration { | |||
| 64 | return; | 64 | return; |
| 65 | } | 65 | } |
| 66 | GEEVENT( | 66 | GEEVENT( |
| 67 | - "Duration record: name[%s], total_count[%lu], total_time[%lu], max_time[%lu], min_time[%lu], " | 67 | + "Duration record: name[%s], total_count[%lu], total_time_ns[%lu], max_time_ns[%lu], min_time_ns[%lu], " |
| 68 | - "average_time[%lu].", | 68 | + "average_time_ns[%lu].", |
| 69 | name_.c_str(), total_count_, total_time_, max_time_, min_time_, | 69 | name_.c_str(), total_count_, total_time_, max_time_, min_time_, |
| 70 | static_cast<uint64_t>(total_time_ / total_count_)); | 70 | static_cast<uint64_t>(total_time_ / total_count_)); |
| 71 | } | 71 | } |
| @@ -190,7 +190,7 @@ Status ConcatApiCall::ParseConcatDim(const Tensor &x0, const Tensor &y, size_t & | |||
| 190 | break; | 190 | break; |
| 191 | } | 191 | } |
| 192 | } | 192 | } |
| 193 | - GE_ASSERT_TRUE(find_concat_dim, "not find concat dim in vectorized_axis"); | 193 | + GE_ASSERT_TRUE(find_concat_dim, "Failed to find concat dim in vectorized_axis"); |
| 194 | return af::SUCCESS; | 194 | return af::SUCCESS; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| @@ -51,7 +51,7 @@ Status CastApiCall::Generate(const TPipe &tpipe, const std::vector<ascir::AxisId | |||
| 51 | auto y = outputs[0].get(); | 51 | auto y = outputs[0].get(); |
| 52 | GELOGD("x, is_constant:%d", static_cast<int32_t>(x.is_constant)); | 52 | GELOGD("x, is_constant:%d", static_cast<int32_t>(x.is_constant)); |
| 53 | GELOGI("cast x_dtype:%d, y.dtype:%d.", static_cast<int32_t>(x.dtype), static_cast<int32_t>(y.dtype)); | 53 | GELOGI("cast x_dtype:%d, y.dtype:%d.", static_cast<int32_t>(x.dtype), static_cast<int32_t>(y.dtype)); |
| 54 | - GE_ASSERT_TRUE((x.dtype != y.dtype), "cast s_dtype:%d, y.dtype:%d", static_cast<int32_t>(x.dtype), | 54 | + GE_ASSERT_TRUE((x.dtype != y.dtype), "cast x_dtype:%d, y.dtype:%d", static_cast<int32_t>(x.dtype), |
| 55 | static_cast<int32_t>(y.dtype)); | 55 | static_cast<int32_t>(y.dtype)); |
| 56 | // 通过 src_dtype 和 dst_dtype 获取 mode | 56 | // 通过 src_dtype 和 dst_dtype 获取 mode |
| 57 | std::string x_dtype; | 57 | std::string x_dtype; |
| @@ -24,7 +24,7 @@ Status UnaryBitWidthChangeApiCall::Generate(const TPipe &tpipe, const std::vecto | |||
| 24 | std::string &result) const { | 24 | std::string &result) const { |
| 25 | auto x = inputs[0].get(); | 25 | auto x = inputs[0].get(); |
| 26 | auto y = outputs[0].get(); | 26 | auto y = outputs[0].get(); |
| 27 | - GE_ASSERT_TRUE((x.dtype != y.dtype), "cast s_dtype:%d, y.dtype:%d", static_cast<int32_t>(x.dtype), | 27 | + GE_ASSERT_TRUE((x.dtype != y.dtype), "cast x_dtype:%d, y.dtype:%d", static_cast<int32_t>(x.dtype), |
| 28 | static_cast<int32_t>(y.dtype)); | 28 | static_cast<int32_t>(y.dtype)); |
| 29 | 29 | ||
| 30 | // 获取tmp_buf复用TBuf的id | 30 | // 获取tmp_buf复用TBuf的id |
| @@ -135,7 +135,7 @@ Status GatherApiCall::Generate(const TPipe &tpipe, const std::vector<ascir::Axis | |||
| 135 | 135 | ||
| 136 | Status GatherApiCall::ParseAttr(const ascir::NodeView &node) { | 136 | Status GatherApiCall::ParseAttr(const ascir::NodeView &node) { |
| 137 | GE_CHK_GRAPH_STATUS_RET(node->attr.ir_attr->GetAttrValue("axis", this->axis), | 137 | GE_CHK_GRAPH_STATUS_RET(node->attr.ir_attr->GetAttrValue("axis", this->axis), |
| 138 | - "Failed to get Gahter axis attr, node = %s", node->GetNamePtr()); | 138 | + "Failed to get Gather axis attr, node = %s", node->GetNamePtr()); |
| 139 | GELOGI("name:%s, axis:%lld", node->GetNamePtr(), this->axis); | 139 | GELOGI("name:%s, axis:%lld", node->GetNamePtr(), this->axis); |
| 140 | return af::SUCCESS; | 140 | return af::SUCCESS; |
| 141 | } | 141 | } |
| @@ -61,7 +61,7 @@ class ApiCallFactory { | |||
| 61 | std::lock_guard<std::mutex> lock(mutex_); | 61 | std::lock_guard<std::mutex> lock(mutex_); |
| 62 | const auto iter = creator_map_.find(class_name); | 62 | const auto iter = creator_map_.find(class_name); |
| 63 | if (iter != creator_map_.end()) { | 63 | if (iter != creator_map_.end()) { |
| 64 | - GELOGD("ApiCallFactory::RegisterCreator: %s creator already exist", class_name.c_str()); | 64 | + GELOGD("ApiCallFactory::RegisterCreator: %s creator already exists", class_name.c_str()); |
| 65 | return; | 65 | return; |
| 66 | } | 66 | } |
| 67 | creator_map_[class_name] = func; | 67 | creator_map_[class_name] = func; |
| @@ -1225,7 +1225,7 @@ Status ApiCall::Generate(const TPipe &tpipe, const std::vector<ascir::AxisId> &c | |||
| 1225 | // apicall pre process | 1225 | // apicall pre process |
| 1226 | std::string pre_result; | 1226 | std::string pre_result; |
| 1227 | GE_CHK_STATUS_RET(PreProcess(tpipe, current_axis, output_tensors, pre_result), | 1227 | GE_CHK_STATUS_RET(PreProcess(tpipe, current_axis, output_tensors, pre_result), |
| 1228 | - "Codegen generate API call pre_p failed"); | 1228 | + "Codegen generate API call PreProcess failed"); |
| 1229 | ss << pre_result; | 1229 | ss << pre_result; |
| 1230 | std::string local_result; | 1230 | std::string local_result; |
| 1231 | GE_CHK_STATUS_RET(Generate(tpipe, current_axis, input_tensors, output_tensors, local_result), | 1231 | GE_CHK_STATUS_RET(Generate(tpipe, current_axis, input_tensors, output_tensors, local_result), |
| @@ -1235,7 +1235,7 @@ Status ApiCall::Generate(const TPipe &tpipe, const std::vector<ascir::AxisId> &c | |||
| 1235 | // apicall post process | 1235 | // apicall post process |
| 1236 | std::string post_result; | 1236 | std::string post_result; |
| 1237 | GE_CHK_STATUS_RET(PostProcess(tpipe, current_axis, output_tensors, post_result), | 1237 | GE_CHK_STATUS_RET(PostProcess(tpipe, current_axis, output_tensors, post_result), |
| 1238 | - "Codegen generate API call post_p failed"); | 1238 | + "Codegen generate API call PostProcess failed"); |
| 1239 | ss << post_result; | 1239 | ss << post_result; |
| 1240 | 1240 | ||
| 1241 | result = ss.str(); | 1241 | result = ss.str(); |
| @@ -162,9 +162,9 @@ Status TilingLib::ExtractMatMulCubeInfoFromImplGraph(const af::AscGraph &impl_gr | |||
| 162 | cube_info.matmul_node = node; | 162 | cube_info.matmul_node = node; |
| 163 | 163 | ||
| 164 | GE_CHK_STATUS_RET(ascgen_utils::GetCubeOutputTypeSize(node, cube_info.type_size), | 164 | GE_CHK_STATUS_RET(ascgen_utils::GetCubeOutputTypeSize(node, cube_info.type_size), |
| 165 | - "GetMutmulOutputTypeSize failed for node[%s]", node->GetName().c_str()); | 165 | + "GetCubeOutputTypeSize failed for node[%s]", node->GetName().c_str()); |
| 166 | 166 | ||
| 167 | - GE_CHK_STATUS_RET(ascgen_utils::GetCubeInputNum(node, cube_info.input_num), "GetMutmulInputNum failed for node[%s]", | 167 | + GE_CHK_STATUS_RET(ascgen_utils::GetCubeInputNum(node, cube_info.input_num), "GetCubeInputNum failed for node[%s]", |
| 168 | node->GetName().c_str()); | 168 | node->GetName().c_str()); |
| 169 | 169 | ||
| 170 | return af::SUCCESS; | 170 | return af::SUCCESS; |
| @@ -246,7 +246,7 @@ Status TilingLib::ExtractInputsFromMatMulNode(const ge::AscNodePtr &matmul_node, | |||
| 246 | GE_ASSERT_NOTNULL(load_node); | 246 | GE_ASSERT_NOTNULL(load_node); |
| 247 | 247 | ||
| 248 | TensorInfo tensor_info; | 248 | TensorInfo tensor_info; |
| 249 | - GE_CHK_STATUS(GetInputTensorInfoFromLoadNode(load_node, tensor_info), "Get mutmul input info failed."); | 249 | + GE_CHK_STATUS(GetInputTensorInfoFromLoadNode(load_node, tensor_info), "Get matmul input info failed."); |
| 250 | inputs.push_back(tensor_info); | 250 | inputs.push_back(tensor_info); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| @@ -651,7 +651,7 @@ std::string codegen::TilingData::GenCVConstTilingData(const std::string &tiling_ | |||
| 651 | ss << "&limit, 0);" << std::endl; | 651 | ss << "&limit, 0);" << std::endl; |
| 652 | ss << " if (ret == -1) {" << std::endl; | 652 | ss << " if (ret == -1) {" << std::endl; |
| 653 | ss << " uint32_t basen_basem_align_tmp = (uint32_t)basen_basem_align;" << std::endl; | 653 | ss << " uint32_t basen_basem_align_tmp = (uint32_t)basen_basem_align;" << std::endl; |
| 654 | - ss << " // ub_size必大于 basen_basem_align_tmp" << std::endl; | 654 | + ss << " // ub_size must be greater than basen_basem_align_tmp" << std::endl; |
| 655 | ss << " limit.ub_size = limit.ub_size - basen_basem_align_tmp * cube_output_type_size;" << std::endl; | 655 | ss << " limit.ub_size = limit.ub_size - basen_basem_align_tmp * cube_output_type_size;" << std::endl; |
| 656 | ss << " set_g_basen_basem_align(basen_align);" << std::endl; | 656 | ss << " set_g_basen_basem_align(basen_align);" << std::endl; |
| 657 | ss << " OP_LOGI(OP_NAME, \"set_g_basen_basem_align=%d, ub_size=%u\", get_g_basen_basem_align(), ub_size);" | 657 | ss << " OP_LOGI(OP_NAME, \"set_g_basen_basem_align=%d, ub_size=%u\", get_g_basen_basem_align(), ub_size);" |
| @@ -547,7 +547,9 @@ void TilingLib::GenPgoWrapperParmCall(const ascir::FusedScheduledResult &fused_s | |||
| 547 | ss << " if (find_best_tiling_key_fn != nullptr) {" << std::endl; | 547 | ss << " if (find_best_tiling_key_fn != nullptr) {" << std::endl; |
| 548 | ss << " tiling_key = find_best_tiling_key_fn(*tiling_data);" << std::endl; | 548 | ss << " tiling_key = find_best_tiling_key_fn(*tiling_data);" << std::endl; |
| 549 | ss << " if (tiling_key < 0 || static_cast<uint64_t>(tiling_key) >= tiling_key_count) {" << std::endl; | 549 | ss << " if (tiling_key < 0 || static_cast<uint64_t>(tiling_key) >= tiling_key_count) {" << std::endl; |
| 550 | - ss << " DLOGE(\"find best tiling key failed\");" << std::endl; | 550 | + ss << " DLOGE(\"find best tiling key failed, tiling_key=%ld, valid range=[0,%lu)\", tiling_key, " |
| 551 | + "tiling_key_count);" | ||
| 552 | + << std::endl; | ||
| 551 | ss << " return FAILED;" << std::endl; | 553 | ss << " return FAILED;" << std::endl; |
| 552 | ss << " }" << std::endl; | 554 | ss << " }" << std::endl; |
| 553 | ss << " } else {" << std::endl; | 555 | ss << " } else {" << std::endl; |
| @@ -944,7 +946,8 @@ void TilingLib::GenPgoBatchCallback(std::stringstream &ss) const { | |||
| 944 | ss << " if (best_perf > average_duration) {" << std::endl; | 946 | ss << " if (best_perf > average_duration) {" << std::endl; |
| 945 | ss << " best_perf = average_duration;" << std::endl; | 947 | ss << " best_perf = average_duration;" << std::endl; |
| 946 | ss << " }" << std::endl; | 948 | ss << " }" << std::endl; |
| 947 | - ss << " DLOGD(\"average_duration:%f best_perf:%f count:%\" PRId64 \" batch_size:%\" PRIu64 \" flush_count:%d\", " | 949 | + ss << " DLOGD(\"average_duration:%f ns best_perf:%f ns count:%\" PRId64 \" batch_size:%\" PRIu64 \" " |
| 950 | + "flush_count:%d\", " | ||
| 948 | "average_duration, best_perf, count, batch_size, flush_count);" | 951 | "average_duration, best_perf, count, batch_size, flush_count);" |
| 949 | << std::endl; | 952 | << std::endl; |
| 950 | ss << " }" << std::endl; | 953 | ss << " }" << std::endl; |
| @@ -1141,7 +1144,7 @@ void TilingLib::GenPgoLegacyProfilingCallback(std::stringstream &ss) const { | |||
| 1141 | ss << " for (const auto &pair : g_profiling_map) {" << std::endl; | 1144 | ss << " for (const auto &pair : g_profiling_map) {" << std::endl; |
| 1142 | ss << " msptiActivityKernel* kernel = reinterpret_cast<msptiActivityKernel*>(pair.second);" << std::endl; | 1145 | ss << " msptiActivityKernel* kernel = reinterpret_cast<msptiActivityKernel*>(pair.second);" << std::endl; |
| 1143 | ss << " durations.push_back(kernel->end - kernel->start);" << std::endl; | 1146 | ss << " durations.push_back(kernel->end - kernel->start);" << std::endl; |
| 1144 | - ss << " DLOGD(\"kernel duration:%\" PRIu64 \"\", kernel->end - kernel->start);" << std::endl; | 1147 | + ss << " DLOGD(\"kernel duration:%\" PRIu64 \" ns\", kernel->end - kernel->start);" << std::endl; |
| 1145 | ss << " }" << std::endl; | 1148 | ss << " }" << std::endl; |
| 1146 | ss << " std::sort(durations.begin(), durations.end(), std::greater<uint64_t>());" << std::endl; | 1149 | ss << " std::sort(durations.begin(), durations.end(), std::greater<uint64_t>());" << std::endl; |
| 1147 | ss << " for (size_t i = 1; i < 6; ++i) {" << std::endl; | 1150 | ss << " for (size_t i = 1; i < 6; ++i) {" << std::endl; |
| @@ -51,7 +51,7 @@ TracingRecorderManager::TracingRecorderManager() { | |||
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | TracingRecorder *TracingRecorderManager::GetTracingRecorder(TracingModule module) const { | 53 | TracingRecorder *TracingRecorderManager::GetTracingRecorder(TracingModule module) const { |
| 54 | - GE_ASSERT_TRUE(static_cast<size_t>(module) <= tracing_recorders_.size(), "Module [%zu] should less than %zu", | 54 | + GE_ASSERT_TRUE(static_cast<size_t>(module) <= tracing_recorders_.size(), "Module [%zu] should be less than %zu", |
| 55 | static_cast<size_t>(module), tracing_recorders_.size()); | 55 | static_cast<size_t>(module), tracing_recorders_.size()); |
| 56 | return tracing_recorders_[static_cast<int32_t>(module)].get(); | 56 | return tracing_recorders_[static_cast<int32_t>(module)].get(); |
| 57 | } | 57 | } |
| @@ -446,7 +446,7 @@ bool IsGeneralizeBrcInlineScene(const af::AscNodePtr &node, const af::AscTensor | |||
| 446 | i0_meger_repeates); | 446 | i0_meger_repeates); |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | - GELOGD("node_name:%s, i0_meger_repeates:%s, i1_meger_repeates:%s", node->GetNamePtr(), | 449 | + GELOGD("node_name:%s, i0_merged_repeats:%s, i1_merged_repeats:%s", node->GetNamePtr(), |
| 450 | VectorToStr(i0_meger_repeates).c_str(), VectorToStr(i1_meger_repeates).c_str()); | 450 | VectorToStr(i0_meger_repeates).c_str(), VectorToStr(i1_meger_repeates).c_str()); |
| 451 | 451 | ||
| 452 | if (i0_meger_repeates.size() == 2U && i1_meger_repeates.size() == 2U) { | 452 | if (i0_meger_repeates.size() == 2U && i1_meger_repeates.size() == 2U) { |
| @@ -971,7 +971,7 @@ int CommonOpsOperatorInit(PyObject *self_pyobject, PyObject *args, PyObject *kwa | |||
| 971 | PY_ASSERT_NOTNULL(op); | 971 | PY_ASSERT_NOTNULL(op); |
| 972 | PY_ASSERT_NOTNULL(ascgraph_object); | 972 | PY_ASSERT_NOTNULL(ascgraph_object); |
| 973 | PY_ASSERT(PyObject_IsInstance(ascgraph_object, ge::PtrToPtr<PyTypeObject, PyObject>(&pyascir::HintGraph::type)) != 0, | 973 | PY_ASSERT(PyObject_IsInstance(ascgraph_object, ge::PtrToPtr<PyTypeObject, PyObject>(&pyascir::HintGraph::type)) != 0, |
| 974 | - "The asc graph node requires hitgraph to be passed in as an input parameter."); | 974 | + "The asc graph node requires hintgraph to be passed in as an input parameter."); |
| 975 | 975 | ||
| 976 | auto graph = ge::PtrToPtr<PyObject, pyascir::HintGraph::Object>(ascgraph_object); | 976 | auto graph = ge::PtrToPtr<PyObject, pyascir::HintGraph::Object>(ascgraph_object); |
| 977 | PY_ASSERT_NOTNULL(graph->graph); | 977 | PY_ASSERT_NOTNULL(graph->graph); |
| @@ -1029,7 +1029,8 @@ PyObject *OpsOperatorMethod::InferDtype(PyObject *self_pyobject, PyObject *args) | |||
| 1029 | ge::AscendString op_name; | 1029 | ge::AscendString op_name; |
| 1030 | (void)self->op->GetName(op_name); | 1030 | (void)self->op->GetName(op_name); |
| 1031 | auto node = af::NodeUtilsEx::GetNodeFromOperator(*self->op); | 1031 | auto node = af::NodeUtilsEx::GetNodeFromOperator(*self->op); |
| 1032 | - PY_ASSERT_NOTNULL(node, "node %s %s need set input before call infer dype", op_name.GetString(), op_type.GetString()); | 1032 | + PY_ASSERT_NOTNULL(node, "node %s %s need set input before call infer dtype", op_name.GetString(), |
| 1033 | + op_type.GetString()); | ||
| 1033 | GE_ASSERT( | 1034 | GE_ASSERT( |
| 1034 | HintGraph::ProcessSingleNode(std::dynamic_pointer_cast<af::AscNode>(std::const_pointer_cast<af::Node>(node)))); | 1035 | HintGraph::ProcessSingleNode(std::dynamic_pointer_cast<af::AscNode>(std::const_pointer_cast<af::Node>(node)))); |
| 1035 | Py_RETURN_NONE; | 1036 | Py_RETURN_NONE; |
| @@ -1066,8 +1067,8 @@ int OpsOperatorInput::_setter_list(PyObject *self, PyObject *value, void *closur | |||
| 1066 | ge::AscendString op_name; | 1067 | ge::AscendString op_name; |
| 1067 | (void)self_->op->GetName(op_name); | 1068 | (void)self_->op->GetName(op_name); |
| 1068 | if (op_type == kAscBackendType || op_type == geir_op::AscGraph::Type) { | 1069 | if (op_type == kAscBackendType || op_type == geir_op::AscGraph::Type) { |
| 1069 | - PY_ASSERT(dynamic_num == self_->op->GetInputsSize(), "%s %s should has %zu input but given %u", op_name.GetString(), | 1070 | + PY_ASSERT(dynamic_num == self_->op->GetInputsSize(), "%s %s should have %zu input(s) but %u given", |
| 1070 | - op_type.GetString(), self_->op->GetInputsSize(), dynamic_num); | 1071 | + op_name.GetString(), op_type.GetString(), self_->op->GetInputsSize(), dynamic_num); |
| 1071 | } else { | 1072 | } else { |
| 1072 | PY_ASSERT_GRAPH_SUCCESS(af::SetDynamicInputNumByIrIndex(*self_->op, ir_index, dynamic_num)); | 1073 | PY_ASSERT_GRAPH_SUCCESS(af::SetDynamicInputNumByIrIndex(*self_->op, ir_index, dynamic_num)); |
| 1073 | } | 1074 | } |
| @@ -1124,9 +1125,9 @@ int OpsOperatorInput::_setter_or_setter_list(PyObject *self, PyObject *value, vo | |||
| 1124 | template <typename OpType, typename AttrDefType> | 1125 | template <typename OpType, typename AttrDefType> |
| 1125 | auto GetValidatedIrAttr(PyObject *self, const char *attr_type_name) -> AttrDefType * { | 1126 | auto GetValidatedIrAttr(PyObject *self, const char *attr_type_name) -> AttrDefType * { |
| 1126 | auto ir_attr_obj = reinterpret_cast<typename IrAttr<OpType>::Object *>(self); | 1127 | auto ir_attr_obj = reinterpret_cast<typename IrAttr<OpType>::Object *>(self); |
| 1127 | - PY_ASSERT(ir_attr_obj != nullptr, "Inner error, has no ir attr", ""); | 1128 | + PY_ASSERT(ir_attr_obj != nullptr, "Internal error, has no ir attr", ""); |
| 1128 | auto target_attr = dynamic_cast<AttrDefType *>(ir_attr_obj->ir_attr); | 1129 | auto target_attr = dynamic_cast<AttrDefType *>(ir_attr_obj->ir_attr); |
| 1129 | - PY_ASSERT(target_attr != nullptr, "Inner error, ir attr type is not %s", attr_type_name); | 1130 | + PY_ASSERT(target_attr != nullptr, "Internal error, ir attr type is not %s", attr_type_name); |
| 1130 | return target_attr; | 1131 | return target_attr; |
| 1131 | } | 1132 | } |
| 1132 | 1133 | ||
| @@ -51,14 +51,14 @@ bool OutputSymbolShapeDeserialize(PyObject *output_shape_obj, std::vector<std::v | |||
| 51 | for (size_t i = 0UL; i < output_shape_obj_size; i++) { | 51 | for (size_t i = 0UL; i < output_shape_obj_size; i++) { |
| 52 | PyObject *inner_list = PyList_GetItem(output_shape_obj, i); | 52 | PyObject *inner_list = PyList_GetItem(output_shape_obj, i); |
| 53 | if (PyList_Check(inner_list) == kPythonFail) { | 53 | if (PyList_Check(inner_list) == kPythonFail) { |
| 54 | - ERROR_PRINT("OutputSymbolShape inner error, expected a list of lists"); | 54 | + ERROR_PRINT("OutputSymbolShape internal error, expected a list of lists"); |
| 55 | return false; | 55 | return false; |
| 56 | } | 56 | } |
| 57 | size_t inner_size = PyList_Size(inner_list); | 57 | size_t inner_size = PyList_Size(inner_list); |
| 58 | for (size_t j = 0UL; j < inner_size; j++) { | 58 | for (size_t j = 0UL; j < inner_size; j++) { |
| 59 | PyObject *item = PyList_GetItem(inner_list, j); | 59 | PyObject *item = PyList_GetItem(inner_list, j); |
| 60 | if (PyUnicode_Check(item) == kPythonFail) { | 60 | if (PyUnicode_Check(item) == kPythonFail) { |
| 61 | - ERROR_PRINT("OutputSymbolShape inner error, expected a unicode string"); | 61 | + ERROR_PRINT("OutputSymbolShape internal error, expected a unicode string"); |
| 62 | return false; | 62 | return false; |
| 63 | } | 63 | } |
| 64 | std::string item_str = PyUnicode_AsUTF8(item); | 64 | std::string item_str = PyUnicode_AsUTF8(item); |
| @@ -90,7 +90,7 @@ bool CollectInputDtypes(const af::AscNodePtr &node, std::vector<af::DataType> &i | |||
| 90 | return CollectInputDtypesForOutput(node, input_dtypes); | 90 | return CollectInputDtypesForOutput(node, input_dtypes); |
| 91 | } | 91 | } |
| 92 | const auto op_desc = node->GetOpDesc(); | 92 | const auto op_desc = node->GetOpDesc(); |
| 93 | - PY_ASSERT_NOTNULL(op_desc, "Inner error!"); | 93 | + PY_ASSERT_NOTNULL(op_desc, "Internal error!"); |
| 94 | 94 | ||
| 95 | const auto &ir_inputs = op_desc->GetIrInputs(); | 95 | const auto &ir_inputs = op_desc->GetIrInputs(); |
| 96 | std::map<size_t, std::pair<size_t, size_t>> ir_input_2_range; | 96 | std::map<size_t, std::pair<size_t, size_t>> ir_input_2_range; |
| @@ -181,7 +181,7 @@ bool DoDynamicOutputInference(const af::AscNodePtr &node, InferDtypeFunc infer_f | |||
| 181 | 181 | ||
| 182 | if (has_complete_output_dtypes) { | 182 | if (has_complete_output_dtypes) { |
| 183 | PY_ASSERT_SUCCESS(infer_func(input_dtypes, output_dtyps, npu_arch), | 183 | PY_ASSERT_SUCCESS(infer_func(input_dtypes, output_dtyps, npu_arch), |
| 184 | - "Check dtype failed for %s %s; input_dtypes: %s, output_dytpes: %s", node->GetNamePtr(), | 184 | + "Check dtype failed for %s %s; input_dtypes: %s, output_dtypes: %s", node->GetNamePtr(), |
| 185 | node->GetTypePtr(), DataTypesToString(input_dtypes).c_str(), | 185 | node->GetTypePtr(), DataTypesToString(input_dtypes).c_str(), |
| 186 | DataTypesToString(output_dtyps).c_str()); | 186 | DataTypesToString(output_dtyps).c_str()); |
| 187 | return true; | 187 | return true; |
| @@ -232,7 +232,7 @@ bool DoInference(const af::AscNodePtr &node, InferDtypeFunc infer_func, const st | |||
| 232 | // 执行推导或者校验 | 232 | // 执行推导或者校验 |
| 233 | if (!for_infer) { | 233 | if (!for_infer) { |
| 234 | PY_ASSERT_SUCCESS(infer_func(input_dtypes, output_dtyps, npu_arch), | 234 | PY_ASSERT_SUCCESS(infer_func(input_dtypes, output_dtyps, npu_arch), |
| 235 | - "Check dtype failed for %s %s; input_dtypes: %s, output_dytpes: %s", node->GetNamePtr(), | 235 | + "Check dtype failed for %s %s; input_dtypes: %s, output_dtypes: %s", node->GetNamePtr(), |
| 236 | node->GetTypePtr(), DataTypesToString(input_dtypes).c_str(), | 236 | node->GetTypePtr(), DataTypesToString(input_dtypes).c_str(), |
| 237 | DataTypesToString(output_dtyps).c_str()); | 237 | DataTypesToString(output_dtyps).c_str()); |
| 238 | return true; | 238 | return true; |
| @@ -455,7 +455,7 @@ def modify_json_file(json_file, host_so, is_cross_compile_flag=False): | |||
| 455 | data["opParaSize"] = int(lib.GetTilingDataSize()) | 455 | data["opParaSize"] = int(lib.GetTilingDataSize()) |
| 456 | CommonUtility.print_compile_log( | 456 | CommonUtility.print_compile_log( |
| 457 | "", | 457 | "", |
| 458 | - f"{kernenl_file_name} tiling size: {data['opParaSize']}", | 458 | + f"{kernenl_file_name} tiling size: {data['opParaSize']} bytes", |
| 459 | AscendCLogLevel.LOG_INFO, | 459 | AscendCLogLevel.LOG_INFO, |
| 460 | ) | 460 | ) |
| 461 | # 自动融合 workspace 默认只有一个 | 461 | # 自动融合 workspace 默认只有一个 |
| @@ -956,7 +956,7 @@ def generate_device_and_host_code(graph_name, temp_dir, params, code_gen): | |||
| 956 | # 生成host代码 | 956 | # 生成host代码 |
| 957 | if not check_keys_in_dict(params, ["output_symbol_shape"]): | 957 | if not check_keys_in_dict(params, ["output_symbol_shape"]): |
| 958 | CommonUtility.print_compile_log( | 958 | CommonUtility.print_compile_log( |
| 959 | - "", "output_symbol_shape is not exist", AscendCLogLevel.LOG_ERROR | 959 | + "", "output_symbol_shape does not exist", AscendCLogLevel.LOG_ERROR |
| 960 | ) | 960 | ) |
| 961 | raise Exception("An error occurred autofuse compile for check extra_params") | 961 | raise Exception("An error occurred autofuse compile for check extra_params") |
| 962 | CommonUtility.print_compile_log( | 962 | CommonUtility.print_compile_log( |
| @@ -1501,7 +1501,7 @@ def asc_pgo_exec(*args, temp_dir, params, op_kernel_src, code_gen): | |||
| 1501 | 1501 | ||
| 1502 | config_path = os.path.join(pgo_dir, f"{graph_name}_config.txt") | 1502 | config_path = os.path.join(pgo_dir, f"{graph_name}_config.txt") |
| 1503 | if os.path.exists(config_path): | 1503 | if os.path.exists(config_path): |
| 1504 | - logger.info(f"[PGO] {config_path} exist, skip pgo tuning") | 1504 | + logger.info(f"[PGO] {config_path} exists, skip pgo tuning") |
| 1505 | return | 1505 | return |
| 1506 | 1506 | ||
| 1507 | timestamp_set(True, graph_name, "CompileKernelForPGO") | 1507 | timestamp_set(True, graph_name, "CompileKernelForPGO") |
| @@ -2880,7 +2880,7 @@ def asc_codegen_compile(*args, **kwargs): | |||
| 2880 | if not is_valid_path(kernel_meta_dir): | 2880 | if not is_valid_path(kernel_meta_dir): |
| 2881 | CommonUtility.print_compile_log( | 2881 | CommonUtility.print_compile_log( |
| 2882 | "", | 2882 | "", |
| 2883 | - f"invalid kernel meta path : `{kernel_meta_dir}' ", | 2883 | + f"invalid kernel meta path: `{kernel_meta_dir}'", |
| 2884 | AscendCLogLevel.LOG_ERROR, | 2884 | AscendCLogLevel.LOG_ERROR, |
| 2885 | ) | 2885 | ) |
| 2886 | raise Exception("An error occurred autofuse compile for check kernel_meta path") | 2886 | raise Exception("An error occurred autofuse compile for check kernel_meta path") |
| @@ -2888,7 +2888,7 @@ def asc_codegen_compile(*args, **kwargs): | |||
| 2888 | if not os.path.exists(kernel_meta_dir): | 2888 | if not os.path.exists(kernel_meta_dir): |
| 2889 | CommonUtility.print_compile_log( | 2889 | CommonUtility.print_compile_log( |
| 2890 | "", | 2890 | "", |
| 2891 | - f"kernel meta parent dir is not exist : `{kernel_meta_dir}' ", | 2891 | + f"kernel meta parent dir does not exist: `{kernel_meta_dir}'", |
| 2892 | AscendCLogLevel.LOG_ERROR, | 2892 | AscendCLogLevel.LOG_ERROR, |
| 2893 | ) | 2893 | ) |
| 2894 | raise Exception("An error occurred autofuse compile for check kernel_meta path") | 2894 | raise Exception("An error occurred autofuse compile for check kernel_meta path") |
| @@ -296,7 +296,7 @@ bool PluginManager::GetRequiredOppAbiVersion(std::vector<std::pair<uint32_t, uin | |||
| 296 | } else if (mmIsDir((model_path + kRuntimePath).c_str()) == EN_OK) { | 296 | } else if (mmIsDir((model_path + kRuntimePath).c_str()) == EN_OK) { |
| 297 | version_path = model_path + kRuntimePath + kVersionInfo; | 297 | version_path = model_path + kRuntimePath + kVersionInfo; |
| 298 | } else { | 298 | } else { |
| 299 | - GELOGW("compiler and runtime not exited"); | 299 | + GELOGW("compiler and runtime not exist"); |
| 300 | return true; | 300 | return true; |
| 301 | } | 301 | } |
| 302 | GELOGI("extract required opp abi version info from %s", version_path.c_str()); | 302 | GELOGI("extract required opp abi version info from %s", version_path.c_str()); |
| @@ -329,19 +329,19 @@ bool PluginManager::GetRequiredOppAbiVersion(std::vector<std::pair<uint32_t, uin | |||
| 329 | second = second.substr(kEffectiveVersionNum, second.size() - kEffectiveVersionNum); | 329 | second = second.substr(kEffectiveVersionNum, second.size() - kEffectiveVersionNum); |
| 330 | uint32_t first_num = 0U; | 330 | uint32_t first_num = 0U; |
| 331 | if (!GetEffectiveVersion(first, first_num)) { | 331 | if (!GetEffectiveVersion(first, first_num)) { |
| 332 | - GELOGW("[InvalidVersion] Format of required_opp_abi_version [%s] is not invalid", version.c_str()); | 332 | + GELOGW("[InvalidVersion] Format of required_opp_abi_version [%s] is invalid", version.c_str()); |
| 333 | return false; | 333 | return false; |
| 334 | } | 334 | } |
| 335 | uint32_t second_num = 0U; | 335 | uint32_t second_num = 0U; |
| 336 | if (!GetEffectiveVersion(second, second_num)) { | 336 | if (!GetEffectiveVersion(second, second_num)) { |
| 337 | - GELOGW("[InvalidVersion] Format of required_opp_abi_version [%s] is not invalid", version.c_str()); | 337 | + GELOGW("[InvalidVersion] Format of required_opp_abi_version [%s] is invalid", version.c_str()); |
| 338 | return false; | 338 | return false; |
| 339 | } | 339 | } |
| 340 | (void)required_opp_abi_version.emplace_back(first_num, second_num); | 340 | (void)required_opp_abi_version.emplace_back(first_num, second_num); |
| 341 | } else { | 341 | } else { |
| 342 | uint32_t tmp_num = 0U; | 342 | uint32_t tmp_num = 0U; |
| 343 | if (!GetEffectiveVersion(first, tmp_num)) { | 343 | if (!GetEffectiveVersion(first, tmp_num)) { |
| 344 | - GELOGW("[InvalidVersion] Format of required_opp_abi_version [%s] is not invalid", version.c_str()); | 344 | + GELOGW("[InvalidVersion] Format of required_opp_abi_version [%s] is invalid", version.c_str()); |
| 345 | return false; | 345 | return false; |
| 346 | } | 346 | } |
| 347 | (void)required_opp_abi_version.emplace_back(tmp_num, tmp_num); | 347 | (void)required_opp_abi_version.emplace_back(tmp_num, tmp_num); |
| @@ -432,7 +432,7 @@ bool PluginManager::CheckOppAndCompilerVersions(const std::string &opp_version, | |||
| 432 | return false; | 432 | return false; |
| 433 | } | 433 | } |
| 434 | if (!IsVersionWithInRequiredRange(effective_opp_version, required_version)) { | 434 | if (!IsVersionWithInRequiredRange(effective_opp_version, required_version)) { |
| 435 | - GELOGW("opp_version:%s is not with in required_opp_abi_version:%s", opp_version.c_str(), | 435 | + GELOGW("opp_version:%s is not within required_opp_abi_version:%s", opp_version.c_str(), |
| 436 | TransRequiredOppAbiVersionToString(required_version).c_str()); | 436 | TransRequiredOppAbiVersionToString(required_version).c_str()); |
| 437 | return false; | 437 | return false; |
| 438 | } | 438 | } |
| @@ -446,7 +446,7 @@ bool PluginManager::CheckOppAndCompilerVersions(const std::string &opp_version, | |||
| 446 | return false; | 446 | return false; |
| 447 | } | 447 | } |
| 448 | if (!IsVersionWithInRequiredRange(effective_compiler_version, required_version)) { | 448 | if (!IsVersionWithInRequiredRange(effective_compiler_version, required_version)) { |
| 449 | - GELOGW("compiler version:%s is not with in required_opp_abi_version:%s", opp_version.c_str(), | 449 | + GELOGW("compiler version:%s is not within required_opp_abi_version:%s", opp_version.c_str(), |
| 450 | TransRequiredOppAbiVersionToString(required_version).c_str()); | 450 | TransRequiredOppAbiVersionToString(required_version).c_str()); |
| 451 | return false; | 451 | return false; |
| 452 | } | 452 | } |
| @@ -1060,7 +1060,7 @@ void PluginManager::GetCurEnvPackageOsAndCpuType(std::string &host_env_os, std:: | |||
| 1060 | } else if (mmAccess2((model_path + kRuntimePath + kScene).c_str(), M_R_OK) == EN_OK) { | 1060 | } else if (mmAccess2((model_path + kRuntimePath + kScene).c_str(), M_R_OK) == EN_OK) { |
| 1061 | scene = model_path + kRuntimePath + kScene; | 1061 | scene = model_path + kRuntimePath + kScene; |
| 1062 | } else { | 1062 | } else { |
| 1063 | - GELOGW("opp and runtime not exit"); | 1063 | + GELOGW("opp and runtime not exist"); |
| 1064 | return; | 1064 | return; |
| 1065 | } | 1065 | } |
| 1066 | GELOGI("extract os and cpu info from %s", scene.c_str()); | 1066 | GELOGI("extract os and cpu info from %s", scene.c_str()); |
| @@ -1171,7 +1171,7 @@ void PluginManager::GetFileListWithSuffix(const std::string &path, const std::st | |||
| 1171 | 1171 | ||
| 1172 | const INT32 is_dir = mmIsDir(&(resolved_path[0U])); | 1172 | const INT32 is_dir = mmIsDir(&(resolved_path[0U])); |
| 1173 | if (is_dir != EN_OK) { | 1173 | if (is_dir != EN_OK) { |
| 1174 | - GELOGW("[FindSo][Check] Open directory %s failed, maybe it is not exit or not a dir, errmsg:%s", | 1174 | + GELOGW("[FindSo][Check] Open directory %s failed, maybe it does not exist or is not a dir, errmsg:%s", |
| 1175 | &(resolved_path[0U]), strerror(errno)); | 1175 | &(resolved_path[0U]), strerror(errno)); |
| 1176 | return; | 1176 | return; |
| 1177 | } | 1177 | } |
| @@ -289,7 +289,7 @@ graphStatus SaveBinToFile(const char *const data, size_t length, const std::stri | |||
| 289 | SplitFilePath(file_path, dir_path, file_name); | 289 | SplitFilePath(file_path, dir_path, file_name); |
| 290 | const bool meta_file_exist = (mmAccess(dir_path.c_str()) == EN_OK); | 290 | const bool meta_file_exist = (mmAccess(dir_path.c_str()) == EN_OK); |
| 291 | if ((!dir_path.empty()) && (!meta_file_exist)) { | 291 | if ((!dir_path.empty()) && (!meta_file_exist)) { |
| 292 | - GE_ASSERT_TRUE((CreateDir(dir_path) == kFileSuccess), "Create direct failed, path: %s.", file_path.c_str()); | 292 | + GE_ASSERT_TRUE((CreateDir(dir_path) == kFileSuccess), "Create directory failed, path: %s.", file_path.c_str()); |
| 293 | } | 293 | } |
| 294 | // 当dir_path为空时,默认使用当前路径 | 294 | // 当dir_path为空时,默认使用当前路径 |
| 295 | std::string real_path = RealPath(dir_path.empty() ? "." : dir_path.c_str()); | 295 | std::string real_path = RealPath(dir_path.empty() ? "." : dir_path.c_str()); |
| @@ -107,7 +107,7 @@ graphStatus EstablishAscNodeAndEdges(const ascendc_ir::proto::AscGraphDef &asc_g | |||
| 107 | node_attr.name().c_str()); | 107 | node_attr.name().c_str()); |
| 108 | GE_ASSERT_GRAPH_SUCCESS( | 108 | GE_ASSERT_GRAPH_SUCCESS( |
| 109 | GraphUtils::AddEdge(src_node->GetOutDataAnchor(src_out_index), dst_node->GetInDataAnchor(dst_in_index)), | 109 | GraphUtils::AddEdge(src_node->GetOutDataAnchor(src_out_index), dst_node->GetInDataAnchor(dst_in_index)), |
| 110 | - "[Add][Edge] failed to add edge from node[%s:%d] to node[%s:%d] failed.Possible duplicate link.", | 110 | + "[Add][Edge] failed to add edge from node[%s:%d] to node[%s:%d], possible duplicate link.", |
| 111 | src_node_name.c_str(), src_out_index, dst_node_name.c_str(), dst_in_index); | 111 | src_node_name.c_str(), src_out_index, dst_node_name.c_str(), dst_in_index); |
| 112 | GELOGD("[Add][Edge] from node[%s:%d] to node[%s:%d].", src_node_name.c_str(), src_out_index, | 112 | GELOGD("[Add][Edge] from node[%s:%d] to node[%s:%d].", src_node_name.c_str(), src_out_index, |
| 113 | dst_node_name.c_str(), dst_in_index); | 113 | dst_node_name.c_str(), dst_in_index); |
| @@ -150,7 +150,7 @@ graphStatus AscGraphUtils::InsertNodeAfter(const OutDataAnchorPtr &src, const st | |||
| 150 | const auto src_node = src->GetOwnerNodeBarePtr(); | 150 | const auto src_node = src->GetOwnerNodeBarePtr(); |
| 151 | GE_CHECK_NOTNULL(src_node); | 151 | GE_CHECK_NOTNULL(src_node); |
| 152 | GE_ASSERT_TRUE(src_node->GetOwnerComputeGraph() == insert_node->GetOwnerComputeGraph(), | 152 | GE_ASSERT_TRUE(src_node->GetOwnerComputeGraph() == insert_node->GetOwnerComputeGraph(), |
| 153 | - "src:%s and insert_node:%s does not exist in the same graph.", src_node->GetName().c_str(), | 153 | + "src:%s and insert_node:%s do not exist in the same graph.", src_node->GetName().c_str(), |
| 154 | insert_node->GetName().c_str()); | 154 | insert_node->GetName().c_str()); |
| 155 | 155 | ||
| 156 | GE_ASSERT_GRAPH_SUCCESS(GraphUtils::AddEdge(src, insert_node->GetInDataAnchor(static_cast<int32_t>(input_index)))); | 156 | GE_ASSERT_GRAPH_SUCCESS(GraphUtils::AddEdge(src, insert_node->GetInDataAnchor(static_cast<int32_t>(input_index)))); |
| @@ -192,7 +192,7 @@ graphStatus AscGraphUtils::InsertNodeBefore(const InDataAnchorPtr &dst, const No | |||
| 192 | const auto dst_node = dst->GetOwnerNodeBarePtr(); | 192 | const auto dst_node = dst->GetOwnerNodeBarePtr(); |
| 193 | GE_CHECK_NOTNULL(dst_node); | 193 | GE_CHECK_NOTNULL(dst_node); |
| 194 | GE_ASSERT_TRUE(dst_node->GetOwnerComputeGraph() == insert_node->GetOwnerComputeGraph(), | 194 | GE_ASSERT_TRUE(dst_node->GetOwnerComputeGraph() == insert_node->GetOwnerComputeGraph(), |
| 195 | - "dst:%s and insert_node:%s does not exist in the same graph.", dst_node->GetName().c_str(), | 195 | + "dst:%s and insert_node:%s do not exist in the same graph.", dst_node->GetName().c_str(), |
| 196 | insert_node->GetName().c_str()); | 196 | insert_node->GetName().c_str()); |
| 197 | 197 | ||
| 198 | const auto src_node_out_anchor = dst->GetPeerOutAnchor(); | 198 | const auto src_node_out_anchor = dst->GetPeerOutAnchor(); |
| @@ -384,7 +384,7 @@ graphStatus AscGraphUtils::DeserializeFromProto(const ascendc_ir::proto::AscGrap | |||
| 384 | asc_node->outputs(); | 384 | asc_node->outputs(); |
| 385 | asc_node->inputs(); | 385 | asc_node->inputs(); |
| 386 | GE_ASSERT_TRUE(node_index < asc_nodes.size(), | 386 | GE_ASSERT_TRUE(node_index < asc_nodes.size(), |
| 387 | - "[Deserialize][Node] failed, node_index[%ld] should less than nodes size[%zu].", node_index, | 387 | + "[Deserialize][Node] failed, node_index[%ld] should be less than nodes size[%zu].", node_index, |
| 388 | asc_nodes.size()); | 388 | asc_nodes.size()); |
| 389 | const auto &asc_node_def = asc_nodes[static_cast<int32_t>(node_index)]; | 389 | const auto &asc_node_def = asc_nodes[static_cast<int32_t>(node_index)]; |
| 390 | const auto op_desc = asc_node->GetOpDesc(); | 390 | const auto op_desc = asc_node->GetOpDesc(); |
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | + | ||
| 12 | namespace af { | 13 | namespace af { |
| 13 | std::stringstream &DumpAscirGraph::TilingKeyStr(std::stringstream &ss, AscGraph &graph) { | 14 | std::stringstream &DumpAscirGraph::TilingKeyStr(std::stringstream &ss, AscGraph &graph) { |
| 14 | std::string Tilingkey = std::to_string(graph.GetTilingKey()); | 15 | std::string Tilingkey = std::to_string(graph.GetTilingKey()); |
| @@ -275,7 +276,7 @@ void DumpAscirGraph::WriteOutToFile(const std::string &filename, AscGraph &graph | |||
| 275 | const auto &content = DumpGraph(graph); | 276 | const auto &content = DumpGraph(graph); |
| 276 | std::ofstream outFile(filename); | 277 | std::ofstream outFile(filename); |
| 277 | if (!outFile) { | 278 | if (!outFile) { |
| 278 | - std::cerr << "Cannot open the file: " << filename << std::endl; | 279 | + GELOGE(FAILED, "Cannot open the file: %s.", filename.c_str()); |
| 279 | return; | 280 | return; |
| 280 | } | 281 | } |
| 281 | outFile << content; | 282 | outFile << content; |
| @@ -68,7 +68,7 @@ void CgContext::PopBackLoopAxis(const Axis &axis) { | |||
| 68 | } | 68 | } |
| 69 | auto last_id = *(loop_axis_ids_cache_.rbegin()); | 69 | auto last_id = *(loop_axis_ids_cache_.rbegin()); |
| 70 | if (last_id != axis.id) { | 70 | if (last_id != axis.id) { |
| 71 | - GELOGE(FAILED, "Pop Axis order unmatch", ""); | 71 | + GELOGE(FAILED, "Pop axis order mismatch", ""); |
| 72 | return; | 72 | return; |
| 73 | } | 73 | } |
| 74 | loop_axis_ids_cache_.pop_back(); | 74 | loop_axis_ids_cache_.pop_back(); |
| @@ -1008,8 +1008,8 @@ std::string AttrUtils::ValueTypeToSerialString(const AnyValue::ValueType value_t | |||
| 1008 | if (it != kAttrTypesMap.end()) { | 1008 | if (it != kAttrTypesMap.end()) { |
| 1009 | return it->second; | 1009 | return it->second; |
| 1010 | } else { | 1010 | } else { |
| 1011 | - REPORT_INNER_ERR_MSG("E18888", "value_type not support %d", value_type); | 1011 | + REPORT_INNER_ERR_MSG("E18888", "value_type %d is not supported", value_type); |
| 1012 | - GELOGE(ge::GRAPH_FAILED, "[Check][Param] value_type not support %d", value_type); | 1012 | + GELOGE(ge::GRAPH_FAILED, "[Check][Param] value_type %d is not supported", value_type); |
| 1013 | return ""; | 1013 | return ""; |
| 1014 | } | 1014 | } |
| 1015 | } | 1015 | } |
| @@ -1019,8 +1019,8 @@ AnyValue::ValueType AttrUtils::SerialStringToValueType(const string &value_type_ | |||
| 1019 | if (it != kAttrStrTypesMap.end()) { | 1019 | if (it != kAttrStrTypesMap.end()) { |
| 1020 | return it->second; | 1020 | return it->second; |
| 1021 | } else { | 1021 | } else { |
| 1022 | - REPORT_INNER_ERR_MSG("E18888", "value_type_string not support %s", value_type_string.c_str()); | 1022 | + REPORT_INNER_ERR_MSG("E18888", "value_type_string %s is not supported", value_type_string.c_str()); |
| 1023 | - GELOGE(ge::GRAPH_FAILED, "[Check][Param] value_type_string not support %s", value_type_string.c_str()); | 1023 | + GELOGE(ge::GRAPH_FAILED, "[Check][Param] value_type_string %s is not supported", value_type_string.c_str()); |
| 1024 | return AnyValue::VT_NONE; | 1024 | return AnyValue::VT_NONE; |
| 1025 | } | 1025 | } |
| 1026 | } | 1026 | } |
| @@ -219,7 +219,7 @@ Expression ShapeEnvAttr::FindReplacements(const Expression &expr) { | |||
| 219 | return expr; | 219 | return expr; |
| 220 | } | 220 | } |
| 221 | if (iter->second.has_replace) { | 221 | if (iter->second.has_replace) { |
| 222 | - GELOGD("Find replace expr: %s of expr: %s has replace", iter->second.replace_expr.Str().get(), expr.Str().get()); | 222 | + GELOGD("Found replacement expr: %s for expr: %s", iter->second.replace_expr.Str().get(), expr.Str().get()); |
| 223 | return expr; | 223 | return expr; |
| 224 | } | 224 | } |
| 225 | auto replace_expr = iter->second.replace_expr; | 225 | auto replace_expr = iter->second.replace_expr; |
| @@ -743,7 +743,7 @@ ExpressionImplPtr Rational(const ExpressionImplPtr &a, const ExpressionImplPtr & | |||
| 743 | auto impl = ExpressionImpl::CreateExpressionImpl<const SymEngineExprPtr &>(sym_expr); | 743 | auto impl = ExpressionImpl::CreateExpressionImpl<const SymEngineExprPtr &>(sym_expr); |
| 744 | return impl; | 744 | return impl; |
| 745 | } else { | 745 | } else { |
| 746 | - std::cerr << "unsupported rational expr" << std::endl; | 746 | + GELOGE(ge::PARAM_INVALID, "unsupported rational expr"); |
| 747 | return nullptr; | 747 | return nullptr; |
| 748 | } | 748 | } |
| 749 | } | 749 | } |
| @@ -85,7 +85,7 @@ Expression Rational(int32_t num, int32_t den) { | |||
| 85 | 85 | ||
| 86 | Expression Align(const Expression &arg, uint32_t alignment) { | 86 | Expression Align(const Expression &arg, uint32_t alignment) { |
| 87 | if (alignment == 0U) { | 87 | if (alignment == 0U) { |
| 88 | - GELOGE(FAILED, "Alignment should more than 0"); | 88 | + GELOGE(FAILED, "Alignment should be more than 0"); |
| 89 | return Expression(nullptr); | 89 | return Expression(nullptr); |
| 90 | } | 90 | } |
| 91 | auto align = Symbol(alignment); | 91 | auto align = Symbol(alignment); |
| @@ -94,7 +94,7 @@ Expression Align(const Expression &arg, uint32_t alignment) { | |||
| 94 | 94 | ||
| 95 | Expression AlignWithPositiveInteger(const Expression &arg, uint32_t alignment) { | 95 | Expression AlignWithPositiveInteger(const Expression &arg, uint32_t alignment) { |
| 96 | if (alignment == 0U) { | 96 | if (alignment == 0U) { |
| 97 | - GELOGE(FAILED, "Alignment should more than 0"); | 97 | + GELOGE(FAILED, "Alignment should be more than 0"); |
| 98 | return Expression(nullptr); | 98 | return Expression(nullptr); |
| 99 | } | 99 | } |
| 100 | auto align = Symbol(alignment); | 100 | auto align = Symbol(alignment); |
| @@ -590,7 +590,7 @@ graphStatus ExecuteGraph::CollectBreadthOutNode(const FastNode *const node, | |||
| 590 | 590 | ||
| 591 | graphStatus ExecuteGraph::BFSTopologicalSorting(std::vector<FastNode *> &node_vec, const bool reverse, | 591 | graphStatus ExecuteGraph::BFSTopologicalSorting(std::vector<FastNode *> &node_vec, const bool reverse, |
| 592 | const ExecuteGraph *const compute_graph) const { | 592 | const ExecuteGraph *const compute_graph) const { |
| 593 | - GELOGD("Runing_Bfs_Sort: %s", GetName().c_str()); | 593 | + GELOGD("Running_Bfs_Sort: %s", GetName().c_str()); |
| 594 | (void)reverse; | 594 | (void)reverse; |
| 595 | const bool is_mem_priority = IsMemoryPriority(); | 595 | const bool is_mem_priority = IsMemoryPriority(); |
| 596 | std::vector<NodeStatus> reverse_dfs_nodes_info; | 596 | std::vector<NodeStatus> reverse_dfs_nodes_info; |
| @@ -628,7 +628,7 @@ graphStatus ExecuteGraph::BFSTopologicalSorting(std::vector<FastNode *> &node_ve | |||
| 628 | 628 | ||
| 629 | graphStatus ExecuteGraph::DFSTopologicalSorting(std::vector<FastNode *> &node_vec, const bool reverse, | 629 | graphStatus ExecuteGraph::DFSTopologicalSorting(std::vector<FastNode *> &node_vec, const bool reverse, |
| 630 | const ExecuteGraph *const compute_graph) const { | 630 | const ExecuteGraph *const compute_graph) const { |
| 631 | - GELOGD("Runing_Dfs_Sort: %s", GetName().c_str()); | 631 | + GELOGD("Running_Dfs_Sort: %s", GetName().c_str()); |
| 632 | std::vector<FastNode *> stack; | 632 | std::vector<FastNode *> stack; |
| 633 | std::map<FastNode *, uint32_t> map_in_edge_num; | 633 | std::map<FastNode *, uint32_t> map_in_edge_num; |
| 634 | // Record the number of non data nodes but no input nodes | 634 | // Record the number of non data nodes but no input nodes |
| @@ -703,7 +703,7 @@ void ExecuteGraph::GetInNodes(const FastNode *const current, std::vector<FastNod | |||
| 703 | graphStatus ExecuteGraph::RDFSTopologicalSorting(std::vector<FastNode *> &node_vec, const bool reverse, | 703 | graphStatus ExecuteGraph::RDFSTopologicalSorting(std::vector<FastNode *> &node_vec, const bool reverse, |
| 704 | const ExecuteGraph *const compute_graph) const { | 704 | const ExecuteGraph *const compute_graph) const { |
| 705 | (void)reverse; | 705 | (void)reverse; |
| 706 | - GELOGD("Runing_Reverse_Dfs_Sort: %s", GetName().c_str()); | 706 | + GELOGD("Running_Reverse_Dfs_Sort: %s", GetName().c_str()); |
| 707 | std::vector<NodeStatus> reverse_dfs_nodes_info; | 707 | std::vector<NodeStatus> reverse_dfs_nodes_info; |
| 708 | InitNodeStatus(compute_graph, reverse_dfs_nodes_info); | 708 | InitNodeStatus(compute_graph, reverse_dfs_nodes_info); |
| 709 | 709 | ||
| @@ -763,13 +763,13 @@ graphStatus ExecuteGraph::TopologicalSortingGraph(const ExecuteGraph *const exec | |||
| 763 | for (auto &node : node_vec) { | 763 | for (auto &node : node_vec) { |
| 764 | (void)itered_nodes_set.insert(node); | 764 | (void)itered_nodes_set.insert(node); |
| 765 | } | 765 | } |
| 766 | - REPORT_INNER_ERR_MSG("E18888", "Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph:%s", | 766 | + REPORT_INNER_ERR_MSG("E18888", "Failed to do topo sorting total %zu, iterated %zu, exist closed loop in graph:%s", |
| 767 | GetDirectNodesSize(), node_vec.size(), GetName().c_str()); | 767 | GetDirectNodesSize(), node_vec.size(), GetName().c_str()); |
| 768 | - GELOGW("[Check][Param] Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph.", | 768 | + GELOGW("[Check][Param] Failed to do topo sorting total %zu, iterated %zu, exist closed loop in graph.", |
| 769 | GetDirectNodesSize(), node_vec.size()); | 769 | GetDirectNodesSize(), node_vec.size()); |
| 770 | for (auto node : graph_shared_->GetDirectNodeToModify()) { | 770 | for (auto node : graph_shared_->GetDirectNodeToModify()) { |
| 771 | if (itered_nodes_set.count(&FastGraphUtils::GetNode(node)) == 0UL) { | 771 | if (itered_nodes_set.count(&FastGraphUtils::GetNode(node)) == 0UL) { |
| 772 | - GELOGW("[Check][Param] The node %s does not itered when topological sorting", | 772 | + GELOGW("[Check][Param] The node %s is not iterated when topological sorting", |
| 773 | FastGraphUtils::GetNode(node).GetName().c_str()); | 773 | FastGraphUtils::GetNode(node).GetName().c_str()); |
| 774 | } | 774 | } |
| 775 | } | 775 | } |
| @@ -1312,7 +1312,7 @@ graphStatus ComputeGraphImpl::UpdateOutputMapping(const std::map<uint32_t, uint3 | |||
| 1312 | } | 1312 | } |
| 1313 | const auto op_desc = net_output->GetOpDescBarePtr(); | 1313 | const auto op_desc = net_output->GetOpDescBarePtr(); |
| 1314 | if (op_desc == nullptr) { | 1314 | if (op_desc == nullptr) { |
| 1315 | - REPORT_INNER_ERR_MSG("E18888", "net output's op desc pr should not be null."); | 1315 | + REPORT_INNER_ERR_MSG("E18888", "net output's op desc ptr should not be null."); |
| 1316 | GE_LOGE("[Get][OpDesc] UpdateOutputMapping failed: op_desc is NULL."); | 1316 | GE_LOGE("[Get][OpDesc] UpdateOutputMapping failed: op_desc is NULL."); |
| 1317 | return GRAPH_FAILED; | 1317 | return GRAPH_FAILED; |
| 1318 | } | 1318 | } |
| @@ -1402,7 +1402,7 @@ graphStatus ComputeGraphImpl::InsertGraphEvents(const ConstComputeGraphPtr &comp | |||
| 1402 | 1402 | ||
| 1403 | graphStatus ComputeGraphImpl::DFSTopologicalSorting(std::vector<NodePtr> &node_vec, const bool reverse, | 1403 | graphStatus ComputeGraphImpl::DFSTopologicalSorting(std::vector<NodePtr> &node_vec, const bool reverse, |
| 1404 | const ConstComputeGraphPtr &compute_graph) const { | 1404 | const ConstComputeGraphPtr &compute_graph) const { |
| 1405 | - GELOGI("Runing_Dfs_Sort, reverse: %d, graph: %s", reverse, name_.c_str()); | 1405 | + GELOGI("Running_Dfs_Sort, reverse: %d, graph: %s", reverse, name_.c_str()); |
| 1406 | std::vector<NodePtr> stack; | 1406 | std::vector<NodePtr> stack; |
| 1407 | std::map<NodePtr, uint32_t> map_in_edge_num; | 1407 | std::map<NodePtr, uint32_t> map_in_edge_num; |
| 1408 | // Record the number of non data nodes but no input nodes | 1408 | // Record the number of non data nodes but no input nodes |
| @@ -1460,7 +1460,7 @@ graphStatus ComputeGraphImpl::DFSTopologicalSorting(std::vector<NodePtr> &node_v | |||
| 1460 | graphStatus ComputeGraphImpl::StableRDFSTopologicalSorting(std::vector<NodePtr> &node_vec, const bool reverse, | 1460 | graphStatus ComputeGraphImpl::StableRDFSTopologicalSorting(std::vector<NodePtr> &node_vec, const bool reverse, |
| 1461 | const ConstComputeGraphPtr &compute_graph) const { | 1461 | const ConstComputeGraphPtr &compute_graph) const { |
| 1462 | (void)reverse; | 1462 | (void)reverse; |
| 1463 | - GELOGI("Runing_Stable_Reverse_Dfs_Sort: %s", name_.c_str()); | 1463 | + GELOGI("Running_Stable_Reverse_Dfs_Sort: %s", name_.c_str()); |
| 1464 | std::vector<NodeStatus> nodes_info; | 1464 | std::vector<NodeStatus> nodes_info; |
| 1465 | InitNodeStatus(compute_graph, nodes_info); | 1465 | InitNodeStatus(compute_graph, nodes_info); |
| 1466 | 1466 | ||
| @@ -1563,7 +1563,7 @@ graphStatus ComputeGraphImpl::RDFSTopologicalSortingV2(std::vector<NodePtr> &nod | |||
| 1563 | 1563 | ||
| 1564 | graphStatus ComputeGraphImpl::BFSTopologicalSorting(std::vector<NodePtr> &node_vec, const bool reverse, | 1564 | graphStatus ComputeGraphImpl::BFSTopologicalSorting(std::vector<NodePtr> &node_vec, const bool reverse, |
| 1565 | const ConstComputeGraphPtr &compute_graph) const { | 1565 | const ConstComputeGraphPtr &compute_graph) const { |
| 1566 | - GELOGI("Runing_Bfs_Sort: %s", name_.c_str()); | 1566 | + GELOGI("Running_Bfs_Sort: %s", name_.c_str()); |
| 1567 | (void)reverse; | 1567 | (void)reverse; |
| 1568 | const bool is_mem_priority = IsMemoryPriority(); | 1568 | const bool is_mem_priority = IsMemoryPriority(); |
| 1569 | std::vector<NodeStatus> nodes_info; | 1569 | std::vector<NodeStatus> nodes_info; |
| @@ -1615,7 +1615,7 @@ void ComputeGraphImpl::SetGraphTargetNodesInfo(const std::vector<af::NodePtr> &t | |||
| 1615 | targets_.clear(); | 1615 | targets_.clear(); |
| 1616 | for (auto &node : target_nodes_info_) { | 1616 | for (auto &node : target_nodes_info_) { |
| 1617 | if (node == nullptr) { | 1617 | if (node == nullptr) { |
| 1618 | - GELOGW("User pointed targets contains null node.ignore it !"); | 1618 | + GELOGW("User pointed targets contains null node, ignore it!"); |
| 1619 | continue; | 1619 | continue; |
| 1620 | } | 1620 | } |
| 1621 | targets_.insert(node); | 1621 | targets_.insert(node); |
| @@ -2243,13 +2243,13 @@ graphStatus ComputeGraphImpl::DoTopologicalSorting(const ConstComputeGraphPtr &c | |||
| 2243 | for (auto &node : node_vec) { | 2243 | for (auto &node : node_vec) { |
| 2244 | (void)itered_nodes_set.insert(node.get()); | 2244 | (void)itered_nodes_set.insert(node.get()); |
| 2245 | } | 2245 | } |
| 2246 | - REPORT_INNER_ERR_MSG("E18888", "Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph:%s", | 2246 | + REPORT_INNER_ERR_MSG("E18888", "Failed to do topo sorting total %zu, iterated %zu, exist closed loop in graph:%s", |
| 2247 | GetDirectNodesSize(), node_vec.size(), name_.c_str()); | 2247 | GetDirectNodesSize(), node_vec.size(), name_.c_str()); |
| 2248 | - GELOGW("[Check][Param] Failed to do topo sorting total %zu, itered %zu, exist closed loop in graph.", | 2248 | + GELOGW("[Check][Param] Failed to do topo sorting total %zu, iterated %zu, exist closed loop in graph.", |
| 2249 | GetDirectNodesSize(), node_vec.size()); | 2249 | GetDirectNodesSize(), node_vec.size()); |
| 2250 | for (auto &node : nodes_) { | 2250 | for (auto &node : nodes_) { |
| 2251 | if (itered_nodes_set.count(node.get()) == 0UL) { | 2251 | if (itered_nodes_set.count(node.get()) == 0UL) { |
| 2252 | - GELOGW("[Check][Param] The node %s does not itered when topological sorting", node->GetName().c_str()); | 2252 | + GELOGW("[Check][Param] The node %s is not iterated when topological sorting", node->GetName().c_str()); |
| 2253 | } | 2253 | } |
| 2254 | } | 2254 | } |
| 2255 | return GRAPH_FAILED; | 2255 | return GRAPH_FAILED; |
| @@ -322,9 +322,9 @@ class GraphImpl { | |||
| 322 | } | 322 | } |
| 323 | res = GraphUtils::RemoveEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor()); | 323 | res = GraphUtils::RemoveEdge(src_node_ptr->GetOutControlAnchor(), dst_node_ptr->GetInControlAnchor()); |
| 324 | if (res != GRAPH_SUCCESS) { | 324 | if (res != GRAPH_SUCCESS) { |
| 325 | - REPORT_INNER_ERR_MSG("E18888", "remove control edge between [%s] and [%s]failed.", | 325 | + REPORT_INNER_ERR_MSG("E18888", "remove control edge between [%s] and [%s] failed.", |
| 326 | src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); | 326 | src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); |
| 327 | - GELOGE(GRAPH_FAILED, "[Remove][ControlEdge] between [%s] and [%s]failed.", src_node_ptr->GetName().c_str(), | 327 | + GELOGE(GRAPH_FAILED, "[Remove][ControlEdge] between [%s] and [%s] failed.", src_node_ptr->GetName().c_str(), |
| 328 | dst_node_ptr->GetName().c_str()); | 328 | dst_node_ptr->GetName().c_str()); |
| 329 | return GRAPH_FAILED; | 329 | return GRAPH_FAILED; |
| 330 | } | 330 | } |
| @@ -342,9 +342,9 @@ class GraphImpl { | |||
| 342 | if ((src_port_index != -1) && (dst_port_index == -1)) { | 342 | if ((src_port_index != -1) && (dst_port_index == -1)) { |
| 343 | res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInControlAnchor()); | 343 | res = GraphUtils::RemoveEdge(src_node_ptr->GetOutDataAnchor(src_port_index), dst_node_ptr->GetInControlAnchor()); |
| 344 | if (res != GRAPH_SUCCESS) { | 344 | if (res != GRAPH_SUCCESS) { |
| 345 | - REPORT_INNER_ERR_MSG("E18888", "remove data-control edge between [%s] and [%s]failed.", | 345 | + REPORT_INNER_ERR_MSG("E18888", "remove data-control edge between [%s] and [%s] failed.", |
| 346 | src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); | 346 | src_node_ptr->GetName().c_str(), dst_node_ptr->GetName().c_str()); |
| 347 | - GELOGE(GRAPH_FAILED, "[Remove][Edge] between [%s] and [%s]failed.", src_node_ptr->GetName().c_str(), | 347 | + GELOGE(GRAPH_FAILED, "[Remove][Edge] between [%s] and [%s] failed.", src_node_ptr->GetName().c_str(), |
| 348 | dst_node_ptr->GetName().c_str()); | 348 | dst_node_ptr->GetName().c_str()); |
| 349 | return GRAPH_FAILED; | 349 | return GRAPH_FAILED; |
| 350 | } | 350 | } |
| @@ -1136,7 +1136,7 @@ GNodePtr Graph::FindNodeByName(const AscendString &node_name) const { | |||
| 1136 | return nullptr; | 1136 | return nullptr; |
| 1137 | } | 1137 | } |
| 1138 | auto node = impl_->GetComputeGraph()->FindNode(node_name.GetString()); | 1138 | auto node = impl_->GetComputeGraph()->FindNode(node_name.GetString()); |
| 1139 | - GE_ASSERT_NOTNULL(node, "Node name: %s was not found in the current graph:%s.", node_name.GetString(), | 1139 | + GE_ASSERT_NOTNULL(node, "Node name: %s was not found in the current graph: %s.", node_name.GetString(), |
| 1140 | impl_->GetName().c_str()); | 1140 | impl_->GetName().c_str()); |
| 1141 | return NodeAdapter::Node2GNodePtr(node); | 1141 | return NodeAdapter::Node2GNodePtr(node); |
| 1142 | } | 1142 | } |
| @@ -147,7 +147,7 @@ graphStatus Model::SaveToFile(const std::string &file_name, const bool force_sep | |||
| 147 | std::string file; | 147 | std::string file; |
| 148 | SplitFilePath(file_name, dir_path, file); | 148 | SplitFilePath(file_name, dir_path, file); |
| 149 | if (!dir_path.empty()) { | 149 | if (!dir_path.empty()) { |
| 150 | - GE_ASSERT_TRUE((CreateDir(dir_path) == 0), "Create direct failed, path: %s.", file_name.c_str()); | 150 | + GE_ASSERT_TRUE((CreateDir(dir_path) == 0), "Create directory failed, path: %s.", file_name.c_str()); |
| 151 | } else { | 151 | } else { |
| 152 | GE_ASSERT_SUCCESS(GetAscendWorkPath(dir_path)); | 152 | GE_ASSERT_SUCCESS(GetAscendWorkPath(dir_path)); |
| 153 | if (dir_path.empty()) { | 153 | if (dir_path.empty()) { |
| @@ -139,11 +139,11 @@ bool Node::NodeImpl::NodeAnchorIsEqual(const AnchorPtr &left_anchor, const Ancho | |||
| 139 | if (anchor_peer_size != right_anchor_peer_size) { | 139 | if (anchor_peer_size != right_anchor_peer_size) { |
| 140 | REPORT_INNER_ERR_MSG("E18888", | 140 | REPORT_INNER_ERR_MSG("E18888", |
| 141 | "Size of anchor's peer anchors verify failed, node name: %s " | 141 | "Size of anchor's peer anchors verify failed, node name: %s " |
| 142 | - "anchor_peer_size [%zu] is different form [%zu] at index [%zu].", | 142 | + "anchor_peer_size [%zu] is different from [%zu] at index [%zu].", |
| 143 | this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); | 143 | this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); |
| 144 | GELOGE(GRAPH_FAILED, | 144 | GELOGE(GRAPH_FAILED, |
| 145 | "[Check][Param] Size of anchor's peer anchors verify failed, node name: %s " | 145 | "[Check][Param] Size of anchor's peer anchors verify failed, node name: %s " |
| 146 | - "anchor_peer_size [%zu] is different form [%zu] at index [%zu].", | 146 | + "anchor_peer_size [%zu] is different from [%zu] at index [%zu].", |
| 147 | this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); | 147 | this->GetName().c_str(), anchor_peer_size, right_anchor_peer_size, i); |
| 148 | return false; | 148 | return false; |
| 149 | } | 149 | } |
| @@ -163,11 +163,11 @@ bool Node::NodeImpl::NodeAnchorIsEqual(const AnchorPtr &left_anchor, const Ancho | |||
| 163 | // Determine the connection relationship by linking the node's name | 163 | // Determine the connection relationship by linking the node's name |
| 164 | if (peer_node->GetName() != r_peer_node->GetName()) { | 164 | if (peer_node->GetName() != r_peer_node->GetName()) { |
| 165 | REPORT_INNER_ERR_MSG("E18888", | 165 | REPORT_INNER_ERR_MSG("E18888", |
| 166 | - "anchor's peer node name verify failed, node name: %s index[%zu]" | 166 | + "anchor's peer node name verify failed, node name: %s index[%zu] " |
| 167 | "peer node name %s is different from %s at index [%zu].", | 167 | "peer node name %s is different from %s at index [%zu].", |
| 168 | this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); | 168 | this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); |
| 169 | GELOGE(GRAPH_FAILED, | 169 | GELOGE(GRAPH_FAILED, |
| 170 | - "[Check][Param] anchor's peer node name verify failed, node name: %s index[%zu]" | 170 | + "[Check][Param] anchor's peer node name verify failed, node name: %s index[%zu] " |
| 171 | "peer node name %s is different from %s at index [%zu].", | 171 | "peer node name %s is different from %s at index [%zu].", |
| 172 | this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); | 172 | this->GetName().c_str(), i, peer_node->GetName().c_str(), r_peer_node->GetName().c_str(), j); |
| 173 | return false; | 173 | return false; |
| @@ -250,8 +250,8 @@ graphStatus Node::NodeImpl::AddLinkFrom(const uint32_t &index, const af::Node::N | |||
| 250 | in_data_anchors_.push_back(anchor); | 250 | in_data_anchors_.push_back(anchor); |
| 251 | (void)out_anchors.at(input_node_index)->LinkTo(in_data_anchors_.back()); | 251 | (void)out_anchors.at(input_node_index)->LinkTo(in_data_anchors_.back()); |
| 252 | } else { | 252 | } else { |
| 253 | - REPORT_INNER_ERR_MSG("E18888", "index %u is over than in data anchors size %zu.", index, in_data_anchors_.size()); | 253 | + REPORT_INNER_ERR_MSG("E18888", "index %u exceeds in data anchors size %zu.", index, in_data_anchors_.size()); |
| 254 | - GELOGE(GRAPH_FAILED, "index %u is over than in data anchors size %zu.", index, in_data_anchors_.size()); | 254 | + GELOGE(GRAPH_FAILED, "index %u exceeds in data anchors size %zu.", index, in_data_anchors_.size()); |
| 255 | return GRAPH_PARAM_INVALID; | 255 | return GRAPH_PARAM_INVALID; |
| 256 | } | 256 | } |
| 257 | 257 | ||
| @@ -318,7 +318,7 @@ graphStatus OpDescImpl::AddInputDesc(const uint32_t index, const af::GeTensorDes | |||
| 318 | 318 | ||
| 319 | graphStatus OpDescImpl::AddInputDesc(const std::string &name, const af::GeTensorDesc &input_desc) { | 319 | graphStatus OpDescImpl::AddInputDesc(const std::string &name, const af::GeTensorDesc &input_desc) { |
| 320 | if (input_name_idx_.find(name) != input_name_idx_.end()) { | 320 | if (input_name_idx_.find(name) != input_name_idx_.end()) { |
| 321 | - GELOGI("input %s is exist, update it", name.c_str()); | 321 | + GELOGI("input %s already exists, update it", name.c_str()); |
| 322 | const graphStatus ret = UpdateInputDesc(name, input_desc); | 322 | const graphStatus ret = UpdateInputDesc(name, input_desc); |
| 323 | return ret; | 323 | return ret; |
| 324 | } else { | 324 | } else { |
| @@ -1106,7 +1106,7 @@ graphStatus OpDescImpl::DefaultInferFormat(const ConstOpDescPtr &op_desc) const | |||
| 1106 | } | 1106 | } |
| 1107 | } | 1107 | } |
| 1108 | // Refresh all input output format | 1108 | // Refresh all input output format |
| 1109 | - GELOGD("Default infer format.node[%s], first none nod format is:%d", GetName().c_str(), first_none_nd_format); | 1109 | + GELOGD("Default infer format.node[%s], first none ND format is:%d", GetName().c_str(), first_none_nd_format); |
| 1110 | 1110 | ||
| 1111 | for (const auto &input_desc : input_descs) { | 1111 | for (const auto &input_desc : input_descs) { |
| 1112 | const Format origin_format = input_desc->GetOriginFormat(); | 1112 | const Format origin_format = input_desc->GetOriginFormat(); |
| @@ -2981,7 +2981,7 @@ class GraphBuilderImpl { | |||
| 2981 | GE_CHK_BOOL_EXEC(op_impl != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_impl is nullptr, check invalid."); | 2981 | GE_CHK_BOOL_EXEC(op_impl != nullptr, REPORT_INNER_ERR_MSG("E18888", "op_impl is nullptr, check invalid."); |
| 2982 | return ge::GRAPH_FAILED, "[Check][Param] Operator Impl is null."); | 2982 | return ge::GRAPH_FAILED, "[Check][Param] Operator Impl is null."); |
| 2983 | if (all_nodes_info_.find(op_impl) != all_nodes_info_.cend()) { | 2983 | if (all_nodes_info_.find(op_impl) != all_nodes_info_.cend()) { |
| 2984 | - GELOGI("This node %s has created.", op_impl->GetName().c_str()); | 2984 | + GELOGI("Node %s has been created.", op_impl->GetName().c_str()); |
| 2985 | continue; | 2985 | continue; |
| 2986 | } | 2986 | } |
| 2987 | auto node_ptr = graph_->AddNode(op_impl->op_desc_); | 2987 | auto node_ptr = graph_->AddNode(op_impl->op_desc_); |
| @@ -239,8 +239,8 @@ graphStatus FormatRefiner::GetAnchorPoints(const ComputeGraphPtr &com_graph, std | |||
| 239 | } | 239 | } |
| 240 | const auto &one_op_desc = one_node_ptr->GetOpDesc(); | 240 | const auto &one_op_desc = one_node_ptr->GetOpDesc(); |
| 241 | if (one_op_desc == nullptr) { | 241 | if (one_op_desc == nullptr) { |
| 242 | - REPORT_INNER_ERR_MSG("E18888", "node's opdesc is nullptr,graph:%s", com_graph->GetName().c_str()); | 242 | + REPORT_INNER_ERR_MSG("E18888", "node's opdesc is nullptr, graph:%s", com_graph->GetName().c_str()); |
| 243 | - GELOGE(GRAPH_FAILED, "[Check][Param] node's opdesc is nullptr,graph:%s", com_graph->GetName().c_str()); | 243 | + GELOGE(GRAPH_FAILED, "[Check][Param] node's opdesc is nullptr, graph:%s", com_graph->GetName().c_str()); |
| 244 | return GRAPH_FAILED; | 244 | return GRAPH_FAILED; |
| 245 | } | 245 | } |
| 246 | graphStatus ret_status = RefreshConstantOutProcess(com_graph, one_op_desc); | 246 | graphStatus ret_status = RefreshConstantOutProcess(com_graph, one_op_desc); |
| @@ -468,7 +468,7 @@ graphStatus FormatRefiner::DataNodeFormatProcess(const ComputeGraphPtr &graph, | |||
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | graphStatus FormatRefiner::InferOrigineFormat(const ComputeGraphPtr &graph) { | 470 | graphStatus FormatRefiner::InferOrigineFormat(const ComputeGraphPtr &graph) { |
| 471 | - GELOGI("Enter InferOrigineFormat process!"); | 471 | + GELOGI("Enter InferOriginFormat process!"); |
| 472 | 472 | ||
| 473 | // True: inferred; false: not inferred. | 473 | // True: inferred; false: not inferred. |
| 474 | std::vector<NodePtr> anchor_points; | 474 | std::vector<NodePtr> anchor_points; |
| @@ -293,8 +293,8 @@ graphStatus RefRelations::Impl::ProcessSubgraphDataNodes(std::vector<NodePtr> &g | |||
| 293 | bool is_exist = true; | 293 | bool is_exist = true; |
| 294 | is_exist = AttrUtils::GetInt(e->GetOpDesc(), kRefIdx, i); | 294 | is_exist = AttrUtils::GetInt(e->GetOpDesc(), kRefIdx, i); |
| 295 | if (!is_exist) { | 295 | if (!is_exist) { |
| 296 | - REPORT_INNER_ERR_MSG("E18888", "Invalid SubGraph NetOutput node[%s].no attr %s", e->GetName().c_str(), kRefIdx); | 296 | + REPORT_INNER_ERR_MSG("E18888", "Invalid SubGraph NetOutput node[%s]. no attr %s", e->GetName().c_str(), kRefIdx); |
| 297 | - GELOGE(GRAPH_FAILED, "[Get][Int] Invalid SubGraph NetOutput node[%s].no attr %s", e->GetName().c_str(), kRefIdx); | 297 | + GELOGE(GRAPH_FAILED, "[Get][Int] Invalid SubGraph NetOutput node[%s]. no attr %s", e->GetName().c_str(), kRefIdx); |
| 298 | return GRAPH_FAILED; | 298 | return GRAPH_FAILED; |
| 299 | } | 299 | } |
| 300 | max_ref_idx = (i > max_ref_idx) ? i : max_ref_idx; | 300 | max_ref_idx = (i > max_ref_idx) ? i : max_ref_idx; |
| @@ -219,8 +219,8 @@ graphStatus UpdateSubGraphDataNodes(const ConstNodePtr &node) { | |||
| 219 | for (const auto &name : sub_graph_names) { | 219 | for (const auto &name : sub_graph_names) { |
| 220 | const auto sub_graph = root_graph->GetSubgraph(name); | 220 | const auto sub_graph = root_graph->GetSubgraph(name); |
| 221 | if (sub_graph == nullptr) { | 221 | if (sub_graph == nullptr) { |
| 222 | - REPORT_INNER_ERR_MSG("E18888", "Can not find the subgrpah %s for node %s", name.c_str(), node->GetName().c_str()); | 222 | + REPORT_INNER_ERR_MSG("E18888", "Can not find the subgraph %s for node %s", name.c_str(), node->GetName().c_str()); |
| 223 | - GE_LOGE("[Get][Graph] can not find the subgrpah %s for node %s", name.c_str(), node->GetName().c_str()); | 223 | + GE_LOGE("[Get][Graph] can not find the subgraph %s for node %s", name.c_str(), node->GetName().c_str()); |
| 224 | return GRAPH_FAILED; | 224 | return GRAPH_FAILED; |
| 225 | } | 225 | } |
| 226 | for (const auto &node_sub : sub_graph->GetDirectNode()) { | 226 | for (const auto &node_sub : sub_graph->GetDirectNode()) { |
| @@ -459,7 +459,7 @@ graphStatus UpdateOpInputDesc(const ConstNodePtr &node_ptr) { | |||
| 459 | const auto peer_out_dtype = peer_out_desc->GetDataType(); | 459 | const auto peer_out_dtype = peer_out_desc->GetDataType(); |
| 460 | if (peer_out_dtype != in_dtype) { | 460 | if (peer_out_dtype != in_dtype) { |
| 461 | GELOGW( | 461 | GELOGW( |
| 462 | - "[Update][InputDesc] current node [%s] [%d]\'th in_dtype is [%s].peer output node [%s] [%d]\'th " | 462 | + "[Update][InputDesc] current node [%s] [%d]\'th in_dtype is [%s]. peer output node [%s] [%d]\'th " |
| 463 | "output_dtype is [%s]. The two dtype should be same! Please check graph and fix it", | 463 | "output_dtype is [%s]. The two dtype should be same! Please check graph and fix it", |
| 464 | node_ptr->GetName().c_str(), in_idx, TypeUtils::DataTypeToSerialString(in_dtype).c_str(), | 464 | node_ptr->GetName().c_str(), in_idx, TypeUtils::DataTypeToSerialString(in_dtype).c_str(), |
| 465 | peer_out_data_node->GetName().c_str(), peer_out_idx, | 465 | peer_out_data_node->GetName().c_str(), peer_out_idx, |
| @@ -468,7 +468,7 @@ graphStatus UpdateOpInputDesc(const ConstNodePtr &node_ptr) { | |||
| 468 | const std::string in_shape_str = Serial(in_shape); | 468 | const std::string in_shape_str = Serial(in_shape); |
| 469 | const std::string peer_out_shape_str = Serial(peer_out_shape); | 469 | const std::string peer_out_shape_str = Serial(peer_out_shape); |
| 470 | GELOGW( | 470 | GELOGW( |
| 471 | - "[Update][InputDesc] current node [%s] [%d]\'th in_shape is [%s].peer output node [%s] [%d]\'th " | 471 | + "[Update][InputDesc] current node [%s] [%d]\'th in_shape is [%s]. peer output node [%s] [%d]\'th " |
| 472 | "output_shape is [%s]. The two shape should be same! Please check graph and fix it", | 472 | "output_shape is [%s]. The two shape should be same! Please check graph and fix it", |
| 473 | node_ptr->GetName().c_str(), in_idx, in_shape_str.c_str(), peer_out_data_node->GetName().c_str(), | 473 | node_ptr->GetName().c_str(), in_idx, in_shape_str.c_str(), peer_out_data_node->GetName().c_str(), |
| 474 | peer_out_idx, peer_out_shape_str.c_str()); | 474 | peer_out_idx, peer_out_shape_str.c_str()); |
| @@ -66,7 +66,7 @@ af::Status CreateExternalWeightPath(const std::string &model_path, const std::st | |||
| 66 | const bool weight_dir_exist = (mmAccess(dir_path.c_str()) == EN_OK); | 66 | const bool weight_dir_exist = (mmAccess(dir_path.c_str()) == EN_OK); |
| 67 | if ((!dir_path.empty()) && (!weight_dir_exist)) { | 67 | if ((!dir_path.empty()) && (!weight_dir_exist)) { |
| 68 | const std::lock_guard<std::mutex> lock(dir_mutex); | 68 | const std::lock_guard<std::mutex> lock(dir_mutex); |
| 69 | - GE_ASSERT_TRUE((af::CreateDir(dir_path) == EOK), "Create direct failed, path: %s.", dir_path.c_str()); | 69 | + GE_ASSERT_TRUE((af::CreateDir(dir_path) == EOK), "Create directory failed, path: %s.", dir_path.c_str()); |
| 70 | } | 70 | } |
| 71 | return af::SUCCESS; | 71 | return af::SUCCESS; |
| 72 | } | 72 | } |
| @@ -1118,7 +1118,7 @@ Buffer ModelSerialize::SerializeModel(const Model &model, const std::string &pat | |||
| 1118 | "but can not separate in this scenario, you can use external_weight instead"); | 1118 | "but can not separate in this scenario, you can use external_weight instead"); |
| 1119 | return Buffer(); | 1119 | return Buffer(); |
| 1120 | } | 1120 | } |
| 1121 | - GELOGW("[Serialize][Model] Model could larger than 2G, need separate"); | 1121 | + GELOGW("[Serialize][Model] Model could be larger than 2G, need separate"); |
| 1122 | if (!model_imp.SeparateModelDef(buffer, path, model_def)) { | 1122 | if (!model_imp.SeparateModelDef(buffer, path, model_def)) { |
| 1123 | GELOGW("[Serialize][Model] Serialize to binary failed"); | 1123 | GELOGW("[Serialize][Model] Serialize to binary failed"); |
| 1124 | return Buffer(); | 1124 | return Buffer(); |
| @@ -1233,7 +1233,7 @@ bool ModelSerialize::UnserializeModel(af::proto::ModelDef &model_def, Model &mod | |||
| 1233 | bool ModelSerialize::UnserializeModel(af::proto::ModelDef &model_def, Model &model, const std::string &path) const { | 1233 | bool ModelSerialize::UnserializeModel(af::proto::ModelDef &model_def, Model &model, const std::string &path) const { |
| 1234 | const std::shared_ptr<proto::ModelDef> model_def_ptr = ComGraphMakeShared<proto::ModelDef>(model_def); | 1234 | const std::shared_ptr<proto::ModelDef> model_def_ptr = ComGraphMakeShared<proto::ModelDef>(model_def); |
| 1235 | GE_CHK_BOOL_EXEC(model_def_ptr != nullptr, REPORT_INNER_ERR_MSG("E18888", "create ModelDef failed."); | 1235 | GE_CHK_BOOL_EXEC(model_def_ptr != nullptr, REPORT_INNER_ERR_MSG("E18888", "create ModelDef failed."); |
| 1236 | - return false, "[Create][ModelDef] mode_def make shared failed"); | 1236 | + return false, "[Create][ModelDef] model_def make shared failed"); |
| 1237 | 1237 | ||
| 1238 | ModelSerializeImp model_imp; | 1238 | ModelSerializeImp model_imp; |
| 1239 | model_imp.SetAirModelPath(path); | 1239 | model_imp.SetAirModelPath(path); |
| @@ -259,7 +259,7 @@ ExpressionType SymDtype::Type() const { | |||
| 259 | graphStatus SymDtype::Eval(const OpDesc &op, TypeOrTypes &type_or_types) const { | 259 | graphStatus SymDtype::Eval(const OpDesc &op, TypeOrTypes &type_or_types) const { |
| 260 | GE_WARN_ASSERT(!is_legacy_, "Trying eval legacy sym dtype %s", id_.c_str()); | 260 | GE_WARN_ASSERT(!is_legacy_, "Trying eval legacy sym dtype %s", id_.c_str()); |
| 261 | if (expression_ != nullptr) { | 261 | if (expression_ != nullptr) { |
| 262 | - GELOGI("Eval sym dtype from expression of op %s", id_.c_str(), op.GetType().c_str()); | 262 | + GELOGI("Eval sym dtype %s from expression of op %s", id_.c_str(), op.GetType().c_str()); |
| 263 | return expression_->Eval(op, type_or_types); | 263 | return expression_->Eval(op, type_or_types); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| @@ -293,13 +293,13 @@ ExecuteGraphUtils::InsertNodeAfter(const EdgeSrcEndpoint &src, const std::vector | |||
| 293 | const auto src_node = src.node; | 293 | const auto src_node = src.node; |
| 294 | GE_ASSERT_NOTNULL(src_node); | 294 | GE_ASSERT_NOTNULL(src_node); |
| 295 | const auto src_extend_info = src_node->GetExtendInfo(); | 295 | const auto src_extend_info = src_node->GetExtendInfo(); |
| 296 | - GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:% is null", src_node->GetNamePtr()); | 296 | + GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:%s is null", src_node->GetNamePtr()); |
| 297 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); | 297 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); |
| 298 | - GE_ASSERT_NOTNULL(graph, "The own graph of src node:% is null", src_node->GetNamePtr()); | 298 | + GE_ASSERT_NOTNULL(graph, "The own graph of src node:%s is null", src_node->GetNamePtr()); |
| 299 | - GE_ASSERT_NOTNULL(insert_node->GetExtendInfo(), "The extend info of insert node:% is null", | 299 | + GE_ASSERT_NOTNULL(insert_node->GetExtendInfo(), "The extend info of insert node:%s is null", |
| 300 | insert_node->GetNamePtr()); | 300 | insert_node->GetNamePtr()); |
| 301 | GE_ASSERT_TRUE(graph == insert_node->GetExtendInfo()->GetOwnerGraphBarePtr(), | 301 | GE_ASSERT_TRUE(graph == insert_node->GetExtendInfo()->GetOwnerGraphBarePtr(), |
| 302 | - "rc:%s and insert_node:%s does not exist in the same graph.", src_node->GetNamePtr(), | 302 | + "src:%s and insert_node:%s does not exist in the same graph.", src_node->GetNamePtr(), |
| 303 | insert_node->GetNamePtr()); | 303 | insert_node->GetNamePtr()); |
| 304 | 304 | ||
| 305 | const auto src_index = src.index; | 305 | const auto src_index = src.index; |
| @@ -310,7 +310,7 @@ ExecuteGraphUtils::InsertNodeAfter(const EdgeSrcEndpoint &src, const std::vector | |||
| 310 | GE_ASSERT_NOTNULL(dst_node); | 310 | GE_ASSERT_NOTNULL(dst_node); |
| 311 | const auto dst_index = dst.index; | 311 | const auto dst_index = dst.index; |
| 312 | const auto dst_extend_info = dst_node->GetExtendInfo(); | 312 | const auto dst_extend_info = dst_node->GetExtendInfo(); |
| 313 | - GE_ASSERT_NOTNULL(dst_extend_info, "The extend info of src node:% is null", dst_node->GetNamePtr()); | 313 | + GE_ASSERT_NOTNULL(dst_extend_info, "The extend info of dst node:%s is null", dst_node->GetNamePtr()); |
| 314 | GE_ASSERT_TRUE(graph == dst_extend_info->GetOwnerGraphBarePtr(), | 314 | GE_ASSERT_TRUE(graph == dst_extend_info->GetOwnerGraphBarePtr(), |
| 315 | "[Check][Param] dst:%s and insert_node:%s does not exist in the same graph.", dst_node->GetNamePtr(), | 315 | "[Check][Param] dst:%s and insert_node:%s does not exist in the same graph.", dst_node->GetNamePtr(), |
| 316 | insert_node->GetNamePtr()); | 316 | insert_node->GetNamePtr()); |
| @@ -341,10 +341,10 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::In | |||
| 341 | const auto dst_node = dst.node; | 341 | const auto dst_node = dst.node; |
| 342 | GE_ASSERT_NOTNULL(dst_node); | 342 | GE_ASSERT_NOTNULL(dst_node); |
| 343 | const auto dst_extend_info = dst_node->GetExtendInfo(); | 343 | const auto dst_extend_info = dst_node->GetExtendInfo(); |
| 344 | - GE_ASSERT_NOTNULL(dst_extend_info, "The extend info of src node:% is null", dst_node->GetNamePtr()); | 344 | + GE_ASSERT_NOTNULL(dst_extend_info, "The extend info of dst node:%s is null", dst_node->GetNamePtr()); |
| 345 | const auto graph = dst_extend_info->GetOwnerGraphBarePtr(); | 345 | const auto graph = dst_extend_info->GetOwnerGraphBarePtr(); |
| 346 | - GE_ASSERT_NOTNULL(graph, "The own graph of src node:% is null", dst_node->GetNamePtr()); | 346 | + GE_ASSERT_NOTNULL(graph, "The own graph of dst node:%s is null", dst_node->GetNamePtr()); |
| 347 | - GE_ASSERT_NOTNULL(insert_node->GetExtendInfo(), "The extend info of insert node:% is null", | 347 | + GE_ASSERT_NOTNULL(insert_node->GetExtendInfo(), "The extend info of insert node:%s is null", |
| 348 | insert_node->GetNamePtr()); | 348 | insert_node->GetNamePtr()); |
| 349 | GE_ASSERT_TRUE(graph == insert_node->GetExtendInfo()->GetOwnerGraphBarePtr(), | 349 | GE_ASSERT_TRUE(graph == insert_node->GetExtendInfo()->GetOwnerGraphBarePtr(), |
| 350 | "[Check][Param] src:%s and insert_node:%s does not exist in the same graph.", dst_node->GetNamePtr(), | 350 | "[Check][Param] src:%s and insert_node:%s does not exist in the same graph.", dst_node->GetNamePtr(), |
| @@ -393,7 +393,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::Co | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | const auto src_extend_info = src_node->GetExtendInfo(); | 395 | const auto src_extend_info = src_node->GetExtendInfo(); |
| 396 | - GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:% is null", src_node->GetNamePtr()); | 396 | + GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:%s is null", src_node->GetNamePtr()); |
| 397 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); | 397 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); |
| 398 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); | 398 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); |
| 399 | for (const auto in_node : src_ctrl_in_nodes) { | 399 | for (const auto in_node : src_ctrl_in_nodes) { |
| @@ -413,7 +413,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::Mo | |||
| 413 | src_node->GetNamePtr(), dst_node->GetNamePtr()); | 413 | src_node->GetNamePtr(), dst_node->GetNamePtr()); |
| 414 | 414 | ||
| 415 | const auto src_extend_info = src_node->GetExtendInfo(); | 415 | const auto src_extend_info = src_node->GetExtendInfo(); |
| 416 | - GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:% is null", src_node->GetNamePtr()); | 416 | + GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:%s is null", src_node->GetNamePtr()); |
| 417 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); | 417 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); |
| 418 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); | 418 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); |
| 419 | for (const auto src_in_ctrl_edge : src_node->GetAllInControlEdgesRef()) { | 419 | for (const auto src_in_ctrl_edge : src_node->GetAllInControlEdgesRef()) { |
| @@ -442,7 +442,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::Co | |||
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | const auto src_extend_info = src_node->GetExtendInfo(); | 444 | const auto src_extend_info = src_node->GetExtendInfo(); |
| 445 | - GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:% is null", src_node->GetNamePtr()); | 445 | + GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:%s is null", src_node->GetNamePtr()); |
| 446 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); | 446 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); |
| 447 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); | 447 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); |
| 448 | for (const auto out_node : out_ctrl_nodes) { | 448 | for (const auto out_node : out_ctrl_nodes) { |
| @@ -462,7 +462,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::Mo | |||
| 462 | src_node->GetNamePtr(), dst_node->GetNamePtr()); | 462 | src_node->GetNamePtr(), dst_node->GetNamePtr()); |
| 463 | 463 | ||
| 464 | const auto src_extend_info = src_node->GetExtendInfo(); | 464 | const auto src_extend_info = src_node->GetExtendInfo(); |
| 465 | - GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:% is null", src_node->GetNamePtr()); | 465 | + GE_ASSERT_NOTNULL(src_extend_info, "The extend info of src node:%s is null", src_node->GetNamePtr()); |
| 466 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); | 466 | const auto graph = src_extend_info->GetOwnerGraphBarePtr(); |
| 467 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); | 467 | GE_ASSERT_NOTNULL(graph, "The graph of src node:% is null", src_node->GetNamePtr()); |
| 468 | for (const auto src_out_ctrl_edge : src_node->GetAllOutControlEdgesRef()) { | 468 | for (const auto src_out_ctrl_edge : src_node->GetAllOutControlEdgesRef()) { |
| @@ -477,7 +477,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::Mo | |||
| 477 | GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::MoveNodeToGraph(FastNode *node, | 477 | GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus ExecuteGraphUtils::MoveNodeToGraph(FastNode *node, |
| 478 | ExecuteGraph *dst_graph) { | 478 | ExecuteGraph *dst_graph) { |
| 479 | GE_ASSERT_GRAPH_SUCCESS(IsolateNode(node, {})); | 479 | GE_ASSERT_GRAPH_SUCCESS(IsolateNode(node, {})); |
| 480 | - GE_ASSERT_NOTNULL(node->GetExtendInfo(), "EntendInfo of node %s is null.", node->GetNamePtr()); | 480 | + GE_ASSERT_NOTNULL(node->GetExtendInfo(), "ExtendInfo of node %s is null.", node->GetNamePtr()); |
| 481 | GE_ASSERT_GRAPH_SUCCESS(RemoveNodeWithoutRelink(node->GetExtendInfo()->GetOwnerGraphBarePtr(), node)); | 481 | GE_ASSERT_GRAPH_SUCCESS(RemoveNodeWithoutRelink(node->GetExtendInfo()->GetOwnerGraphBarePtr(), node)); |
| 482 | GE_ASSERT_NOTNULL(dst_graph->AddNode(node)); | 482 | GE_ASSERT_NOTNULL(dst_graph->AddNode(node)); |
| 483 | GE_ASSERT_GRAPH_SUCCESS(node->GetExtendInfo()->SetOwnerGraph(dst_graph, node)); | 483 | GE_ASSERT_GRAPH_SUCCESS(node->GetExtendInfo()->SetOwnerGraph(dst_graph, node)); |
| @@ -532,8 +532,8 @@ ExecuteGraphUtils::ReplaceNodeEdges(FastNode *new_node, FastNode *old_node, cons | |||
| 532 | GE_ASSERT_NOTNULL(old_node->GetExtendInfo()); | 532 | GE_ASSERT_NOTNULL(old_node->GetExtendInfo()); |
| 533 | GE_ASSERT_TRUE(graph == old_node->GetExtendInfo()->GetOwnerGraphBarePtr()); | 533 | GE_ASSERT_TRUE(graph == old_node->GetExtendInfo()->GetOwnerGraphBarePtr()); |
| 534 | GE_ASSERT_GRAPH_SUCCESS(ReplaceNodeDataEdges(new_node, old_node, inputs_map, outputs_map, graph), | 534 | GE_ASSERT_GRAPH_SUCCESS(ReplaceNodeDataEdges(new_node, old_node, inputs_map, outputs_map, graph), |
| 535 | - "Replace data edgs from %s to %s failed.", old_node->GetNamePtr(), new_node->GetNamePtr()); | 535 | + "Replace data edges from %s to %s failed.", old_node->GetNamePtr(), new_node->GetNamePtr()); |
| 536 | - GE_ASSERT_GRAPH_SUCCESS(ReplaceControlEdges(new_node, old_node, graph), "Replace control edgs from %s to %s failed.", | 536 | + GE_ASSERT_GRAPH_SUCCESS(ReplaceControlEdges(new_node, old_node, graph), "Replace control edges from %s to %s failed.", |
| 537 | old_node->GetNamePtr(), new_node->GetNamePtr()); | 537 | old_node->GetNamePtr(), new_node->GetNamePtr()); |
| 538 | return GRAPH_SUCCESS; | 538 | return GRAPH_SUCCESS; |
| 539 | } | 539 | } |
| @@ -588,7 +588,7 @@ ExecuteGraphUtils::RemoveSubgraphRecursively(ExecuteGraph *execute_graph, FastNo | |||
| 588 | const auto remove_extend_info = remove_node->GetExtendInfo(); | 588 | const auto remove_extend_info = remove_node->GetExtendInfo(); |
| 589 | GE_ASSERT_NOTNULL(remove_extend_info); | 589 | GE_ASSERT_NOTNULL(remove_extend_info); |
| 590 | if (remove_extend_info->GetOwnerGraphBarePtr() == nullptr) { | 590 | if (remove_extend_info->GetOwnerGraphBarePtr() == nullptr) { |
| 591 | - GELOGW("Node %s has a owner graph with null value.", remove_node->GetNamePtr()); | 591 | + GELOGW("Node %s has an owner graph with null value.", remove_node->GetNamePtr()); |
| 592 | return GRAPH_SUCCESS; | 592 | return GRAPH_SUCCESS; |
| 593 | } | 593 | } |
| 594 | 594 | ||
| @@ -37,7 +37,7 @@ FastNode *FastNodeUtils::GetParentInput(const FastNode *const node) { | |||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | // Subgraph Data Node, check for constant input. | 39 | // Subgraph Data Node, check for constant input. |
| 40 | - GE_ASSERT_NOTNULL(node->GetExtendInfo(), "EntendInfo of node %s is null.", node->GetNamePtr()); | 40 | + GE_ASSERT_NOTNULL(node->GetExtendInfo(), "ExtendInfo of node %s is null.", node->GetNamePtr()); |
| 41 | const auto graph = node->GetExtendInfo()->GetOwnerGraphBarePtr(); | 41 | const auto graph = node->GetExtendInfo()->GetOwnerGraphBarePtr(); |
| 42 | GE_ASSERT_NOTNULL(graph); | 42 | GE_ASSERT_NOTNULL(graph); |
| 43 | 43 | ||
| @@ -100,7 +100,7 @@ ExecuteGraph *FastNodeUtils::GetSubgraphFromNode(const FastNode *const node, con | |||
| 100 | const auto op_desc = node->GetOpDescBarePtr(); | 100 | const auto op_desc = node->GetOpDescBarePtr(); |
| 101 | GE_ASSERT_NOTNULL(op_desc); | 101 | GE_ASSERT_NOTNULL(op_desc); |
| 102 | 102 | ||
| 103 | - GE_ASSERT_NOTNULL(node->GetExtendInfo(), "EntendInfo of node %s is null.", node->GetNamePtr()); | 103 | + GE_ASSERT_NOTNULL(node->GetExtendInfo(), "ExtendInfo of node %s is null.", node->GetNamePtr()); |
| 104 | const auto root_graph = ExecuteGraphUtils::FindRootGraph(node->GetExtendInfo()->GetOwnerGraphBarePtr()); | 104 | const auto root_graph = ExecuteGraphUtils::FindRootGraph(node->GetExtendInfo()->GetOwnerGraphBarePtr()); |
| 105 | GE_ASSERT_NOTNULL(root_graph); | 105 | GE_ASSERT_NOTNULL(root_graph); |
| 106 | return root_graph->GetSubGraph(op_desc->GetSubgraphInstanceName(index)); | 106 | return root_graph->GetSubGraph(op_desc->GetSubgraphInstanceName(index)); |
| @@ -114,7 +114,7 @@ graphStatus FastNodeUtils::MountSubgraphToNode(FastNode *const node, const uint3 | |||
| 114 | const auto op_desc = node->GetOpDescBarePtr(); | 114 | const auto op_desc = node->GetOpDescBarePtr(); |
| 115 | GE_ASSERT_NOTNULL(op_desc); | 115 | GE_ASSERT_NOTNULL(op_desc); |
| 116 | 116 | ||
| 117 | - GE_ASSERT_NOTNULL(node->GetExtendInfo(), "EntendInfo of node %s is null.", node->GetNamePtr()); | 117 | + GE_ASSERT_NOTNULL(node->GetExtendInfo(), "ExtendInfo of node %s is null.", node->GetNamePtr()); |
| 118 | const auto root_graph = ExecuteGraphUtils::FindRootGraph(node->GetExtendInfo()->GetOwnerGraphBarePtr()); | 118 | const auto root_graph = ExecuteGraphUtils::FindRootGraph(node->GetExtendInfo()->GetOwnerGraphBarePtr()); |
| 119 | GE_ASSERT_NOTNULL(root_graph, "[Get][Graph] Failed to add subgraph to node %s, null root graph", node->GetNamePtr()); | 119 | GE_ASSERT_NOTNULL(root_graph, "[Get][Graph] Failed to add subgraph to node %s, null root graph", node->GetNamePtr()); |
| 120 | 120 | ||
| @@ -122,7 +122,7 @@ graphStatus FastNodeUtils::MountSubgraphToNode(FastNode *const node, const uint3 | |||
| 122 | GE_CHK_GRAPH_STATUS_RET(ret, "[Set][Name] Failed to set subgraph to node %s index %u", node->GetNamePtr(), index); | 122 | GE_CHK_GRAPH_STATUS_RET(ret, "[Set][Name] Failed to set subgraph to node %s index %u", node->GetNamePtr(), index); |
| 123 | 123 | ||
| 124 | subgraph->SetParentNode(node); | 124 | subgraph->SetParentNode(node); |
| 125 | - GE_ASSERT_NOTNULL(node->GetExtendInfo(), "EntendInfo of node %s is null.", node->GetNamePtr()); | 125 | + GE_ASSERT_NOTNULL(node->GetExtendInfo(), "ExtendInfo of node %s is null.", node->GetNamePtr()); |
| 126 | subgraph->SetParentGraph(node->GetExtendInfo()->GetOwnerGraphBarePtr()); | 126 | subgraph->SetParentGraph(node->GetExtendInfo()->GetOwnerGraphBarePtr()); |
| 127 | 127 | ||
| 128 | return (root_graph->AddSubGraph(const_cast<ExecuteGraphPtr &>(subgraph)) != nullptr) ? GRAPH_SUCCESS : GRAPH_FAILED; | 128 | return (root_graph->AddSubGraph(const_cast<ExecuteGraphPtr &>(subgraph)) != nullptr) ? GRAPH_SUCCESS : GRAPH_FAILED; |
| @@ -85,7 +85,7 @@ graphStatus ReLinkInputDataEdge(const NodePtr &input_node, const NodePtr &target | |||
| 85 | (void)AttrUtils::GetInt(input_node->GetOpDesc(), ATTR_NAME_INDEX, index); | 85 | (void)AttrUtils::GetInt(input_node->GetOpDesc(), ATTR_NAME_INDEX, index); |
| 86 | GE_ASSERT_TRUE(index >= 0, "Attr index[%d] of node: %s is invalid", index, input_node->GetNamePtr()); | 86 | GE_ASSERT_TRUE(index >= 0, "Attr index[%d] of node: %s is invalid", index, input_node->GetNamePtr()); |
| 87 | GE_ASSERT_TRUE(index < static_cast<int32_t>(target_node->GetAllInDataAnchorsSize()), | 87 | GE_ASSERT_TRUE(index < static_cast<int32_t>(target_node->GetAllInDataAnchorsSize()), |
| 88 | - "Attr index[%d] of node: %s cannot larger than input num: %u of target node: %s", index, | 88 | + "Attr index[%d] of node: %s cannot be larger than input num: %u of target node: %s", index, |
| 89 | input_node->GetNamePtr(), target_node->GetAllInDataAnchorsSize(), target_node->GetNamePtr()); | 89 | input_node->GetNamePtr(), target_node->GetAllInDataAnchorsSize(), target_node->GetNamePtr()); |
| 90 | GELOGD("Begin to handle subgraph input node:%s with index:%d.", input_node->GetName().c_str(), index); | 90 | GELOGD("Begin to handle subgraph input node:%s with index:%d.", input_node->GetName().c_str(), index); |
| 91 | // get node's in data anchor and peer out anchor | 91 | // get node's in data anchor and peer out anchor |
| @@ -122,7 +122,7 @@ graphStatus RelinkOutputNodeEdge(const NodePtr &out_node, const int32_t out_inde | |||
| 122 | const size_t target_index) { | 122 | const size_t target_index) { |
| 123 | // 处理输出算子的连边关系 | 123 | // 处理输出算子的连边关系 |
| 124 | GE_ASSERT_TRUE(target_index < static_cast<size_t>(target_node->GetAllOutDataAnchorsSize()), | 124 | GE_ASSERT_TRUE(target_index < static_cast<size_t>(target_node->GetAllOutDataAnchorsSize()), |
| 125 | - "Attr index[%d] of node: %s cannot larger than input num: %u of target node: %s", target_index, | 125 | + "Attr index[%d] of node: %s cannot be larger than output num: %u of target node: %s", target_index, |
| 126 | out_node->GetNamePtr(), target_node->GetAllOutDataAnchorsSize(), target_node->GetNamePtr()); | 126 | out_node->GetNamePtr(), target_node->GetAllOutDataAnchorsSize(), target_node->GetNamePtr()); |
| 127 | auto node_out_anchor = target_node->GetOutDataAnchor(target_index); | 127 | auto node_out_anchor = target_node->GetOutDataAnchor(target_index); |
| 128 | GE_ASSERT_NOTNULL(node_out_anchor, "Get index: %zu of node: %s failed", target_index, target_node->GetNamePtr()); | 128 | GE_ASSERT_NOTNULL(node_out_anchor, "Get index: %zu of node: %s failed", target_index, target_node->GetNamePtr()); |
| @@ -478,7 +478,7 @@ GraphUtils::RemoveNodesWithoutRelink(const ComputeGraphPtr &compute_graph, const | |||
| 478 | } | 478 | } |
| 479 | const auto to_be_remove_nodes_size = nodes.size(); | 479 | const auto to_be_remove_nodes_size = nodes.size(); |
| 480 | if (success_removed_nodes_size != to_be_remove_nodes_size) { | 480 | if (success_removed_nodes_size != to_be_remove_nodes_size) { |
| 481 | - GELOGW("Successfully remove %zu nodes but there are %zu nodes to be delete", success_removed_nodes_size, | 481 | + GELOGW("Successfully remove %zu nodes but there are %zu nodes to be deleted", success_removed_nodes_size, |
| 482 | to_be_remove_nodes_size); | 482 | to_be_remove_nodes_size); |
| 483 | } | 483 | } |
| 484 | return af::GRAPH_SUCCESS; | 484 | return af::GRAPH_SUCCESS; |
| @@ -673,7 +673,7 @@ graphStatus GetDumpRealPath(const int64_t file_index, const std::string &suffix, | |||
| 673 | const std::string file_name = user_graph_name.substr(sep + 1UL, user_graph_name.length()); | 673 | const std::string file_name = user_graph_name.substr(sep + 1UL, user_graph_name.length()); |
| 674 | std::string path_dir = user_graph_name.substr(0UL, sep + 1UL); | 674 | std::string path_dir = user_graph_name.substr(0UL, sep + 1UL); |
| 675 | if ((file_name.length() == 0UL) || (path_dir.length() == 0UL)) { | 675 | if ((file_name.length() == 0UL) || (path_dir.length() == 0UL)) { |
| 676 | - GELOGW("[Invalid]path or name invalid.user_graph_name:%s", user_graph_name.c_str()); | 676 | + GELOGW("[Invalid] path or name is invalid. user_graph_name:%s", user_graph_name.c_str()); |
| 677 | return GRAPH_PARAM_INVALID; | 677 | return GRAPH_PARAM_INVALID; |
| 678 | } | 678 | } |
| 679 | 679 | ||
| @@ -968,7 +968,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons | |||
| 968 | // Get Model object from ModelDef by deserialize ModelDef | 968 | // Get Model object from ModelDef by deserialize ModelDef |
| 969 | GE_ASSERT_SUCCESS(model.Load(model_def), "[Get][Model] failed from ModelDef:%s", file); | 969 | GE_ASSERT_SUCCESS(model.Load(model_def), "[Get][Model] failed from ModelDef:%s", file); |
| 970 | GE_CHK_BOOL_EXEC(model.GetGraph() != nullptr, | 970 | GE_CHK_BOOL_EXEC(model.GetGraph() != nullptr, |
| 971 | - REPORT_INNER_ERR_MSG("E18888", "Get computer graph is nullptr, model file:%s.", file); | 971 | + REPORT_INNER_ERR_MSG("E18888", "Get compute graph is nullptr, model file:%s.", file); |
| 972 | return false, "[Get][ComputerGraph] is nullptr"); | 972 | return false, "[Get][ComputerGraph] is nullptr"); |
| 973 | compute_graph = *model.GetGraph(); | 973 | compute_graph = *model.GetGraph(); |
| 974 | return true; | 974 | return true; |
| @@ -984,12 +984,12 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool GraphUtils::LoadGEGraph(cons | |||
| 984 | // Get Model object from ModelDef by deserialize ModelDef | 984 | // Get Model object from ModelDef by deserialize ModelDef |
| 985 | GE_ASSERT_SUCCESS(model.Load(model_def), "[Get][Model] failed from ModelDef:%s", file); | 985 | GE_ASSERT_SUCCESS(model.Load(model_def), "[Get][Model] failed from ModelDef:%s", file); |
| 986 | GE_CHK_BOOL_EXEC(model.GetGraph() != nullptr, | 986 | GE_CHK_BOOL_EXEC(model.GetGraph() != nullptr, |
| 987 | - REPORT_INNER_ERR_MSG("E18888", "Get computer graph is nullptr, model file:%s.", file); | 987 | + REPORT_INNER_ERR_MSG("E18888", "Get compute graph is nullptr, model file:%s.", file); |
| 988 | return false, "[Get][ComputerGraph] is nullptr"); | 988 | return false, "[Get][ComputerGraph] is nullptr"); |
| 989 | compute_graph = model.GetGraph(); | 989 | compute_graph = model.GetGraph(); |
| 990 | for (const auto &node : compute_graph->GetDirectNode()) { | 990 | for (const auto &node : compute_graph->GetDirectNode()) { |
| 991 | if (node == nullptr) { | 991 | if (node == nullptr) { |
| 992 | - REPORT_INNER_ERR_MSG("E18888", "ModeDef %s has nullptr node.", file); | 992 | + REPORT_INNER_ERR_MSG("E18888", "ModelDef %s has nullptr node.", file); |
| 993 | GELOGE(af::GRAPH_FAILED, "[Get][Node]Nullptr node in graph:%s, model:%s", compute_graph->GetName().c_str(), file); | 993 | GELOGE(af::GRAPH_FAILED, "[Get][Node]Nullptr node in graph:%s, model:%s", compute_graph->GetName().c_str(), file); |
| 994 | return false; | 994 | return false; |
| 995 | } | 995 | } |
| @@ -1312,7 +1312,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY void GraphUtils::DumpGrphToOnnx(c | |||
| 1312 | if ((proto_file.length()) >= kNameMax) { | 1312 | if ((proto_file.length()) >= kNameMax) { |
| 1313 | proto_file = proto_file.substr(0U, kNameMax - 7U); | 1313 | proto_file = proto_file.substr(0U, kNameMax - 7U); |
| 1314 | proto_file = proto_file + ".pbtxt"; | 1314 | proto_file = proto_file + ".pbtxt"; |
| 1315 | - GELOGW("[Check][Param] File name is too longer!, file:%s", proto_file.c_str()); | 1315 | + GELOGW("[Check][Param] File name is too long!, file:%s", proto_file.c_str()); |
| 1316 | } | 1316 | } |
| 1317 | const std::string full_proto_file = path + "/" + proto_file; | 1317 | const std::string full_proto_file = path + "/" + proto_file; |
| 1318 | const auto real_path = ComGraphMakeUnique<char_t[]>(static_cast<size_t>(MMPA_MAX_PATH)); | 1318 | const auto real_path = ComGraphMakeUnique<char_t[]>(static_cast<size_t>(MMPA_MAX_PATH)); |
| @@ -1680,7 +1680,7 @@ graphStatus DoReplaceInDataAnchors(const InDataAnchorVisitor &new_ins, const InD | |||
| 1680 | REPORT_INNER_ERR_MSG("E18888", "Failed to link new anchors, link from %s(%d) to %s(%d)", | 1680 | REPORT_INNER_ERR_MSG("E18888", "Failed to link new anchors, link from %s(%d) to %s(%d)", |
| 1681 | GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), | 1681 | GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), |
| 1682 | GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); | 1682 | GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); |
| 1683 | - GELOGE(af::GRAPH_FAILED, "[Create][Link]Failed to link new anchors, link from %s(%d) to %s(%d)", | 1683 | + GELOGE(af::GRAPH_FAILED, "[Create][Link] Failed to link new anchors, link from %s(%d) to %s(%d)", |
| 1684 | GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), | 1684 | GetNodeNameByAnchor(peer_out_anchor.get()).c_str(), peer_out_anchor->GetIdx(), |
| 1685 | GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); | 1685 | GetNodeNameByAnchor(old_in_anchor.get()).c_str(), old_in_anchor->GetIdx()); |
| 1686 | return af::GRAPH_FAILED; | 1686 | return af::GRAPH_FAILED; |
| @@ -3214,7 +3214,7 @@ graphStatus GraphUtils::UnionSymbolMapping(const NodeIndexIO &exist_node_info1, | |||
| 3214 | GE_ASSERT_TRUE(iter != anchor_to_symbol.end(), "anchor %s does not exist in anchor_to_symbol.", | 3214 | GE_ASSERT_TRUE(iter != anchor_to_symbol.end(), "anchor %s does not exist in anchor_to_symbol.", |
| 3215 | node_index_io.ToString().c_str()); | 3215 | node_index_io.ToString().c_str()); |
| 3216 | if (iter->second != min_symbol) { | 3216 | if (iter->second != min_symbol) { |
| 3217 | - GELOGW("[GetRefMapping][Check] not expected symbol of anchor %s, expect %s but %s exactly.", iter->first.c_str(), | 3217 | + GELOGW("[GetRefMapping][Check] not expected symbol of anchor %s, expect %s but got %s.", iter->first.c_str(), |
| 3218 | min_symbol.c_str(), iter->second.c_str()); | 3218 | min_symbol.c_str(), iter->second.c_str()); |
| 3219 | } | 3219 | } |
| 3220 | iter->second = symbol; | 3220 | iter->second = symbol; |
| @@ -4558,7 +4558,7 @@ void CompleteGraphBuilder::AddNetOutputNode(graphStatus &error_code, std::string | |||
| 4558 | 4558 | ||
| 4559 | if (net_output_desc->AddInputDesc(tensor) != af::GRAPH_SUCCESS) { | 4559 | if (net_output_desc->AddInputDesc(tensor) != af::GRAPH_SUCCESS) { |
| 4560 | error_code = af::GRAPH_FAILED; | 4560 | error_code = af::GRAPH_FAILED; |
| 4561 | - error_msg = "AddNetOutputNode failed: add input_desc ailed."; | 4561 | + error_msg = "AddNetOutputNode failed: add input_desc failed."; |
| 4562 | return; | 4562 | return; |
| 4563 | } | 4563 | } |
| 4564 | peer_out_anchors[i] = node->GetOutDataAnchor(static_cast<int32_t>(index)); | 4564 | peer_out_anchors[i] = node->GetOutDataAnchor(static_cast<int32_t>(index)); |
| @@ -4657,7 +4657,7 @@ void CompleteGraphBuilder::PostProcess(graphStatus &error_code, std::string &err | |||
| 4657 | std::vector<ComputeGraphPtr> subgraphs; | 4657 | std::vector<ComputeGraphPtr> subgraphs; |
| 4658 | if (NodeUtils::GetDirectSubgraphs(node, subgraphs) != af::GRAPH_SUCCESS) { | 4658 | if (NodeUtils::GetDirectSubgraphs(node, subgraphs) != af::GRAPH_SUCCESS) { |
| 4659 | error_code = af::GRAPH_FAILED; | 4659 | error_code = af::GRAPH_FAILED; |
| 4660 | - error_msg = "Get subgraphs for failed failed, node:" + node->GetName(); | 4660 | + error_msg = "Get subgraphs for node " + node->GetName() + " failed."; |
| 4661 | return; | 4661 | return; |
| 4662 | } | 4662 | } |
| 4663 | for (const auto &subgraph : subgraphs) { | 4663 | for (const auto &subgraph : subgraphs) { |
| @@ -4807,7 +4807,7 @@ graphStatus GraphUtils::RemoveJustNodes(const ComputeGraphPtr &compute_graph, | |||
| 4807 | } | 4807 | } |
| 4808 | const auto to_be_remove_nodes_size = nodes.size(); | 4808 | const auto to_be_remove_nodes_size = nodes.size(); |
| 4809 | if (success_removed_nodes_size != to_be_remove_nodes_size) { | 4809 | if (success_removed_nodes_size != to_be_remove_nodes_size) { |
| 4810 | - GELOGW("Successfully remove %zu nodes but there are %zu nodes to be delete", success_removed_nodes_size, | 4810 | + GELOGW("Successfully remove %zu nodes but there are %zu nodes to be deleted", success_removed_nodes_size, |
| 4811 | to_be_remove_nodes_size); | 4811 | to_be_remove_nodes_size); |
| 4812 | } | 4812 | } |
| 4813 | return af::GRAPH_SUCCESS; | 4813 | return af::GRAPH_SUCCESS; |
| @@ -4877,7 +4877,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::GetSuppor | |||
| 4877 | constexpr size_t kInplaceAbilitySize = 2U; | 4877 | constexpr size_t kInplaceAbilitySize = 2U; |
| 4878 | for (auto &inplace_index : output_inplace_index_list) { | 4878 | for (auto &inplace_index : output_inplace_index_list) { |
| 4879 | if (inplace_index.size() != kInplaceAbilitySize) { | 4879 | if (inplace_index.size() != kInplaceAbilitySize) { |
| 4880 | - GELOGW("The size %u of inplace index is not invalid, must be equal to 2.", inplace_index.size()); | 4880 | + GELOGW("The size %u of inplace index is invalid, must be equal to 2.", inplace_index.size()); |
| 4881 | return af::GRAPH_FAILED; | 4881 | return af::GRAPH_FAILED; |
| 4882 | } | 4882 | } |
| 4883 | GE_ASSERT_TRUE(ge::IntegerChecker<int32_t>::Compat(inplace_index[0])); | 4883 | GE_ASSERT_TRUE(ge::IntegerChecker<int32_t>::Compat(inplace_index[0])); |
| @@ -5028,7 +5028,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY graphStatus GraphUtils::GenDumpOn | |||
| 5028 | std::string dump_file_name = ss.str(); | 5028 | std::string dump_file_name = ss.str(); |
| 5029 | if ((dump_file_name.length()) >= kNameMax) { | 5029 | if ((dump_file_name.length()) >= kNameMax) { |
| 5030 | dump_file_name = dump_file_name.substr(0U, kNameMax - 7U) + ".pbtxt"; | 5030 | dump_file_name = dump_file_name.substr(0U, kNameMax - 7U) + ".pbtxt"; |
| 5031 | - GELOGW("[Check][Param] File name is too longer!, file:%s", dump_file_name.c_str()); | 5031 | + GELOGW("[Check][Param] File name is too long!, file:%s", dump_file_name.c_str()); |
| 5032 | } | 5032 | } |
| 5033 | std::string proto_file = stream_file_name.str() + dump_file_name; | 5033 | std::string proto_file = stream_file_name.str() + dump_file_name; |
| 5034 | 5034 | ||
| @@ -714,7 +714,7 @@ ge::graphStatus ShapeInferenceRule::InferOnRuntime(gert::InferShapeContext *infe | |||
| 714 | GertContextWrapper ctx(infer_shape_ctx); | 714 | GertContextWrapper ctx(infer_shape_ctx); |
| 715 | const ge::graphStatus result = InferOnRuntime(&ctx); | 715 | const ge::graphStatus result = InferOnRuntime(&ctx); |
| 716 | if (result != ge::GRAPH_SUCCESS) { | 716 | if (result != ge::GRAPH_SUCCESS) { |
| 717 | - GELOGE(af::FAILED, "Failed infer shape by rule for op %s(%s): %s", infer_shape_ctx->GetNodeName(), | 717 | + GELOGE(af::FAILED, "Failed to infer shape by rule for op %s(%s): %s", infer_shape_ctx->GetNodeName(), |
| 718 | infer_shape_ctx->GetNodeType(), ctx.Error().c_str()); | 718 | infer_shape_ctx->GetNodeType(), ctx.Error().c_str()); |
| 719 | } | 719 | } |
| 720 | return result; | 720 | return result; |
| @@ -725,7 +725,7 @@ ge::graphStatus ShapeInferenceRule::InferOnCompile(gert::InferShapeContext *infe | |||
| 725 | GertContextWrapper ctx(infer_shape_ctx); | 725 | GertContextWrapper ctx(infer_shape_ctx); |
| 726 | const ge::graphStatus result = InferOnCompile(&ctx); | 726 | const ge::graphStatus result = InferOnCompile(&ctx); |
| 727 | if (result != ge::GRAPH_SUCCESS) { | 727 | if (result != ge::GRAPH_SUCCESS) { |
| 728 | - GELOGE(af::FAILED, "Failed infer shape on compile by rule for op %s(%s): %s", infer_shape_ctx->GetNodeName(), | 728 | + GELOGE(af::FAILED, "Failed to infer shape on compile by rule for op %s(%s): %s", infer_shape_ctx->GetNodeName(), |
| 729 | infer_shape_ctx->GetNodeType(), ctx.Error().c_str()); | 729 | infer_shape_ctx->GetNodeType(), ctx.Error().c_str()); |
| 730 | } | 730 | } |
| 731 | return result; | 731 | return result; |
| @@ -834,7 +834,7 @@ ge::graphStatus ShapeInferenceRule::CompileJsonString(const std::string &json_st | |||
| 834 | ge::graphStatus DtypeInferenceRule::InferDtype(gert::InferDataTypeContext *infer_dtype_ctx) const { | 834 | ge::graphStatus DtypeInferenceRule::InferDtype(gert::InferDataTypeContext *infer_dtype_ctx) const { |
| 835 | GE_ASSERT_NOTNULL(infer_dtype_ctx); | 835 | GE_ASSERT_NOTNULL(infer_dtype_ctx); |
| 836 | if (!Error().empty()) { | 836 | if (!Error().empty()) { |
| 837 | - GELOGE(af::FAILED, "Failed infer dtype by rule for op %s(%s): %s", infer_dtype_ctx->GetNodeName(), | 837 | + GELOGE(af::FAILED, "Failed to infer dtype by rule for op %s(%s): %s", infer_dtype_ctx->GetNodeName(), |
| 838 | infer_dtype_ctx->GetNodeType(), Error().c_str()); | 838 | infer_dtype_ctx->GetNodeType(), Error().c_str()); |
| 839 | return ge::GRAPH_FAILED; | 839 | return ge::GRAPH_FAILED; |
| 840 | } | 840 | } |
| @@ -875,7 +875,7 @@ std::shared_ptr<DtypeInferenceRule> DtypeInferenceRule::FromJsonString(const std | |||
| 875 | 875 | ||
| 876 | const auto dtype_json = rule_json["dtype"]; | 876 | const auto dtype_json = rule_json["dtype"]; |
| 877 | if (dtype_json.is_null()) { | 877 | if (dtype_json.is_null()) { |
| 878 | - *rule << "Filed 'dtype' must not be null."; | 878 | + *rule << "Field 'dtype' must not be null."; |
| 879 | return g_dtype_rule_cache.GetWithDefault(json_str, rule); | 879 | return g_dtype_rule_cache.GetWithDefault(json_str, rule); |
| 880 | } | 880 | } |
| 881 | 881 | ||
| @@ -272,7 +272,7 @@ OpDescPtr OpDescUtils::CreateConstOp(const GeTensorPtr &tensor_ptr, const bool c | |||
| 272 | const_opdesc->GetNamePtr()); | 272 | const_opdesc->GetNamePtr()); |
| 273 | } else { | 273 | } else { |
| 274 | GE_ASSERT_TRUE(AttrUtils::SetShareTensor(const_opdesc, ATTR_NAME_WEIGHTS, *tensor_ptr), | 274 | GE_ASSERT_TRUE(AttrUtils::SetShareTensor(const_opdesc, ATTR_NAME_WEIGHTS, *tensor_ptr), |
| 275 | - "[Set][ShardTensor] success for %s.", const_opdesc->GetNamePtr()); | 275 | + "[Set][ShardTensor] failed for %s.", const_opdesc->GetNamePtr()); |
| 276 | } | 276 | } |
| 277 | const_opdesc->SetType(CONSTANT); | 277 | const_opdesc->SetType(CONSTANT); |
| 278 | std::string op_name; | 278 | std::string op_name; |
| @@ -65,7 +65,7 @@ graphStatus OpDescUtilsEx::CallInferFuncV2(const OpDescPtr &op_desc, Operator &o | |||
| 65 | return GRAPH_FAILED; | 65 | return GRAPH_FAILED; |
| 66 | } | 66 | } |
| 67 | if (op_desc->GetIrInputs().empty() && op_desc->GetIrOutputs().empty() && op_desc->GetAllOutputsDescSize() != 0U) { | 67 | if (op_desc->GetIrInputs().empty() && op_desc->GetIrOutputs().empty() && op_desc->GetAllOutputsDescSize() != 0U) { |
| 68 | - GE_CHK_STATUS_RET(RecoverIrUtils::RecoverOpDescIrDefinition(op_desc), "Failed recover ir def for %s %s", | 68 | + GE_CHK_STATUS_RET(RecoverIrUtils::RecoverOpDescIrDefinition(op_desc), "Failed to recover ir def for %s %s", |
| 69 | op_desc->GetNamePtr(), op_desc->GetTypePtr()); | 69 | op_desc->GetNamePtr(), op_desc->GetTypePtr()); |
| 70 | } | 70 | } |
| 71 | GE_WARN_ASSERT_GRAPH_SUCCESS(call_infer_data_type(op_desc), | 71 | GE_WARN_ASSERT_GRAPH_SUCCESS(call_infer_data_type(op_desc), |
| @@ -240,7 +240,7 @@ graphStatus OpDescUtilsEx::CallInferFormatFuncV2(const OpDescPtr &op_desc, Opera | |||
| 240 | const auto call_infer_format_v2 = OperatorFactoryImpl::GetInferFormatV2Func(); | 240 | const auto call_infer_format_v2 = OperatorFactoryImpl::GetInferFormatV2Func(); |
| 241 | GE_ASSERT_NOTNULL(call_infer_format_v2); | 241 | GE_ASSERT_NOTNULL(call_infer_format_v2); |
| 242 | if (op_desc->GetIrInputs().empty() && op_desc->GetIrOutputs().empty() && op_desc->GetAllOutputsDescSize() != 0U) { | 242 | if (op_desc->GetIrInputs().empty() && op_desc->GetIrOutputs().empty() && op_desc->GetAllOutputsDescSize() != 0U) { |
| 243 | - GE_CHK_STATUS_RET(RecoverIrUtils::RecoverOpDescIrDefinition(op_desc), "Failed recover ir def for %s %s", | 243 | + GE_CHK_STATUS_RET(RecoverIrUtils::RecoverOpDescIrDefinition(op_desc), "Failed to recover ir def for %s %s", |
| 244 | op_desc->GetNamePtr(), op_desc->GetTypePtr()); | 244 | op_desc->GetNamePtr(), op_desc->GetTypePtr()); |
| 245 | } | 245 | } |
| 246 | return call_infer_format_v2(op, op_desc); | 246 | return call_infer_format_v2(op, op_desc); |
| @@ -39,7 +39,7 @@ class TraceFileHolder { | |||
| 39 | if (fd_ >= 0) { | 39 | if (fd_ >= 0) { |
| 40 | const mmSsize_t written_count = mmWrite(fd_, const_cast<char_t *>(data), strlen(data)); | 40 | const mmSsize_t written_count = mmWrite(fd_, const_cast<char_t *>(data), strlen(data)); |
| 41 | if ((written_count == EN_INVALID_PARAM) || (written_count == EN_ERROR)) { | 41 | if ((written_count == EN_INVALID_PARAM) || (written_count == EN_ERROR)) { |
| 42 | - GELOGE(INTERNAL_ERROR, "[trace] Failed write trace info to file %s", data); | 42 | + GELOGE(INTERNAL_ERROR, "[trace] Failed to write trace info to file %s", data); |
| 43 | } | 43 | } |
| 44 | (void)mmWrite(fd_, const_cast<char_t *>(separator), strlen(separator)); | 44 | (void)mmWrite(fd_, const_cast<char_t *>(separator), strlen(separator)); |
| 45 | } | 45 | } |
| @@ -149,7 +149,7 @@ void TraceManager::SaveTraceBufferToFile(const ReadyPart ready_part) { | |||
| 149 | 149 | ||
| 150 | auto fh = OpenOrCreateFile(current_saving_file_name_); | 150 | auto fh = OpenOrCreateFile(current_saving_file_name_); |
| 151 | if (fh == nullptr || (!fh->Valid())) { | 151 | if (fh == nullptr || (!fh->Valid())) { |
| 152 | - GELOGE(INTERNAL_ERROR, "[trace] Failed get file holder for %s", current_saving_file_name_.c_str()); | 152 | + GELOGE(INTERNAL_ERROR, "[trace] Failed to get file holder for %s", current_saving_file_name_.c_str()); |
| 153 | return; | 153 | return; |
| 154 | } | 154 | } |
| 155 | 155 | ||
| @@ -190,7 +190,7 @@ Status TraceManager::Initialize(const char_t *file_save_path) { | |||
| 190 | << MMPA_PATH_SEPARATOR_STR << af::GetContext().DeviceId() << MMPA_PATH_SEPARATOR_STR; | 190 | << MMPA_PATH_SEPARATOR_STR << af::GetContext().DeviceId() << MMPA_PATH_SEPARATOR_STR; |
| 191 | trace_save_file_path_ = ss.str(); | 191 | trace_save_file_path_ = ss.str(); |
| 192 | if (CreateDir(trace_save_file_path_) != 0) { | 192 | if (CreateDir(trace_save_file_path_) != 0) { |
| 193 | - GELOGE(INTERNAL_ERROR, "[trace] Trace not enabled as failed create trace file save directory[%s]", | 193 | + GELOGE(INTERNAL_ERROR, "[trace] Trace not enabled as failed to create trace file save directory[%s]", |
| 194 | trace_save_file_path_.c_str()); | 194 | trace_save_file_path_.c_str()); |
| 195 | return FAILED; | 195 | return FAILED; |
| 196 | } | 196 | } |
| @@ -198,7 +198,7 @@ Status TraceManager::Initialize(const char_t *file_save_path) { | |||
| 198 | try { | 198 | try { |
| 199 | save_thread_ = std::thread(&TraceManager::SaveBufferToFileThreadFunc, this); | 199 | save_thread_ = std::thread(&TraceManager::SaveBufferToFileThreadFunc, this); |
| 200 | } catch (const std::system_error &) { | 200 | } catch (const std::system_error &) { |
| 201 | - GELOGE(INTERNAL_ERROR, "[trace] Trace not enabled as failed start trace saving thread"); | 201 | + GELOGE(INTERNAL_ERROR, "[trace] Trace not enabled as failed to start trace saving thread"); |
| 202 | return FAILED; | 202 | return FAILED; |
| 203 | } | 203 | } |
| 204 | return SUCCESS; | 204 | return SUCCESS; |
| @@ -86,7 +86,7 @@ bool NodeShapeTransUtils::CatchFormatAndShape() { | |||
| 86 | const auto ori_format = tensor_desc_output->GetOriginFormat(); | 86 | const auto ori_format = tensor_desc_output->GetOriginFormat(); |
| 87 | if (SameCurrentAndOrigin(tensor_desc_output)) { | 87 | if (SameCurrentAndOrigin(tensor_desc_output)) { |
| 88 | GELOGD( | 88 | GELOGD( |
| 89 | - "Node is %s, output tensor idx is %zu. ori format: %s, format: %s, ori shape:%s, shape:%s is same!" | 89 | + "Node is %s, output tensor idx is %zu. ori format: %s, format: %s, ori shape:%s, shape:%s is same! " |
| 90 | "or output original not initialized. No need to catch format&shape!", | 90 | "or output original not initialized. No need to catch format&shape!", |
| 91 | op_desc_->GetName().c_str(), i, TypeUtils::FormatToSerialString(ori_format).c_str(), | 91 | op_desc_->GetName().c_str(), i, TypeUtils::FormatToSerialString(ori_format).c_str(), |
| 92 | TypeUtils::FormatToSerialString(format).c_str(), tensor_desc_output->GetOriginShape().ToString().c_str(), | 92 | TypeUtils::FormatToSerialString(format).c_str(), tensor_desc_output->GetOriginShape().ToString().c_str(), |
| @@ -113,9 +113,9 @@ bool NodeShapeTransUtils::UpdateFormatAndShape() { | |||
| 113 | if (tensor_desc_input == nullptr) { | 113 | if (tensor_desc_input == nullptr) { |
| 114 | continue; | 114 | continue; |
| 115 | } | 115 | } |
| 116 | - // if can not find saved info, it says format and origin format is same when catched | 116 | + // if can not find saved info, it says format and origin format is same when caught |
| 117 | if (map_format_in_[i] == FORMAT_RESERVED) { | 117 | if (map_format_in_[i] == FORMAT_RESERVED) { |
| 118 | - GELOGD("Node is [%s], input tensor idx [%zu] is not been catched.Skip update action for it!", | 118 | + GELOGD("Node is [%s], input tensor idx [%zu] has not been caught. Skip update action for it!", |
| 119 | op_desc_->GetName().c_str(), i); | 119 | op_desc_->GetName().c_str(), i); |
| 120 | tensor_desc_input->SetOriginFormat(tensor_desc_input->GetFormat()); | 120 | tensor_desc_input->SetOriginFormat(tensor_desc_input->GetFormat()); |
| 121 | tensor_desc_input->SetOriginShape(tensor_desc_input->MutableShape()); | 121 | tensor_desc_input->SetOriginShape(tensor_desc_input->MutableShape()); |
| @@ -152,9 +152,9 @@ bool NodeShapeTransUtils::UpdateFormatAndShape() { | |||
| 152 | if (tensor_desc_output == nullptr) { | 152 | if (tensor_desc_output == nullptr) { |
| 153 | continue; | 153 | continue; |
| 154 | } | 154 | } |
| 155 | - // if can not find saved info, it says format and origin format is same when catched | 155 | + // if can not find saved info, it says format and origin format is same when caught |
| 156 | if (map_ori_format_out_[i] == FORMAT_RESERVED) { | 156 | if (map_ori_format_out_[i] == FORMAT_RESERVED) { |
| 157 | - GELOGD("Node is [%s], output tensor idx [%zu] is not been catched.Skip update action for it!", | 157 | + GELOGD("Node is [%s], output tensor idx [%zu] has not been caught. Skip update action for it!", |
| 158 | op_desc_->GetName().c_str(), i); | 158 | op_desc_->GetName().c_str(), i); |
| 159 | tensor_desc_output->SetOriginFormat(tensor_desc_output->GetFormat()); | 159 | tensor_desc_output->SetOriginFormat(tensor_desc_output->GetFormat()); |
| 160 | tensor_desc_output->SetOriginShape(tensor_desc_output->MutableShape()); | 160 | tensor_desc_output->SetOriginShape(tensor_desc_output->MutableShape()); |
| @@ -102,7 +102,7 @@ graphStatus TuningUtils::ConvertGraphToFile(std::vector<ComputeGraphPtr> tuning_ | |||
| 102 | auto help_info = HelpInfo{i, exe_flag, true, path, user_path}; | 102 | auto help_info = HelpInfo{i, exe_flag, true, path, user_path}; |
| 103 | help_info.need_preprocess_ = true; | 103 | help_info.need_preprocess_ = true; |
| 104 | if (MakeExeGraph(subgraph, help_info) != SUCCESS) { | 104 | if (MakeExeGraph(subgraph, help_info) != SUCCESS) { |
| 105 | - GELOGE(GRAPH_FAILED, "[Invoke][MakeExeGraph] TUU:subgraph %zu generate exe graph failed", i); | 105 | + GELOGE(GRAPH_FAILED, "[Invoke][MakeExeGraph] subgraph %zu generate exe graph failed", i); |
| 106 | return GRAPH_FAILED; | 106 | return GRAPH_FAILED; |
| 107 | } | 107 | } |
| 108 | i++; | 108 | i++; |
| @@ -112,7 +112,7 @@ graphStatus TuningUtils::ConvertGraphToFile(std::vector<ComputeGraphPtr> tuning_ | |||
| 112 | (void)create_output_.emplace(subgraph, nullptr); | 112 | (void)create_output_.emplace(subgraph, nullptr); |
| 113 | const auto help_info = HelpInfo{j, true, false, path, user_path}; | 113 | const auto help_info = HelpInfo{j, true, false, path, user_path}; |
| 114 | if (MakeExeGraph(subgraph, help_info) != SUCCESS) { | 114 | if (MakeExeGraph(subgraph, help_info) != SUCCESS) { |
| 115 | - GELOGE(GRAPH_FAILED, "[Invoke][MakeExeGraph] TUU:non tuning_subgraph %zu generate exe graph failed", j); | 115 | + GELOGE(GRAPH_FAILED, "[Invoke][MakeExeGraph] non tuning_subgraph %zu generate exe graph failed", j); |
| 116 | return GRAPH_FAILED; | 116 | return GRAPH_FAILED; |
| 117 | } | 117 | } |
| 118 | j++; | 118 | j++; |
| @@ -179,7 +179,7 @@ graphStatus TuningUtils::MakeExeGraph(ComputeGraphPtr &exe_graph, const HelpInfo | |||
| 179 | } | 179 | } |
| 180 | // clear graph id | 180 | // clear graph id |
| 181 | GE_ASSERT_TRUE(AttrUtils::SetStr(*exe_graph, ATTR_NAME_SESSION_GRAPH_ID, "")); | 181 | GE_ASSERT_TRUE(AttrUtils::SetStr(*exe_graph, ATTR_NAME_SESSION_GRAPH_ID, "")); |
| 182 | - GELOGI("TUU:clear [%s] session_graph_id success", exe_graph->GetName().c_str()); | 182 | + GELOGI("clear [%s] session_graph_id success", exe_graph->GetName().c_str()); |
| 183 | // if not make exe, just dump and return | 183 | // if not make exe, just dump and return |
| 184 | if (!help_info.exe_flag_) { | 184 | if (!help_info.exe_flag_) { |
| 185 | if (ConvertConstToWeightAttr(exe_graph) != SUCCESS) { | 185 | if (ConvertConstToWeightAttr(exe_graph) != SUCCESS) { |
| @@ -188,7 +188,7 @@ graphStatus TuningUtils::MakeExeGraph(ComputeGraphPtr &exe_graph, const HelpInfo | |||
| 188 | return FAILED; | 188 | return FAILED; |
| 189 | } | 189 | } |
| 190 | DumpGraphToPath(exe_graph, help_info.index_, help_info.is_tuning_graph_, help_info.path_); | 190 | DumpGraphToPath(exe_graph, help_info.index_, help_info.is_tuning_graph_, help_info.path_); |
| 191 | - GELOGI("TUU:just return, dump original sub_graph[%s]index[%" PRId64 "]", exe_graph->GetName().c_str(), | 191 | + GELOGI("just return, dump original sub_graph[%s]index[%" PRId64 "]", exe_graph->GetName().c_str(), |
| 192 | help_info.index_); | 192 | help_info.index_); |
| 193 | return SUCCESS; | 193 | return SUCCESS; |
| 194 | } | 194 | } |
| @@ -423,8 +423,8 @@ graphStatus TuningUtils::CreateDataNode(NodePtr &node, const std::string &aoe_pa | |||
| 423 | GE_CHECK_NOTNULL(data_node); | 423 | GE_CHECK_NOTNULL(data_node); |
| 424 | if (data_node->GetType() == CONSTANT) { | 424 | if (data_node->GetType() == CONSTANT) { |
| 425 | if (OpDescUtils::SetWeights(data_node, weight) != GRAPH_SUCCESS) { | 425 | if (OpDescUtils::SetWeights(data_node, weight) != GRAPH_SUCCESS) { |
| 426 | - REPORT_INNER_ERR_MSG("E18888", "TUU:const node %s add weight failed", data_op_desc->GetName().c_str()); | 426 | + REPORT_INNER_ERR_MSG("E18888", "const node %s add weight failed", data_op_desc->GetName().c_str()); |
| 427 | - GELOGE(FAILED, "[Set][Weights] TUU:const node %s add weight failed", data_op_desc->GetName().c_str()); | 427 | + GELOGE(FAILED, "[Set][Weights] const node %s add weight failed", data_op_desc->GetName().c_str()); |
| 428 | return FAILED; | 428 | return FAILED; |
| 429 | } | 429 | } |
| 430 | } | 430 | } |
| @@ -442,38 +442,38 @@ graphStatus TuningUtils::AddAttrToDataNodeForMergeGraph(const NodePtr &pld, cons | |||
| 442 | // a. set `end's input node type` as attr | 442 | // a. set `end's input node type` as attr |
| 443 | const std::string *parent_op_type = AttrUtils::GetStr(pld_desc, "parentOpType"); | 443 | const std::string *parent_op_type = AttrUtils::GetStr(pld_desc, "parentOpType"); |
| 444 | if (parent_op_type == nullptr) { | 444 | if (parent_op_type == nullptr) { |
| 445 | - REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get parentOpType failed", pld_desc->GetName().c_str()); | 445 | + REPORT_INNER_ERR_MSG("E18888", "pld %s get parentOpType failed", pld_desc->GetName().c_str()); |
| 446 | - GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get parentOpType failed", pld_desc->GetName().c_str()); | 446 | + GELOGE(FAILED, "[Invoke][GetStr] pld %s get parentOpType failed", pld_desc->GetName().c_str()); |
| 447 | return FAILED; | 447 | return FAILED; |
| 448 | } | 448 | } |
| 449 | (void)AttrUtils::SetStr(op_desc, "parentOpType", *parent_op_type); | 449 | (void)AttrUtils::SetStr(op_desc, "parentOpType", *parent_op_type); |
| 450 | // b. set `end's input node name` as attr | 450 | // b. set `end's input node name` as attr |
| 451 | const std::string *parent_op_name = AttrUtils::GetStr(pld_desc, parent_node_name_attr); | 451 | const std::string *parent_op_name = AttrUtils::GetStr(pld_desc, parent_node_name_attr); |
| 452 | if (parent_op_name == nullptr) { | 452 | if (parent_op_name == nullptr) { |
| 453 | - REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); | 453 | + REPORT_INNER_ERR_MSG("E18888", "pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); |
| 454 | - GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); | 454 | + GELOGE(FAILED, "[Invoke][GetStr] pld %s get _parentNodeName failed", pld_desc->GetName().c_str()); |
| 455 | return FAILED; | 455 | return FAILED; |
| 456 | } | 456 | } |
| 457 | (void)AttrUtils::SetStr(op_desc, parent_node_name_attr, *parent_op_name); | 457 | (void)AttrUtils::SetStr(op_desc, parent_node_name_attr, *parent_op_name); |
| 458 | // c. set `end's input node's out anchor index` as attr | 458 | // c. set `end's input node's out anchor index` as attr |
| 459 | int32_t parent_node_anchor_index; | 459 | int32_t parent_node_anchor_index; |
| 460 | if (!AttrUtils::GetInt(pld_desc, "anchorIndex", parent_node_anchor_index)) { | 460 | if (!AttrUtils::GetInt(pld_desc, "anchorIndex", parent_node_anchor_index)) { |
| 461 | - REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get anchorIndex failed", pld_desc->GetName().c_str()); | 461 | + REPORT_INNER_ERR_MSG("E18888", "pld %s get anchorIndex failed", pld_desc->GetName().c_str()); |
| 462 | - GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get anchorIndex failed", pld_desc->GetName().c_str()); | 462 | + GELOGE(FAILED, "[Invoke][GetStr] pld %s get anchorIndex failed", pld_desc->GetName().c_str()); |
| 463 | return FAILED; | 463 | return FAILED; |
| 464 | } | 464 | } |
| 465 | (void)AttrUtils::SetInt(op_desc, parent_node_anchor_index_attr, parent_node_anchor_index); | 465 | (void)AttrUtils::SetInt(op_desc, parent_node_anchor_index_attr, parent_node_anchor_index); |
| 466 | - GELOGD("TUU:from node %s(%s) to add attr to node %s(%s) success", pld->GetName().c_str(), pld->GetType().c_str(), | 466 | + GELOGD("from node %s(%s) to add attr to node %s(%s) success", pld->GetName().c_str(), pld->GetType().c_str(), |
| 467 | data_node->GetName().c_str(), data_node->GetType().c_str()); | 467 | data_node->GetName().c_str(), data_node->GetType().c_str()); |
| 468 | // d. set `end node name` as attr | 468 | // d. set `end node name` as attr |
| 469 | const std::string *peer_end_name = AttrUtils::GetStr(pld_desc, peer_node_name_attr); | 469 | const std::string *peer_end_name = AttrUtils::GetStr(pld_desc, peer_node_name_attr); |
| 470 | if (peer_end_name == nullptr) { | 470 | if (peer_end_name == nullptr) { |
| 471 | - REPORT_INNER_ERR_MSG("E18888", "TUU:pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); | 471 | + REPORT_INNER_ERR_MSG("E18888", "pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); |
| 472 | - GELOGE(FAILED, "[Invoke][GetStr] TUU:pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); | 472 | + GELOGE(FAILED, "[Invoke][GetStr] pld %s get _peerNodeName failed", pld_desc->GetName().c_str()); |
| 473 | return FAILED; | 473 | return FAILED; |
| 474 | } | 474 | } |
| 475 | (void)AttrUtils::SetStr(op_desc, peer_node_name_attr, *peer_end_name); | 475 | (void)AttrUtils::SetStr(op_desc, peer_node_name_attr, *peer_end_name); |
| 476 | - GELOGD("TUU:from node %s(%s) to add attr to node %s(%s) success", pld->GetName().c_str(), pld->GetType().c_str(), | 476 | + GELOGD("from node %s(%s) to add attr to node %s(%s) success", pld->GetName().c_str(), pld->GetType().c_str(), |
| 477 | data_node->GetName().c_str(), data_node->GetType().c_str()); | 477 | data_node->GetName().c_str(), data_node->GetType().c_str()); |
| 478 | return SUCCESS; | 478 | return SUCCESS; |
| 479 | } | 479 | } |
| @@ -482,9 +482,9 @@ graphStatus TuningUtils::ChangePld2Data(const NodePtr &node, const NodePtr &data | |||
| 482 | const auto type_pld = node->GetType(); | 482 | const auto type_pld = node->GetType(); |
| 483 | const auto type_data = data_node->GetType(); | 483 | const auto type_data = data_node->GetType(); |
| 484 | if ((type_pld != PLACEHOLDER) || (kExeTypes.count(type_data) == 0U)) { | 484 | if ((type_pld != PLACEHOLDER) || (kExeTypes.count(type_data) == 0U)) { |
| 485 | - REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to change node %s from type %s to type %s", node->GetName().c_str(), | 485 | + REPORT_INNER_ERR_MSG("E18888", "Failed to change node %s from type %s to type %s", node->GetName().c_str(), |
| 486 | type_pld.c_str(), type_data.c_str()); | 486 | type_pld.c_str(), type_data.c_str()); |
| 487 | - GELOGE(FAILED, "[Check][Param] TUU:Failed to change node %s from type %s to type %s", node->GetName().c_str(), | 487 | + GELOGE(FAILED, "[Check][Param] Failed to change node %s from type %s to type %s", node->GetName().c_str(), |
| 488 | type_pld.c_str(), type_data.c_str()); | 488 | type_pld.c_str(), type_data.c_str()); |
| 489 | return FAILED; | 489 | return FAILED; |
| 490 | } | 490 | } |
| @@ -497,7 +497,7 @@ graphStatus TuningUtils::ChangePld2Data(const NodePtr &node, const NodePtr &data | |||
| 497 | 497 | ||
| 498 | const auto ret = GraphUtils::ReplaceNodeAnchors(data_node, node, {}, output_map); | 498 | const auto ret = GraphUtils::ReplaceNodeAnchors(data_node, node, {}, output_map); |
| 499 | if (ret != GRAPH_SUCCESS) { | 499 | if (ret != GRAPH_SUCCESS) { |
| 500 | - REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to replace node %s by node %s, ret:%u", node->GetName().c_str(), | 500 | + REPORT_INNER_ERR_MSG("E18888", "Failed to replace node %s by node %s, ret:%u", node->GetName().c_str(), |
| 501 | data_node->GetName().c_str(), ret); | 501 | data_node->GetName().c_str(), ret); |
| 502 | GELOGE(FAILED, "[Replace][Node] %s by node %s failed, ret:%u", node->GetName().c_str(), | 502 | GELOGE(FAILED, "[Replace][Node] %s by node %s failed, ret:%u", node->GetName().c_str(), |
| 503 | data_node->GetName().c_str(), ret); | 503 | data_node->GetName().c_str(), ret); |
| @@ -506,7 +506,7 @@ graphStatus TuningUtils::ChangePld2Data(const NodePtr &node, const NodePtr &data | |||
| 506 | 506 | ||
| 507 | NodeUtils::UnlinkAll(*node); | 507 | NodeUtils::UnlinkAll(*node); |
| 508 | 508 | ||
| 509 | - GELOGD("TUU:Remove node %s(%s) by the ChangePld2Data process, replace it with node %s(%s)", node->GetName().c_str(), | 509 | + GELOGD("Remove node %s(%s) by the ChangePld2Data process, replace it with node %s(%s)", node->GetName().c_str(), |
| 510 | node->GetType().c_str(), data_node->GetName().c_str(), data_node->GetType().c_str()); | 510 | node->GetType().c_str(), data_node->GetName().c_str(), data_node->GetType().c_str()); |
| 511 | return ret; | 511 | return ret; |
| 512 | } | 512 | } |
| @@ -519,23 +519,23 @@ graphStatus TuningUtils::HandlePld(NodePtr &node, const std::string &aoe_path) { | |||
| 519 | NodePtr data_node = nullptr; | 519 | NodePtr data_node = nullptr; |
| 520 | // 1. create data node | 520 | // 1. create data node |
| 521 | if (CreateDataNode(node, aoe_path, data_node) != SUCCESS) { | 521 | if (CreateDataNode(node, aoe_path, data_node) != SUCCESS) { |
| 522 | - GELOGE(FAILED, "[Create][DataNode] TUU:Failed to handle node %s from graph %s", node->GetName().c_str(), | 522 | + GELOGE(FAILED, "[Create][DataNode] Failed to handle node %s from graph %s", node->GetName().c_str(), |
| 523 | graph->GetName().c_str()); | 523 | graph->GetName().c_str()); |
| 524 | return FAILED; | 524 | return FAILED; |
| 525 | } | 525 | } |
| 526 | // 2. add necessary info to data_node for recovery whole graph | 526 | // 2. add necessary info to data_node for recovery whole graph |
| 527 | if (AddAttrToDataNodeForMergeGraph(node, data_node) != SUCCESS) { | 527 | if (AddAttrToDataNodeForMergeGraph(node, data_node) != SUCCESS) { |
| 528 | - GELOGE(FAILED, "[Add][Attr] TUU:Failed to handle node %s from graph %s", node->GetName().c_str(), | 528 | + GELOGE(FAILED, "[Add][Attr] Failed to handle node %s from graph %s", node->GetName().c_str(), |
| 529 | graph->GetName().c_str()); | 529 | graph->GetName().c_str()); |
| 530 | return FAILED; | 530 | return FAILED; |
| 531 | } | 531 | } |
| 532 | // 3. replace pld node by data node created before | 532 | // 3. replace pld node by data node created before |
| 533 | if (ChangePld2Data(node, data_node) != SUCCESS) { | 533 | if (ChangePld2Data(node, data_node) != SUCCESS) { |
| 534 | - GELOGE(FAILED, "[Change][Pld2Data] TUU:Failed to handle node %s from graph %s", node->GetName().c_str(), | 534 | + GELOGE(FAILED, "[Change][Pld2Data] Failed to handle node %s from graph %s", node->GetName().c_str(), |
| 535 | graph->GetName().c_str()); | 535 | graph->GetName().c_str()); |
| 536 | return FAILED; | 536 | return FAILED; |
| 537 | } | 537 | } |
| 538 | - GELOGD("TUU:pld[%s] handle success", node->GetName().c_str()); | 538 | + GELOGD("pld[%s] handle success", node->GetName().c_str()); |
| 539 | return SUCCESS; | 539 | return SUCCESS; |
| 540 | } | 540 | } |
| 541 | 541 | ||
| @@ -545,15 +545,15 @@ graphStatus TuningUtils::CreateNetOutput(const NodePtr &node, NodePtr &out_node) | |||
| 545 | GE_CHECK_NOTNULL(graph); | 545 | GE_CHECK_NOTNULL(graph); |
| 546 | const auto search = create_output_.find(graph); | 546 | const auto search = create_output_.find(graph); |
| 547 | if (search == create_output_.end()) { | 547 | if (search == create_output_.end()) { |
| 548 | - REPORT_INNER_ERR_MSG("E18888", "TUU:node %s's owner sub graph %s does not exist in create_output map", | 548 | + REPORT_INNER_ERR_MSG("E18888", "node %s's owner sub graph %s does not exist in create_output map", |
| 549 | node->GetName().c_str(), graph->GetName().c_str()); | 549 | node->GetName().c_str(), graph->GetName().c_str()); |
| 550 | - GELOGE(FAILED, "[Check][Param] TUU:node %s's owner sub graph %s does not exist in create_output map", | 550 | + GELOGE(FAILED, "[Check][Param] node %s's owner sub graph %s does not exist in create_output map", |
| 551 | node->GetName().c_str(), graph->GetName().c_str()); | 551 | node->GetName().c_str(), graph->GetName().c_str()); |
| 552 | return FAILED; | 552 | return FAILED; |
| 553 | } | 553 | } |
| 554 | if (search->second != nullptr) { | 554 | if (search->second != nullptr) { |
| 555 | out_node = search->second; | 555 | out_node = search->second; |
| 556 | - GELOGD("TUU:sub graph %s has created output node, just return", graph->GetName().c_str()); | 556 | + GELOGD("sub graph %s has created output node, just return", graph->GetName().c_str()); |
| 557 | return SUCCESS; | 557 | return SUCCESS; |
| 558 | } | 558 | } |
| 559 | const auto out_op_desc = ComGraphMakeShared<OpDesc>(node->GetName(), NETOUTPUT); | 559 | const auto out_op_desc = ComGraphMakeShared<OpDesc>(node->GetName(), NETOUTPUT); |
| @@ -561,8 +561,8 @@ graphStatus TuningUtils::CreateNetOutput(const NodePtr &node, NodePtr &out_node) | |||
| 561 | out_node = graph->AddNode(out_op_desc); | 561 | out_node = graph->AddNode(out_op_desc); |
| 562 | GE_CHECK_NOTNULL(out_node); | 562 | GE_CHECK_NOTNULL(out_node); |
| 563 | if (out_node->SetOwnerComputeGraph(graph) != GRAPH_SUCCESS) { | 563 | if (out_node->SetOwnerComputeGraph(graph) != GRAPH_SUCCESS) { |
| 564 | - REPORT_INNER_ERR_MSG("E18888", "TUU:SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); | 564 | + REPORT_INNER_ERR_MSG("E18888", "SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); |
| 565 | - GELOGE(FAILED, "[Set][Graph] TUU:SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); | 565 | + GELOGE(FAILED, "[Set][Graph] SetOwnerComputeGraph failed, graph:%s", graph->GetName().c_str()); |
| 566 | return FAILED; | 566 | return FAILED; |
| 567 | } | 567 | } |
| 568 | create_output_[graph] = out_node; | 568 | create_output_[graph] = out_node; |
| @@ -601,13 +601,13 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) | |||
| 601 | GE_CHECK_NOTNULL(src_anchor); | 601 | GE_CHECK_NOTNULL(src_anchor); |
| 602 | if (GraphUtils::RemoveEdge(src_anchor, end_in_anchor) != GRAPH_SUCCESS) { | 602 | if (GraphUtils::RemoveEdge(src_anchor, end_in_anchor) != GRAPH_SUCCESS) { |
| 603 | REPORT_INNER_ERR_MSG("E18888", | 603 | REPORT_INNER_ERR_MSG("E18888", |
| 604 | - "TUU:remove end input edge from from %s(%d) to %s(%d) failed. " | 604 | + "remove end input edge from %s(%d) to %s(%d) failed. " |
| 605 | "node_name:%s, graph_name:%s", | 605 | "node_name:%s, graph_name:%s", |
| 606 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), | 606 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), |
| 607 | GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), | 607 | GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), |
| 608 | end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); | 608 | end_node->GetName().c_str(), end_node->GetOwnerComputeGraph()->GetName().c_str()); |
| 609 | GELOGE(FAILED, | 609 | GELOGE(FAILED, |
| 610 | - "[Remove][Edge] TUU:remove end input edge from from %s(%d) to %s(%d) failed. " | 610 | + "[Remove][Edge] remove end input edge from %s(%d) to %s(%d) failed. " |
| 611 | "node_name:%s, graph_name:%s", | 611 | "node_name:%s, graph_name:%s", |
| 612 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), | 612 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), |
| 613 | GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), end_node->GetName().c_str(), | 613 | GetNodeNameByAnchor(end_in_anchor.get()).c_str(), end_in_anchor->GetIdx(), end_node->GetName().c_str(), |
| @@ -622,7 +622,7 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) | |||
| 622 | GE_CHECK_NOTNULL(out_node->impl_); | 622 | GE_CHECK_NOTNULL(out_node->impl_); |
| 623 | out_node->impl_->in_data_anchors_.push_back(anchor); | 623 | out_node->impl_->in_data_anchors_.push_back(anchor); |
| 624 | if (GraphUtils::AddEdge(src_anchor, anchor) != GRAPH_SUCCESS) { | 624 | if (GraphUtils::AddEdge(src_anchor, anchor) != GRAPH_SUCCESS) { |
| 625 | - REPORT_INNER_ERR_MSG("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", | 625 | + REPORT_INNER_ERR_MSG("E18888", "add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", |
| 626 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), | 626 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), |
| 627 | GetNodeNameByAnchor(anchor.get()).c_str(), anchor->GetIdx(), end_node->GetName().c_str(), | 627 | GetNodeNameByAnchor(anchor.get()).c_str(), anchor->GetIdx(), end_node->GetName().c_str(), |
| 628 | end_node->GetOwnerComputeGraph()->GetName().c_str()); | 628 | end_node->GetOwnerComputeGraph()->GetName().c_str()); |
| @@ -638,13 +638,13 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) | |||
| 638 | GE_CHECK_NOTNULL(out_node_op_desc); | 638 | GE_CHECK_NOTNULL(out_node_op_desc); |
| 639 | // end node always has one input | 639 | // end node always has one input |
| 640 | if (out_node_op_desc->AddInputDesc(end_op_desc->GetInputDesc(0U)) != GRAPH_SUCCESS) { | 640 | if (out_node_op_desc->AddInputDesc(end_op_desc->GetInputDesc(0U)) != GRAPH_SUCCESS) { |
| 641 | - REPORT_INNER_ERR_MSG("E18888", "TUU:node %s add input desc failed.", out_node_op_desc->GetName().c_str()); | 641 | + REPORT_INNER_ERR_MSG("E18888", "node %s add input desc failed.", out_node_op_desc->GetName().c_str()); |
| 642 | - GELOGE(FAILED, "[Add][InputDesc] failed, TUU:node %s .", out_node_op_desc->GetName().c_str()); | 642 | + GELOGE(FAILED, "[Add][InputDesc] failed, node %s .", out_node_op_desc->GetName().c_str()); |
| 643 | return FAILED; | 643 | return FAILED; |
| 644 | } | 644 | } |
| 645 | // add necessary info to out_node for recovery whole graph | 645 | // add necessary info to out_node for recovery whole graph |
| 646 | if (AddAttrToNetOutputForMergeGraph(end_node, out_node, static_cast<int64_t>(anchor->GetIdx())) != SUCCESS) { | 646 | if (AddAttrToNetOutputForMergeGraph(end_node, out_node, static_cast<int64_t>(anchor->GetIdx())) != SUCCESS) { |
| 647 | - GELOGE(FAILED, "[Add][Attr] TUU:Failed to handle node %s from graph %s", end_node->GetName().c_str(), | 647 | + GELOGE(FAILED, "[Add][Attr] Failed to handle node %s from graph %s", end_node->GetName().c_str(), |
| 648 | end_node->GetOwnerComputeGraph()->GetName().c_str()); | 648 | end_node->GetOwnerComputeGraph()->GetName().c_str()); |
| 649 | return FAILED; | 649 | return FAILED; |
| 650 | } | 650 | } |
| @@ -657,7 +657,7 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) | |||
| 657 | const auto out_in_anchor = out_node->GetInControlAnchor(); | 657 | const auto out_in_anchor = out_node->GetInControlAnchor(); |
| 658 | if ((GraphUtils::AddEdge(src_anchor, noop_node->GetInControlAnchor()) != GRAPH_SUCCESS) || | 658 | if ((GraphUtils::AddEdge(src_anchor, noop_node->GetInControlAnchor()) != GRAPH_SUCCESS) || |
| 659 | (GraphUtils::AddEdge(noop_node->GetOutControlAnchor(), out_in_anchor) != GRAPH_SUCCESS)) { | 659 | (GraphUtils::AddEdge(noop_node->GetOutControlAnchor(), out_in_anchor) != GRAPH_SUCCESS)) { |
| 660 | - REPORT_INNER_ERR_MSG("E18888", "TUU:add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", | 660 | + REPORT_INNER_ERR_MSG("E18888", "add edge from %s(%d) to %s(%d) failed. node_name:%s, graph_name:%s", |
| 661 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), | 661 | GetNodeNameByAnchor(src_anchor.get()).c_str(), src_anchor->GetIdx(), |
| 662 | GetNodeNameByAnchor(noop_node->GetInControlAnchor().get()).c_str(), | 662 | GetNodeNameByAnchor(noop_node->GetInControlAnchor().get()).c_str(), |
| 663 | noop_node->GetInControlAnchor()->GetIdx(), end_node->GetName().c_str(), | 663 | noop_node->GetInControlAnchor()->GetIdx(), end_node->GetName().c_str(), |
| @@ -671,14 +671,14 @@ graphStatus TuningUtils::LinkEnd2NetOutput(NodePtr &end_node, NodePtr &out_node) | |||
| 671 | } | 671 | } |
| 672 | // add necessary info to out_node for recovery whole graph | 672 | // add necessary info to out_node for recovery whole graph |
| 673 | if (AddAttrToNetOutputForMergeGraph(end_node, out_node, kControlIndex) != SUCCESS) { | 673 | if (AddAttrToNetOutputForMergeGraph(end_node, out_node, kControlIndex) != SUCCESS) { |
| 674 | - GELOGE(FAILED, "[Add][Attr] TUU:Failed to handle node %s from graph %s", end_node->GetName().c_str(), | 674 | + GELOGE(FAILED, "[Add][Attr] Failed to handle node %s from graph %s", end_node->GetName().c_str(), |
| 675 | end_node->GetOwnerComputeGraph()->GetName().c_str()); | 675 | end_node->GetOwnerComputeGraph()->GetName().c_str()); |
| 676 | return FAILED; | 676 | return FAILED; |
| 677 | } | 677 | } |
| 678 | } else { | 678 | } else { |
| 679 | - REPORT_INNER_ERR_MSG("E18888", "TUU: node_name:%s, graph_name:%s handled failed", end_node->GetName().c_str(), | 679 | + REPORT_INNER_ERR_MSG("E18888", "node_name:%s, graph_name:%s handled failed", end_node->GetName().c_str(), |
| 680 | end_node->GetOwnerComputeGraph()->GetName().c_str()); | 680 | end_node->GetOwnerComputeGraph()->GetName().c_str()); |
| 681 | - GELOGE(FAILED, "[Handle][Node] TUU: node_name:%s, graph_name:%s handled failed", end_node->GetName().c_str(), | 681 | + GELOGE(FAILED, "[Handle][Node] node_name:%s, graph_name:%s handled failed", end_node->GetName().c_str(), |
| 682 | end_node->GetOwnerComputeGraph()->GetName().c_str()); | 682 | end_node->GetOwnerComputeGraph()->GetName().c_str()); |
| 683 | return FAILED; | 683 | return FAILED; |
| 684 | } | 684 | } |
| @@ -692,15 +692,15 @@ graphStatus TuningUtils::ChangeEnd2NetOutput(NodePtr &end_node, NodePtr &out_nod | |||
| 692 | const auto type_end = end_node->GetType(); | 692 | const auto type_end = end_node->GetType(); |
| 693 | const auto type_out = out_node->GetType(); | 693 | const auto type_out = out_node->GetType(); |
| 694 | if ((type_end != END) || (type_out != NETOUTPUT)) { | 694 | if ((type_end != END) || (type_out != NETOUTPUT)) { |
| 695 | - REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to change end_node %s from type %s to type %s", | 695 | + REPORT_INNER_ERR_MSG("E18888", "Failed to change end_node %s from type %s to type %s", end_node->GetName().c_str(), |
| 696 | - end_node->GetName().c_str(), type_end.c_str(), type_out.c_str()); | 696 | + type_end.c_str(), type_out.c_str()); |
| 697 | - GELOGE(FAILED, "[Check][Param] TUU:Failed to change end_node %s from type %s to type %s", | 697 | + GELOGE(FAILED, "[Check][Param] Failed to change end_node %s from type %s to type %s", end_node->GetName().c_str(), |
| 698 | - end_node->GetName().c_str(), type_end.c_str(), type_out.c_str()); | 698 | + type_end.c_str(), type_out.c_str()); |
| 699 | return FAILED; | 699 | return FAILED; |
| 700 | } | 700 | } |
| 701 | // link all `end nodes's in node` to this out_node | 701 | // link all `end nodes's in node` to this out_node |
| 702 | if (LinkEnd2NetOutput(end_node, out_node) != SUCCESS) { | 702 | if (LinkEnd2NetOutput(end_node, out_node) != SUCCESS) { |
| 703 | - GELOGE(FAILED, "[Invoke][LinkEnd2NetOutput] failed, TUU:end_node [%s].", end_node->GetName().c_str()); | 703 | + GELOGE(FAILED, "[Invoke][LinkEnd2NetOutput] failed, end_node [%s].", end_node->GetName().c_str()); |
| 704 | return FAILED; | 704 | return FAILED; |
| 705 | } | 705 | } |
| 706 | // remove `end node` | 706 | // remove `end node` |
| @@ -716,17 +716,17 @@ graphStatus TuningUtils::HandleEnd(NodePtr &node) { | |||
| 716 | 716 | ||
| 717 | // 1. create net_output node , add only one NetOutput node to one subgraph | 717 | // 1. create net_output node , add only one NetOutput node to one subgraph |
| 718 | if (CreateNetOutput(node, out_node) != SUCCESS) { | 718 | if (CreateNetOutput(node, out_node) != SUCCESS) { |
| 719 | - GELOGE(FAILED, "[Create][NetOutput] TUU:Failed to handle node %s from graph %s", node->GetName().c_str(), | 719 | + GELOGE(FAILED, "[Create][NetOutput] Failed to handle node %s from graph %s", node->GetName().c_str(), |
| 720 | graph->GetName().c_str()); | 720 | graph->GetName().c_str()); |
| 721 | return FAILED; | 721 | return FAILED; |
| 722 | } | 722 | } |
| 723 | // 2. replace all end nodes by one output node created before | 723 | // 2. replace all end nodes by one output node created before |
| 724 | if (ChangeEnd2NetOutput(node, out_node) != SUCCESS) { | 724 | if (ChangeEnd2NetOutput(node, out_node) != SUCCESS) { |
| 725 | - GELOGE(FAILED, "[Invoke][ChangeEnd2NetOutput] TUU:Failed to handle node %s from graph %s", node->GetName().c_str(), | 725 | + GELOGE(FAILED, "[Invoke][ChangeEnd2NetOutput] Failed to handle node %s from graph %s", node->GetName().c_str(), |
| 726 | graph->GetName().c_str()); | 726 | graph->GetName().c_str()); |
| 727 | return FAILED; | 727 | return FAILED; |
| 728 | } | 728 | } |
| 729 | - GELOGD("TUU:end[%s] handle success", node->GetName().c_str()); | 729 | + GELOGD("end[%s] handle success", node->GetName().c_str()); |
| 730 | return SUCCESS; | 730 | return SUCCESS; |
| 731 | } | 731 | } |
| 732 | 732 | ||
| @@ -786,7 +786,7 @@ graphStatus TuningUtils::LinkSubgraph(ComputeGraphPtr &root_graph, const Compute | |||
| 786 | for (const auto &subgraph_name : op_desc->GetSubgraphInstanceNames()) { | 786 | for (const auto &subgraph_name : op_desc->GetSubgraphInstanceNames()) { |
| 787 | const auto iter = name_to_merged_subgraph.find(subgraph_name); | 787 | const auto iter = name_to_merged_subgraph.find(subgraph_name); |
| 788 | if (iter == name_to_merged_subgraph.end()) { | 788 | if (iter == name_to_merged_subgraph.end()) { |
| 789 | - REPORT_INNER_ERR_MSG("E18888", "TUU:can not find subgraph with name:%s for op:%s.", subgraph_name.c_str(), | 789 | + REPORT_INNER_ERR_MSG("E18888", "can not find subgraph with name:%s for op:%s.", subgraph_name.c_str(), |
| 790 | op_desc->GetName().c_str()); | 790 | op_desc->GetName().c_str()); |
| 791 | GELOGE(GRAPH_FAILED, "can not find subgraph with name:%s for op:%s", subgraph_name.c_str(), | 791 | GELOGE(GRAPH_FAILED, "can not find subgraph with name:%s for op:%s", subgraph_name.c_str(), |
| 792 | op_desc->GetName().c_str()); | 792 | op_desc->GetName().c_str()); |
| @@ -838,7 +838,7 @@ graphStatus TuningUtils::LoadGraphFromFile(const std::map<int64_t, std::string> | |||
| 838 | } else { | 838 | } else { |
| 839 | const std::string *parent_graph_name = af::AttrUtils::GetStr(compute_graph, ATTR_NAME_PARENT_GRAPH_NAME); | 839 | const std::string *parent_graph_name = af::AttrUtils::GetStr(compute_graph, ATTR_NAME_PARENT_GRAPH_NAME); |
| 840 | if (parent_graph_name == nullptr) { | 840 | if (parent_graph_name == nullptr) { |
| 841 | - REPORT_INNER_ERR_MSG("E18888", "TUU:get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph."); | 841 | + REPORT_INNER_ERR_MSG("E18888", "get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph."); |
| 842 | GELOGE(GRAPH_FAILED, "get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph:%s", | 842 | GELOGE(GRAPH_FAILED, "get attr ATTR_NAME_PARENT_GRAPH_NAME failed for subgraph:%s", |
| 843 | compute_graph->GetName().c_str()); | 843 | compute_graph->GetName().c_str()); |
| 844 | return GRAPH_FAILED; | 844 | return GRAPH_FAILED; |
| @@ -848,7 +848,7 @@ graphStatus TuningUtils::LoadGraphFromFile(const std::map<int64_t, std::string> | |||
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | if (root_graphs.empty()) { | 850 | if (root_graphs.empty()) { |
| 851 | - REPORT_INNER_ERR_MSG("E18888", "TUU:root graph has no subgraphs, can not merge."); | 851 | + REPORT_INNER_ERR_MSG("E18888", "root graph has no subgraphs, can not merge."); |
| 852 | GELOGE(GRAPH_FAILED, "root graph has no subgraphs, can not merge"); | 852 | GELOGE(GRAPH_FAILED, "root graph has no subgraphs, can not merge"); |
| 853 | return GRAPH_FAILED; | 853 | return GRAPH_FAILED; |
| 854 | } | 854 | } |
| @@ -897,7 +897,7 @@ graphStatus TuningUtils::MergeAllSubGraph(const std::vector<ComputeGraphPtr> &su | |||
| 897 | for (auto &subgraph : subgraphs) { | 897 | for (auto &subgraph : subgraphs) { |
| 898 | const Status ret_status = MergeSubGraph(subgraph); | 898 | const Status ret_status = MergeSubGraph(subgraph); |
| 899 | if (ret_status != SUCCESS) { | 899 | if (ret_status != SUCCESS) { |
| 900 | - GELOGE(ret_status, "[Invoke][MergeSubGraph] TUU:subgraph %s merge failed", subgraph->GetName().c_str()); | 900 | + GELOGE(ret_status, "[Invoke][MergeSubGraph] subgraph %s merge failed", subgraph->GetName().c_str()); |
| 901 | return ret_status; | 901 | return ret_status; |
| 902 | } | 902 | } |
| 903 | } | 903 | } |
| @@ -906,13 +906,13 @@ graphStatus TuningUtils::MergeAllSubGraph(const std::vector<ComputeGraphPtr> &su | |||
| 906 | (void)output_merged_compute_graph->AddNode(node); | 906 | (void)output_merged_compute_graph->AddNode(node); |
| 907 | // set owner graph | 907 | // set owner graph |
| 908 | GE_CHK_STATUS_RET(node->SetOwnerComputeGraph(output_merged_compute_graph), | 908 | GE_CHK_STATUS_RET(node->SetOwnerComputeGraph(output_merged_compute_graph), |
| 909 | - "[Set][Graph] TUU:node %s set owner graph failed", node->GetName().c_str()); | 909 | + "[Set][Graph] node %s set owner graph failed", node->GetName().c_str()); |
| 910 | - GELOGD("TUU:graph %s add node %s success", output_merged_compute_graph->GetName().c_str(), node->GetName().c_str()); | 910 | + GELOGD("graph %s add node %s success", output_merged_compute_graph->GetName().c_str(), node->GetName().c_str()); |
| 911 | } | 911 | } |
| 912 | 912 | ||
| 913 | // 2. remove data and output node added by us | 913 | // 2. remove data and output node added by us |
| 914 | if (RemoveDataNetoutputEdge(output_merged_compute_graph) != SUCCESS) { | 914 | if (RemoveDataNetoutputEdge(output_merged_compute_graph) != SUCCESS) { |
| 915 | - GELOGE(FAILED, "[Remove][Edge] TUU:Failed to merge graph %s", output_merged_compute_graph->GetName().c_str()); | 915 | + GELOGE(FAILED, "[Remove][Edge] Failed to merge graph %s", output_merged_compute_graph->GetName().c_str()); |
| 916 | return FAILED; | 916 | return FAILED; |
| 917 | } | 917 | } |
| 918 | const graphStatus ret = output_merged_compute_graph->TopologicalSorting(); | 918 | const graphStatus ret = output_merged_compute_graph->TopologicalSorting(); |
| @@ -923,16 +923,16 @@ graphStatus TuningUtils::MergeAllSubGraph(const std::vector<ComputeGraphPtr> &su | |||
| 923 | output_merged_compute_graph->GetName().c_str(), ret); | 923 | output_merged_compute_graph->GetName().c_str(), ret); |
| 924 | return ret; | 924 | return ret; |
| 925 | } | 925 | } |
| 926 | - GELOGD("TUU:Print-%s", PrintCheckLog().c_str()); | 926 | + GELOGD("Print-%s", PrintCheckLog().c_str()); |
| 927 | - GELOGI("TUU:output_merged_compute_graph %s success", output_merged_compute_graph->GetName().c_str()); | 927 | + GELOGI("output_merged_compute_graph %s success", output_merged_compute_graph->GetName().c_str()); |
| 928 | return SUCCESS; | 928 | return SUCCESS; |
| 929 | } | 929 | } |
| 930 | 930 | ||
| 931 | graphStatus TuningUtils::MergeSubGraph(const ComputeGraphPtr &subgraph) { | 931 | graphStatus TuningUtils::MergeSubGraph(const ComputeGraphPtr &subgraph) { |
| 932 | for (auto &node : subgraph->GetDirectNode()) { | 932 | for (auto &node : subgraph->GetDirectNode()) { |
| 933 | if (kPartitionOpTypes.count(node->GetType()) > 0UL) { | 933 | if (kPartitionOpTypes.count(node->GetType()) > 0UL) { |
| 934 | - REPORT_INNER_ERR_MSG("E18888", "TUU:subgraph passed in should not contain nodes of end or pld type"); | 934 | + REPORT_INNER_ERR_MSG("E18888", "subgraph passed in should not contain nodes of end or pld type"); |
| 935 | - GELOGE(FAILED, "[Check][Param] TUU:subgraph passed in should not contain nodes of end or pld type"); | 935 | + GELOGE(FAILED, "[Check][Param] subgraph passed in should not contain nodes of end or pld type"); |
| 936 | return FAILED; | 936 | return FAILED; |
| 937 | } | 937 | } |
| 938 | // handle data converted from pld node | 938 | // handle data converted from pld node |
| @@ -964,9 +964,9 @@ graphStatus TuningUtils::MergeSubGraph(const ComputeGraphPtr &subgraph) { | |||
| 964 | const std::lock_guard<std::mutex> lock(mutex_); | 964 | const std::lock_guard<std::mutex> lock(mutex_); |
| 965 | merged_graph_nodes_.emplace_back(node); | 965 | merged_graph_nodes_.emplace_back(node); |
| 966 | } | 966 | } |
| 967 | - GELOGD("TUU:subgraph %s add node %s success", subgraph->GetName().c_str(), node->GetName().c_str()); | 967 | + GELOGD("subgraph %s add node %s success", subgraph->GetName().c_str(), node->GetName().c_str()); |
| 968 | } | 968 | } |
| 969 | - GELOGI("TUU:merge subgraph %s success", subgraph->GetName().c_str()); | 969 | + GELOGI("merge subgraph %s success", subgraph->GetName().c_str()); |
| 970 | return SUCCESS; | 970 | return SUCCESS; |
| 971 | } | 971 | } |
| 972 | 972 | ||
| @@ -1000,7 +1000,7 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { | |||
| 1000 | const auto end_name = pair.second; | 1000 | const auto end_name = pair.second; |
| 1001 | int64_t index = 0; | 1001 | int64_t index = 0; |
| 1002 | auto netoutput_node = FindNode(end_name, index); | 1002 | auto netoutput_node = FindNode(end_name, index); |
| 1003 | - GELOGD("TUU:start to find info[%s][%s][%" PRId64 "] ", data_node->GetName().c_str(), end_name.c_str(), index); | 1003 | + GELOGD("start to find info[%s][%s][%" PRId64 "] ", data_node->GetName().c_str(), end_name.c_str(), index); |
| 1004 | GE_CHECK_NOTNULL(netoutput_node); | 1004 | GE_CHECK_NOTNULL(netoutput_node); |
| 1005 | (void)data_node_2_netoutput_node_.emplace(data_node, netoutput_node); | 1005 | (void)data_node_2_netoutput_node_.emplace(data_node, netoutput_node); |
| 1006 | // 2. get `data out anchor` and `net output in anchor` and `net output in node's out anchor` | 1006 | // 2. get `data out anchor` and `net output in anchor` and `net output in node's out anchor` |
| @@ -1024,9 +1024,9 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { | |||
| 1024 | // remove noop node | 1024 | // remove noop node |
| 1025 | NodeUtils::UnlinkAll(*noop_node); | 1025 | NodeUtils::UnlinkAll(*noop_node); |
| 1026 | if (GraphUtils::RemoveJustNode(graph, noop_node) != SUCCESS) { | 1026 | if (GraphUtils::RemoveJustNode(graph, noop_node) != SUCCESS) { |
| 1027 | - REPORT_INNER_ERR_MSG("E18888", "TUU:noop node [%s] RemoveNodeWithoutRelink failed.", | 1027 | + REPORT_INNER_ERR_MSG("E18888", "noop node [%s] RemoveNodeWithoutRelink failed.", |
| 1028 | noop_node->GetName().c_str()); | 1028 | noop_node->GetName().c_str()); |
| 1029 | - GELOGE(FAILED, "[Remove][Node]TUU:noop node [%s] RemoveNodeWithoutRelink failed.", | 1029 | + GELOGE(FAILED, "[Remove][Node]noop node [%s] RemoveNodeWithoutRelink failed.", |
| 1030 | noop_node->GetName().c_str()); | 1030 | noop_node->GetName().c_str()); |
| 1031 | return FAILED; | 1031 | return FAILED; |
| 1032 | } | 1032 | } |
| @@ -1035,7 +1035,7 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { | |||
| 1035 | } | 1035 | } |
| 1036 | } | 1036 | } |
| 1037 | GE_CHECK_NOTNULL(src_out_anchor); | 1037 | GE_CHECK_NOTNULL(src_out_anchor); |
| 1038 | - GELOGD("TUU:get out node:%s 's in anchor(%d) peer_src_node:%s 's out anchor(%d) match info[%s][%s][%" PRId64 "]", | 1038 | + GELOGD("get out node:%s 's in anchor(%d) peer_src_node:%s 's out anchor(%d) match info[%s][%s][%" PRId64 "]", |
| 1039 | netoutput_node->GetName().c_str(), net_output_in_anchor->GetIdx(), | 1039 | netoutput_node->GetName().c_str(), net_output_in_anchor->GetIdx(), |
| 1040 | src_out_anchor->GetOwnerNode()->GetName().c_str(), src_out_anchor->GetIdx(), data_node->GetName().c_str(), | 1040 | src_out_anchor->GetOwnerNode()->GetName().c_str(), src_out_anchor->GetIdx(), data_node->GetName().c_str(), |
| 1041 | end_name.c_str(), index); | 1041 | end_name.c_str(), index); |
| @@ -1059,7 +1059,7 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { | |||
| 1059 | } | 1059 | } |
| 1060 | if (GraphUtils::AddEdge(src_out_anchor, peer_in_anchor) != GRAPH_SUCCESS) { | 1060 | if (GraphUtils::AddEdge(src_out_anchor, peer_in_anchor) != GRAPH_SUCCESS) { |
| 1061 | REPORT_INNER_ERR_MSG("E18888", | 1061 | REPORT_INNER_ERR_MSG("E18888", |
| 1062 | - "TUU:add edge from %s(%d) to %s(%d) failed. " | 1062 | + "add edge from %s(%d) to %s(%d) failed. " |
| 1063 | "node_name:(data:%s;netoutput:%s), graph_name:%s", | 1063 | "node_name:(data:%s;netoutput:%s), graph_name:%s", |
| 1064 | GetNodeNameByAnchor(src_out_anchor.get()).c_str(), src_out_anchor->GetIdx(), | 1064 | GetNodeNameByAnchor(src_out_anchor.get()).c_str(), src_out_anchor->GetIdx(), |
| 1065 | GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), | 1065 | GetNodeNameByAnchor(peer_in_anchor.get()).c_str(), peer_in_anchor->GetIdx(), |
| @@ -1076,11 +1076,11 @@ graphStatus TuningUtils::RemoveDataNetoutputEdge(ComputeGraphPtr &graph) { | |||
| 1076 | for (auto &node : netoutput_nodes_) { | 1076 | for (auto &node : netoutput_nodes_) { |
| 1077 | NodeUtils::UnlinkAll(*node); | 1077 | NodeUtils::UnlinkAll(*node); |
| 1078 | if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != GRAPH_SUCCESS) { | 1078 | if (GraphUtils::RemoveNodeWithoutRelink(graph, node) != GRAPH_SUCCESS) { |
| 1079 | - REPORT_INNER_ERR_MSG("E18888", "TUU:Failed to remove node %s from graph", node->GetName().c_str()); | 1079 | + REPORT_INNER_ERR_MSG("E18888", "Failed to remove node %s from graph", node->GetName().c_str()); |
| 1080 | GELOGE(FAILED, "[Remove][Node] %s from graph failed.", node->GetName().c_str()); | 1080 | GELOGE(FAILED, "[Remove][Node] %s from graph failed.", node->GetName().c_str()); |
| 1081 | return FAILED; | 1081 | return FAILED; |
| 1082 | } | 1082 | } |
| 1083 | - GELOGD("TUU:Remove node %s by the RemoveDataNetoutputEdge process success", node->GetName().c_str()); | 1083 | + GELOGD("Remove node %s by the RemoveDataNetoutputEdge process success", node->GetName().c_str()); |
| 1084 | } | 1084 | } |
| 1085 | return SUCCESS; | 1085 | return SUCCESS; |
| 1086 | } | 1086 | } |
| @@ -1093,7 +1093,7 @@ graphStatus TuningUtils::PreProcessNode(const NodePtr &node) { | |||
| 1093 | } | 1093 | } |
| 1094 | // strep 0: recovery ir | 1094 | // strep 0: recovery ir |
| 1095 | if (op_desc->GetIrInputs().empty() && op_desc->GetIrOutputs().empty() && (op_desc->GetAllOutputsDescSize() != 0U)) { | 1095 | if (op_desc->GetIrInputs().empty() && op_desc->GetIrOutputs().empty() && (op_desc->GetAllOutputsDescSize() != 0U)) { |
| 1096 | - GE_ASSERT_GRAPH_SUCCESS(RecoverIrUtils::RecoverOpDescIrDefinition(op_desc), "Failed recover ir def for %s %s", | 1096 | + GE_ASSERT_GRAPH_SUCCESS(RecoverIrUtils::RecoverOpDescIrDefinition(op_desc), "Failed to recover ir def for %s %s", |
| 1097 | op_desc->GetNamePtr(), op_desc->GetTypePtr()); | 1097 | op_desc->GetNamePtr(), op_desc->GetTypePtr()); |
| 1098 | GELOGI("Node %s %s recover ir def successfully", node->GetNamePtr(), node->GetTypePtr()); | 1098 | GELOGI("Node %s %s recover ir def successfully", node->GetNamePtr(), node->GetTypePtr()); |
| 1099 | } | 1099 | } |
| @@ -172,13 +172,13 @@ inline bool AppendVectorStrAttr(const ge::AnyValue &attr, std::vector<std::vecto | |||
| 172 | for (size_t i = 0U; i < (*val).size(); ++i) { | 172 | for (size_t i = 0U; i < (*val).size(); ++i) { |
| 173 | const size_t ele_str_size = (*val)[i].size() + static_cast<size_t>(1); | 173 | const size_t ele_str_size = (*val)[i].size() + static_cast<size_t>(1); |
| 174 | if (ge::AddOverflow(total_str_size, ele_str_size, total_str_size)) { | 174 | if (ge::AddOverflow(total_str_size, ele_str_size, total_str_size)) { |
| 175 | - GELOGW("Add over flow ele str size %zu, total_str_size %zu.", ele_str_size, total_str_size); | 175 | + GELOGW("Add overflow ele str size %zu, total_str_size %zu.", ele_str_size, total_str_size); |
| 176 | return false; | 176 | return false; |
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | size_t total_size = 0U; | 179 | size_t total_size = 0U; |
| 180 | if (ge::AddOverflow(total_str_size, sizeof(ContinuousVector), total_size)) { | 180 | if (ge::AddOverflow(total_str_size, sizeof(ContinuousVector), total_size)) { |
| 181 | - GELOGW("Add over flow ContinuousVector size %zu, total_str_size %zu.", sizeof(ContinuousVector), total_str_size); | 181 | + GELOGW("Add overflow ContinuousVector size %zu, total_str_size %zu.", sizeof(ContinuousVector), total_str_size); |
| 182 | return false; | 182 | return false; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| @@ -514,7 +514,7 @@ class AscOpDynamicInput { | |||
| 514 | template <typename Container> | 514 | template <typename Container> |
| 515 | AscOpDynamicInput<INPUT_INDEX> &AssignImpl(const Container &outputs) { | 515 | AscOpDynamicInput<INPUT_INDEX> &AssignImpl(const Container &outputs) { |
| 516 | if (op_ == nullptr) { | 516 | if (op_ == nullptr) { |
| 517 | - GELOGE(FAILED, "op_ in null"); | 517 | + GELOGE(FAILED, "op_ is null"); |
| 518 | return *this; | 518 | return *this; |
| 519 | } | 519 | } |
| 520 | if (inited_) { | 520 | if (inited_) { |
| @@ -83,7 +83,7 @@ class ReadableDump { | |||
| 83 | std::shared_ptr<std::vector<std::string>> output_rets = ComGraphMakeShared<std::vector<std::string>>(); | 83 | std::shared_ptr<std::vector<std::string>> output_rets = ComGraphMakeShared<std::vector<std::string>>(); |
| 84 | if (output_rets == nullptr) { | 84 | if (output_rets == nullptr) { |
| 85 | REPORT_INNER_ERR_MSG("E18888", "Initial output vector failed"); | 85 | REPORT_INNER_ERR_MSG("E18888", "Initial output vector failed"); |
| 86 | - GELOGE(GRAPH_FAILED, "[OutputHandler][GenNodeToOutputsMap] failed to initial output vector"); | 86 | + GELOGE(GRAPH_FAILED, "[OutputHandler][GenNodeToOutputsMap] failed to initialize output vector"); |
| 87 | return; | 87 | return; |
| 88 | } | 88 | } |
| 89 | if (node->GetAllOutDataAnchorsPtr().size() <= 1) { | 89 | if (node->GetAllOutDataAnchorsPtr().size() <= 1) { |
| @@ -164,7 +164,7 @@ Status FusedGraphModifier::SubgraphConnectionsToWorkspace(const af::ComputeGraph | |||
| 164 | continue; | 164 | continue; |
| 165 | } | 165 | } |
| 166 | auto iter = asc_backend_to_ascgraph.find(node); | 166 | auto iter = asc_backend_to_ascgraph.find(node); |
| 167 | - GE_ASSERT_TRUE(iter != asc_backend_to_ascgraph.end(), "Cannot find ascgraph for node [%s].", node->GetNamePtr()); | 167 | + GE_ASSERT_TRUE(iter != asc_backend_to_ascgraph.end(), "Cannot find AscGraph for node [%s].", node->GetNamePtr()); |
| 168 | std::set<int64_t> data_used_ids; | 168 | std::set<int64_t> data_used_ids; |
| 169 | ProcessNodesContext context = {nodes_to_out_anchor_idx_to_attr, free_workspace_id, data_used_ids}; | 169 | ProcessNodesContext context = {nodes_to_out_anchor_idx_to_attr, free_workspace_id, data_used_ids}; |
| 170 | 170 | ||
| @@ -533,7 +533,7 @@ Status FusedGraphUnfolder::ReAssembleOutputIndex(const af::ComputeGraphPtr &fuse | |||
| 533 | auto peer_out_anchor = in_data_anchor->GetPeerOutAnchor(); | 533 | auto peer_out_anchor = in_data_anchor->GetPeerOutAnchor(); |
| 534 | if (peer_out_anchor != nullptr) { | 534 | if (peer_out_anchor != nullptr) { |
| 535 | auto asc_node = std::dynamic_pointer_cast<af::AscNode>(peer_out_anchor->GetOwnerNode()); | 535 | auto asc_node = std::dynamic_pointer_cast<af::AscNode>(peer_out_anchor->GetOwnerNode()); |
| 536 | - GE_ASSERT_NOTNULL(asc_node, "In anchor [%ld]'s peer out anchor[%d] does have owner node.", index, | 536 | + GE_ASSERT_NOTNULL(asc_node, "In anchor [%ld]'s peer out anchor [%d] does not have owner node.", index, |
| 537 | peer_out_anchor->GetIdx()); | 537 | peer_out_anchor->GetIdx()); |
| 538 | GE_ASSERT_TRUE(af::ops::IsOps<af::ascir_op::Output>(asc_node), | 538 | GE_ASSERT_TRUE(af::ops::IsOps<af::ascir_op::Output>(asc_node), |
| 539 | "Only output nodes can be directly connected to the netoutput."); | 539 | "Only output nodes can be directly connected to the netoutput."); |
| @@ -562,7 +562,7 @@ Status FusedGraphUnfolder::ReAssembleDataIrAttr(const af::ComputeGraphPtr &fused | |||
| 562 | GE_ASSERT_TRUE(!peer_in_anchor.empty()); | 562 | GE_ASSERT_TRUE(!peer_in_anchor.empty()); |
| 563 | auto peer_first_data_anchor = peer_in_anchor[0UL]; | 563 | auto peer_first_data_anchor = peer_in_anchor[0UL]; |
| 564 | auto iter = asc_backend_to_asc_graph.find(peer_first_data_anchor->GetOwnerNodeBarePtr()); | 564 | auto iter = asc_backend_to_asc_graph.find(peer_first_data_anchor->GetOwnerNodeBarePtr()); |
| 565 | - GE_ASSERT_TRUE(iter != asc_backend_to_asc_graph.end(), "Cannot find ascgraph for data [%s].", node->GetNamePtr()); | 565 | + GE_ASSERT_TRUE(iter != asc_backend_to_asc_graph.end(), "Cannot find AscGraph for data [%s].", node->GetNamePtr()); |
| 566 | auto data_index = peer_first_data_anchor->GetIdx(); | 566 | auto data_index = peer_first_data_anchor->GetIdx(); |
| 567 | // 存在geir和ascir构图两种可能性 | 567 | // 存在geir和ascir构图两种可能性 |
| 568 | auto node_attr = node->GetOpDesc()->GetOrCreateAttrsGroup<af::AscNodeAttr>(); | 568 | auto node_attr = node->GetOpDesc()->GetOrCreateAttrsGroup<af::AscNodeAttr>(); |
| @@ -693,7 +693,8 @@ Status FusedGraphUnfolder::FindConcatContext(const af::ComputeGraphPtr &fused_gr | |||
| 693 | } | 693 | } |
| 694 | } | 694 | } |
| 695 | GE_ASSERT_NOTNULL(concat_ascbc_node); | 695 | GE_ASSERT_NOTNULL(concat_ascbc_node); |
| 696 | - GE_ASSERT_TRUE(concat_dim < new_loop_axes.size(), "Concat dim is invalid."); | 696 | + GE_ASSERT_TRUE(concat_dim < new_loop_axes.size(), "Concat dim [%zu] is invalid, max dim [%zu].", concat_dim, |
| 697 | + new_loop_axes.size()); | ||
| 697 | return af::SUCCESS; | 698 | return af::SUCCESS; |
| 698 | } | 699 | } |
| 699 | 700 | ||
| @@ -828,7 +829,7 @@ Status FusedGraphUnfolder::MarkAllOutputAxisId( | |||
| 828 | while (!que.empty()) { | 829 | while (!que.empty()) { |
| 829 | auto top = que.front(); | 830 | auto top = que.front(); |
| 830 | auto iter = asc_backend_to_asc_graph.find(top); | 831 | auto iter = asc_backend_to_asc_graph.find(top); |
| 831 | - GE_ASSERT_TRUE(iter != asc_backend_to_asc_graph.end(), "Cannot find ascgraph for node [%s].", top->GetNamePtr()); | 832 | + GE_ASSERT_TRUE(iter != asc_backend_to_asc_graph.end(), "Cannot find AscGraph for node [%s].", top->GetNamePtr()); |
| 832 | seen_graph_to_changed_axis_id[&iter->second] = axis_id; | 833 | seen_graph_to_changed_axis_id[&iter->second] = axis_id; |
| 833 | GELOGD("Mark graph [%s] with id [%ld].", iter->second.GetName().c_str(), axis_id); | 834 | GELOGD("Mark graph [%s] with id [%ld].", iter->second.GetName().c_str(), axis_id); |
| 834 | seen_node.emplace(top); | 835 | seen_node.emplace(top); |
| @@ -853,7 +854,7 @@ Status FusedGraphUnfolder::MarkAllInputAxisId(af::Node *concat_input_node, | |||
| 853 | auto top = que.front(); | 854 | auto top = que.front(); |
| 854 | if (top->GetType() == kAscGraphNodeType && seen_node.count(top) == 0U) { | 855 | if (top->GetType() == kAscGraphNodeType && seen_node.count(top) == 0U) { |
| 855 | auto iter = asc_backend_to_asc_graph.find(top); | 856 | auto iter = asc_backend_to_asc_graph.find(top); |
| 856 | - GE_ASSERT_TRUE(iter != asc_backend_to_asc_graph.end(), "Cannot find ascgraph for node [%s].", top->GetNamePtr()); | 857 | + GE_ASSERT_TRUE(iter != asc_backend_to_asc_graph.end(), "Cannot find AscGraph for node [%s].", top->GetNamePtr()); |
| 857 | seen_graph_to_changed_axis_id[&iter->second] = axis_id; | 858 | seen_graph_to_changed_axis_id[&iter->second] = axis_id; |
| 858 | GELOGD("Mark graph [%s] with id [%ld].", iter->second.GetName().c_str(), axis_id); | 859 | GELOGD("Mark graph [%s] with id [%ld].", iter->second.GetName().c_str(), axis_id); |
| 859 | } | 860 | } |
| @@ -140,7 +140,7 @@ Status DtypeConsistency::ProcessOutputDtype(const NodeDtypeRequirement &req) { | |||
| 140 | for (size_t i = 0UL; i < output_nums; ++i) { | 140 | for (size_t i = 0UL; i < output_nums; ++i) { |
| 141 | GE_ASSERT_TRUE(i < req.output_dtypes.size()); | 141 | GE_ASSERT_TRUE(i < req.output_dtypes.size()); |
| 142 | if (req.node->outputs[i].attr.dtype != req.output_dtypes[i]) { | 142 | if (req.node->outputs[i].attr.dtype != req.output_dtypes[i]) { |
| 143 | - GELOGD("Node [%s]'s output[%zu] need to change dtype from [%s] to [%s].", req.node->GetNamePtr(), i, | 143 | + GELOGD("Node [%s]'s output[%zu] needs to change dtype from [%s] to [%s].", req.node->GetNamePtr(), i, |
| 144 | ge::TypeUtils::DataTypeToSerialString(req.node->outputs[i].attr.dtype).c_str(), | 144 | ge::TypeUtils::DataTypeToSerialString(req.node->outputs[i].attr.dtype).c_str(), |
| 145 | ge::TypeUtils::DataTypeToSerialString(req.output_dtypes[i]).c_str()); | 145 | ge::TypeUtils::DataTypeToSerialString(req.output_dtypes[i]).c_str()); |
| 146 | req.node->outputs[i].attr.dtype = req.output_dtypes[i]; | 146 | req.node->outputs[i].attr.dtype = req.output_dtypes[i]; |
| @@ -25,7 +25,7 @@ bool IsAllReduce(af::AscNode &node) { | |||
| 25 | "The output dim cnt [%zu] of reduce mismatch with input dim cnt [%zu].", dst_strides.size(), | 25 | "The output dim cnt [%zu] of reduce mismatch with input dim cnt [%zu].", dst_strides.size(), |
| 26 | src_strides.size()); | 26 | src_strides.size()); |
| 27 | GE_ASSERT_TRUE((src_strides.size() == axes.size()), | 27 | GE_ASSERT_TRUE((src_strides.size() == axes.size()), |
| 28 | - "The input dim cnt [%zu] of reduce mismatch with input dim cnt [%zu].", src_strides.size(), | 28 | + "The input dim cnt [%zu] of reduce mismatch with reduce axes cnt [%zu].", src_strides.size(), |
| 29 | axes.size()); | 29 | axes.size()); |
| 30 | std::vector<ascir::AxisId> reduce_axes; | 30 | std::vector<ascir::AxisId> reduce_axes; |
| 31 | for (size_t i = 0UL; i < src_strides.size(); ++i) { | 31 | for (size_t i = 0UL; i < src_strides.size(); ++i) { |
| @@ -566,7 +566,7 @@ Status Optimizer::DeserializeAscGraphNodes(const af::ComputeGraphPtr &fused_grap | |||
| 566 | std::string graph_name = node->GetName() + "_ascgraph"; | 566 | std::string graph_name = node->GetName() + "_ascgraph"; |
| 567 | af::AscGraph ascgraph(graph_name.c_str()); | 567 | af::AscGraph ascgraph(graph_name.c_str()); |
| 568 | GE_CHK_STATUS_RET(af::AscGraphUtils::DeserializeFromReadable(*serialized_ascgraph, ascgraph), | 568 | GE_CHK_STATUS_RET(af::AscGraphUtils::DeserializeFromReadable(*serialized_ascgraph, ascgraph), |
| 569 | - "DeserializeFromBinary failed, graph:[%s].", fused_graph->GetName().c_str()); | 569 | + "DeserializeFromReadable failed, graph:[%s].", fused_graph->GetName().c_str()); |
| 570 | std::vector<af::Expression> graph_shape_vars; | 570 | std::vector<af::Expression> graph_shape_vars; |
| 571 | GE_CHK_STATUS_RET(AscGraphInfoComplete::CollectFrontendShapeVars(ascgraph, graph_shape_vars), | 571 | GE_CHK_STATUS_RET(AscGraphInfoComplete::CollectFrontendShapeVars(ascgraph, graph_shape_vars), |
| 572 | "Collect frontend shape vars failed, graph:[%s].", ascgraph.GetName().c_str()); | 572 | "Collect frontend shape vars failed, graph:[%s].", ascgraph.GetName().c_str()); |
| @@ -113,14 +113,14 @@ af::Status UnalignedTemplate::Generate(const af::AscGraph &origin_graph, | |||
| 113 | const auto &src_nodes = node->GetInDataNodes(); | 113 | const auto &src_nodes = node->GetInDataNodes(); |
| 114 | const auto connect_to_concat = (!src_nodes.empty()) && (src_nodes.at(0U)->GetType() == af::ascir_op::Concat::Type); | 114 | const auto connect_to_concat = (!src_nodes.empty()) && (src_nodes.at(0U)->GetType() == af::ascir_op::Concat::Type); |
| 115 | if ((!connect_to_concat) && ScheduleUtils::IsContinuesVecStrides(std::dynamic_pointer_cast<af::AscNode>(node))) { | 115 | if ((!connect_to_concat) && ScheduleUtils::IsContinuesVecStrides(std::dynamic_pointer_cast<af::AscNode>(node))) { |
| 116 | - GELOGD("Graph[%s] Node[%s] is continues.", new_case.GetName().c_str(), node->GetNamePtr()); | 116 | + GELOGD("Graph[%s] Node[%s] is continuous.", new_case.GetName().c_str(), node->GetNamePtr()); |
| 117 | continues_store_cnt++; | 117 | continues_store_cnt++; |
| 118 | continue; | 118 | continue; |
| 119 | } | 119 | } |
| 120 | GE_WARN_ASSERT(ReverseDfsUnAlignNode(new_case, node, visited_nodes) == af::SUCCESS); | 120 | GE_WARN_ASSERT(ReverseDfsUnAlignNode(new_case, node, visited_nodes) == af::SUCCESS); |
| 121 | } | 121 | } |
| 122 | if (continues_store_cnt == store_nodes.size()) { | 122 | if (continues_store_cnt == store_nodes.size()) { |
| 123 | - GELOGD("Graph[%s] is continues, do not need generate un-aligned tiling case.", new_case.GetName().c_str()); | 123 | + GELOGD("Graph[%s] is continuous, do not need to generate un-aligned tiling case.", new_case.GetName().c_str()); |
| 124 | return af::FAILED; | 124 | return af::FAILED; |
| 125 | } | 125 | } |
| 126 | GE_ASSERT_SUCCESS(ScheduleUtils::TopologicalSorting(new_case)); | 126 | GE_ASSERT_SUCCESS(ScheduleUtils::TopologicalSorting(new_case)); |
| @@ -454,10 +454,10 @@ Status ConcatFusionCaseGenerator::RemoveUnusedNodes(const af::AscNodePtr &concat | |||
| 454 | const std::vector<af::AscNodePtr> &nodes) { | 454 | const std::vector<af::AscNodePtr> &nodes) { |
| 455 | auto owner_compute_graph = concat_node->GetOwnerComputeGraph(); | 455 | auto owner_compute_graph = concat_node->GetOwnerComputeGraph(); |
| 456 | GE_ASSERT_NOTNULL(owner_compute_graph); | 456 | GE_ASSERT_NOTNULL(owner_compute_graph); |
| 457 | - GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(concat_node), "Failed to remote node: %s", | 457 | + GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(concat_node), "Failed to remove node: %s", |
| 458 | concat_node->GetNamePtr()); | 458 | concat_node->GetNamePtr()); |
| 459 | for (const auto &node : nodes) { | 459 | for (const auto &node : nodes) { |
| 460 | - GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(node), "Failed to remote node: %s", node->GetNamePtr()); | 460 | + GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(node), "Failed to remove node: %s", node->GetNamePtr()); |
| 461 | } | 461 | } |
| 462 | return af::SUCCESS; | 462 | return af::SUCCESS; |
| 463 | } | 463 | } |
| @@ -123,7 +123,7 @@ bool IsSupportedBroadcastPath(const NodePath &path, size_t broadcast_index, asci | |||
| 123 | for (size_t i = broadcast_index + 1UL; i < path.size(); ++i) { | 123 | for (size_t i = broadcast_index + 1UL; i < path.size(); ++i) { |
| 124 | const af::AscNodePtr &element = path[i]; | 124 | const af::AscNodePtr &element = path[i]; |
| 125 | if (!IsSingleConsumerWithoutControlEdge(element)) { | 125 | if (!IsSingleConsumerWithoutControlEdge(element)) { |
| 126 | - GELOGI("[IndirectLoad] Reject candidate[%d]: Broadcast path node[%s] is not safely foldable.", | 126 | + GELOGI("[IndirectLoad] Reject candidate[%d]: Broadcast post element node[%s] is not safely foldable.", |
| 127 | static_cast<int32_t>(template_id), element->GetNamePtr()); | 127 | static_cast<int32_t>(template_id), element->GetNamePtr()); |
| 128 | return false; | 128 | return false; |
| 129 | } | 129 | } |
| @@ -64,8 +64,7 @@ Status SplitFusionCaseGenerator::Generate(ascir::HintGraph &graph, std::vector<a | |||
| 64 | split_node = FindSplitNodes(optimized_graph).front(); | 64 | split_node = FindSplitNodes(optimized_graph).front(); |
| 65 | bool split = false; | 65 | bool split = false; |
| 66 | GE_CHK_STATUS_RET(SplitSplits(optimized_graph, split_node, split_dim, split), "SplitSplits failed"); | 66 | GE_CHK_STATUS_RET(SplitSplits(optimized_graph, split_node, split_dim, split), "SplitSplits failed"); |
| 67 | - GELOGI("Split on non-first dim, split split into groups templates generated, split = %d", | 67 | + GELOGI("Split on non-first dim, splits are grouped and templates generated, split = %d", static_cast<int32_t>(split)); |
| 68 | - static_cast<int32_t>(split)); | ||
| 69 | 68 | ||
| 70 | GE_CHK_STATUS_RET(ConvertSplitToLoads(optimized_graph, split_node, split_dim), "ConvertSplitToLoads failed"); | 69 | GE_CHK_STATUS_RET(ConvertSplitToLoads(optimized_graph, split_node, split_dim), "ConvertSplitToLoads failed"); |
| 71 | graphs.emplace_back(optimized_graph); | 70 | graphs.emplace_back(optimized_graph); |
| @@ -218,7 +217,7 @@ Status SplitFusionCaseGenerator::ReplaceWithLoad(::ascir::ImplGraph &owner_graph | |||
| 218 | "Failed to SplitData"); | 217 | "Failed to SplitData"); |
| 219 | std::vector<af::AscNodePtr> nodes; | 218 | std::vector<af::AscNodePtr> nodes; |
| 220 | af::AscNodePtr broadcast_node; | 219 | af::AscNodePtr broadcast_node; |
| 221 | - GE_CHK_STATUS_RET(CollectBackwardNodes(load_node, nodes, broadcast_node), "Failed to SplitData"); | 220 | + GE_CHK_STATUS_RET(CollectBackwardNodes(load_node, nodes, broadcast_node), "Failed to collect backward nodes"); |
| 222 | GE_CHK_STATUS_RET(SplitOutReplaceAxis(owner_graph, nodes, load_node, out_index, broadcast_node), | 221 | GE_CHK_STATUS_RET(SplitOutReplaceAxis(owner_graph, nodes, load_node, out_index, broadcast_node), |
| 223 | "Failed to replace axis"); | 222 | "Failed to replace axis"); |
| 224 | return af::SUCCESS; | 223 | return af::SUCCESS; |
| @@ -335,18 +334,18 @@ Status SplitFusionCaseGenerator::RemoveUnusedNodes(const af::AscNodePtr &split_n | |||
| 335 | GE_CHK_STATUS_RET(af::GraphUtils::RemoveEdge(ori_load_node_->GetOutDataAnchor(0), split_node->GetInDataAnchor(0)), | 334 | GE_CHK_STATUS_RET(af::GraphUtils::RemoveEdge(ori_load_node_->GetOutDataAnchor(0), split_node->GetInDataAnchor(0)), |
| 336 | "Failed to RemoveEdge"); | 335 | "Failed to RemoveEdge"); |
| 337 | GE_ASSERT_NOTNULL(owner_compute_graph); | 336 | GE_ASSERT_NOTNULL(owner_compute_graph); |
| 338 | - GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(split_node), "Failed to remote node: %s", split_node->GetNamePtr()); | 337 | + GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(split_node), "Failed to remove node: %s", split_node->GetNamePtr()); |
| 339 | auto load_out_data_anchor = ori_load_node_->GetOutDataAnchor(0); | 338 | auto load_out_data_anchor = ori_load_node_->GetOutDataAnchor(0); |
| 340 | if (load_out_data_anchor->GetPeerInDataAnchors().empty()) { | 339 | if (load_out_data_anchor->GetPeerInDataAnchors().empty()) { |
| 341 | /* 先删除data与load的边 */ | 340 | /* 先删除data与load的边 */ |
| 342 | GE_CHK_STATUS_RET( | 341 | GE_CHK_STATUS_RET( |
| 343 | af::GraphUtils::RemoveEdge(ori_in_data_node_->GetOutDataAnchor(0), ori_load_node_->GetInDataAnchor(0)), | 342 | af::GraphUtils::RemoveEdge(ori_in_data_node_->GetOutDataAnchor(0), ori_load_node_->GetInDataAnchor(0)), |
| 344 | "Failed to RemoveEdge"); | 343 | "Failed to RemoveEdge"); |
| 345 | - GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(ori_load_node_), "Failed to remote node: %s", | 344 | + GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(ori_load_node_), "Failed to remove node: %s", |
| 346 | ori_load_node_->GetNamePtr()); | 345 | ori_load_node_->GetNamePtr()); |
| 347 | auto data_node_data_anchor = ori_in_data_node_->GetOutDataAnchor(0); | 346 | auto data_node_data_anchor = ori_in_data_node_->GetOutDataAnchor(0); |
| 348 | if (data_node_data_anchor->GetPeerInDataAnchors().empty()) { | 347 | if (data_node_data_anchor->GetPeerInDataAnchors().empty()) { |
| 349 | - GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(ori_in_data_node_), "Failed to remote node: %s", | 348 | + GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(ori_in_data_node_), "Failed to remove node: %s", |
| 350 | ori_in_data_node_->GetNamePtr()); | 349 | ori_in_data_node_->GetNamePtr()); |
| 351 | } | 350 | } |
| 352 | } | 351 | } |
| @@ -87,7 +87,7 @@ Status TransposeFusionCaseGenerator::TransposeConvertProcess(ascir::HintGraph &g | |||
| 87 | UpdateAxis(graph, transpose_node); | 87 | UpdateAxis(graph, transpose_node); |
| 88 | 88 | ||
| 89 | auto owner_compute_graph = transpose_node->GetOwnerComputeGraph(); | 89 | auto owner_compute_graph = transpose_node->GetOwnerComputeGraph(); |
| 90 | - GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(transpose_node), "Failed to remote node: %s", | 90 | + GE_CHK_STATUS_RET(owner_compute_graph->RemoveNode(transpose_node), "Failed to remove node: %s", |
| 91 | transpose_node->GetNamePtr()); | 91 | transpose_node->GetNamePtr()); |
| 92 | 92 | ||
| 93 | GE_ASSERT_GRAPH_SUCCESS(ScheduleUtils::TopologicalSorting(graph)); | 93 | GE_ASSERT_GRAPH_SUCCESS(ScheduleUtils::TopologicalSorting(graph)); |
| @@ -82,7 +82,7 @@ Status EsbGraph::SetGraphOutput(EsbTensor *tensor, int32_t output_index) { | |||
| 82 | } | 82 | } |
| 83 | bool EsbGraph::IsGraphValid() const { | 83 | bool EsbGraph::IsGraphValid() const { |
| 84 | if (!graph_input_indexes_.empty()) { | 84 | if (!graph_input_indexes_.empty()) { |
| 85 | - GE_ASSERT_TRUE(*graph_input_indexes_.begin() == 0, "Invalid graph, graph input index must starts with 0"); | 85 | + GE_ASSERT_TRUE(*graph_input_indexes_.begin() == 0, "Invalid graph, graph input index must start with 0"); |
| 86 | if (static_cast<size_t>(*graph_input_indexes_.rbegin()) + 1U != graph_input_indexes_.size()) { | 86 | if (static_cast<size_t>(*graph_input_indexes_.rbegin()) + 1U != graph_input_indexes_.size()) { |
| 87 | std::stringstream ss; | 87 | std::stringstream ss; |
| 88 | ss << "Invalid graph, graph input indexes are not continuous: "; | 88 | ss << "Invalid graph, graph input indexes are not continuous: "; |
| @@ -100,7 +100,7 @@ bool EsbGraph::IsGraphValid() const { | |||
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | if (!output_indexes_to_tensor_.empty()) { | 102 | if (!output_indexes_to_tensor_.empty()) { |
| 103 | - GE_ASSERT_TRUE(output_indexes_to_tensor_.begin()->first == 0, "Invalid graph, output index must starts with 0"); | 103 | + GE_ASSERT_TRUE(output_indexes_to_tensor_.begin()->first == 0, "Invalid graph, output index must start with 0"); |
| 104 | if (static_cast<size_t>(output_indexes_to_tensor_.rbegin()->first) + 1U != output_indexes_to_tensor_.size()) { | 104 | if (static_cast<size_t>(output_indexes_to_tensor_.rbegin()->first) + 1U != output_indexes_to_tensor_.size()) { |
| 105 | std::stringstream ss; | 105 | std::stringstream ss; |
| 106 | ss << "Invalid graph, output indexes are not continuous: "; | 106 | ss << "Invalid graph, output indexes are not continuous: "; |
| @@ -73,8 +73,8 @@ INTERFACE(EdgeLayout) { | |||
| 73 | auto node_pair = graph->FindNodePair(edge_); | 73 | auto node_pair = graph->FindNodePair(edge_); |
| 74 | 74 | ||
| 75 | if ((!node_pair.first) || (!node_pair.second)) { | 75 | if ((!node_pair.first) || (!node_pair.second)) { |
| 76 | - EG_FATAL("Layout context graph(%s) has not found node(%s, %s)!", graph->GetName().c_str(), | 76 | + EG_FATAL("Node(%s, %s) not found in layout context graph(%s)!", edge_.GetSrc().getNodeId().c_str(), |
| 77 | - edge_.GetSrc().getNodeId().c_str(), edge_.GetDst().getNodeId().c_str()); | 77 | + edge_.GetDst().getNodeId().c_str(), graph->GetName().c_str()); |
| 78 | return ""; | 78 | return ""; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| @@ -167,7 +167,7 @@ void BuildAndRunBinary(const std::string &compile_cmd, const std::string &run_cm | |||
| 167 | bool IsFileContainsString(const std::string &filename, const std::string &searchString) { | 167 | bool IsFileContainsString(const std::string &filename, const std::string &searchString) { |
| 168 | std::ifstream file(filename); | 168 | std::ifstream file(filename); |
| 169 | if (!file.is_open()) { | 169 | if (!file.is_open()) { |
| 170 | - std::cerr << "无法打开文件: " << filename << std::endl; | 170 | + std::cerr << "Cannot open file: " << filename << std::endl; |
| 171 | return false; | 171 | return false; |
| 172 | } | 172 | } |
| 173 | std::string line; | 173 | std::string line; |
| @@ -247,10 +247,10 @@ using namespace optiling; | |||
| 247 | 247 | ||
| 248 | int main() { | 248 | int main() { |
| 249 | // ========== Group 级别缓存测试 ========== | 249 | // ========== Group 级别缓存测试 ========== |
| 250 | - std::cout << "\n========== Group 级别缓存测试 ==========" << std::endl; | 250 | + std::cout << "\n========== Group-level cache test ==========" << std::endl; |
| 251 | AscGraph0ScheduleResult0G0::GroupLevelCache group_cache; | 251 | AscGraph0ScheduleResult0G0::GroupLevelCache group_cache; |
| 252 | // Test 1: ND = 1024,首次执行(不命中) | 252 | // Test 1: ND = 1024,首次执行(不命中) |
| 253 | - std::cout << "\n--- Test 1: ND = 1024 (首次执行) ---" << std::endl; | 253 | + std::cout << "\n--- Test 1: ND = 1024 (first execution) ---" << std::endl; |
| 254 | AscGraph0ScheduleResult0G0TilingData tilingData1; | 254 | AscGraph0ScheduleResult0G0TilingData tilingData1; |
| 255 | tilingData1.set_ND(1024); | 255 | tilingData1.set_ND(1024); |
| 256 | tilingData1.set_block_dim(64); | 256 | tilingData1.set_block_dim(64); |
| @@ -264,7 +264,7 @@ int main() { | |||
| 264 | std::cout << "get_tiling_key = " << tilingData1.get_tiling_key() << std::endl; | 264 | std::cout << "get_tiling_key = " << tilingData1.get_tiling_key() << std::endl; |
| 265 | std::cout << "ND = " << tilingData1.get_ND() << std::endl; | 265 | std::cout << "ND = " << tilingData1.get_ND() << std::endl; |
| 266 | // Test 2: ND = 1024,再次执行(应命中 Group 缓存) | 266 | // Test 2: ND = 1024,再次执行(应命中 Group 缓存) |
| 267 | - std::cout << "\n--- Test 2: ND = 1024 (应命中 Group 缓存) ---" << std::endl; | 267 | + std::cout << "\n--- Test 2: ND = 1024 (should hit Group cache) ---" << std::endl; |
| 268 | AscGraph0ScheduleResult0G0TilingData tilingData2; | 268 | AscGraph0ScheduleResult0G0TilingData tilingData2; |
| 269 | tilingData2.set_ND(1024); | 269 | tilingData2.set_ND(1024); |
| 270 | tilingData2.set_block_dim(64); | 270 | tilingData2.set_block_dim(64); |
| @@ -279,7 +279,7 @@ int main() { | |||
| 279 | std::cout << "get_tiling_key = " << tilingData2.get_tiling_key() << std::endl; | 279 | std::cout << "get_tiling_key = " << tilingData2.get_tiling_key() << std::endl; |
| 280 | std::cout << "ND = " << tilingData2.get_ND() << std::endl; | 280 | std::cout << "ND = " << tilingData2.get_ND() << std::endl; |
| 281 | // Test 3: ND = 2048,首次执行(不命中) | 281 | // Test 3: ND = 2048,首次执行(不命中) |
| 282 | - std::cout << "\n--- Test 3: ND = 2048 (首次执行) ---" << std::endl; | 282 | + std::cout << "\n--- Test 3: ND = 2048 (first execution) ---" << std::endl; |
| 283 | AscGraph0ScheduleResult0G0TilingData tilingData3; | 283 | AscGraph0ScheduleResult0G0TilingData tilingData3; |
| 284 | tilingData3.set_ND(2048); | 284 | tilingData3.set_ND(2048); |
| 285 | tilingData3.set_block_dim(64); | 285 | tilingData3.set_block_dim(64); |
| @@ -295,7 +295,7 @@ int main() { | |||
| 295 | std::cout << "ND = " << tilingData3.get_ND() << std::endl; | 295 | std::cout << "ND = " << tilingData3.get_ND() << std::endl; |
| 296 | 296 | ||
| 297 | // Test 4: ND = 2048,再次执行(应命中 Group 缓存) | 297 | // Test 4: ND = 2048,再次执行(应命中 Group 缓存) |
| 298 | - std::cout << "\n--- Test 4: ND = 2048 (应命中 Group 缓存) ---" << std::endl; | 298 | + std::cout << "\n--- Test 4: ND = 2048 (should hit Group cache) ---" << std::endl; |
| 299 | AscGraph0ScheduleResult0G0TilingData tilingData4; | 299 | AscGraph0ScheduleResult0G0TilingData tilingData4; |
| 300 | tilingData4.set_ND(2048); | 300 | tilingData4.set_ND(2048); |
| 301 | tilingData4.set_block_dim(64); | 301 | tilingData4.set_block_dim(64); |
| @@ -311,10 +311,10 @@ int main() { | |||
| 311 | std::cout << "ND = " << tilingData4.get_ND() << std::endl; | 311 | std::cout << "ND = " << tilingData4.get_ND() << std::endl; |
| 312 | 312 | ||
| 313 | // ========== Operator 级别缓存测试 ========== | 313 | // ========== Operator 级别缓存测试 ========== |
| 314 | - std::cout << "\n========== Operator 级别缓存测试 ==========" << std::endl; | 314 | + std::cout << "\n========== Operator-level cache test ==========" << std::endl; |
| 315 | 315 | ||
| 316 | // Test 5: ND = 4096,首次执行(不命中) | 316 | // Test 5: ND = 4096,首次执行(不命中) |
| 317 | - std::cout << "\n--- Test 5: ND = 4096 (首次执行) ---" << std::endl; | 317 | + std::cout << "\n--- Test 5: ND = 4096 (first execution) ---" << std::endl; |
| 318 | graph_ndTilingData tilingData5; | 318 | graph_ndTilingData tilingData5; |
| 319 | tilingData5.set_block_dim(64); | 319 | tilingData5.set_block_dim(64); |
| 320 | tilingData5.set_ub_size(245760); | 320 | tilingData5.set_ub_size(245760); |
| @@ -328,7 +328,7 @@ int main() { | |||
| 328 | std::cout << "ND = " << tilingData5.graph0_result0_g0_tiling_data.get_ND() << std::endl; | 328 | std::cout << "ND = " << tilingData5.graph0_result0_g0_tiling_data.get_ND() << std::endl; |
| 329 | 329 | ||
| 330 | // Test 6: ND = 4096,再次执行(应命中 Operator 缓存) | 330 | // Test 6: ND = 4096,再次执行(应命中 Operator 缓存) |
| 331 | - std::cout << "\n--- Test 6: ND = 4096 (应命中 Operator 缓存) ---" << std::endl; | 331 | + std::cout << "\n--- Test 6: ND = 4096 (should hit Operator cache) ---" << std::endl; |
| 332 | graph_ndTilingData tilingData6; | 332 | graph_ndTilingData tilingData6; |
| 333 | tilingData6.set_block_dim(64); | 333 | tilingData6.set_block_dim(64); |
| 334 | tilingData6.set_ub_size(245760); | 334 | tilingData6.set_ub_size(245760); |
| @@ -90,7 +90,7 @@ TEST_F(TestSelectModel, att_test_select_model_01) { | |||
| 90 | file.close(); | 90 | file.close(); |
| 91 | } | 91 | } |
| 92 | std::map<uint64_t, double> myMap; | 92 | std::map<uint64_t, double> myMap; |
| 93 | - std::regex pattern("The optimal objection for tiling_case_id (\\d+) is (\\d+)."); | 93 | + std::regex pattern("The optimal objective for tiling_case_id (\\d+) is (\\d+)."); |
| 94 | std::sregex_iterator it(str.begin(), str.end(), pattern); | 94 | std::sregex_iterator it(str.begin(), str.end(), pattern); |
| 95 | std::sregex_iterator end; | 95 | std::sregex_iterator end; |
| 96 | while (it != end) { | 96 | while (it != end) { |
| @@ -135,7 +135,7 @@ TEST_F(TestSelectModel, att_test_select_model_04) { | |||
| 135 | file.close(); | 135 | file.close(); |
| 136 | } | 136 | } |
| 137 | std::map<uint64_t, double> myMap; | 137 | std::map<uint64_t, double> myMap; |
| 138 | - std::regex pattern("The optimal objection for tiling_case_id (\\d+) is (\\d+)."); | 138 | + std::regex pattern("The optimal objective for tiling_case_id (\\d+) is (\\d+)."); |
| 139 | std::sregex_iterator it(str.begin(), str.end(), pattern); | 139 | std::sregex_iterator it(str.begin(), str.end(), pattern); |
| 140 | std::regex pattern2("Objective value for case(\\d+) is (\\d+)."); | 140 | std::regex pattern2("Objective value for case(\\d+) is (\\d+)."); |
| 141 | std::sregex_iterator it2(str.begin(), str.end(), pattern2); | 141 | std::sregex_iterator it2(str.begin(), str.end(), pattern2); |
| @@ -23,7 +23,7 @@ bool CheckValidTilingkey() { | |||
| 23 | } | 23 | } |
| 24 | file.close(); | 24 | file.close(); |
| 25 | } | 25 | } |
| 26 | - std::regex pattern("The optimal objection for tilingCaseId (\\d+) is (\\d+)."); | 26 | + std::regex pattern("The optimal objective for tilingCaseId (\\d+) is (\\d+)."); |
| 27 | std::sregex_iterator it(str.begin(), str.end(), pattern); | 27 | std::sregex_iterator it(str.begin(), str.end(), pattern); |
| 28 | std::sregex_iterator end; | 28 | std::sregex_iterator end; |
| 29 | while (it != end) { | 29 | while (it != end) { |
| @@ -34,7 +34,8 @@ int main() { | |||
| 34 | if (GetTiling(tilingData)) { | 34 | if (GetTiling(tilingData)) { |
| 35 | PrintResult(tilingData); | 35 | PrintResult(tilingData); |
| 36 | if (tilingData.get_tiling_key() != 1101u) { | 36 | if (tilingData.get_tiling_key() != 1101u) { |
| 37 | - std::cout << "1101 should be better with brcbuf." << std::endl; | 37 | + std::cout << "tiling key 1101 (brcbuf case) should be better, but got tiling key " << tilingData.get_tiling_key() |
| 38 | + << "." << std::endl; | ||
| 38 | return -1; | 39 | return -1; |
| 39 | } | 40 | } |
| 40 | } else { | 41 | } else { |
| @@ -477,7 +477,7 @@ namespace { | |||
| 477 | bool IsFileContainsString(const std::string &filename, const std::string &search_sub_string) { | 477 | bool IsFileContainsString(const std::string &filename, const std::string &search_sub_string) { |
| 478 | std::ifstream file(filename); | 478 | std::ifstream file(filename); |
| 479 | if (!file.is_open()) { | 479 | if (!file.is_open()) { |
| 480 | - std::cerr << "无法打开文件: " << filename << std::endl; | 480 | + std::cerr << "Cannot open file: " << filename << std::endl; |
| 481 | return false; | 481 | return false; |
| 482 | } | 482 | } |
| 483 | std::string line; | 483 | std::string line; |
| @@ -617,7 +617,7 @@ bool Result::AddVarVal(uint64_t *vars, double obj, double cons) | |||
| 617 | { | 617 | { |
| 618 | uint64_t rec_num = solution_num_; | 618 | uint64_t rec_num = solution_num_; |
| 619 | if (rec_num > MAX_SOLUTION) { | 619 | if (rec_num > MAX_SOLUTION) { |
| 620 | - OP_LOG(op_name, "Too much solutions!"); | 620 | + OP_LOG(op_name, "Too many solutions!"); |
| 621 | return false; | 621 | return false; |
| 622 | } | 622 | } |
| 623 | int32_t cnt_num = 0; | 623 | int32_t cnt_num = 0; |
| @@ -111,7 +111,7 @@ bool Result::InsertSorted(VarVal **temp, uint64_t rec_num, VarVal *new_vars, dou | |||
| 111 | bool Result::AddVarVal(uint64_t *vars, double obj, double cons) { | 111 | bool Result::AddVarVal(uint64_t *vars, double obj, double cons) { |
| 112 | uint64_t rec_num = solution_num_; | 112 | uint64_t rec_num = solution_num_; |
| 113 | if (rec_num > MAX_SOLUTION) { | 113 | if (rec_num > MAX_SOLUTION) { |
| 114 | - OP_LOG("Too much solutions!"); | 114 | + OP_LOG("Too many solutions!"); |
| 115 | return false; | 115 | return false; |
| 116 | } | 116 | } |
| 117 | solution_num_ = SMIN(solution_num_ + 1, top_n_); | 117 | solution_num_ = SMIN(solution_num_ + 1, top_n_); |
| @@ -418,7 +418,7 @@ void AppendSolverImplPart7(std::string &codes) { | |||
| 418 | codes += " delete[] solution;\n"; | 418 | codes += " delete[] solution;\n"; |
| 419 | codes += " }\n"; | 419 | codes += " }\n"; |
| 420 | 420 | ||
| 421 | - codes += " OP_LOGW(OP_NAME, \"The solver executed failed.\");\n"; | 421 | + codes += " OP_LOGW(OP_NAME, \"The solver execution failed.\");\n"; |
| 422 | codes += " return false;\n"; | 422 | codes += " return false;\n"; |
| 423 | codes += "}\n"; | 423 | codes += "}\n"; |
| 424 | codes += "\n"; | 424 | codes += "\n"; |
| @@ -534,7 +534,7 @@ void AppendSolverInvokePart1(std::string &codes) { | |||
| 534 | void AppendSolverInvokePart2(std::string &codes) { | 534 | void AppendSolverInvokePart2(std::string &codes) { |
| 535 | codes += " }\n"; | 535 | codes += " }\n"; |
| 536 | 536 | ||
| 537 | - codes += " OP_LOGW(OP_NAME, \"The solver executed failed.\");\n"; | 537 | + codes += " OP_LOGW(OP_NAME, \"The solver execution failed.\");\n"; |
| 538 | codes += " return false;\n"; | 538 | codes += " return false;\n"; |
| 539 | codes += "}\n"; | 539 | codes += "}\n"; |
| 540 | codes += "\n"; | 540 | codes += "\n"; |
| @@ -107,7 +107,7 @@ TEST_F(TestAttLog, test_att_logw) { | |||
| 107 | auto ret = std::system("./tiling_func_log_main 8192 2048 -1 > ./att_info.log"); | 107 | auto ret = std::system("./tiling_func_log_main 8192 2048 -1 > ./att_info.log"); |
| 108 | EXPECT_EQ(ret, 0); | 108 | EXPECT_EQ(ret, 0); |
| 109 | 109 | ||
| 110 | - EXPECT_TRUE(CheckOutput("\\[WARNING\\]\\[OpTest6\\]The solver executed failed.")); | 110 | + EXPECT_TRUE(CheckOutput("\\[WARNING\\]\\[OpTest6\\]The solver execution failed.")); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | TEST_F(TestAttLog, test_att_loge) { | 113 | TEST_F(TestAttLog, test_att_loge) { |
| @@ -47,7 +47,7 @@ std::string ResultCheckerUtils::DefineCheckerFunction() { | |||
| 47 | bool ResultCheckerUtils::IsFileContainsString(const std::string &filename, const std::string &search_sub_string) { | 47 | bool ResultCheckerUtils::IsFileContainsString(const std::string &filename, const std::string &search_sub_string) { |
| 48 | std::ifstream file(filename); | 48 | std::ifstream file(filename); |
| 49 | if (!file.is_open()) { | 49 | if (!file.is_open()) { |
| 50 | - std::cerr << "无法打开文件: " << filename << std::endl; | 50 | + std::cerr << "Cannot open file: " << filename << std::endl; |
| 51 | return false; | 51 | return false; |
| 52 | } | 52 | } |
| 53 | std::string line; | 53 | std::string line; |
| @@ -69,7 +69,7 @@ bool ResultCheckerUtils::ReadFileLines(const std::string &filename, std::vector< | |||
| 69 | 69 | ||
| 70 | std::ifstream in_file(filename); | 70 | std::ifstream in_file(filename); |
| 71 | if (!in_file.is_open()) { | 71 | if (!in_file.is_open()) { |
| 72 | - std::cerr << "Error: can not open file " << filename << " can not read!" << std::endl; | 72 | + std::cerr << "Error: cannot open file " << filename << " for reading!" << std::endl; |
| 73 | return false; | 73 | return false; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| @@ -84,8 +84,11 @@ constexpr inline __aicore__ T2 Mod(T1 a, T2 b) { | |||
| 84 | uint64_t mod_num = a_tmp % b_tmp; | 84 | uint64_t mod_num = a_tmp % b_tmp; |
| 85 | return static_cast<uint64_t>(mod_num); | 85 | return static_cast<uint64_t>(mod_num); |
| 86 | } else if constexpr (std::is_same<T1, uint64_t>::value || std::is_same<T2, uint64_t>::value) { | 86 | } else if constexpr (std::is_same<T1, uint64_t>::value || std::is_same<T2, uint64_t>::value) { |
| 87 | - ASCENDC_ASSERT(true, | 87 | + ASCENDC_ASSERT(true, { |
| 88 | - { KERNEL_LOG(KERNEL_ERROR, "does not support mix type of uint64 because of possible overflow!"); }); | 88 | + KERNEL_LOG(KERNEL_ERROR, |
| 89 | + "does not support mixed type of uint64 because of possible " | ||
| 90 | + "overflow!"); | ||
| 91 | + }); | ||
| 89 | return 0; | 92 | return 0; |
| 90 | } else { | 93 | } else { |
| 91 | ASCENDC_ASSERT(b != 0, { KERNEL_LOG(KERNEL_ERROR, "b can't be equal to 0, b is %d!", b); }); | 94 | ASCENDC_ASSERT(b != 0, { KERNEL_LOG(KERNEL_ERROR, "b can't be equal to 0, b is %d!", b); }); |
| @@ -626,7 +626,7 @@ bool FindPerfBetterTilingbyCaseId(TilingCaseImpl *tilingCaseImplPtr, double &obj | |||
| 626 | if (tilingCaseImplPtr->GetTiling(tiling_data, cur_ub_ratio)) { | 626 | if (tilingCaseImplPtr->GetTiling(tiling_data, cur_ub_ratio)) { |
| 627 | cur_obj = tilingCaseImplPtr->GetPerf(tiling_data); | 627 | cur_obj = tilingCaseImplPtr->GetPerf(tiling_data); |
| 628 | OP_LOGD(OP_NAME, "The ub ratio for tilingCaseId %u is %f.", tilingCaseId, cur_ub_ratio); | 628 | OP_LOGD(OP_NAME, "The ub ratio for tilingCaseId %u is %f.", tilingCaseId, cur_ub_ratio); |
| 629 | - OP_LOGD(OP_NAME, "The optimal objection for tilingCaseId %u is %f.", tilingCaseId, cur_obj); | 629 | + OP_LOGD(OP_NAME, "The optimal objective for tilingCaseId %u is %f.", tilingCaseId, cur_obj); |
| 630 | if (obj < 0) { | 630 | if (obj < 0) { |
| 631 | UpdateBetterTiling(tilingCaseImplPtr, tmp_tiling, tiling_data, tilingCaseId); | 631 | UpdateBetterTiling(tilingCaseImplPtr, tmp_tiling, tiling_data, tilingCaseId); |
| 632 | sub_case_flag = is_sub_case; | 632 | sub_case_flag = is_sub_case; |
| @@ -738,7 +738,8 @@ bool GetTiling(AutofuseTilingData &tiling_data, int32_t tilingCaseId) { | |||
| 738 | bool GetTilingOptionRange(const int32_t option_id, int32_t *option_range_size, int32_t *range_type, | 738 | bool GetTilingOptionRange(const int32_t option_id, int32_t *option_range_size, int32_t *range_type, |
| 739 | int32_t *option_range) { | 739 | int32_t *option_range) { |
| 740 | if (!((option_id >= 0) && (option_id <= 1))) { | 740 | if (!((option_id >= 0) && (option_id <= 1))) { |
| 741 | - OP_LOGE(OP_NAME, "option_id is invalid, valid range is ((option_id >= 0) && (option_id <=1))"); | 741 | + OP_LOGE(OP_NAME, "option_id is invalid, option_id=%d, valid range is ((option_id >= 0) && (option_id <=1))", |
| 742 | + option_id); | ||
| 742 | return false; | 743 | return false; |
| 743 | } | 744 | } |
| 744 | if ((option_range_size != nullptr)) { | 745 | if ((option_range_size != nullptr)) { |
| @@ -140,7 +140,7 @@ class TestAscir: | |||
| 140 | except Exception as e: | 140 | except Exception as e: |
| 141 | assert ( | 141 | assert ( |
| 142 | e.args[0] | 142 | e.args[0] |
| 143 | - == "Check dtype failed for cast Cast; input_dtypes: [DT_INT8], output_dytpes: [DT_INT4]" | 143 | + == "Check dtype failed for cast Cast; input_dtypes: [DT_INT8], output_dtypes: [DT_INT4]" |
| 144 | ) | 144 | ) |
| 145 | import sys | 145 | import sys |
| 146 | 146 | ||
| @@ -158,7 +158,7 @@ class TestAscir: | |||
| 158 | except Exception as e: | 158 | except Exception as e: |
| 159 | assert ( | 159 | assert ( |
| 160 | e.args[0] | 160 | e.args[0] |
| 161 | - == "Check dtype failed for cast_0 Cast; input_dtypes: [DT_INT8], output_dytpes: [DT_INT4]" | 161 | + == "Check dtype failed for cast_0 Cast; input_dtypes: [DT_INT8], output_dtypes: [DT_INT4]" |
| 162 | ) | 162 | ) |
| 163 | 163 | ||
| 164 | 164 | ||
| @@ -1101,7 +1101,7 @@ class TestAutofuseLoadConcatStore: | |||
| 1101 | try: | 1101 | try: |
| 1102 | load.infer_dtype() | 1102 | load.infer_dtype() |
| 1103 | except Exception as e: | 1103 | except Exception as e: |
| 1104 | - assert e.args[0] == "node load Load need set input before call infer dype" | 1104 | + assert e.args[0] == "node load Load need set input before call infer dtype" |
| 1105 | load.attr.sched.axis = [z0, z1] | 1105 | load.attr.sched.axis = [z0, z1] |
| 1106 | load.x = arg2_1.y | 1106 | load.x = arg2_1.y |
| 1107 | load.y.axis = [z0, z1] | 1107 | load.y.axis = [z0, z1] |
| @@ -534,7 +534,7 @@ Status BuildTqueTbufAscendGraph_multi_case_g1(af::AscGraph &graph) { | |||
| 534 | bool IsFileContainsString(const std::string &filename, const std::string &searchString) { | 534 | bool IsFileContainsString(const std::string &filename, const std::string &searchString) { |
| 535 | std::ifstream file(filename); | 535 | std::ifstream file(filename); |
| 536 | if (!file.is_open()) { | 536 | if (!file.is_open()) { |
| 537 | - std::cerr << "无法打开文件: " << filename << std::endl; | 537 | + std::cerr << "Cannot open file: " << filename << std::endl; |
| 538 | return false; | 538 | return false; |
| 539 | } | 539 | } |
| 540 | std::string line; | 540 | std::string line; |
| @@ -85,7 +85,7 @@ Node *VisitedNode::GetVarVal(uint64_t *vars) { | |||
| 85 | bool Result::AddVarVal(uint64_t *vars, double obj, double cons) { | 85 | bool Result::AddVarVal(uint64_t *vars, double obj, double cons) { |
| 86 | uint64_t rec_num = solution_num_; | 86 | uint64_t rec_num = solution_num_; |
| 87 | if (rec_num > MAX_SOLUTION) { | 87 | if (rec_num > MAX_SOLUTION) { |
| 88 | - ATT_LOG("Too much solutions!"); | 88 | + ATT_LOG("Too many solutions!"); |
| 89 | return false; | 89 | return false; |
| 90 | } | 90 | } |
| 91 | uint32_t cnt_num = 0; | 91 | uint32_t cnt_num = 0; |
| @@ -47,7 +47,7 @@ std::string ResultCheckerUtils::DefineCheckerFunction() { | |||
| 47 | bool ResultCheckerUtils::IsFileContainsString(const std::string &filename, const std::string &search_sub_string) { | 47 | bool ResultCheckerUtils::IsFileContainsString(const std::string &filename, const std::string &search_sub_string) { |
| 48 | std::ifstream file(filename); | 48 | std::ifstream file(filename); |
| 49 | if (!file.is_open()) { | 49 | if (!file.is_open()) { |
| 50 | - std::cerr << "无法打开文件: " << filename << std::endl; | 50 | + std::cerr << "Cannot open file: " << filename << std::endl; |
| 51 | return false; | 51 | return false; |
| 52 | } | 52 | } |
| 53 | std::string line; | 53 | std::string line; |
| @@ -683,7 +683,7 @@ int WrapperOnlyLaunch(uint32_t workspace_size, AutofuseTilingData *tiling_data) | |||
| 683 | if (find_best_tiling_key_fn != nullptr) { | 683 | if (find_best_tiling_key_fn != nullptr) { |
| 684 | tiling_key = find_best_tiling_key_fn(*tiling_data); | 684 | tiling_key = find_best_tiling_key_fn(*tiling_data); |
| 685 | if (tiling_key < 0 || static_cast<uint64_t>(tiling_key) >= tiling_key_count) { | 685 | if (tiling_key < 0 || static_cast<uint64_t>(tiling_key) >= tiling_key_count) { |
| 686 | - DLOGE("find best tiling key failed"); | 686 | + DLOGE("find best tiling key failed, tiling_key=%ld, valid range=[0,%lu)", tiling_key, tiling_key_count); |
| 687 | return FAILED; | 687 | return FAILED; |
| 688 | } | 688 | } |
| 689 | } else { | 689 | } else { |
| @@ -142,7 +142,7 @@ class TestAscir: | |||
| 142 | except Exception as e: | 142 | except Exception as e: |
| 143 | assert ( | 143 | assert ( |
| 144 | e.args[0] | 144 | e.args[0] |
| 145 | - == "Check dtype failed for cast Cast; input_dtypes: [DT_INT8], output_dytpes: [DT_INT4]" | 145 | + == "Check dtype failed for cast Cast; input_dtypes: [DT_INT8], output_dtypes: [DT_INT4]" |
| 146 | ) | 146 | ) |
| 147 | import sys | 147 | import sys |
| 148 | 148 | ||
| @@ -160,7 +160,7 @@ class TestAscir: | |||
| 160 | except Exception as e: | 160 | except Exception as e: |
| 161 | assert ( | 161 | assert ( |
| 162 | e.args[0] | 162 | e.args[0] |
| 163 | - == "Check dtype failed for cast_0 Cast; input_dtypes: [DT_INT8], output_dytpes: [DT_INT4]" | 163 | + == "Check dtype failed for cast_0 Cast; input_dtypes: [DT_INT8], output_dtypes: [DT_INT4]" |
| 164 | ) | 164 | ) |
| 165 | 165 | ||
| 166 | 166 | ||
| @@ -1125,7 +1125,7 @@ class TestAutofuseLoadConcatStore: | |||
| 1125 | try: | 1125 | try: |
| 1126 | load.infer_dtype() | 1126 | load.infer_dtype() |
| 1127 | except Exception as e: | 1127 | except Exception as e: |
| 1128 | - assert e.args[0] == "node load Load need set input before call infer dype" | 1128 | + assert e.args[0] == "node load Load need set input before call infer dtype" |
| 1129 | load.attr.sched.axis = [z0, z1] | 1129 | load.attr.sched.axis = [z0, z1] |
| 1130 | load.x = arg2_1.y | 1130 | load.x = arg2_1.y |
| 1131 | load.y.axis = [z0, z1] | 1131 | load.y.axis = [z0, z1] |
| @@ -97,7 +97,7 @@ bool ExtractBlockDimFromLine(const std::string &line, uint32_t &block_dim) { | |||
| 97 | std::pair<std::vector<uint32_t>, std::vector<uint32_t>> ParseBlockDimFromLog(const std::string &filename) { | 97 | std::pair<std::vector<uint32_t>, std::vector<uint32_t>> ParseBlockDimFromLog(const std::string &filename) { |
| 98 | std::ifstream file(filename); | 98 | std::ifstream file(filename); |
| 99 | if (!file.is_open()) { | 99 | if (!file.is_open()) { |
| 100 | - std::cerr << "无法打开文件: " << filename << std::endl; | 100 | + std::cerr << "Cannot open file: " << filename << std::endl; |
| 101 | return {}; | 101 | return {}; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| @@ -125,7 +125,7 @@ bool VerifySecondaryTilingCoreUsage(const std::string &filename, uint32_t total_ | |||
| 125 | auto [first_blocks, second_blocks] = ParseBlockDimFromLog(filename); | 125 | auto [first_blocks, second_blocks] = ParseBlockDimFromLog(filename); |
| 126 | 126 | ||
| 127 | if (first_blocks.size() < 2 || second_blocks.size() < 2) { | 127 | if (first_blocks.size() < 2 || second_blocks.size() < 2) { |
| 128 | - std::cerr << "无法从日志中解析出足够的block_dim值,first.size()=" << first_blocks.size() | 128 | + std::cerr << "Cannot parse enough block_dim values from log, first.size()=" << first_blocks.size() |
| 129 | << ", second.size()=" << second_blocks.size() << std::endl; | 129 | << ", second.size()=" << second_blocks.size() << std::endl; |
| 130 | return false; | 130 | return false; |
| 131 | } | 131 | } |
| @@ -261,7 +261,7 @@ __aicore__ inline void BroadcastExtendImpl(const LocalTensor<T> &dst, const Loca | |||
| 261 | ASCENDC_ASSERT((tiling != nullptr), "BroadcastTilingExtend could not be empty!"); | 261 | ASCENDC_ASSERT((tiling != nullptr), "BroadcastTilingExtend could not be empty!"); |
| 262 | if constexpr (constRank != -1) { | 262 | if constexpr (constRank != -1) { |
| 263 | ASCENDC_ASSERT((tiling->oriRank == constRank), | 263 | ASCENDC_ASSERT((tiling->oriRank == constRank), |
| 264 | - { KERNEL_LOG(KERNEL_ERROR, "Tilling original rank and constRank should be equal!"); }); | 264 | + { KERNEL_LOG(KERNEL_ERROR, "Tiling original rank and constRank should be equal!"); }); |
| 265 | } | 265 | } |
| 266 | BroadcastInternal::ShapeCheck(tiling->oriDstShape, dstShape, tiling->oriRank); | 266 | BroadcastInternal::ShapeCheck(tiling->oriDstShape, dstShape, tiling->oriRank); |
| 267 | BroadcastInternal::ShapeCheck(tiling->oriSrcShape, srcShape, tiling->oriRank); | 267 | BroadcastInternal::ShapeCheck(tiling->oriSrcShape, srcShape, tiling->oriRank); |
| @@ -88,7 +88,7 @@ __aicore__ inline void DstShapeCheck(const uint32_t *dstShape, uint32_t dim) { | |||
| 88 | __aicore__ inline void ShapeCheck(uint32_t *tillingShape, const uint32_t *shape, uint32_t rank) { | 88 | __aicore__ inline void ShapeCheck(uint32_t *tillingShape, const uint32_t *shape, uint32_t rank) { |
| 89 | for (uint16_t i = 0; i < rank; ++i) { | 89 | for (uint16_t i = 0; i < rank; ++i) { |
| 90 | ASCENDC_ASSERT((shape[i] == tillingShape[i]), | 90 | ASCENDC_ASSERT((shape[i] == tillingShape[i]), |
| 91 | - { KERNEL_LOG(KERNEL_ERROR, "Tilling shape should be equal to shape!"); }); | 91 | + { KERNEL_LOG(KERNEL_ERROR, "Tiling shape should be equal to shape!"); }); |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| 94 | } // namespace BroadcastInternal | 94 | } // namespace BroadcastInternal |
| @@ -822,7 +822,8 @@ af::Status CalculateArTreeReduceParams(const ReduceApiPerfContext &context, uint | |||
| 822 | int64_t vl_size_value = 0; | 822 | int64_t vl_size_value = 0; |
| 823 | nd.input_dims[1].GetConstValue(dim_r); | 823 | nd.input_dims[1].GetConstValue(dim_r); |
| 824 | vl_size.GetConstValue(vl_size_value); | 824 | vl_size.GetConstValue(vl_size_value); |
| 825 | - GE_ASSERT_TRUE(dim_r > 0 && vl_size_value > 0, "Reduce AR dimR or vlSize is invalid."); | 825 | + GE_ASSERT_TRUE(dim_r > 0 && vl_size_value > 0, |
| 826 | + "Reduce AR dimR[%ld] or vlSize[%ld] is invalid, both must be positive.", dim_r, vl_size_value); | ||
| 826 | uint32_t main_r = CalculateMainRConst(static_cast<uint32_t>(dim_r)); | 827 | uint32_t main_r = CalculateMainRConst(static_cast<uint32_t>(dim_r)); |
| 827 | uint32_t tail_r = static_cast<uint32_t>(dim_r) - main_r; | 828 | uint32_t tail_r = static_cast<uint32_t>(dim_r) - main_r; |
| 828 | if (apply_non_reuse && !context.is_reuse_source) { | 829 | if (apply_non_reuse && !context.is_reuse_source) { |
| @@ -63,7 +63,7 @@ class MicroApiCallFactory { | |||
| 63 | std::lock_guard<std::mutex> lock(mutex_); | 63 | std::lock_guard<std::mutex> lock(mutex_); |
| 64 | const auto iter = creator_map_.find(class_name); | 64 | const auto iter = creator_map_.find(class_name); |
| 65 | if (iter != creator_map_.end()) { | 65 | if (iter != creator_map_.end()) { |
| 66 | - GELOGD("MicroApiCallFactory::RegisterCreator: %s creator already exist", class_name.c_str()); | 66 | + GELOGD("MicroApiCallFactory::RegisterCreator: %s creator already exists", class_name.c_str()); |
| 67 | return; | 67 | return; |
| 68 | } | 68 | } |
| 69 | creator_map_[class_name] = func; | 69 | creator_map_[class_name] = func; |
| @@ -63,7 +63,7 @@ Status CastV2ApiCall::Generate(const TPipe &tpipe, const std::vector<ascir::Axis | |||
| 63 | (void)RegisterBasicDumpParam(this->api_name_, inputs, outputs); | 63 | (void)RegisterBasicDumpParam(this->api_name_, inputs, outputs); |
| 64 | GELOGD("x, is_constant:%d", static_cast<int32_t>(x.is_constant)); | 64 | GELOGD("x, is_constant:%d", static_cast<int32_t>(x.is_constant)); |
| 65 | GELOGI("cast x_dtype:%d, y.dtype:%d.", static_cast<int32_t>(x.dtype), static_cast<int32_t>(y.dtype)); | 65 | GELOGI("cast x_dtype:%d, y.dtype:%d.", static_cast<int32_t>(x.dtype), static_cast<int32_t>(y.dtype)); |
| 66 | - GE_ASSERT_TRUE((x.dtype != y.dtype), "cast s_dtype:%d, y.dtype:%d", static_cast<int32_t>(x.dtype), | 66 | + GE_ASSERT_TRUE((x.dtype != y.dtype), "cast x_dtype:%d, y.dtype:%d", static_cast<int32_t>(x.dtype), |
| 67 | static_cast<int32_t>(y.dtype)); | 67 | static_cast<int32_t>(y.dtype)); |
| 68 | // 通过 src_dtype 和 dst_dtype 获取 mode | 68 | // 通过 src_dtype 和 dst_dtype 获取 mode |
| 69 | std::string x_dtype; | 69 | std::string x_dtype; |
| @@ -115,7 +115,7 @@ af::Status ConcatRegApiCall::GenerateDefault(const vector<std::reference_wrapper | |||
| 115 | DefineConcatTiling(tiling_b32, t_pipe.tiler, ss); | 115 | DefineConcatTiling(tiling_b32, t_pipe.tiler, ss); |
| 116 | dtype_name = "uint32_t"; | 116 | dtype_name = "uint32_t"; |
| 117 | } else if (NeedB8ToB16(tiling)) { | 117 | } else if (NeedB8ToB16(tiling)) { |
| 118 | - GELOGD("can use b16 concat", dtype_name.c_str()); | 118 | + GELOGD("can use b16 concat, dtype: %s", dtype_name.c_str()); |
| 119 | const ConcatTiling tiling_b16 = B8ToB16(tiling); | 119 | const ConcatTiling tiling_b16 = B8ToB16(tiling); |
| 120 | DefineConcatTiling(tiling_b16, t_pipe.tiler, ss); | 120 | DefineConcatTiling(tiling_b16, t_pipe.tiler, ss); |
| 121 | dtype_name = "uint16_t"; | 121 | dtype_name = "uint16_t"; |
| @@ -152,7 +152,7 @@ af::Status ConcatRegApiCall::GenerateForGather(const vector<std::reference_wrapp | |||
| 152 | DefineConcatTilingGather(tiling_b32, t_pipe.tiler, ss); | 152 | DefineConcatTilingGather(tiling_b32, t_pipe.tiler, ss); |
| 153 | dtype_name = "uint32_t"; | 153 | dtype_name = "uint32_t"; |
| 154 | } else if (NeedB8ToB16(tiling)) { | 154 | } else if (NeedB8ToB16(tiling)) { |
| 155 | - GELOGD("can use b16 concat", dtype_name.c_str()); | 155 | + GELOGD("can use b16 concat, dtype: %s", dtype_name.c_str()); |
| 156 | const ConcatTiling tiling_b16 = B8ToB16(tiling); | 156 | const ConcatTiling tiling_b16 = B8ToB16(tiling); |
| 157 | DefineConcatTilingGather(tiling_b16, t_pipe.tiler, ss); | 157 | DefineConcatTilingGather(tiling_b16, t_pipe.tiler, ss); |
| 158 | dtype_name = "uint16_t"; | 158 | dtype_name = "uint16_t"; |
| @@ -167,7 +167,7 @@ Status GatherRegApiCall::GenerateComputeTypeLoad(const TPipe &tpipe, const std:: | |||
| 167 | ss << dtypename << ", "; | 167 | ss << dtypename << ", "; |
| 168 | std::string case_; | 168 | std::string case_; |
| 169 | if (GetGatherCase(x1, case_) == af::FAILED) { | 169 | if (GetGatherCase(x1, case_) == af::FAILED) { |
| 170 | - GELOGE(af::FAILED, "gather_dim status need add"); | 170 | + GELOGE(af::FAILED, "gather_dim status is not handled and needs to be implemented"); |
| 171 | return af::FAILED; | 171 | return af::FAILED; |
| 172 | } | 172 | } |
| 173 | ss << case_ << ", " << y.vectorized_axis.size() << ", " << this->negative_index_support << ">("; | 173 | ss << case_ << ", " << y.vectorized_axis.size() << ", " << this->negative_index_support << ">("; |
| @@ -243,7 +243,7 @@ Status GatherRegApiCall::Generate(const TPipe &tpipe, const std::vector<ascir::A | |||
| 243 | 243 | ||
| 244 | Status GatherRegApiCall::ParseAttr(const ascir::NodeView &node) { | 244 | Status GatherRegApiCall::ParseAttr(const ascir::NodeView &node) { |
| 245 | GE_CHK_GRAPH_STATUS_RET(node->attr.ir_attr->GetAttrValue("axis", this->axis), | 245 | GE_CHK_GRAPH_STATUS_RET(node->attr.ir_attr->GetAttrValue("axis", this->axis), |
| 246 | - "Failed to get Gahter axis attr, node = %s", node->GetNamePtr()); | 246 | + "Failed to get Gather axis attr, node = %s", node->GetNamePtr()); |
| 247 | if (node->attr.api.compute_type == af::ComputeType::kComputeLoad) { | 247 | if (node->attr.api.compute_type == af::ComputeType::kComputeLoad) { |
| 248 | GE_CHK_GRAPH_STATUS_RET(node->attr.ir_attr->GetAttrValue("negative_index_support", this->negative_index_support), | 248 | GE_CHK_GRAPH_STATUS_RET(node->attr.ir_attr->GetAttrValue("negative_index_support", this->negative_index_support), |
| 249 | "Failed to get Gather negative_index_support attr, node = %s", node->GetNamePtr()); | 249 | "Failed to get Gather negative_index_support attr, node = %s", node->GetNamePtr()); |
| @@ -217,7 +217,7 @@ af::Status SplitRegApiCall::GenerateDefault(const vector<std::reference_wrapper< | |||
| 217 | DefineSplitTiling(tiling_b32, t_pipe.tiler, ss); | 217 | DefineSplitTiling(tiling_b32, t_pipe.tiler, ss); |
| 218 | dtype_name = "uint32_t"; | 218 | dtype_name = "uint32_t"; |
| 219 | } else if (NeedB8ToB16(tiling)) { | 219 | } else if (NeedB8ToB16(tiling)) { |
| 220 | - GELOGD("can use b16 split", dtype_name.c_str()); | 220 | + GELOGD("can use b16 split, dtype: %s", dtype_name.c_str()); |
| 221 | SplitTiling tiling_b16; | 221 | SplitTiling tiling_b16; |
| 222 | const auto &kB16ToB8 = af::Symbol(2); | 222 | const auto &kB16ToB8 = af::Symbol(2); |
| 223 | GE_ASSERT_TRUE(kB16ToB8 != 0); | 223 | GE_ASSERT_TRUE(kB16ToB8 != 0); |
| @@ -26,7 +26,7 @@ Status SplitConcatOptimizationPass::RunPass(af::AscGraph &graph) { | |||
| 26 | std::vector<af::AscNodePtr> concat_nodes; | 26 | std::vector<af::AscNodePtr> concat_nodes; |
| 27 | FindSplitAndConcatNodes(graph, split_nodes, concat_nodes); | 27 | FindSplitAndConcatNodes(graph, split_nodes, concat_nodes); |
| 28 | if (split_nodes.empty() || concat_nodes.empty()) { | 28 | if (split_nodes.empty() || concat_nodes.empty()) { |
| 29 | - GELOGI("graph[%s] does not has split concat fusion", graph.GetName().c_str()); | 29 | + GELOGI("graph[%s] does not have split concat fusion", graph.GetName().c_str()); |
| 30 | return af::SUCCESS; | 30 | return af::SUCCESS; |
| 31 | } | 31 | } |
| 32 | GE_ASSERT_TRUE(concat_nodes.size() == kExpectedNodeNum, "expect just 1 Concat node, but got %zu ", | 32 | GE_ASSERT_TRUE(concat_nodes.size() == kExpectedNodeNum, "expect just 1 Concat node, but got %zu ", |
| @@ -1033,7 +1033,7 @@ af::Status VectorFuncPartitioner::BuildSubgraph(const ClusterPtr &cluster, af::A | |||
| 1033 | vf_op.GetName(str); | 1033 | vf_op.GetName(str); |
| 1034 | // add node to impl graph | 1034 | // add node to impl graph |
| 1035 | auto vf_node = impl_graph_.FindNode(str.GetString()); | 1035 | auto vf_node = impl_graph_.FindNode(str.GetString()); |
| 1036 | - GE_ASSERT_NOTNULL(vf_node, "Failed to find vf node %s form graph %s.", str.GetString(), | 1036 | + GE_ASSERT_NOTNULL(vf_node, "Failed to find vf node %s from graph %s.", str.GetString(), |
| 1037 | impl_graph_.GetName().c_str()); | 1037 | impl_graph_.GetName().c_str()); |
| 1038 | 1038 | ||
| 1039 | int64_t parent_out_idx = 0; | 1039 | int64_t parent_out_idx = 0; |
| @@ -1338,7 +1338,7 @@ af::Status VectorFuncPartitioner::AddRemovePadForBrcInline(af::AscGraph &graph) | |||
| 1338 | const auto &src_nodes = node->GetInDataNodes(); | 1338 | const auto &src_nodes = node->GetInDataNodes(); |
| 1339 | const auto connect_to_concat = (!src_nodes.empty()) && (src_nodes.at(0U)->GetType() == af::ascir_op::Concat::Type); | 1339 | const auto connect_to_concat = (!src_nodes.empty()) && (src_nodes.at(0U)->GetType() == af::ascir_op::Concat::Type); |
| 1340 | if ((!connect_to_concat) && ScheduleUtils::IsContinuesVecStrides(std::dynamic_pointer_cast<af::AscNode>(node))) { | 1340 | if ((!connect_to_concat) && ScheduleUtils::IsContinuesVecStrides(std::dynamic_pointer_cast<af::AscNode>(node))) { |
| 1341 | - GELOGD("Graph[%s] Node[%s] is continues.", graph.GetName().c_str(), node->GetNamePtr()); | 1341 | + GELOGD("Graph[%s] Node[%s] is continuous.", graph.GetName().c_str(), node->GetNamePtr()); |
| 1342 | continue; | 1342 | continue; |
| 1343 | } | 1343 | } |
| 1344 | GE_ASSERT_SUCCESS(ReverseDfsUnAlignNode(graph, node, visited_nodes)); | 1344 | GE_ASSERT_SUCCESS(ReverseDfsUnAlignNode(graph, node, visited_nodes)); |
| @@ -24,7 +24,7 @@ AlignmentType UnAlignmentStrategy::GetDefaultAlignmentType() { | |||
| 24 | af::Status UnAlignmentStrategy::LoadAlignmentInferFunc(const af::AscNodePtr &node) { | 24 | af::Status UnAlignmentStrategy::LoadAlignmentInferFunc(const af::AscNodePtr &node) { |
| 25 | const auto &output_attr = node->outputs[0].attr; | 25 | const auto &output_attr = node->outputs[0].attr; |
| 26 | if (!af::ops::IsOps<af::ascir_op::Load>(node)) { | 26 | if (!af::ops::IsOps<af::ascir_op::Load>(node)) { |
| 27 | - GELOGD("Node[%s] is continuous loading, input tensor does not needs to be aligned.", node->GetNamePtr()); | 27 | + GELOGD("Node[%s] is continuous loading, input tensor does not need to be aligned.", node->GetNamePtr()); |
| 28 | // vectorized_axis连续则可以连续搬运 | 28 | // vectorized_axis连续则可以连续搬运 |
| 29 | tensor_to_align_type_[&output_attr] = {AlignmentType::kNotAligned}; | 29 | tensor_to_align_type_[&output_attr] = {AlignmentType::kNotAligned}; |
| 30 | return af::SUCCESS; | 30 | return af::SUCCESS; |
| @@ -78,7 +78,7 @@ static std::string GetBasePath() { | |||
| 78 | const char *pathRaw = MsprofGetPath(); | 78 | const char *pathRaw = MsprofGetPath(); |
| 79 | if (pathRaw == nullptr || pathRaw[0] == '\0') { | 79 | if (pathRaw == nullptr || pathRaw[0] == '\0') { |
| 80 | SK_DLOGE("[sk time profiling] MsprofGetPath returned empty path\n"); | 80 | SK_DLOGE("[sk time profiling] MsprofGetPath returned empty path\n"); |
| 81 | - SK_DLOGI("[sk time profiling] Profiler should start before than net start, Please check it\n"); | 81 | + SK_DLOGI("[sk time profiling] Profiler should start before the network starts, please check it\n"); |
| 82 | return ""; | 82 | return ""; |
| 83 | } | 83 | } |
| 84 | std::string path(pathRaw); | 84 | std::string path(pathRaw); |
| @@ -487,11 +487,11 @@ bool SuperKernelGraph::ProcessMemoryWriteNodes(const uint64_t eventId, const Mem | |||
| 487 | bool waitFusible = false; | 487 | bool waitFusible = false; |
| 488 | // check notify size and apply corresponding bypass policy | 488 | // check notify size and apply corresponding bypass policy |
| 489 | if (notifyIdVec.size() > 1) { | 489 | if (notifyIdVec.size() > 1) { |
| 490 | - SK_LOGE("there exits multi memory write node which is notify, it is illegal, eventId: 0x%lx", eventId); | 490 | + SK_LOGE("there exist multiple memory write nodes which are notify, it is illegal, eventId: 0x%lx", eventId); |
| 491 | return false; | 491 | return false; |
| 492 | } else if (notifyIdVec.size() == 1) { | 492 | } else if (notifyIdVec.size() == 1) { |
| 493 | auto *writeNode = GetNodeById(notifyIdVec[0]); | 493 | auto *writeNode = GetNodeById(notifyIdVec[0]); |
| 494 | - SK_LOGD("there exits only one memory write node which is notify, it may cause dead lock, details=%s", | 494 | + SK_LOGD("there exists only one memory write node which is notify, it may cause dead lock, details=%s", |
| 495 | writeNode->Format().c_str()); | 495 | writeNode->Format().c_str()); |
| 496 | writeNode->SetNodeType(SkNodeType::NODE_NOTIFY); | 496 | writeNode->SetNodeType(SkNodeType::NODE_NOTIFY); |
| 497 | writeNode->SetIsFusible(enablePairedWaitBypass); | 497 | writeNode->SetIsFusible(enablePairedWaitBypass); |
| @@ -1092,15 +1092,15 @@ bool SuperKernelGraph::InitStreamsFromModelRI(std::vector<uint32_t> &streamTaskN | |||
| 1092 | uint32_t streamNum = 0; | 1092 | uint32_t streamNum = 0; |
| 1093 | aclError ret = aclmdlRIGetStreams(modelRI, nullptr, &streamNum); | 1093 | aclError ret = aclmdlRIGetStreams(modelRI, nullptr, &streamNum); |
| 1094 | if (ret != ACL_SUCCESS) { | 1094 | if (ret != ACL_SUCCESS) { |
| 1095 | - SK_LOGE("Failed to get number of streams in model RI, ret=%d", ret); | 1095 | + SK_LOGE("Failed to get number of streams in model runtime image, ret=%d", ret); |
| 1096 | return false; | 1096 | return false; |
| 1097 | } | 1097 | } |
| 1098 | - SK_LOGI("Get %u streams from model RI", streamNum); | 1098 | + SK_LOGI("Get %u streams from model runtime image", streamNum); |
| 1099 | 1099 | ||
| 1100 | std::vector<aclrtStream> modelStreams(streamNum); | 1100 | std::vector<aclrtStream> modelStreams(streamNum); |
| 1101 | ret = aclmdlRIGetStreams(modelRI, modelStreams.data(), &streamNum); | 1101 | ret = aclmdlRIGetStreams(modelRI, modelStreams.data(), &streamNum); |
| 1102 | if (ret != ACL_SUCCESS) { | 1102 | if (ret != ACL_SUCCESS) { |
| 1103 | - SK_LOGE("Failed to get streams in model RI, ret=%d", ret); | 1103 | + SK_LOGE("Failed to get streams in model runtime image, ret=%d", ret); |
| 1104 | return false; | 1104 | return false; |
| 1105 | } | 1105 | } |
| 1106 | 1106 | ||
| @@ -1139,7 +1139,7 @@ bool SuperKernelGraph::InitStreamsFromModelRI(std::vector<uint32_t> &streamTaskN | |||
| 1139 | */ | 1139 | */ |
| 1140 | bool SuperKernelGraph::ProcessAllStreamsAndTasks(const std::vector<uint32_t> &streamTaskNums) { | 1140 | bool SuperKernelGraph::ProcessAllStreamsAndTasks(const std::vector<uint32_t> &streamTaskNums) { |
| 1141 | if (streamTaskNums.empty()) { | 1141 | if (streamTaskNums.empty()) { |
| 1142 | - SK_LOGI("No tasks found in model RI, skip processing streams and tasks"); | 1142 | + SK_LOGI("No tasks found in model runtime image, skip processing streams and tasks"); |
| 1143 | return true; | 1143 | return true; |
| 1144 | } | 1144 | } |
| 1145 | 1145 | ||
| @@ -414,7 +414,7 @@ bool LockDetector::GetFusibleStatus(SuperKernelBaseNode &curNode) { | |||
| 414 | SK_LOGD("[lock detector] Notify node %s: not needed core resource, can fuse", curNode.Format().c_str()); | 414 | SK_LOGD("[lock detector] Notify node %s: not needed core resource, can fuse", curNode.Format().c_str()); |
| 415 | return true; | 415 | return true; |
| 416 | } else { | 416 | } else { |
| 417 | - SK_LOGE("[lock detector] Notify node %s: in SK range with coreNum>0 (cube %u, vec %u), which not allowed", | 417 | + SK_LOGE("[lock detector] Notify node %s: in SK range with coreNum>0 (cube %u, vec %u), which is not allowed", |
| 418 | curNode.Format().c_str(), curNode.GetCubeNum(), curNode.GetVecNum()); | 418 | curNode.Format().c_str(), curNode.GetCubeNum(), curNode.GetVecNum()); |
| 419 | deadlockReason_ = DeadlockFailReason::NOTIFY_INVALID; | 419 | deadlockReason_ = DeadlockFailReason::NOTIFY_INVALID; |
| 420 | return false; | 420 | return false; |
| @@ -78,13 +78,13 @@ const char *FusionFailReasonDetail(FusionFailReason reason) { | |||
| 78 | return "There is no kernel node on the stream where the current node is located, and this stream is within the " | 78 | return "There is no kernel node on the stream where the current node is located, and this stream is within the " |
| 79 | "scope"; | 79 | "scope"; |
| 80 | case FusionFailReason::EXIST_DEADLOCK: | 80 | case FusionFailReason::EXIST_DEADLOCK: |
| 81 | - return "exist deadlock"; | 81 | + return "deadlock exists"; |
| 82 | case FusionFailReason::SCOPE_FUSE_PART: | 82 | case FusionFailReason::SCOPE_FUSE_PART: |
| 83 | return "scope fuse failed"; | 83 | return "scope fuse failed"; |
| 84 | case FusionFailReason::EXTERNAL_DEPEND: | 84 | case FusionFailReason::EXTERNAL_DEPEND: |
| 85 | return "event node has external dependency"; | 85 | return "event node has external dependency"; |
| 86 | case FusionFailReason::UNSUPPORT_EVENT_TYPE: | 86 | case FusionFailReason::UNSUPPORT_EVENT_TYPE: |
| 87 | - return "unsupport event type"; | 87 | + return "unsupported event type"; |
| 88 | case FusionFailReason::MEMORY_WAIT_NODE_ONLY: | 88 | case FusionFailReason::MEMORY_WAIT_NODE_ONLY: |
| 89 | return "No memory write exists, meaning the memory write is outside modelRI. Therefore change all waits to event " | 89 | return "No memory write exists, meaning the memory write is outside modelRI. Therefore change all waits to event " |
| 90 | "semantics, but they cannot be fused."; | 90 | "semantics, but they cannot be fused."; |
| @@ -226,7 +226,7 @@ bool SuperKernelOptimizer::Update(SuperKernelScopeInfo &scopeInfo, SuperKernelGr | |||
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | if (!skMainNodeUpdated) { | 228 | if (!skMainNodeUpdated) { |
| 229 | - SK_LOGE("not find sk launch node, sk optimize failed"); | 229 | + SK_LOGE("failed to find sk launch node, sk optimize failed"); |
| 230 | return false; | 230 | return false; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| @@ -528,7 +528,7 @@ void SuperKernelOptionsManager::SetOptOptionValue(const aclskOption *option) { | |||
| 528 | } | 528 | } |
| 529 | } | 529 | } |
| 530 | if (iter == optionMap.end()) { | 530 | if (iter == optionMap.end()) { |
| 531 | - SK_LOGI("Optiontype: %d is not support now", static_cast<int>(type)); | 531 | + SK_LOGI("OptionType: %d is not supported now", static_cast<int>(type)); |
| 532 | return; | 532 | return; |
| 533 | } | 533 | } |
| 534 | auto *subOption = iter->second.get(); | 534 | auto *subOption = iter->second.get(); |
| @@ -687,7 +687,7 @@ void SuperKernelOptionsManager::SetOptOptionValue(const aclskOption *option) { | |||
| 687 | } | 687 | } |
| 688 | break; | 688 | break; |
| 689 | default: | 689 | default: |
| 690 | - SK_LOGI("Optiontype: %d is not support now", static_cast<int>(type)); | 690 | + SK_LOGI("OptionType: %d is not supported now", static_cast<int>(type)); |
| 691 | break; | 691 | break; |
| 692 | } | 692 | } |
| 693 | } | 693 | } |
| @@ -174,13 +174,8 @@ void ScopeSplitPass::PrintScopeDetails(const std::vector<SuperKernelScopeInfo> & | |||
| 174 | 174 | ||
| 175 | void ScopeSplitPass::PrintScopeResults(const std::vector<SuperKernelScopeInfo> &scopes, const SuperKernelGraph &graph, | 175 | void ScopeSplitPass::PrintScopeResults(const std::vector<SuperKernelScopeInfo> &scopes, const SuperKernelGraph &graph, |
| 176 | const char *passName) { | 176 | const char *passName) { |
| 177 | - // Log to dedicated file first | 177 | + // Log to dedicated file |
| 178 | - { | 178 | + SK_LOG_CONTEXT_SIMPLE("sk_scope_split.log"); |
| 179 | - SK_LOG_CONTEXT_SIMPLE("sk_scope_split.log"); | ||
| 180 | - PrintScopeDetails(scopes, graph, passName); | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - // Also log to default log for visibility | ||
| 184 | PrintScopeDetails(scopes, graph, passName); | 179 | PrintScopeDetails(scopes, graph, passName); |
| 185 | } | 180 | } |
| 186 | 181 | ||
| @@ -15,62 +15,68 @@ super kernel feature manager | |||
| 15 | 15 | ||
| 16 | import threading | 16 | import threading |
| 17 | from abc import ABC, abstractmethod | 17 | from abc import ABC, abstractmethod |
| 18 | -from typing import Dict, Type, Any, Callable, Optional | 18 | +from typing import Dict, Type, Callable, Optional |
| 19 | from asc_op_compile_base.common.utils.log_utils import LogUtil, AscendCLogLevel | 19 | from asc_op_compile_base.common.utils.log_utils import LogUtil, AscendCLogLevel |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | - | ||
| 23 | class BaseFeature(ABC): | 22 | class BaseFeature(ABC): |
| 24 | """ | 23 | """ |
| 25 | base feature class | 24 | base feature class |
| 26 | """ | 25 | """ |
| 26 | + | ||
| 27 | def __init__(self, feature_name: str, feature_version: int): | 27 | def __init__(self, feature_name: str, feature_version: int): |
| 28 | if not isinstance(feature_name, str): | 28 | if not isinstance(feature_name, str): |
| 29 | - raise TypeError(f"feature_name's type must be str, current type is {type(feature_name).__name__}") | 29 | + raise TypeError( |
| 30 | + f"feature_name's type must be str, current type is {type(feature_name).__name__}" | ||
| 31 | + ) | ||
| 30 | if not isinstance(feature_version, int): | 32 | if not isinstance(feature_version, int): |
| 31 | - raise TypeError(f"feature_version's type must be int, current type is {type(feature_version).__name__}") | 33 | + raise TypeError( |
| 34 | + f"feature_version's type must be int, current type is {type(feature_version).__name__}" | ||
| 35 | + ) | ||
| 32 | self.feature_name = feature_name | 36 | self.feature_name = feature_name |
| 33 | self.feature_version = feature_version | 37 | self.feature_version = feature_version |
| 34 | 38 | ||
| 35 | def get_intersection_version(self, others_value: int) -> int: | 39 | def get_intersection_version(self, others_value: int) -> int: |
| 36 | """ | 40 | """ |
| 37 | - Get the minimum version between current feature version and another version. | 41 | + Get the minimum version between current feature version and another version. |
| 38 | 42 | ||
| 39 | - Args: | 43 | + Args: |
| 40 | - other_version: The version to compare with. | 44 | + other_version: The version to compare with. |
| 41 | - | 45 | + |
| 42 | - Return: | 46 | + Return: |
| 43 | - The minimum version of the two. | 47 | + The minimum version of the two. |
| 44 | """ | 48 | """ |
| 45 | return min(self.feature_version, others_value) | 49 | return min(self.feature_version, others_value) |
| 46 | 50 | ||
| 47 | 51 | ||
| 48 | def get_feature_version_of_value(self, feature_value: any) -> int: | 52 | def get_feature_version_of_value(self, feature_value: any) -> int: |
| 49 | """ | 53 | """ |
| 50 | - Abstract method to get feature version from feature value. | 54 | + Abstract method to get feature version from feature value. |
| 51 | """ | 55 | """ |
| 52 | pass | 56 | pass |
| 53 | 57 | ||
| 54 | 58 | ||
| 55 | def get_feature_value_of_version(self, feature_version: int) -> any: | 59 | def get_feature_value_of_version(self, feature_version: int) -> any: |
| 56 | """ | 60 | """ |
| 57 | - Abstract method to get feature value from feature version. | 61 | + Abstract method to get feature value from feature version. |
| 58 | """ | 62 | """ |
| 59 | pass | 63 | pass |
| 60 | 64 | ||
| 61 | 65 | ||
| 62 | - | ||
| 63 | class SuperKernelFeatureManager: | 66 | class SuperKernelFeatureManager: |
| 64 | """ | 67 | """ |
| 65 | super kernel feature manager | 68 | super kernel feature manager |
| 66 | """ | 69 | """ |
| 70 | + | ||
| 67 | _instance = None | 71 | _instance = None |
| 68 | _lock = threading.Lock() | 72 | _lock = threading.Lock() |
| 69 | 73 | ||
| 70 | def __new__(cls, *args, **kwargs): | 74 | def __new__(cls, *args, **kwargs): |
| 71 | with cls._lock: | 75 | with cls._lock: |
| 72 | if not cls._instance: | 76 | if not cls._instance: |
| 73 | - cls._instance = super(SuperKernelFeatureManager, cls).__new__(cls, *args, **kwargs) | 77 | + cls._instance = super(SuperKernelFeatureManager, cls).__new__( |
| 78 | + cls, *args, **kwargs | ||
| 79 | + ) | ||
| 74 | return cls._instance | 80 | return cls._instance |
| 75 | 81 | ||
| 76 | def __init__(self, use_ordered: bool = False): | 82 | def __init__(self, use_ordered: bool = False): |
| @@ -79,53 +85,76 @@ class SuperKernelFeatureManager: | |||
| 79 | self._available_feature_version_map: dict = {} | 85 | self._available_feature_version_map: dict = {} |
| 80 | self._enable_features_base: dict = {} | 86 | self._enable_features_base: dict = {} |
| 81 | 87 | ||
| 82 | - | ||
| 83 | def init_available_and_enable_features(self): | 88 | def init_available_and_enable_features(self): |
| 84 | input_features = {} | 89 | input_features = {} |
| 85 | try: | 90 | try: |
| 86 | from importlib import import_module | 91 | from importlib import import_module |
| 87 | - ascendc_compile_impl = "asc_op_compile_base.asc_op_compiler.ascendc_kernel_feature_manager" | 92 | + |
| 93 | + ascendc_compile_impl = ( | ||
| 94 | + "asc_op_compile_base.asc_op_compiler.ascendc_kernel_feature_manager" | ||
| 95 | + ) | ||
| 88 | ascendc_compile_module = import_module(ascendc_compile_impl) | 96 | ascendc_compile_module = import_module(ascendc_compile_impl) |
| 89 | - get_ascendc_feature_versions_func: Optional[Callable] = \ | 97 | + get_ascendc_feature_versions_func: Optional[Callable] = getattr( |
| 90 | - getattr(ascendc_compile_module, "get_features", None) | 98 | + ascendc_compile_module, "get_features", None |
| 99 | + ) | ||
| 91 | if get_ascendc_feature_versions_func is None: | 100 | if get_ascendc_feature_versions_func is None: |
| 92 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 101 | + LogUtil.print_compile_log( |
| 93 | - f"Module '{ascendc_compile_impl}' does not have a 'get_features' function.", \ | 102 | + "Super Kernel Feature Manager", |
| 94 | - AscendCLogLevel.LOG_ERROR) | 103 | + f"Module '{ascendc_compile_impl}' does not have a 'get_features' function.", |
| 95 | - raise AttributeError(f"Module '{ascendc_compile_impl}' does not have a 'get_features' function.") | 104 | + AscendCLogLevel.LOG_ERROR, |
| 105 | + ) | ||
| 106 | + raise AttributeError( | ||
| 107 | + f"Module '{ascendc_compile_impl}' does not have a 'get_features' function." | ||
| 108 | + ) | ||
| 96 | input_features = get_ascendc_feature_versions_func() | 109 | input_features = get_ascendc_feature_versions_func() |
| 97 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 110 | + LogUtil.print_compile_log( |
| 98 | - f"get ascendc feature versions success, {input_features}", \ | 111 | + "Super Kernel Feature Manager", |
| 99 | - AscendCLogLevel.LOG_INFO) | 112 | + f"get ascendc feature versions success, {input_features}", |
| 113 | + AscendCLogLevel.LOG_INFO, | ||
| 114 | + ) | ||
| 100 | except Exception as e: | 115 | except Exception as e: |
| 101 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 116 | + LogUtil.print_compile_log( |
| 117 | + "Super Kernel Feature Manager", | ||
| 102 | f"import {ascendc_compile_impl} failed, \ | 118 | f"import {ascendc_compile_impl} failed, \ |
| 103 | - please install the related software version, i.e. cann, opp, graph-autofusion.", \ | 119 | + please install the related software version, i.e. cann, opp, graph-autofusion.", |
| 104 | - AscendCLogLevel.LOG_ERROR) | 120 | + AscendCLogLevel.LOG_ERROR, |
| 121 | + ) | ||
| 105 | raise e | 122 | raise e |
| 106 | 123 | ||
| 107 | for feature_name in input_features.keys(): | 124 | for feature_name in input_features.keys(): |
| 108 | if feature_name not in self._support_features_instances.keys(): | 125 | if feature_name not in self._support_features_instances.keys(): |
| 109 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 126 | + LogUtil.print_compile_log( |
| 110 | - f"{feature_name} does not support in ascendc compile, please upgrade the CANN version", \ | 127 | + "Super Kernel Feature Manager", |
| 111 | - AscendCLogLevel.LOG_INFO) | 128 | + f"{feature_name} is not supported in ascendc compile, please upgrade the CANN version", |
| 129 | + AscendCLogLevel.LOG_INFO, | ||
| 130 | + ) | ||
| 112 | else: | 131 | else: |
| 113 | feature_instance = self._support_features_instances[feature_name] | 132 | feature_instance = self._support_features_instances[feature_name] |
| 114 | - self._available_feature_version_map[feature_name] = \ | 133 | + self._available_feature_version_map[feature_name] = ( |
| 115 | - feature_instance.get_intersection_version(input_features[feature_name]) | 134 | + feature_instance.get_intersection_version( |
| 135 | + input_features[feature_name] | ||
| 136 | + ) | ||
| 137 | + ) | ||
| 116 | 138 | ||
| 117 | - self._enable_features_base[feature_name] = \ | 139 | + self._enable_features_base[feature_name] = ( |
| 118 | - feature_instance.get_feature_value_of_version(self._available_feature_version_map[feature_name]) | 140 | + feature_instance.get_feature_value_of_version( |
| 119 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 141 | + self._available_feature_version_map[feature_name] |
| 142 | + ) | ||
| 143 | + ) | ||
| 144 | + LogUtil.print_compile_log( | ||
| 145 | + "Super Kernel Feature Manager", | ||
| 120 | f"{feature_name} available feature version is {self._available_feature_version_map[feature_name]}, \ | 146 | f"{feature_name} available feature version is {self._available_feature_version_map[feature_name]}, \ |
| 121 | - enable feature value is {self._enable_features_base[feature_name]}", \ | 147 | + enable feature value is {self._enable_features_base[feature_name]}", |
| 122 | - AscendCLogLevel.LOG_INFO) | 148 | + AscendCLogLevel.LOG_INFO, |
| 123 | - | 149 | + ) |
| 124 | 150 | ||
| 125 | def check_feature_valid(self, feature_name: str, feature_value: any): | 151 | def check_feature_valid(self, feature_name: str, feature_value: any): |
| 126 | available_feature_verison = self._available_feature_version_map[feature_name] | 152 | available_feature_verison = self._available_feature_version_map[feature_name] |
| 127 | feature_instance = self._support_features_instances[feature_name] | 153 | feature_instance = self._support_features_instances[feature_name] |
| 128 | - return feature_instance.get_feature_version_of_value(feature_value) <= available_feature_verison | 154 | + return ( |
| 155 | + feature_instance.get_feature_version_of_value(feature_value) | ||
| 156 | + <= available_feature_verison | ||
| 157 | + ) | ||
| 129 | 158 | ||
| 130 | def register_feature(self, feature_cls: Type[BaseFeature]) -> None: | 159 | def register_feature(self, feature_cls: Type[BaseFeature]) -> None: |
| 131 | """ | 160 | """ |
| @@ -134,7 +163,9 @@ class SuperKernelFeatureManager: | |||
| 134 | :raises ValueError: if duplicated or unimplemented | 163 | :raises ValueError: if duplicated or unimplemented |
| 135 | """ | 164 | """ |
| 136 | if not issubclass(feature_cls, BaseFeature): | 165 | if not issubclass(feature_cls, BaseFeature): |
| 137 | - raise ValueError(f"class {feature_cls.__name__} must be inherited from BaseFeature") | 166 | + raise ValueError( |
| 167 | + f"class {feature_cls.__name__} must be inherited from BaseFeature" | ||
| 168 | + ) | ||
| 138 | 169 | ||
| 139 | instance = feature_cls() | 170 | instance = feature_cls() |
| 140 | if instance.feature_name in self._support_features_instances: | 171 | if instance.feature_name in self._support_features_instances: |
| @@ -144,7 +175,7 @@ class SuperKernelFeatureManager: | |||
| 144 | def unregister_feature(self, feature_name: str) -> None: | 175 | def unregister_feature(self, feature_name: str) -> None: |
| 145 | if feature_name not in self._support_features_instances: | 176 | if feature_name not in self._support_features_instances: |
| 146 | raise KeyError(f"feature {feature_name} does not exists") | 177 | raise KeyError(f"feature {feature_name} does not exists") |
| 147 | - | 178 | + |
| 148 | self._support_features_instances.pop(feature_name) | 179 | self._support_features_instances.pop(feature_name) |
| 149 | 180 | ||
| 150 | def set_feature_value(self, feature_name: str, feature_value: any): | 181 | def set_feature_value(self, feature_name: str, feature_value: any): |
| @@ -154,29 +185,36 @@ class SuperKernelFeatureManager: | |||
| 154 | otherwise, the default value is used. | 185 | otherwise, the default value is used. |
| 155 | """ | 186 | """ |
| 156 | if feature_name not in self._enable_features_base.keys(): | 187 | if feature_name not in self._enable_features_base.keys(): |
| 157 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 188 | + LogUtil.print_compile_log( |
| 158 | - f"{feature_name} does not support in ascendc compile, \ | 189 | + "Super Kernel Feature Manager", |
| 159 | - please upgrade the related software version, i.e. cann, opp, graph-autofusion.", \ | 190 | + f"{feature_name} is not supported in ascendc compile, \ |
| 160 | - AscendCLogLevel.LOG_INFO) | 191 | + please upgrade the related software version, i.e. cann, opp, graph-autofusion.", |
| 192 | + AscendCLogLevel.LOG_INFO, | ||
| 193 | + ) | ||
| 161 | return | 194 | return |
| 162 | if self.check_feature_valid(feature_name, feature_value): | 195 | if self.check_feature_valid(feature_name, feature_value): |
| 163 | self._enable_features_base[feature_name] = feature_value | 196 | self._enable_features_base[feature_name] = feature_value |
| 164 | else: | 197 | else: |
| 165 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 198 | + LogUtil.print_compile_log( |
| 199 | + "Super Kernel Feature Manager", | ||
| 166 | f"feature {feature_name} does not support {feature_value}, \ | 200 | f"feature {feature_name} does not support {feature_value}, \ |
| 167 | - currect support version is {self._available_feature_version_map[feature_name]}, \ | 201 | + currently supported version is {self._available_feature_version_map[feature_name]}, \ |
| 168 | please upgrade the related software version, \ | 202 | please upgrade the related software version, \ |
| 169 | - i.e. cann, opp, graph-autofusion.", AscendCLogLevel.LOG_INFO) | 203 | + i.e. cann, opp, graph-autofusion.", |
| 204 | + AscendCLogLevel.LOG_INFO, | ||
| 205 | + ) | ||
| 170 | 206 | ||
| 171 | def get_feature_value(self, feature_name: str) -> any: | 207 | def get_feature_value(self, feature_name: str) -> any: |
| 172 | """ | 208 | """ |
| 173 | get feature value according to feature name | 209 | get feature value according to feature name |
| 174 | """ | 210 | """ |
| 175 | if feature_name not in self._enable_features_base.keys(): | 211 | if feature_name not in self._enable_features_base.keys(): |
| 176 | - LogUtil.print_compile_log("Super Kernel Feature Manager", \ | 212 | + LogUtil.print_compile_log( |
| 177 | - f"{feature_name} does not support in ascendc compile, \ | 213 | + "Super Kernel Feature Manager", |
| 178 | - please upgrade the related software version, i.e. cann, opp, graph-autofusion.", \ | 214 | + f"{feature_name} is not supported in ascendc compile, \ |
| 179 | - AscendCLogLevel.LOG_INFO) | 215 | + please upgrade the related software version, i.e. cann, opp, graph-autofusion.", |
| 216 | + AscendCLogLevel.LOG_INFO, | ||
| 217 | + ) | ||
| 180 | return None | 218 | return None |
| 181 | return self._enable_features_base[feature_name] | 219 | return self._enable_features_base[feature_name] |
| 182 | 220 | ||
| @@ -208,6 +246,7 @@ def register_feature(manager: SuperKernelFeatureManager): | |||
| 208 | else: | 246 | else: |
| 209 | raise ValueError(f"{self.feature_name} does not support {feature_version}") | 247 | raise ValueError(f"{self.feature_name} does not support {feature_version}") |
| 210 | """ | 248 | """ |
| 249 | + | ||
| 211 | def decorator(feature_cls: Type[BaseFeature]) -> Type[BaseFeature]: | 250 | def decorator(feature_cls: Type[BaseFeature]) -> Type[BaseFeature]: |
| 212 | manager.register_feature(feature_cls) | 251 | manager.register_feature(feature_cls) |
| 213 | return feature_cls | 252 | return feature_cls |
| @@ -221,4 +260,3 @@ global_super_kernel_feature_manager = SuperKernelFeatureManager() | |||
| 221 | def get_features(): | 260 | def get_features(): |
| 222 | global_super_kernel_feature_manager.init_available_and_enable_features() | 261 | global_super_kernel_feature_manager.init_available_and_enable_features() |
| 223 | return global_super_kernel_feature_manager.get_available_feature_versions() | 262 | return global_super_kernel_feature_manager.get_available_feature_versions() |
| 224 | - | ||
| @@ -12,23 +12,39 @@ | |||
| 12 | """ | 12 | """ |
| 13 | super kernel op infos | 13 | super kernel op infos |
| 14 | """ | 14 | """ |
| 15 | + | ||
| 15 | import os | 16 | import os |
| 16 | import json | 17 | import json |
| 17 | import subprocess | 18 | import subprocess |
| 18 | import math | 19 | import math |
| 19 | import shutil | 20 | import shutil |
| 20 | 21 | ||
| 21 | -from asc_op_compile_base.asc_op_compiler.super_kernel_utility import AscendCLogLevel, CompileStage, CommonUtility, \ | 22 | +from asc_op_compile_base.asc_op_compiler.super_kernel_utility import ( |
| 22 | - get_soc_spec | 23 | + AscendCLogLevel, |
| 24 | + CompileStage, | ||
| 25 | + CommonUtility, | ||
| 26 | + get_soc_spec, | ||
| 27 | +) | ||
| 23 | 28 | ||
| 24 | from asc_op_compile_base.common.buildcfg import get_current_build_config | 29 | from asc_op_compile_base.common.buildcfg import get_current_build_config |
| 25 | from asc_op_compile_base.common.buildcfg.buildcfg_mapping import op_debug_config | 30 | from asc_op_compile_base.common.buildcfg.buildcfg_mapping import op_debug_config |
| 26 | 31 | ||
| 27 | from .super_kernel_option_parse import parse_super_kernel_options | 32 | from .super_kernel_option_parse import parse_super_kernel_options |
| 28 | -from .super_kernel_constants import SuperKernelLinkMode, SuperKernelPreLoadMode, \ | 33 | +from .super_kernel_constants import ( |
| 29 | - SuperKernelDataCacheMode, SuperKernelEarlyStartMode, SubOperatorType, SuperKernelStreamFusionMode, \ | 34 | + SuperKernelLinkMode, |
| 30 | - SuperKernelDebugDcciAllMode, SuperKernelDebugSyncAllMode, SuperKernelFeedSyncAllMode, SuperKernelProfilingMode, \ | 35 | + SuperKernelPreLoadMode, |
| 31 | - AI_CORE_STR, ERR_CODE, SuperKernelKernelType | 36 | + SuperKernelDataCacheMode, |
| 37 | + SuperKernelEarlyStartMode, | ||
| 38 | + SubOperatorType, | ||
| 39 | + SuperKernelStreamFusionMode, | ||
| 40 | + SuperKernelDebugDcciAllMode, | ||
| 41 | + SuperKernelDebugSyncAllMode, | ||
| 42 | + SuperKernelFeedSyncAllMode, | ||
| 43 | + SuperKernelProfilingMode, | ||
| 44 | + AI_CORE_STR, | ||
| 45 | + ERR_CODE, | ||
| 46 | + SuperKernelKernelType, | ||
| 47 | +) | ||
| 32 | from .super_kernel_sub_op_infos import SubOperatorInfos | 48 | from .super_kernel_sub_op_infos import SubOperatorInfos |
| 33 | 49 | ||
| 34 | 50 | ||
| @@ -42,44 +58,60 @@ def gen_symbol_rename_file(dynamic_func_names, rename_file_path_list, split_mode | |||
| 42 | 58 | ||
| 43 | for tiling_key in dynamic_func_names: | 59 | for tiling_key in dynamic_func_names: |
| 44 | kernel_info_of_tiling_key = dynamic_func_names[tiling_key] | 60 | kernel_info_of_tiling_key = dynamic_func_names[tiling_key] |
| 45 | - for arch_name in [AI_CORE_STR, f"dav-{chip_version}-cube", f"dav-{chip_version}-vec"]: | 61 | + for arch_name in [ |
| 62 | + AI_CORE_STR, | ||
| 63 | + f"dav-{chip_version}-cube", | ||
| 64 | + f"dav-{chip_version}-vec", | ||
| 65 | + ]: | ||
| 46 | if arch_name in kernel_info_of_tiling_key: | 66 | if arch_name in kernel_info_of_tiling_key: |
| 47 | kernel_name = kernel_info_of_tiling_key[arch_name] | 67 | kernel_name = kernel_info_of_tiling_key[arch_name] |
| 48 | for i in range(1, split_mode): | 68 | for i in range(1, split_mode): |
| 49 | - new_kernel_name = f'{kernel_name}_split{i}' | 69 | + new_kernel_name = f"{kernel_name}_split{i}" |
| 50 | - lines_list[i - 1].append(f'{kernel_name} {new_kernel_name}') | 70 | + lines_list[i - 1].append(f"{kernel_name} {new_kernel_name}") |
| 51 | new_kernel_names_list[i - 1].append(new_kernel_name) | 71 | new_kernel_names_list[i - 1].append(new_kernel_name) |
| 52 | for i in range(1, split_mode): | 72 | for i in range(1, split_mode): |
| 53 | - with open(rename_file_path_list[i - 1], 'w', encoding='utf-8') as file: | 73 | + with open(rename_file_path_list[i - 1], "w", encoding="utf-8") as file: |
| 54 | for line in lines_list[i - 1]: | 74 | for line in lines_list[i - 1]: |
| 55 | - file.write(line + '\n') | 75 | + file.write(line + "\n") |
| 56 | return new_kernel_names_list | 76 | return new_kernel_names_list |
| 57 | 77 | ||
| 58 | 78 | ||
| 59 | -def split_dynamic_o_in_super_kernel(orign_bin_path, rename_file_path, i, compile_log_path): | 79 | +def split_dynamic_o_in_super_kernel( |
| 80 | + orign_bin_path, rename_file_path, i, compile_log_path | ||
| 81 | +): | ||
| 60 | filename = os.path.basename(orign_bin_path) | 82 | filename = os.path.basename(orign_bin_path) |
| 61 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() | 83 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() |
| 62 | new_bin_path = os.path.join(kernel_meta_dir, filename[:-2] + f"_split{i}.o") | 84 | new_bin_path = os.path.join(kernel_meta_dir, filename[:-2] + f"_split{i}.o") |
| 63 | if os.path.exists(new_bin_path): | 85 | if os.path.exists(new_bin_path): |
| 64 | - str_lst = f'WARNING: ALLREADY EXISTS split .o path: {new_bin_path}' | 86 | + str_lst = f"WARNING: split .o path ALREADY EXISTS: {new_bin_path}" |
| 65 | - CommonUtility.dump_compile_log([str_lst], CompileStage.SPLIT_SUB_OBJS, compile_log_path) | 87 | + CommonUtility.dump_compile_log( |
| 66 | - cmds = ['cp'] + ['-rfL'] + [f'{orign_bin_path}'] + [f'{new_bin_path}'] | 88 | + [str_lst], CompileStage.SPLIT_SUB_OBJS, compile_log_path |
| 89 | + ) | ||
| 90 | + cmds = ["cp"] + ["-rfL"] + [f"{orign_bin_path}"] + [f"{new_bin_path}"] | ||
| 67 | try: | 91 | try: |
| 68 | - CommonUtility.dump_compile_log(cmds, CompileStage.SPLIT_SUB_OBJS, compile_log_path) | 92 | + CommonUtility.dump_compile_log( |
| 93 | + cmds, CompileStage.SPLIT_SUB_OBJS, compile_log_path | ||
| 94 | + ) | ||
| 69 | subprocess.run(cmds) | 95 | subprocess.run(cmds) |
| 70 | except Exception as err: | 96 | except Exception as err: |
| 71 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (f"{' '.join(cmds)} failed", err)) | 97 | + CommonUtility().ascendc_raise_python_err( |
| 72 | - cmds = ['llvm-objcopy', f'--redefine-syms={rename_file_path}', f'{new_bin_path}'] | 98 | + ERR_CODE, (f"{' '.join(cmds)} failed", err) |
| 99 | + ) | ||
| 100 | + cmds = ["llvm-objcopy", f"--redefine-syms={rename_file_path}", f"{new_bin_path}"] | ||
| 73 | try: | 101 | try: |
| 74 | - CommonUtility.dump_compile_log(cmds, CompileStage.SPLIT_SUB_OBJS, compile_log_path) | 102 | + CommonUtility.dump_compile_log( |
| 103 | + cmds, CompileStage.SPLIT_SUB_OBJS, compile_log_path | ||
| 104 | + ) | ||
| 75 | subprocess.run(cmds) | 105 | subprocess.run(cmds) |
| 76 | except Exception as err: | 106 | except Exception as err: |
| 77 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (f"{' '.join(cmds)} failed", err)) | 107 | + CommonUtility().ascendc_raise_python_err( |
| 108 | + ERR_CODE, (f"{' '.join(cmds)} failed", err) | ||
| 109 | + ) | ||
| 78 | return new_bin_path | 110 | return new_bin_path |
| 79 | 111 | ||
| 80 | 112 | ||
| 81 | def get_sub_op_streamid(op_info): | 113 | def get_sub_op_streamid(op_info): |
| 82 | - streamid = op_info.get('stream_id') | 114 | + streamid = op_info.get("stream_id") |
| 83 | if streamid is not None: | 115 | if streamid is not None: |
| 84 | return streamid | 116 | return streamid |
| 85 | return -1 | 117 | return -1 |
| @@ -95,20 +127,31 @@ class SuperOperatorInfos: | |||
| 95 | self.info_base = [] | 127 | self.info_base = [] |
| 96 | self.super_kernel_params = [] | 128 | self.super_kernel_params = [] |
| 97 | self.enable_double_stream: bool = False | 129 | self.enable_double_stream: bool = False |
| 98 | - self.op_options = parse_super_kernel_options(kernel_infos.get("super_kernel_options", "")) | 130 | + self.op_options = parse_super_kernel_options( |
| 99 | - self.split_mode = self.op_options.get('split-mode', 4) | 131 | + kernel_infos.get("super_kernel_options", "") |
| 100 | - self.profiling_mode = self.op_options.get('profiling', SuperKernelProfilingMode.ProfilingDisable) | 132 | + ) |
| 101 | - self.stream_fusin_mode = self.op_options.get('stream-fusion', SuperKernelStreamFusionMode.StreamFusionDisable) | 133 | + self.split_mode = self.op_options.get("split-mode", 4) |
| 102 | - self.feed_sync_all_mode = self.op_options.get('feed-sync-all', | 134 | + self.profiling_mode = self.op_options.get( |
| 103 | - SuperKernelFeedSyncAllMode.FeedSyncAllDisable) | 135 | + "profiling", SuperKernelProfilingMode.ProfilingDisable |
| 104 | - self.debug_aic_num: int = self.op_options.get('debug-aic-num', 0) | 136 | + ) |
| 105 | - self.debug_aiv_num: int = self.op_options.get('debug-aiv-num', 0) | 137 | + self.stream_fusin_mode = self.op_options.get( |
| 138 | + "stream-fusion", SuperKernelStreamFusionMode.StreamFusionDisable | ||
| 139 | + ) | ||
| 140 | + self.feed_sync_all_mode = self.op_options.get( | ||
| 141 | + "feed-sync-all", SuperKernelFeedSyncAllMode.FeedSyncAllDisable | ||
| 142 | + ) | ||
| 143 | + self.debug_aic_num: int = self.op_options.get("debug-aic-num", 0) | ||
| 144 | + self.debug_aiv_num: int = self.op_options.get("debug-aiv-num", 0) | ||
| 106 | self.inner_event_id_set = set() | 145 | self.inner_event_id_set = set() |
| 107 | for index, op_info in enumerate(self.op_list): | 146 | for index, op_info in enumerate(self.op_list): |
| 108 | if "json_path" not in op_info: | 147 | if "json_path" not in op_info: |
| 109 | continue | 148 | continue |
| 110 | stream_id = get_sub_op_streamid(op_info) | 149 | stream_id = get_sub_op_streamid(op_info) |
| 111 | - self.info_base.append(SubOperatorInfos(index, op_info, stream_id, self.op_options, self.compile_log_path)) | 150 | + self.info_base.append( |
| 151 | + SubOperatorInfos( | ||
| 152 | + index, op_info, stream_id, self.op_options, self.compile_log_path | ||
| 153 | + ) | ||
| 154 | + ) | ||
| 112 | self.init_sub_operators() | 155 | self.init_sub_operators() |
| 113 | self.kernel_type: SuperKernelKernelType = SuperKernelKernelType.KERNEL_TYPE_MAX | 156 | self.kernel_type: SuperKernelKernelType = SuperKernelKernelType.KERNEL_TYPE_MAX |
| 114 | self.timestamp_option: bool = False | 157 | self.timestamp_option: bool = False |
| @@ -122,7 +165,9 @@ class SuperOperatorInfos: | |||
| 122 | self.compile_info: json = None | 165 | self.compile_info: json = None |
| 123 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() | 166 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() |
| 124 | file_name_tag = CommonUtility.get_distinct_filename_tag() + "_kernel.cpp" | 167 | file_name_tag = CommonUtility.get_distinct_filename_tag() + "_kernel.cpp" |
| 125 | - self.kernel_file = os.path.realpath(os.path.join(kernel_meta_dir, self.kernel_name + file_name_tag)) | 168 | + self.kernel_file = os.path.realpath( |
| 169 | + os.path.join(kernel_meta_dir, self.kernel_name + file_name_tag) | ||
| 170 | + ) | ||
| 126 | self.gen_op_options() | 171 | self.gen_op_options() |
| 127 | self.gen_super_kernel_params() | 172 | self.gen_super_kernel_params() |
| 128 | self.cub_op_list: list = [] | 173 | self.cub_op_list: list = [] |
| @@ -133,38 +178,52 @@ class SuperOperatorInfos: | |||
| 133 | self.insert_sync_by_stream_idx() | 178 | self.insert_sync_by_stream_idx() |
| 134 | self.print_send_recv_info("[Sync by stream idx]") | 179 | self.print_send_recv_info("[Sync by stream idx]") |
| 135 | self.insert_sync_by_event() | 180 | self.insert_sync_by_event() |
| 136 | - self.print_send_recv_info("[Sync by evnet]") | 181 | + self.print_send_recv_info("[Sync by event]") |
| 137 | self.insert_sync_for_notify() | 182 | self.insert_sync_for_notify() |
| 138 | self.print_send_recv_info("[Sync by notify]") | 183 | self.print_send_recv_info("[Sync by notify]") |
| 139 | self.optimize_sync_pass() | 184 | self.optimize_sync_pass() |
| 140 | self.print_send_recv_info("[After Optimize]") | 185 | self.print_send_recv_info("[After Optimize]") |
| 141 | 186 | ||
| 142 | def gen_op_options(self): | 187 | def gen_op_options(self): |
| 143 | - self.link_mode: SuperKernelLinkMode = \ | 188 | + self.link_mode: SuperKernelLinkMode = self.op_options.get( |
| 144 | - self.op_options.get('link-mode', SuperKernelLinkMode.PerCubeHerVecWithSuper) | 189 | + "link-mode", SuperKernelLinkMode.PerCubeHerVecWithSuper |
| 145 | - self.preload_mode: SuperKernelPreLoadMode = \ | 190 | + ) |
| 146 | - self.op_options.get('preload-code', SuperKernelPreLoadMode.PreloadByAdanvanceStep) | 191 | + self.preload_mode: SuperKernelPreLoadMode = self.op_options.get( |
| 192 | + "preload-code", SuperKernelPreLoadMode.PreloadByAdanvanceStep | ||
| 193 | + ) | ||
| 147 | if self.enable_double_stream: | 194 | if self.enable_double_stream: |
| 148 | - self.early_start_mode: SuperKernelEarlyStartMode = SuperKernelEarlyStartMode.EarlyStartDisable | 195 | + self.early_start_mode: SuperKernelEarlyStartMode = ( |
| 196 | + SuperKernelEarlyStartMode.EarlyStartDisable | ||
| 197 | + ) | ||
| 149 | else: | 198 | else: |
| 150 | - self.early_start_mode: SuperKernelEarlyStartMode = \ | 199 | + self.early_start_mode: SuperKernelEarlyStartMode = self.op_options.get( |
| 151 | - self.op_options.get('early-start', SuperKernelEarlyStartMode.EarlyStartEnableV2) | 200 | + "early-start", SuperKernelEarlyStartMode.EarlyStartEnableV2 |
| 152 | - self.datacache_mode: SuperKernelDataCacheMode = \ | 201 | + ) |
| 153 | - self.op_options.get('preload-data', SuperKernelDataCacheMode.DataCacheLoadNA) | 202 | + self.datacache_mode: SuperKernelDataCacheMode = self.op_options.get( |
| 154 | - self.debug_dcci_all_mode: SuperKernelDebugDcciAllMode = \ | 203 | + "preload-data", SuperKernelDataCacheMode.DataCacheLoadNA |
| 155 | - self.op_options.get('debug-dcci-all', SuperKernelDebugDcciAllMode.DebugDcciAllDisable) | 204 | + ) |
| 156 | - self.debug_sync_all_mode: SuperKernelDebugSyncAllMode = \ | 205 | + self.debug_dcci_all_mode: SuperKernelDebugDcciAllMode = self.op_options.get( |
| 157 | - self.op_options.get('debug-sync-all', SuperKernelDebugSyncAllMode.DebugSyncAllDisable) | 206 | + "debug-dcci-all", SuperKernelDebugDcciAllMode.DebugDcciAllDisable |
| 207 | + ) | ||
| 208 | + self.debug_sync_all_mode: SuperKernelDebugSyncAllMode = self.op_options.get( | ||
| 209 | + "debug-sync-all", SuperKernelDebugSyncAllMode.DebugSyncAllDisable | ||
| 210 | + ) | ||
| 158 | 211 | ||
| 159 | self.check_dcci_before_after_op_options() | 212 | self.check_dcci_before_after_op_options() |
| 160 | 213 | ||
| 161 | - | ||
| 162 | def print_send_recv_info(self, stage): | 214 | def print_send_recv_info(self, stage): |
| 163 | - CommonUtility.dump_compile_log([stage], CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 215 | + CommonUtility.dump_compile_log( |
| 216 | + [stage], CompileStage.SPLIT_SUB_OBJS, self.compile_log_path | ||
| 217 | + ) | ||
| 164 | for sub_op in self.info_base: | 218 | for sub_op in self.info_base: |
| 165 | - CommonUtility.dump_compile_log(\ | 219 | + CommonUtility.dump_compile_log( |
| 166 | - [f'op_name: {sub_op.kernel_name_for_multi_stream}, send_info: {sub_op.send_info}, \ | 220 | + [ |
| 167 | - recv_info: {sub_op.recv_info}'], CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 221 | + f"op_name: {sub_op.kernel_name_for_multi_stream}, send_info: {sub_op.send_info}, \ |
| 222 | + recv_info: {sub_op.recv_info}" | ||
| 223 | + ], | ||
| 224 | + CompileStage.SPLIT_SUB_OBJS, | ||
| 225 | + self.compile_log_path, | ||
| 226 | + ) | ||
| 168 | 227 | ||
| 169 | def split_op_by_kernel_type(self): | 228 | def split_op_by_kernel_type(self): |
| 170 | """ | 229 | """ |
| @@ -172,21 +231,31 @@ class SuperOperatorInfos: | |||
| 172 | vec_op_list save all vec ops and mix ops | 231 | vec_op_list save all vec ops and mix ops |
| 173 | """ | 232 | """ |
| 174 | for sub_op in self.info_base: | 233 | for sub_op in self.info_base: |
| 175 | - if sub_op.kernel_type in [SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, \ | 234 | + if sub_op.kernel_type in [ |
| 176 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0, SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1, \ | 235 | + SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, |
| 177 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2]: | 236 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0, |
| 237 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1, | ||
| 238 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2, | ||
| 239 | + ]: | ||
| 178 | self.cub_op_list.append(sub_op) | 240 | self.cub_op_list.append(sub_op) |
| 179 | - if sub_op.kernel_type in [SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, \ | 241 | + if sub_op.kernel_type in [ |
| 180 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0, SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1, \ | 242 | + SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, |
| 181 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2]: | 243 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0, |
| 244 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1, | ||
| 245 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2, | ||
| 246 | + ]: | ||
| 182 | self.vec_op_list.append(sub_op) | 247 | self.vec_op_list.append(sub_op) |
| 183 | 248 | ||
| 184 | def get_task_type(self, op): | 249 | def get_task_type(self, op): |
| 185 | - if op.kernel_type in [SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, \ | 250 | + if op.kernel_type in [ |
| 186 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0]: | 251 | + SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, |
| 252 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0, | ||
| 253 | + ]: | ||
| 187 | return "cub" | 254 | return "cub" |
| 188 | - elif op.kernel_type in [SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, \ | 255 | + elif op.kernel_type in [ |
| 189 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0]: | 256 | + SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, |
| 257 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0, | ||
| 258 | + ]: | ||
| 190 | return "vec" | 259 | return "vec" |
| 191 | else: | 260 | else: |
| 192 | return "mix" | 261 | return "mix" |
| @@ -207,7 +276,7 @@ class SuperOperatorInfos: | |||
| 207 | else: | 276 | else: |
| 208 | return "vec:cub" | 277 | return "vec:cub" |
| 209 | else: | 278 | else: |
| 210 | - return f'{pre_type}:{current_type}' | 279 | + return f"{pre_type}:{current_type}" |
| 211 | 280 | ||
| 212 | def insert_sync_event(self, pre_op, current_op): | 281 | def insert_sync_event(self, pre_op, current_op): |
| 213 | """ | 282 | """ |
| @@ -219,18 +288,26 @@ class SuperOperatorInfos: | |||
| 219 | pre_type = self.get_task_type(pre_op) | 288 | pre_type = self.get_task_type(pre_op) |
| 220 | if pre_type == "mix" or pre_type == "vec": | 289 | if pre_type == "mix" or pre_type == "vec": |
| 221 | idx = self.vec_op_list.index(pre_op) | 290 | idx = self.vec_op_list.index(pre_op) |
| 222 | - self.vec_op_list[idx].send_info[current_op.kernel_name_for_multi_stream] = sync_event | 291 | + self.vec_op_list[idx].send_info[current_op.kernel_name_for_multi_stream] = ( |
| 292 | + sync_event | ||
| 293 | + ) | ||
| 223 | if pre_type == "mix" or pre_type == "cub": | 294 | if pre_type == "mix" or pre_type == "cub": |
| 224 | idx = self.cub_op_list.index(pre_op) | 295 | idx = self.cub_op_list.index(pre_op) |
| 225 | - self.cub_op_list[idx].send_info[current_op.kernel_name_for_multi_stream] = sync_event | 296 | + self.cub_op_list[idx].send_info[current_op.kernel_name_for_multi_stream] = ( |
| 297 | + sync_event | ||
| 298 | + ) | ||
| 226 | 299 | ||
| 227 | current_type = self.get_task_type(current_op) | 300 | current_type = self.get_task_type(current_op) |
| 228 | if current_type == "mix" or current_type == "vec": | 301 | if current_type == "mix" or current_type == "vec": |
| 229 | idx = self.vec_op_list.index(current_op) | 302 | idx = self.vec_op_list.index(current_op) |
| 230 | - self.vec_op_list[idx].recv_info[pre_op.kernel_name_for_multi_stream] = sync_event | 303 | + self.vec_op_list[idx].recv_info[pre_op.kernel_name_for_multi_stream] = ( |
| 304 | + sync_event | ||
| 305 | + ) | ||
| 231 | if current_type == "mix" or current_type == "cub": | 306 | if current_type == "mix" or current_type == "cub": |
| 232 | idx = self.cub_op_list.index(current_op) | 307 | idx = self.cub_op_list.index(current_op) |
| 233 | - self.cub_op_list[idx].recv_info[pre_op.kernel_name_for_multi_stream] = sync_event | 308 | + self.cub_op_list[idx].recv_info[pre_op.kernel_name_for_multi_stream] = ( |
| 309 | + sync_event | ||
| 310 | + ) | ||
| 234 | 311 | ||
| 235 | def insert_sync_by_stream_idx(self): | 312 | def insert_sync_by_stream_idx(self): |
| 236 | """ | 313 | """ |
| @@ -250,15 +327,14 @@ class SuperOperatorInfos: | |||
| 250 | self.insert_sync_event(pre_op, current_op) | 327 | self.insert_sync_event(pre_op, current_op) |
| 251 | pre_op = current_op | 328 | pre_op = current_op |
| 252 | 329 | ||
| 253 | - | ||
| 254 | def insert_sync_by_event(self): | 330 | def insert_sync_by_event(self): |
| 255 | - ''' | 331 | + """ |
| 256 | insert sync event according to send_event_list and recv_event_list | 332 | insert sync event according to send_event_list and recv_event_list |
| 257 | e.g. | 333 | e.g. |
| 258 | op1: send_event_list [100, 101] | 334 | op1: send_event_list [100, 101] |
| 259 | op2: recv_event_list [100, 101] | 335 | op2: recv_event_list [100, 101] |
| 260 | then insert sync: op1->op2 | 336 | then insert sync: op1->op2 |
| 261 | - ''' | 337 | + """ |
| 262 | event_send = {} | 338 | event_send = {} |
| 263 | event_recv = {} | 339 | event_recv = {} |
| 264 | 340 | ||
| @@ -271,22 +347,28 @@ class SuperOperatorInfos: | |||
| 271 | for send_id in event_send.keys(): | 347 | for send_id in event_send.keys(): |
| 272 | if event_recv.get(send_id) is not None: | 348 | if event_recv.get(send_id) is not None: |
| 273 | if event_send[send_id] == event_recv[send_id]: | 349 | if event_send[send_id] == event_recv[send_id]: |
| 274 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, \ | 350 | + CommonUtility().ascendc_raise_python_err( |
| 275 | -(f"send op {event_send[send_id].kernel_name_for_multi_stream} can not same with recv op \ | 351 | + ERR_CODE, |
| 276 | -{event_recv[send_id].kernel_name_for_multi_stream}")) | 352 | + ( |
| 353 | + f"send op {event_send[send_id].kernel_name_for_multi_stream} can not same with recv op \ | ||
| 354 | +{event_recv[send_id].kernel_name_for_multi_stream}" | ||
| 355 | + ), | ||
| 356 | + ) | ||
| 277 | self.insert_sync_event(event_send[send_id], event_recv[send_id]) | 357 | self.insert_sync_event(event_send[send_id], event_recv[send_id]) |
| 278 | 358 | ||
| 279 | def insert_sync_for_notify(self): | 359 | def insert_sync_for_notify(self): |
| 280 | for sub_op in self.info_base[:-1]: | 360 | for sub_op in self.info_base[:-1]: |
| 281 | op_type = self.get_task_type(sub_op) | 361 | op_type = self.get_task_type(sub_op) |
| 282 | - if (op_type == "mix") and \ | 362 | + if (op_type == "mix") and ( |
| 283 | - (sub_op.notify_block.get('aic', "") != "" or sub_op.notify_block.get('aiv', "") != ""): | 363 | + sub_op.notify_block.get("aic", "") != "" |
| 364 | + or sub_op.notify_block.get("aiv", "") != "" | ||
| 365 | + ): | ||
| 284 | sub_op_index = self.info_base.index(sub_op) | 366 | sub_op_index = self.info_base.index(sub_op) |
| 285 | next_op = self.info_base[sub_op_index + 1] | 367 | next_op = self.info_base[sub_op_index + 1] |
| 286 | next_op_type = self.get_task_type(next_op) | 368 | next_op_type = self.get_task_type(next_op) |
| 287 | if next_op_type == "cub": | 369 | if next_op_type == "cub": |
| 288 | - sub_op.notify_block['aic'] = sub_op.tmp_notify_block.get('aic', "") | 370 | + sub_op.notify_block["aic"] = sub_op.tmp_notify_block.get("aic", "") |
| 289 | - sub_op.notify_block['aiv'] = sub_op.tmp_notify_block.get('aiv', "") | 371 | + sub_op.notify_block["aiv"] = sub_op.tmp_notify_block.get("aiv", "") |
| 290 | if next_op.stream_index != sub_op.stream_index: | 372 | if next_op.stream_index != sub_op.stream_index: |
| 291 | flag = False | 373 | flag = False |
| 292 | for sub_send_info in sub_op.send_info: | 374 | for sub_send_info in sub_op.send_info: |
| @@ -295,8 +377,9 @@ class SuperOperatorInfos: | |||
| 295 | if flag is False: | 377 | if flag is False: |
| 296 | self.insert_sync_event(sub_op, next_op) | 378 | self.insert_sync_event(sub_op, next_op) |
| 297 | 379 | ||
| 298 | - | 380 | + def remove_info_by_name( |
| 299 | - def remove_info_by_name(self, send_op_name, recv_op_name, is_delete_recv_info, update_content=""): | 381 | + self, send_op_name, recv_op_name, is_delete_recv_info, update_content="" |
| 382 | + ): | ||
| 300 | """delete sync event | 383 | """delete sync event |
| 301 | Args: | 384 | Args: |
| 302 | send_op_name (str): sent op name | 385 | send_op_name (str): sent op name |
| @@ -310,14 +393,13 @@ class SuperOperatorInfos: | |||
| 310 | if is_delete_recv_info is True: | 393 | if is_delete_recv_info is True: |
| 311 | sub_op.recv_info.pop(recv_op_name, "unknown") | 394 | sub_op.recv_info.pop(recv_op_name, "unknown") |
| 312 | else: | 395 | else: |
| 313 | - sub_op.send_info.pop(recv_op_name, 'unknown') | 396 | + sub_op.send_info.pop(recv_op_name, "unknown") |
| 314 | else: | 397 | else: |
| 315 | if is_delete_recv_info is True: | 398 | if is_delete_recv_info is True: |
| 316 | sub_op.recv_info[recv_op_name] = update_content | 399 | sub_op.recv_info[recv_op_name] = update_content |
| 317 | else: | 400 | else: |
| 318 | sub_op.send_info[recv_op_name] = update_content | 401 | sub_op.send_info[recv_op_name] = update_content |
| 319 | 402 | ||
| 320 | - | ||
| 321 | def get_remain_events(self, origin_events, delete_event): | 403 | def get_remain_events(self, origin_events, delete_event): |
| 322 | split_events = origin_events.split(";") | 404 | split_events = origin_events.split(";") |
| 323 | remain_events = [] | 405 | remain_events = [] |
| @@ -328,7 +410,6 @@ class SuperOperatorInfos: | |||
| 328 | 410 | ||
| 329 | return ";".join(remain_events) | 411 | return ";".join(remain_events) |
| 330 | 412 | ||
| 331 | - | ||
| 332 | def get_idx(self, op_name, is_vec_list): | 413 | def get_idx(self, op_name, is_vec_list): |
| 333 | """ | 414 | """ |
| 334 | get idx in vec_op_list or cub_op_list | 415 | get idx in vec_op_list or cub_op_list |
| @@ -353,7 +434,9 @@ class SuperOperatorInfos: | |||
| 353 | for key, value in sub_op.recv_info.items(): | 434 | for key, value in sub_op.recv_info.items(): |
| 354 | if "cub:vec" in value: | 435 | if "cub:vec" in value: |
| 355 | send_idx1 = self.get_idx(key, False) | 436 | send_idx1 = self.get_idx(key, False) |
| 356 | - recv_idx1 = self.get_idx(sub_op.kernel_name_for_multi_stream, True) | 437 | + recv_idx1 = self.get_idx( |
| 438 | + sub_op.kernel_name_for_multi_stream, True | ||
| 439 | + ) | ||
| 357 | if recv_idx1 < recv_idx and send_idx1 > send_idx: | 440 | if recv_idx1 < recv_idx and send_idx1 > send_idx: |
| 358 | return True | 441 | return True |
| 359 | return False | 442 | return False |
| @@ -364,12 +447,13 @@ class SuperOperatorInfos: | |||
| 364 | for key, value in sub_op.recv_info.items(): | 447 | for key, value in sub_op.recv_info.items(): |
| 365 | if "vec:cub" in value: | 448 | if "vec:cub" in value: |
| 366 | send_idx1 = self.get_idx(key, True) | 449 | send_idx1 = self.get_idx(key, True) |
| 367 | - recv_idx1 = self.get_idx(sub_op.kernel_name_for_multi_stream, False) | 450 | + recv_idx1 = self.get_idx( |
| 451 | + sub_op.kernel_name_for_multi_stream, False | ||
| 452 | + ) | ||
| 368 | if recv_idx1 < recv_idx and send_idx1 > send_idx: | 453 | if recv_idx1 < recv_idx and send_idx1 > send_idx: |
| 369 | return True | 454 | return True |
| 370 | return False | 455 | return False |
| 371 | 456 | ||
| 372 | - | ||
| 373 | def remove_crossed_line_sync(self): | 457 | def remove_crossed_line_sync(self): |
| 374 | delete_event = [] | 458 | delete_event = [] |
| 375 | for sub_op in self.cub_op_list: | 459 | for sub_op in self.cub_op_list: |
| @@ -377,33 +461,56 @@ class SuperOperatorInfos: | |||
| 377 | value_list = value.split(";") | 461 | value_list = value.split(";") |
| 378 | for sub_value in value_list: | 462 | for sub_value in value_list: |
| 379 | if sub_value in "cub:vec": | 463 | if sub_value in "cub:vec": |
| 380 | - flag = self.judge_remove(sub_op.kernel_name_for_multi_stream, key, True) | 464 | + flag = self.judge_remove( |
| 465 | + sub_op.kernel_name_for_multi_stream, key, True | ||
| 466 | + ) | ||
| 381 | if flag is True: | 467 | if flag is True: |
| 382 | - delete_event.append(\ | 468 | + delete_event.append( |
| 383 | - [sub_op.kernel_name_for_multi_stream, key, False, \ | 469 | + [ |
| 384 | - self.get_remain_events(value, "cub:vec")]) | 470 | + sub_op.kernel_name_for_multi_stream, |
| 385 | - delete_event.append(\ | 471 | + key, |
| 386 | - [key, sub_op.kernel_name_for_multi_stream, True, \ | 472 | + False, |
| 387 | - self.get_remain_events(value, "cub:vec")]) | 473 | + self.get_remain_events(value, "cub:vec"), |
| 474 | + ] | ||
| 475 | + ) | ||
| 476 | + delete_event.append( | ||
| 477 | + [ | ||
| 478 | + key, | ||
| 479 | + sub_op.kernel_name_for_multi_stream, | ||
| 480 | + True, | ||
| 481 | + self.get_remain_events(value, "cub:vec"), | ||
| 482 | + ] | ||
| 483 | + ) | ||
| 388 | 484 | ||
| 389 | for sub_op in self.vec_op_list: | 485 | for sub_op in self.vec_op_list: |
| 390 | for key, value in sub_op.send_info.items(): | 486 | for key, value in sub_op.send_info.items(): |
| 391 | value_list = value.split(";") | 487 | value_list = value.split(";") |
| 392 | for sub_value in value_list: | 488 | for sub_value in value_list: |
| 393 | if sub_value in "vec:cub": | 489 | if sub_value in "vec:cub": |
| 394 | - flag = self.judge_remove(sub_op.kernel_name_for_multi_stream, key, False) | 490 | + flag = self.judge_remove( |
| 491 | + sub_op.kernel_name_for_multi_stream, key, False | ||
| 492 | + ) | ||
| 395 | if flag is True: | 493 | if flag is True: |
| 396 | - delete_event.append(\ | 494 | + delete_event.append( |
| 397 | - [sub_op.kernel_name_for_multi_stream, key, False, \ | 495 | + [ |
| 398 | - self.get_remain_events(value, "vec:cub")]) | 496 | + sub_op.kernel_name_for_multi_stream, |
| 399 | - delete_event.append(\ | 497 | + key, |
| 400 | - [key, sub_op.kernel_name_for_multi_stream, True, \ | 498 | + False, |
| 401 | - self.get_remain_events(value, "vec:cub")]) | 499 | + self.get_remain_events(value, "vec:cub"), |
| 500 | + ] | ||
| 501 | + ) | ||
| 502 | + delete_event.append( | ||
| 503 | + [ | ||
| 504 | + key, | ||
| 505 | + sub_op.kernel_name_for_multi_stream, | ||
| 506 | + True, | ||
| 507 | + self.get_remain_events(value, "vec:cub"), | ||
| 508 | + ] | ||
| 509 | + ) | ||
| 402 | 510 | ||
| 403 | for item in delete_event: | 511 | for item in delete_event: |
| 404 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) | 512 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) |
| 405 | 513 | ||
| 406 | - | ||
| 407 | def remove_multi_send_info(self): | 514 | def remove_multi_send_info(self): |
| 408 | delete_event = [] | 515 | delete_event = [] |
| 409 | for op in self.vec_op_list: | 516 | for op in self.vec_op_list: |
| @@ -415,12 +522,22 @@ class SuperOperatorInfos: | |||
| 415 | if len(send_info_list) > 1: | 522 | if len(send_info_list) > 1: |
| 416 | send_info_list.sort(key=lambda x: x[2]) | 523 | send_info_list.sort(key=lambda x: x[2]) |
| 417 | for sub_info in send_info_list[1:]: | 524 | for sub_info in send_info_list[1:]: |
| 418 | - delete_event.append(\ | 525 | + delete_event.append( |
| 419 | - [op.kernel_name_for_multi_stream, sub_info[0], False, \ | 526 | + [ |
| 420 | - self.get_remain_events(sub_info[1], "vec:cub")]) | 527 | + op.kernel_name_for_multi_stream, |
| 421 | - delete_event.append(\ | 528 | + sub_info[0], |
| 422 | - [sub_info[0], op.kernel_name_for_multi_stream, True, \ | 529 | + False, |
| 423 | - self.get_remain_events(sub_info[1], "vec:cub")]) | 530 | + self.get_remain_events(sub_info[1], "vec:cub"), |
| 531 | + ] | ||
| 532 | + ) | ||
| 533 | + delete_event.append( | ||
| 534 | + [ | ||
| 535 | + sub_info[0], | ||
| 536 | + op.kernel_name_for_multi_stream, | ||
| 537 | + True, | ||
| 538 | + self.get_remain_events(sub_info[1], "vec:cub"), | ||
| 539 | + ] | ||
| 540 | + ) | ||
| 424 | 541 | ||
| 425 | for item in delete_event: | 542 | for item in delete_event: |
| 426 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) | 543 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) |
| @@ -435,17 +552,26 @@ class SuperOperatorInfos: | |||
| 435 | if len(send_info_list) > 1: | 552 | if len(send_info_list) > 1: |
| 436 | send_info_list.sort(key=lambda x: x[2]) | 553 | send_info_list.sort(key=lambda x: x[2]) |
| 437 | for sub_info in send_info_list[1:]: | 554 | for sub_info in send_info_list[1:]: |
| 438 | - delete_event.append(\ | 555 | + delete_event.append( |
| 439 | - [op.kernel_name_for_multi_stream, sub_info[0], False, \ | 556 | + [ |
| 440 | - self.get_remain_events(sub_info[1], "cub:vec")]) | 557 | + op.kernel_name_for_multi_stream, |
| 441 | - delete_event.append(\ | 558 | + sub_info[0], |
| 442 | - [sub_info[0], op.kernel_name_for_multi_stream, True, \ | 559 | + False, |
| 443 | - self.get_remain_events(sub_info[1], "cub:vec")]) | 560 | + self.get_remain_events(sub_info[1], "cub:vec"), |
| 561 | + ] | ||
| 562 | + ) | ||
| 563 | + delete_event.append( | ||
| 564 | + [ | ||
| 565 | + sub_info[0], | ||
| 566 | + op.kernel_name_for_multi_stream, | ||
| 567 | + True, | ||
| 568 | + self.get_remain_events(sub_info[1], "cub:vec"), | ||
| 569 | + ] | ||
| 570 | + ) | ||
| 444 | 571 | ||
| 445 | for item in delete_event: | 572 | for item in delete_event: |
| 446 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) | 573 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) |
| 447 | 574 | ||
| 448 | - | ||
| 449 | def remove_multi_recv_info(self): | 575 | def remove_multi_recv_info(self): |
| 450 | delete_event = [] | 576 | delete_event = [] |
| 451 | for op in self.vec_op_list: | 577 | for op in self.vec_op_list: |
| @@ -457,12 +583,22 @@ class SuperOperatorInfos: | |||
| 457 | if len(recv_info_list) > 1: | 583 | if len(recv_info_list) > 1: |
| 458 | recv_info_list.sort(key=lambda x: x[2], reverse=True) | 584 | recv_info_list.sort(key=lambda x: x[2], reverse=True) |
| 459 | for sub_info in recv_info_list[1:]: | 585 | for sub_info in recv_info_list[1:]: |
| 460 | - delete_event.append(\ | 586 | + delete_event.append( |
| 461 | - [op.kernel_name_for_multi_stream, sub_info[0], True, \ | 587 | + [ |
| 462 | - self.get_remain_events(sub_info[1], "cub:vec")]) | 588 | + op.kernel_name_for_multi_stream, |
| 463 | - delete_event.append(\ | 589 | + sub_info[0], |
| 464 | - [sub_info[0], op.kernel_name_for_multi_stream, False, \ | 590 | + True, |
| 465 | - self.get_remain_events(sub_info[1], "cub:vec")]) | 591 | + self.get_remain_events(sub_info[1], "cub:vec"), |
| 592 | + ] | ||
| 593 | + ) | ||
| 594 | + delete_event.append( | ||
| 595 | + [ | ||
| 596 | + sub_info[0], | ||
| 597 | + op.kernel_name_for_multi_stream, | ||
| 598 | + False, | ||
| 599 | + self.get_remain_events(sub_info[1], "cub:vec"), | ||
| 600 | + ] | ||
| 601 | + ) | ||
| 466 | 602 | ||
| 467 | for item in delete_event: | 603 | for item in delete_event: |
| 468 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) | 604 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) |
| @@ -477,45 +613,67 @@ class SuperOperatorInfos: | |||
| 477 | if len(recv_info_list) > 1: | 613 | if len(recv_info_list) > 1: |
| 478 | recv_info_list.sort(key=lambda x: x[2], reverse=True) | 614 | recv_info_list.sort(key=lambda x: x[2], reverse=True) |
| 479 | for sub_info in recv_info_list[1:]: | 615 | for sub_info in recv_info_list[1:]: |
| 480 | - delete_event.append(\ | 616 | + delete_event.append( |
| 481 | - [op.kernel_name_for_multi_stream, sub_info[0], True, \ | 617 | + [ |
| 482 | - self.get_remain_events(sub_info[1], "vec:cub")]) | 618 | + op.kernel_name_for_multi_stream, |
| 483 | - delete_event.append(\ | 619 | + sub_info[0], |
| 484 | - [sub_info[0], op.kernel_name_for_multi_stream, False, \ | 620 | + True, |
| 485 | - self.get_remain_events(sub_info[1], "vec:cub")]) | 621 | + self.get_remain_events(sub_info[1], "vec:cub"), |
| 622 | + ] | ||
| 623 | + ) | ||
| 624 | + delete_event.append( | ||
| 625 | + [ | ||
| 626 | + sub_info[0], | ||
| 627 | + op.kernel_name_for_multi_stream, | ||
| 628 | + False, | ||
| 629 | + self.get_remain_events(sub_info[1], "vec:cub"), | ||
| 630 | + ] | ||
| 631 | + ) | ||
| 486 | 632 | ||
| 487 | for item in delete_event: | 633 | for item in delete_event: |
| 488 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) | 634 | self.remove_info_by_name(item[0], item[1], item[2], item[3]) |
| 489 | 635 | ||
| 490 | - | ||
| 491 | def optimize_sync_pass(self): | 636 | def optimize_sync_pass(self): |
| 492 | CommonUtility.print_compile_log("", "[INIT STATE]:", AscendCLogLevel.LOG_DEBUG) | 637 | CommonUtility.print_compile_log("", "[INIT STATE]:", AscendCLogLevel.LOG_DEBUG) |
| 493 | self.print_vec_cub_list_info() | 638 | self.print_vec_cub_list_info() |
| 494 | self.remove_crossed_line_sync() | 639 | self.remove_crossed_line_sync() |
| 495 | - CommonUtility.print_compile_log("", "[AFTER REMOVE CORESS LINE SYNC]:", AscendCLogLevel.LOG_DEBUG) | 640 | + CommonUtility.print_compile_log( |
| 641 | + "", "[AFTER REMOVE CROSS LINE SYNC]:", AscendCLogLevel.LOG_DEBUG | ||
| 642 | + ) | ||
| 496 | self.print_vec_cub_list_info() | 643 | self.print_vec_cub_list_info() |
| 497 | self.remove_multi_send_info() | 644 | self.remove_multi_send_info() |
| 498 | self.remove_multi_recv_info() | 645 | self.remove_multi_recv_info() |
| 499 | - CommonUtility.print_compile_log("", "[AFTER REMOVE MULTI EVENT SYNC]:", AscendCLogLevel.LOG_DEBUG) | 646 | + CommonUtility.print_compile_log( |
| 647 | + "", "[AFTER REMOVE MULTI EVENT SYNC]:", AscendCLogLevel.LOG_DEBUG | ||
| 648 | + ) | ||
| 500 | self.print_vec_cub_list_info() | 649 | self.print_vec_cub_list_info() |
| 501 | 650 | ||
| 502 | def print_vec_cub_list_info(self): | 651 | def print_vec_cub_list_info(self): |
| 503 | CommonUtility.print_compile_log("", "[VEC LIST OP]:", AscendCLogLevel.LOG_DEBUG) | 652 | CommonUtility.print_compile_log("", "[VEC LIST OP]:", AscendCLogLevel.LOG_DEBUG) |
| 504 | for sub_op in self.vec_op_list: | 653 | for sub_op in self.vec_op_list: |
| 505 | - CommonUtility.print_compile_log("", f"op_name: {sub_op.kernel_name_for_multi_stream}, \ | 654 | + CommonUtility.print_compile_log( |
| 655 | + "", | ||
| 656 | + f"op_name: {sub_op.kernel_name_for_multi_stream}, \ | ||
| 506 | stream_idx: {sub_op.stream_index}, send_info: {sub_op.send_info}, \ | 657 | stream_idx: {sub_op.stream_index}, send_info: {sub_op.send_info}, \ |
| 507 | - recv_info: {sub_op.recv_info}", AscendCLogLevel.LOG_DEBUG) | 658 | + recv_info: {sub_op.recv_info}", |
| 659 | + AscendCLogLevel.LOG_DEBUG, | ||
| 660 | + ) | ||
| 508 | CommonUtility.print_compile_log("", "[CUB LIST OP]:", AscendCLogLevel.LOG_DEBUG) | 661 | CommonUtility.print_compile_log("", "[CUB LIST OP]:", AscendCLogLevel.LOG_DEBUG) |
| 509 | for sub_op in self.cub_op_list: | 662 | for sub_op in self.cub_op_list: |
| 510 | - CommonUtility.print_compile_log("", f"op_name: {sub_op.kernel_name_for_multi_stream}, \ | 663 | + CommonUtility.print_compile_log( |
| 664 | + "", | ||
| 665 | + f"op_name: {sub_op.kernel_name_for_multi_stream}, \ | ||
| 511 | stream_idx: {sub_op.stream_index}, send_info: {sub_op.send_info}, \ | 666 | stream_idx: {sub_op.stream_index}, send_info: {sub_op.send_info}, \ |
| 512 | - recv_info: {sub_op.recv_info}", AscendCLogLevel.LOG_DEBUG) | 667 | + recv_info: {sub_op.recv_info}", |
| 668 | + AscendCLogLevel.LOG_DEBUG, | ||
| 669 | + ) | ||
| 513 | 670 | ||
| 514 | def creat_compile_log(self): | 671 | def creat_compile_log(self): |
| 515 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() | 672 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() |
| 516 | distinct_tag = CommonUtility.get_distinct_filename_tag() | 673 | distinct_tag = CommonUtility.get_distinct_filename_tag() |
| 517 | - self.compile_log_path = os.path.join(kernel_meta_dir, self.kernel_name + distinct_tag + '.log') | 674 | + self.compile_log_path = os.path.join( |
| 518 | - | 675 | + kernel_meta_dir, self.kernel_name + distinct_tag + ".log" |
| 676 | + ) | ||
| 519 | 677 | ||
| 520 | def sub_op_connect_set(self, former_op, op): | 678 | def sub_op_connect_set(self, former_op, op): |
| 521 | former_send_list = former_op.send_event_list | 679 | former_send_list = former_op.send_event_list |
| @@ -525,58 +683,84 @@ class SuperOperatorInfos: | |||
| 525 | union_set = former_send_set & recv_set | 683 | union_set = former_send_set & recv_set |
| 526 | return union_set | 684 | return union_set |
| 527 | 685 | ||
| 528 | - | ||
| 529 | def find_all_inner_event_id_set(self): | 686 | def find_all_inner_event_id_set(self): |
| 530 | sub_num = len(self.info_base) | 687 | sub_num = len(self.info_base) |
| 531 | if sub_num <= 1: | 688 | if sub_num <= 1: |
| 532 | return | 689 | return |
| 533 | for i in range(0, sub_num - 1): | 690 | for i in range(0, sub_num - 1): |
| 534 | for j in range(i + 1, sub_num): | 691 | for j in range(i + 1, sub_num): |
| 535 | - connect_set = self.sub_op_connect_set(self.info_base[i], self.info_base[j]) | 692 | + connect_set = self.sub_op_connect_set( |
| 536 | - if self.info_base[i].stream_index == self.info_base[j].stream_index and connect_set: | 693 | + self.info_base[i], self.info_base[j] |
| 537 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (\ | 694 | + ) |
| 538 | -f"ERROR: super kernel do not support self send/receive pair within 1 real stream: oplist: {self.op_list} ")) | 695 | + if ( |
| 696 | + self.info_base[i].stream_index == self.info_base[j].stream_index | ||
| 697 | + and connect_set | ||
| 698 | + ): | ||
| 699 | + CommonUtility().ascendc_raise_python_err( | ||
| 700 | + ERR_CODE, | ||
| 701 | + ( | ||
| 702 | + f"ERROR: super kernel do not support self send/receive pair within 1 real stream: oplist: {self.op_list} " | ||
| 703 | + ), | ||
| 704 | + ) | ||
| 539 | elif connect_set: | 705 | elif connect_set: |
| 540 | self.inner_event_id_set.update(connect_set) | 706 | self.inner_event_id_set.update(connect_set) |
| 541 | 707 | ||
| 542 | - | ||
| 543 | - | ||
| 544 | def check_sp_has_two_real_stream(self): | 708 | def check_sp_has_two_real_stream(self): |
| 545 | former_op = None | 709 | former_op = None |
| 546 | for _, op in enumerate(self.info_base): | 710 | for _, op in enumerate(self.info_base): |
| 547 | if former_op is not None: | 711 | if former_op is not None: |
| 548 | self_connet_set = self.sub_op_connect_set(op, op) | 712 | self_connet_set = self.sub_op_connect_set(op, op) |
| 549 | if self.sub_op_connect_set(op, op): | 713 | if self.sub_op_connect_set(op, op): |
| 550 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (\ | 714 | + CommonUtility().ascendc_raise_python_err( |
| 551 | - f"ERROR: exists send-recv event pair within 1 op:"\ | 715 | + ERR_CODE, |
| 552 | - f" {op.kernel_name}, event id: {self_connet_set}, oplist:{self.op_list}")) | 716 | + ( |
| 717 | + f"ERROR: exists send-recv event pair within 1 op:" | ||
| 718 | + f" {op.kernel_name}, event id: {self_connet_set}, oplist:{self.op_list}" | ||
| 719 | + ), | ||
| 720 | + ) | ||
| 553 | connect_set = self.sub_op_connect_set(former_op, op) | 721 | connect_set = self.sub_op_connect_set(former_op, op) |
| 554 | if former_op.stream_index == op.stream_index and connect_set: | 722 | if former_op.stream_index == op.stream_index and connect_set: |
| 555 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (\ | 723 | + CommonUtility().ascendc_raise_python_err( |
| 556 | -f"ERROR: super kernel do not support self send/receive pair within 1 real stream: oplist: {self.op_list} ")) | 724 | + ERR_CODE, |
| 725 | + ( | ||
| 726 | + f"ERROR: super kernel do not support self send/receive pair within 1 real stream: oplist: {self.op_list} " | ||
| 727 | + ), | ||
| 728 | + ) | ||
| 557 | elif former_op.stream_index != op.stream_index and not connect_set: | 729 | elif former_op.stream_index != op.stream_index and not connect_set: |
| 558 | - if self.stream_fusin_mode.value == SuperKernelStreamFusionMode.StreamFusionEnable.value: | 730 | + if ( |
| 559 | - CommonUtility.print_compile_log("", \ | 731 | + self.stream_fusin_mode.value |
| 560 | - f"enter into 2 real stream mode, oplist: {self.op_list} ", AscendCLogLevel.LOG_DEBUG) | 732 | + == SuperKernelStreamFusionMode.StreamFusionEnable.value |
| 733 | + ): | ||
| 734 | + CommonUtility.print_compile_log( | ||
| 735 | + "", | ||
| 736 | + f"enter into 2 real stream mode, oplist: {self.op_list} ", | ||
| 737 | + AscendCLogLevel.LOG_DEBUG, | ||
| 738 | + ) | ||
| 561 | self.enable_double_stream = True | 739 | self.enable_double_stream = True |
| 562 | break | 740 | break |
| 563 | else: | 741 | else: |
| 564 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (\ | 742 | + CommonUtility().ascendc_raise_python_err( |
| 565 | - f"ERROR: super kernel do not support more than 2 real stream, use " \ | 743 | + ERR_CODE, |
| 566 | - f"'options=\"stream-fusion=1\"' to enable operators fusion on multi-stream, " \ | 744 | + ( |
| 567 | - f"oplist: {self.op_list} ")) | 745 | + f"ERROR: super kernel do not support more than 2 real stream, use " |
| 746 | + f"'options=\"stream-fusion=1\"' to enable operators fusion on multi-stream, " | ||
| 747 | + f"oplist: {self.op_list} " | ||
| 748 | + ), | ||
| 749 | + ) | ||
| 568 | if connect_set: | 750 | if connect_set: |
| 569 | self.inner_event_id_set.update(connect_set) | 751 | self.inner_event_id_set.update(connect_set) |
| 570 | former_op = op | 752 | former_op = op |
| 571 | self.find_all_inner_event_id_set() | 753 | self.find_all_inner_event_id_set() |
| 572 | 754 | ||
| 573 | - | ||
| 574 | def init_sub_operators(self): | 755 | def init_sub_operators(self): |
| 575 | for sub_op in self.info_base: | 756 | for sub_op in self.info_base: |
| 576 | sub_op.init_of_sub_operator_info() | 757 | sub_op.init_of_sub_operator_info() |
| 577 | self.check_sp_has_two_real_stream() | 758 | self.check_sp_has_two_real_stream() |
| 578 | - CommonUtility.dump_compile_log(['###INNER_ID:'] + list(self.inner_event_id_set), \ | 759 | + CommonUtility.dump_compile_log( |
| 579 | - CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 760 | + ["###INNER_ID:"] + list(self.inner_event_id_set), |
| 761 | + CompileStage.SPLIT_SUB_OBJS, | ||
| 762 | + self.compile_log_path, | ||
| 763 | + ) | ||
| 580 | 764 | ||
| 581 | param_offset = 0 | 765 | param_offset = 0 |
| 582 | # c310 do not have ffts_addr | 766 | # c310 do not have ffts_addr |
| @@ -587,16 +771,15 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 587 | sub_op.code_gen(self.inner_event_id_set, self.enable_double_stream) | 771 | sub_op.code_gen(self.inner_event_id_set, self.enable_double_stream) |
| 588 | param_offset += len(sub_op.kernel_params) + len(sub_op.extra_kernel_params) | 772 | param_offset += len(sub_op.kernel_params) + len(sub_op.extra_kernel_params) |
| 589 | 773 | ||
| 590 | - | ||
| 591 | def warn_op_sequence_with_no_dcci_option(self, op_sequence_with_no_dcci_option): | 774 | def warn_op_sequence_with_no_dcci_option(self, op_sequence_with_no_dcci_option): |
| 592 | if len(op_sequence_with_no_dcci_option) == 0: | 775 | if len(op_sequence_with_no_dcci_option) == 0: |
| 593 | return | 776 | return |
| 594 | 777 | ||
| 595 | CommonUtility.print_compile_log( | 778 | CommonUtility.print_compile_log( |
| 596 | "", | 779 | "", |
| 597 | - f"[Super Kernel] There are more than 2 consecutive sub-operators with option dcci-disable-on-kernel, " | 780 | + "[Super Kernel] There are more than 2 consecutive sub-operators with option dcci-disable-on-kernel, " |
| 598 | - f"may lead to data cache consistency issue.", | 781 | + "may lead to data cache consistency issue.", |
| 599 | - AscendCLogLevel.LOG_WARNING | 782 | + AscendCLogLevel.LOG_WARNING, |
| 600 | ) | 783 | ) |
| 601 | 784 | ||
| 602 | for seq_id, seq in enumerate(op_sequence_with_no_dcci_option): | 785 | for seq_id, seq in enumerate(op_sequence_with_no_dcci_option): |
| @@ -605,10 +788,9 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 605 | CommonUtility.print_compile_log( | 788 | CommonUtility.print_compile_log( |
| 606 | "", | 789 | "", |
| 607 | f"[Super Kernel] Operator sequence {seq_id}, op_kernel_name {op_id}: {op_kernel_name}", | 790 | f"[Super Kernel] Operator sequence {seq_id}, op_kernel_name {op_id}: {op_kernel_name}", |
| 608 | - AscendCLogLevel.LOG_WARNING | 791 | + AscendCLogLevel.LOG_WARNING, |
| 609 | ) | 792 | ) |
| 610 | 793 | ||
| 611 | - | ||
| 612 | def check_dcci_before_after_op_options(self): | 794 | def check_dcci_before_after_op_options(self): |
| 613 | op_sequence_with_no_dcci_option = [] | 795 | op_sequence_with_no_dcci_option = [] |
| 614 | current_sequence = [] | 796 | current_sequence = [] |
| @@ -626,7 +808,6 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 626 | 808 | ||
| 627 | self.warn_op_sequence_with_no_dcci_option(op_sequence_with_no_dcci_option) | 809 | self.warn_op_sequence_with_no_dcci_option(op_sequence_with_no_dcci_option) |
| 628 | 810 | ||
| 629 | - | ||
| 630 | def check_debug_aic_aiv_num_ratio(self): | 811 | def check_debug_aic_aiv_num_ratio(self): |
| 631 | # aic:aiv ratio should be 1:0 or 0:1 or 1:1 or 1:2 | 812 | # aic:aiv ratio should be 1:0 or 0:1 or 1:1 or 1:2 |
| 632 | if self.debug_aic_num == 0 or self.debug_aiv_num == 0: | 813 | if self.debug_aic_num == 0 or self.debug_aiv_num == 0: |
| @@ -638,67 +819,77 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 638 | CommonUtility().ascendc_raise_python_err( | 819 | CommonUtility().ascendc_raise_python_err( |
| 639 | ERR_CODE, | 820 | ERR_CODE, |
| 640 | f"[Super Kernel][ERROR]: ratio of super kernel options debug-aic-num {self.debug_aic_num} " | 821 | f"[Super Kernel][ERROR]: ratio of super kernel options debug-aic-num {self.debug_aic_num} " |
| 641 | - f"to debug-aiv-num {self.debug_aiv_num} is invalid. Should be 1:0 or 0:1 or 1:1 or 1:2." | 822 | + f"to debug-aiv-num {self.debug_aiv_num} is invalid. Should be 1:0 or 0:1 or 1:1 or 1:2.", |
| 642 | ) | 823 | ) |
| 643 | 824 | ||
| 644 | - | ||
| 645 | def check_debug_aic_aiv_num_exceed_platform_num_blocks(self): | 825 | def check_debug_aic_aiv_num_exceed_platform_num_blocks(self): |
| 646 | - max_aic_num = int(get_soc_spec('ai_core_cnt')) | 826 | + max_aic_num = int(get_soc_spec("ai_core_cnt")) |
| 647 | - max_aiv_num = int(get_soc_spec('vector_core_cnt')) | 827 | + max_aiv_num = int(get_soc_spec("vector_core_cnt")) |
| 648 | if self.debug_aic_num > max_aic_num: | 828 | if self.debug_aic_num > max_aic_num: |
| 649 | CommonUtility().ascendc_raise_python_err( | 829 | CommonUtility().ascendc_raise_python_err( |
| 650 | ERR_CODE, | 830 | ERR_CODE, |
| 651 | f"[Super Kernel][ERROR]: super kernel option debug-aic-num {self.debug_aic_num} " | 831 | f"[Super Kernel][ERROR]: super kernel option debug-aic-num {self.debug_aic_num} " |
| 652 | - f"exceeds current platform max aic num {max_aic_num}." | 832 | + f"exceeds current platform max aic num {max_aic_num}.", |
| 653 | ) | 833 | ) |
| 654 | 834 | ||
| 655 | if self.debug_aiv_num > max_aiv_num: | 835 | if self.debug_aiv_num > max_aiv_num: |
| 656 | CommonUtility().ascendc_raise_python_err( | 836 | CommonUtility().ascendc_raise_python_err( |
| 657 | ERR_CODE, | 837 | ERR_CODE, |
| 658 | f"[Super Kernel][ERROR]: super kernel option debug-aiv-num {self.debug_aiv_num} " | 838 | f"[Super Kernel][ERROR]: super kernel option debug-aiv-num {self.debug_aiv_num} " |
| 659 | - f"exceeds current platform max aiv num {max_aiv_num}." | 839 | + f"exceeds current platform max aiv num {max_aiv_num}.", |
| 660 | ) | 840 | ) |
| 661 | 841 | ||
| 662 | - | 842 | + def raise_exceed_sub_op_aic_aiv_num_error( |
| 663 | - def raise_exceed_sub_op_aic_aiv_num_error(self, case_str, aic_or_aiv, debug_block_num, sub_op_block_num): | 843 | + self, case_str, aic_or_aiv, debug_block_num, sub_op_block_num |
| 844 | + ): | ||
| 664 | CommonUtility().ascendc_raise_python_err( | 845 | CommonUtility().ascendc_raise_python_err( |
| 665 | ERR_CODE, | 846 | ERR_CODE, |
| 666 | f"[Super Kernel][ERROR]: In super kernel {case_str} case, " | 847 | f"[Super Kernel][ERROR]: In super kernel {case_str} case, " |
| 667 | f"option debug-{aic_or_aiv}-num {debug_block_num} should not " | 848 | f"option debug-{aic_or_aiv}-num {debug_block_num} should not " |
| 668 | - f"be less than max sub op {aic_or_aiv} num {sub_op_block_num}." | 849 | + f"be less than max sub op {aic_or_aiv} num {sub_op_block_num}.", |
| 669 | ) | 850 | ) |
| 670 | 851 | ||
| 671 | - | ||
| 672 | def check_debug_aic_aiv_num_exceed_sub_op_aic_aiv_num(self): | 852 | def check_debug_aic_aiv_num_exceed_sub_op_aic_aiv_num(self): |
| 673 | if self.debug_aic_num == 0 and self.debug_aiv_num == 0: | 853 | if self.debug_aic_num == 0 and self.debug_aiv_num == 0: |
| 674 | return | 854 | return |
| 675 | 855 | ||
| 676 | if self.kernel_type in [ | 856 | if self.kernel_type in [ |
| 677 | SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, | 857 | SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, |
| 678 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0 | 858 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0, |
| 679 | ]: | 859 | ]: |
| 680 | if self.debug_aic_num < self.block_num: | 860 | if self.debug_aic_num < self.block_num: |
| 681 | - self.raise_exceed_sub_op_aic_aiv_num_error("aic", "aic", self.debug_aic_num, self.block_num) | 861 | + self.raise_exceed_sub_op_aic_aiv_num_error( |
| 862 | + "aic", "aic", self.debug_aic_num, self.block_num | ||
| 863 | + ) | ||
| 682 | 864 | ||
| 683 | if self.kernel_type in [ | 865 | if self.kernel_type in [ |
| 684 | SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, | 866 | SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, |
| 685 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0 | 867 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0, |
| 686 | ]: | 868 | ]: |
| 687 | if self.debug_aiv_num < self.block_num: | 869 | if self.debug_aiv_num < self.block_num: |
| 688 | - self.raise_exceed_sub_op_aic_aiv_num_error("aiv", "aiv", self.debug_aiv_num, self.block_num) | 870 | + self.raise_exceed_sub_op_aic_aiv_num_error( |
| 871 | + "aiv", "aiv", self.debug_aiv_num, self.block_num | ||
| 872 | + ) | ||
| 689 | 873 | ||
| 690 | if self.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1: | 874 | if self.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1: |
| 691 | if self.debug_aic_num < self.block_num: | 875 | if self.debug_aic_num < self.block_num: |
| 692 | - self.raise_exceed_sub_op_aic_aiv_num_error("mix 1:1", "aic", self.debug_aic_num, self.block_num) | 876 | + self.raise_exceed_sub_op_aic_aiv_num_error( |
| 877 | + "mix 1:1", "aic", self.debug_aic_num, self.block_num | ||
| 878 | + ) | ||
| 693 | if self.debug_aiv_num < self.block_num: | 879 | if self.debug_aiv_num < self.block_num: |
| 694 | - self.raise_exceed_sub_op_aic_aiv_num_error("mix 1:1", "aiv", self.debug_aiv_num, self.block_num) | 880 | + self.raise_exceed_sub_op_aic_aiv_num_error( |
| 881 | + "mix 1:1", "aiv", self.debug_aiv_num, self.block_num | ||
| 882 | + ) | ||
| 695 | 883 | ||
| 696 | if self.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2: | 884 | if self.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2: |
| 697 | if self.debug_aic_num < self.block_num: | 885 | if self.debug_aic_num < self.block_num: |
| 698 | - self.raise_exceed_sub_op_aic_aiv_num_error("mix 1:2", "aic", self.debug_aic_num, self.block_num) | 886 | + self.raise_exceed_sub_op_aic_aiv_num_error( |
| 887 | + "mix 1:2", "aic", self.debug_aic_num, self.block_num | ||
| 888 | + ) | ||
| 699 | if self.debug_aiv_num < self.block_num * 2: | 889 | if self.debug_aiv_num < self.block_num * 2: |
| 700 | - self.raise_exceed_sub_op_aic_aiv_num_error("mix 1:2", "aiv", self.debug_aiv_num, self.block_num * 2) | 890 | + self.raise_exceed_sub_op_aic_aiv_num_error( |
| 701 | - | 891 | + "mix 1:2", "aiv", self.debug_aiv_num, self.block_num * 2 |
| 892 | + ) | ||
| 702 | 893 | ||
| 703 | def update_superkernel_blocknum_by_debug_options(self): | 894 | def update_superkernel_blocknum_by_debug_options(self): |
| 704 | self.check_debug_aic_aiv_num_ratio() | 895 | self.check_debug_aic_aiv_num_ratio() |
| @@ -723,11 +914,12 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 723 | CommonUtility().ascendc_raise_python_err( | 914 | CommonUtility().ascendc_raise_python_err( |
| 724 | ERR_CODE, | 915 | ERR_CODE, |
| 725 | f"ERROR: ratio of super kernel debug-aic-num {self.debug_aic_num} to " | 916 | f"ERROR: ratio of super kernel debug-aic-num {self.debug_aic_num} to " |
| 726 | - f"debug-aiv-num {self.debug_aiv_num} is invalid." | 917 | + f"debug-aiv-num {self.debug_aiv_num} is invalid.", |
| 727 | ) | 918 | ) |
| 728 | 919 | ||
| 729 | - | 920 | + def get_finale_type_and_block_num( |
| 730 | - def get_finale_type_and_block_num(self, final_kernel_type, max_aic_num, max_aiv_num): | 921 | + self, final_kernel_type, max_aic_num, max_aiv_num |
| 922 | + ): | ||
| 731 | # get kernel type of super kernel | 923 | # get kernel type of super kernel |
| 732 | if final_kernel_type == 0b1: | 924 | if final_kernel_type == 0b1: |
| 733 | self.kernel_type = SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0 | 925 | self.kernel_type = SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0 |
| @@ -751,11 +943,14 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 751 | else: | 943 | else: |
| 752 | self.kernel_type = SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2 | 944 | self.kernel_type = SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2 |
| 753 | max_1_2_aiv_block_num = math.ceil(max_aiv_num / 2) | 945 | max_1_2_aiv_block_num = math.ceil(max_aiv_num / 2) |
| 754 | - self.block_num = max_aic_num if max_aic_num >= max_1_2_aiv_block_num else max_1_2_aiv_block_num | 946 | + self.block_num = ( |
| 947 | + max_aic_num | ||
| 948 | + if max_aic_num >= max_1_2_aiv_block_num | ||
| 949 | + else max_1_2_aiv_block_num | ||
| 950 | + ) | ||
| 755 | 951 | ||
| 756 | self.update_superkernel_blocknum_by_debug_options() | 952 | self.update_superkernel_blocknum_by_debug_options() |
| 757 | 953 | ||
| 758 | - | ||
| 759 | def get_summary_type_and_options(self): | 954 | def get_summary_type_and_options(self): |
| 760 | """set superkernel kernel type and block dim.""" | 955 | """set superkernel kernel type and block dim.""" |
| 761 | final_kernel_type = 0 | 956 | final_kernel_type = 0 |
| @@ -771,17 +966,29 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 771 | elif sub_operator.kernel_type == SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY: | 966 | elif sub_operator.kernel_type == SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY: |
| 772 | sub_aic_num = sub_operator.block_num | 967 | sub_aic_num = sub_operator.block_num |
| 773 | final_kernel_type = final_kernel_type | 0b10 | 968 | final_kernel_type = final_kernel_type | 0b10 |
| 774 | - elif sub_operator.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0: | 969 | + elif ( |
| 970 | + sub_operator.kernel_type | ||
| 971 | + == SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0 | ||
| 972 | + ): | ||
| 775 | sub_aiv_num = sub_operator.block_num | 973 | sub_aiv_num = sub_operator.block_num |
| 776 | final_kernel_type = final_kernel_type | 0b100 | 974 | final_kernel_type = final_kernel_type | 0b100 |
| 777 | - elif sub_operator.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0: | 975 | + elif ( |
| 976 | + sub_operator.kernel_type | ||
| 977 | + == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0 | ||
| 978 | + ): | ||
| 778 | sub_aic_num = sub_operator.block_num | 979 | sub_aic_num = sub_operator.block_num |
| 779 | final_kernel_type = final_kernel_type | 0b1000 | 980 | final_kernel_type = final_kernel_type | 0b1000 |
| 780 | - elif sub_operator.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1: | 981 | + elif ( |
| 982 | + sub_operator.kernel_type | ||
| 983 | + == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1 | ||
| 984 | + ): | ||
| 781 | sub_aic_num = sub_operator.block_num | 985 | sub_aic_num = sub_operator.block_num |
| 782 | sub_aiv_num = sub_operator.block_num | 986 | sub_aiv_num = sub_operator.block_num |
| 783 | final_kernel_type = final_kernel_type | 0b10000 | 987 | final_kernel_type = final_kernel_type | 0b10000 |
| 784 | - elif sub_operator.kernel_type == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2: | 988 | + elif ( |
| 989 | + sub_operator.kernel_type | ||
| 990 | + == SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_2 | ||
| 991 | + ): | ||
| 785 | sub_aic_num = sub_operator.block_num | 992 | sub_aic_num = sub_operator.block_num |
| 786 | sub_aiv_num = sub_operator.block_num * 2 | 993 | sub_aiv_num = sub_operator.block_num * 2 |
| 787 | final_kernel_type = final_kernel_type | 0b100000 | 994 | final_kernel_type = final_kernel_type | 0b100000 |
| @@ -792,8 +999,8 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 792 | if sub_operator.debug_size > self.debug_size: | 999 | if sub_operator.debug_size > self.debug_size: |
| 793 | self.debug_size = sub_operator.debug_size | 1000 | self.debug_size = sub_operator.debug_size |
| 794 | if self.debug_option != "": | 1001 | if self.debug_option != "": |
| 795 | - option_list = self.debug_option.split(',') | 1002 | + option_list = self.debug_option.split(",") |
| 796 | - sub_option_list = sub_operator.debug_option.split(',') | 1003 | + sub_option_list = sub_operator.debug_option.split(",") |
| 797 | for option in sub_option_list: | 1004 | for option in sub_option_list: |
| 798 | if option not in option_list: | 1005 | if option not in option_list: |
| 799 | self.debug_option += "," | 1006 | self.debug_option += "," |
| @@ -805,47 +1012,56 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 805 | 1012 | ||
| 806 | self.get_finale_type_and_block_num(final_kernel_type, max_aic_num, max_aiv_num) | 1013 | self.get_finale_type_and_block_num(final_kernel_type, max_aic_num, max_aiv_num) |
| 807 | 1014 | ||
| 808 | - | ||
| 809 | - | ||
| 810 | def find_sub_kernel_name(self, origin_sub_kernel_names): | 1015 | def find_sub_kernel_name(self, origin_sub_kernel_names): |
| 811 | aiv_kernel_name = origin_sub_kernel_names[0] | 1016 | aiv_kernel_name = origin_sub_kernel_names[0] |
| 812 | aic_kernel_name = origin_sub_kernel_names[0] | 1017 | aic_kernel_name = origin_sub_kernel_names[0] |
| 813 | for sub_kernel_name in origin_sub_kernel_names: | 1018 | for sub_kernel_name in origin_sub_kernel_names: |
| 814 | - if '_mix_aiv_' in sub_kernel_name: | 1019 | + if "_mix_aiv_" in sub_kernel_name: |
| 815 | aiv_kernel_name = sub_kernel_name | 1020 | aiv_kernel_name = sub_kernel_name |
| 816 | - elif '_mix_aic_' in sub_kernel_name: | 1021 | + elif "_mix_aic_" in sub_kernel_name: |
| 817 | aic_kernel_name = sub_kernel_name | 1022 | aic_kernel_name = sub_kernel_name |
| 818 | return aiv_kernel_name, aic_kernel_name | 1023 | return aiv_kernel_name, aic_kernel_name |
| 819 | 1024 | ||
| 820 | - | ||
| 821 | def adjust_dynamic_op_block_num(self): | 1025 | def adjust_dynamic_op_block_num(self): |
| 822 | for sub_op in self.info_base: | 1026 | for sub_op in self.info_base: |
| 823 | sub_op.adjust_dynamic_op(self.block_num) | 1027 | sub_op.adjust_dynamic_op(self.block_num) |
| 824 | 1028 | ||
| 825 | - | ||
| 826 | def split_o_in_super_kernel(self, orign_bin_path, origin_kernel_name, i): | 1029 | def split_o_in_super_kernel(self, orign_bin_path, origin_kernel_name, i): |
| 827 | filename = os.path.basename(orign_bin_path) | 1030 | filename = os.path.basename(orign_bin_path) |
| 828 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() | 1031 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() |
| 829 | new_bin_path = os.path.join(kernel_meta_dir, filename[:-2] + f"_split{i}.o") | 1032 | new_bin_path = os.path.join(kernel_meta_dir, filename[:-2] + f"_split{i}.o") |
| 830 | if os.path.exists(new_bin_path): | 1033 | if os.path.exists(new_bin_path): |
| 831 | - str_lst = f'WARNING: ALLREADY EXISTS split .o path: {new_bin_path}' | 1034 | + str_lst = f"WARNING: split .o path ALREADY EXISTS: {new_bin_path}" |
| 832 | - CommonUtility.dump_compile_log([str_lst], CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 1035 | + CommonUtility.dump_compile_log( |
| 833 | - cmds = ['cp'] + ['-rfL'] + [f'{orign_bin_path}'] + [f'{new_bin_path}'] | 1036 | + [str_lst], CompileStage.SPLIT_SUB_OBJS, self.compile_log_path |
| 1037 | + ) | ||
| 1038 | + cmds = ["cp"] + ["-rfL"] + [f"{orign_bin_path}"] + [f"{new_bin_path}"] | ||
| 834 | try: | 1039 | try: |
| 835 | - CommonUtility.dump_compile_log(cmds, CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 1040 | + CommonUtility.dump_compile_log( |
| 1041 | + cmds, CompileStage.SPLIT_SUB_OBJS, self.compile_log_path | ||
| 1042 | + ) | ||
| 836 | subprocess.run(cmds) | 1043 | subprocess.run(cmds) |
| 837 | except Exception as err: | 1044 | except Exception as err: |
| 838 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (f"{' '.join(cmds)} failed", err)) | 1045 | + CommonUtility().ascendc_raise_python_err( |
| 1046 | + ERR_CODE, (f"{' '.join(cmds)} failed", err) | ||
| 1047 | + ) | ||
| 839 | new_kernel_name = f"{origin_kernel_name}_split{i}" | 1048 | new_kernel_name = f"{origin_kernel_name}_split{i}" |
| 840 | - cmds = ['llvm-objcopy', f'--redefine-sym={origin_kernel_name}={new_kernel_name}', f'{new_bin_path}'] | 1049 | + cmds = [ |
| 1050 | + "llvm-objcopy", | ||
| 1051 | + f"--redefine-sym={origin_kernel_name}={new_kernel_name}", | ||
| 1052 | + f"{new_bin_path}", | ||
| 1053 | + ] | ||
| 841 | try: | 1054 | try: |
| 842 | - CommonUtility.dump_compile_log(cmds, CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 1055 | + CommonUtility.dump_compile_log( |
| 1056 | + cmds, CompileStage.SPLIT_SUB_OBJS, self.compile_log_path | ||
| 1057 | + ) | ||
| 843 | subprocess.run(cmds) | 1058 | subprocess.run(cmds) |
| 844 | except Exception as err: | 1059 | except Exception as err: |
| 845 | - CommonUtility().ascendc_raise_python_err(ERR_CODE, (f"{' '.join(cmds)} failed", err)) | 1060 | + CommonUtility().ascendc_raise_python_err( |
| 1061 | + ERR_CODE, (f"{' '.join(cmds)} failed", err) | ||
| 1062 | + ) | ||
| 846 | return new_bin_path, new_kernel_name | 1063 | return new_bin_path, new_kernel_name |
| 847 | 1064 | ||
| 848 | - | ||
| 849 | def gen_super_kernel_params(self): | 1065 | def gen_super_kernel_params(self): |
| 850 | for sub_operator in self.info_base: | 1066 | for sub_operator in self.info_base: |
| 851 | self.super_kernel_params += sub_operator.kernel_params | 1067 | self.super_kernel_params += sub_operator.kernel_params |
| @@ -853,9 +1069,11 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 853 | self.super_kernel_params += sub_operator.extra_kernel_params | 1069 | self.super_kernel_params += sub_operator.extra_kernel_params |
| 854 | elif sub_operator.sub_op_task_type.value == SubOperatorType.STATIC_OP.value: | 1070 | elif sub_operator.sub_op_task_type.value == SubOperatorType.STATIC_OP.value: |
| 855 | self.super_kernel_params += sub_operator.extra_kernel_params | 1071 | self.super_kernel_params += sub_operator.extra_kernel_params |
| 856 | - CommonUtility.dump_compile_log(['### SK Arg: FFTS', ','.join(self.super_kernel_params)], \ | 1072 | + CommonUtility.dump_compile_log( |
| 857 | - CompileStage.SPLIT_SUB_OBJS, self.compile_log_path) | 1073 | + ["### SK Arg: FFTS", ",".join(self.super_kernel_params)], |
| 858 | - | 1074 | + CompileStage.SPLIT_SUB_OBJS, |
| 1075 | + self.compile_log_path, | ||
| 1076 | + ) | ||
| 859 | 1077 | ||
| 860 | def get_ws_size(self, block_num): | 1078 | def get_ws_size(self, block_num): |
| 861 | base_size = 512 | 1079 | base_size = 512 |
| @@ -864,32 +1082,46 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 864 | base_size *= 2 | 1082 | base_size *= 2 |
| 865 | self.workspace_size = block_num * base_size | 1083 | self.workspace_size = block_num * base_size |
| 866 | 1084 | ||
| 867 | - | ||
| 868 | def calc_workspace_size(self): | 1085 | def calc_workspace_size(self): |
| 869 | - if self.feed_sync_all_mode.value == SuperKernelFeedSyncAllMode.FeedSyncAllDisable.value: | 1086 | + if ( |
| 1087 | + self.feed_sync_all_mode.value | ||
| 1088 | + == SuperKernelFeedSyncAllMode.FeedSyncAllDisable.value | ||
| 1089 | + ): | ||
| 870 | self.workspace_size = 0 | 1090 | self.workspace_size = 0 |
| 871 | return | 1091 | return |
| 872 | - if self.kernel_type in [SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0, \ | 1092 | + if self.kernel_type in [ |
| 873 | - SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0, SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1, \ | 1093 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIV_1_0, |
| 874 | - SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY]: | 1094 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_0, |
| 1095 | + SuperKernelKernelType.KERNEL_TYPE_MIX_AIC_1_1, | ||
| 1096 | + SuperKernelKernelType.KERNEL_TYPE_AIC_ONLY, | ||
| 1097 | + SuperKernelKernelType.KERNEL_TYPE_AIV_ONLY, | ||
| 1098 | + ]: | ||
| 875 | self.get_ws_size(self.block_num) | 1099 | self.get_ws_size(self.block_num) |
| 876 | else: | 1100 | else: |
| 877 | self.get_ws_size(self.block_num * 2) | 1101 | self.get_ws_size(self.block_num * 2) |
| 878 | 1102 | ||
| 879 | - | ||
| 880 | def add_define_options(self, exist_dynamic_sub_ops, options: list): | 1103 | def add_define_options(self, exist_dynamic_sub_ops, options: list): |
| 881 | if exist_dynamic_sub_ops: | 1104 | if exist_dynamic_sub_ops: |
| 882 | options.append("-D__SUPER_KERNEL_DYNAMIC_BLOCK_NUM__") | 1105 | options.append("-D__SUPER_KERNEL_DYNAMIC_BLOCK_NUM__") |
| 883 | 1106 | ||
| 884 | - if self.early_start_mode.value != SuperKernelEarlyStartMode.EarlyStartDisable.value: | 1107 | + if ( |
| 1108 | + self.early_start_mode.value | ||
| 1109 | + != SuperKernelEarlyStartMode.EarlyStartDisable.value | ||
| 1110 | + ): | ||
| 885 | options.append("-D__ASCENDC_ENABLE_SET_NEXT_TASK_START") | 1111 | options.append("-D__ASCENDC_ENABLE_SET_NEXT_TASK_START") |
| 886 | options.append("-D__ASCENDC_ENABLE_WAIT_PRE_TASK_END") | 1112 | options.append("-D__ASCENDC_ENABLE_WAIT_PRE_TASK_END") |
| 887 | - if self.early_start_mode.value == SuperKernelEarlyStartMode.EarlyStartEnableV1.value: | 1113 | + if ( |
| 1114 | + self.early_start_mode.value | ||
| 1115 | + == SuperKernelEarlyStartMode.EarlyStartEnableV1.value | ||
| 1116 | + ): | ||
| 888 | options.append("-D__ASCENDC_SUPERKERNEL_EARLY_START_V1") | 1117 | options.append("-D__ASCENDC_SUPERKERNEL_EARLY_START_V1") |
| 889 | else: | 1118 | else: |
| 890 | options.append("-D__ASCENDC_SUPERKERNEL_EARLY_START_V2") | 1119 | options.append("-D__ASCENDC_SUPERKERNEL_EARLY_START_V2") |
| 891 | 1120 | ||
| 892 | - if self.feed_sync_all_mode.value == SuperKernelFeedSyncAllMode.FeedSyncAllEnable.value: | 1121 | + if ( |
| 1122 | + self.feed_sync_all_mode.value | ||
| 1123 | + == SuperKernelFeedSyncAllMode.FeedSyncAllEnable.value | ||
| 1124 | + ): | ||
| 893 | options.append("-D__ASCENDC_SUPERKERNEL_AUTO_SYNC_ALL__") | 1125 | options.append("-D__ASCENDC_SUPERKERNEL_AUTO_SYNC_ALL__") |
| 894 | 1126 | ||
| 895 | if self.timestamp_option: | 1127 | if self.timestamp_option: |
| @@ -897,33 +1129,43 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 897 | else: | 1129 | else: |
| 898 | options.append("-DASCENDC_DUMP=0") | 1130 | options.append("-DASCENDC_DUMP=0") |
| 899 | 1131 | ||
| 900 | - external_option = \ | 1132 | + external_option = [ |
| 901 | -[part_option.strip() for part_option in self.op_options.get('compile-options', "").split(',') if part_option.strip()] | 1133 | + part_option.strip() |
| 1134 | + for part_option in self.op_options.get("compile-options", "").split(",") | ||
| 1135 | + if part_option.strip() | ||
| 1136 | + ] | ||
| 902 | for sub_external_option in external_option: | 1137 | for sub_external_option in external_option: |
| 903 | options.append(sub_external_option) | 1138 | options.append(sub_external_option) |
| 904 | 1139 | ||
| 905 | - | ||
| 906 | def gen_compile_info(self): | 1140 | def gen_compile_info(self): |
| 907 | options = ["-x", "cce"] | 1141 | options = ["-x", "cce"] |
| 908 | - ascend_home_path = os.environ.get('ASCEND_HOME_PATH') | 1142 | + ascend_home_path = os.environ.get("ASCEND_HOME_PATH") |
| 909 | import platform | 1143 | import platform |
| 1144 | + | ||
| 910 | archlinux = platform.machine() | 1145 | archlinux = platform.machine() |
| 911 | - if ascend_home_path is None or ascend_home_path == '': | 1146 | + if ascend_home_path is None or ascend_home_path == "": |
| 912 | asc_opc_path = shutil.which("asc_opc") | 1147 | asc_opc_path = shutil.which("asc_opc") |
| 913 | if asc_opc_path is not None: | 1148 | if asc_opc_path is not None: |
| 914 | asc_opc_path_link = os.path.dirname(asc_opc_path) | 1149 | asc_opc_path_link = os.path.dirname(asc_opc_path) |
| 915 | asc_opc_real_path = os.path.realpath(asc_opc_path_link) | 1150 | asc_opc_real_path = os.path.realpath(asc_opc_path_link) |
| 916 | ascend_home_path = os.path.realpath( | 1151 | ascend_home_path = os.path.realpath( |
| 917 | - os.path.join(asc_opc_real_path, "..", "..")) | 1152 | + os.path.join(asc_opc_real_path, "..", "..") |
| 1153 | + ) | ||
| 918 | else: | 1154 | else: |
| 919 | ascend_home_path = "/usr/local/Ascend/latest" | 1155 | ascend_home_path = "/usr/local/Ascend/latest" |
| 920 | 1156 | ||
| 921 | - if 'x86' in archlinux: | 1157 | + if "x86" in archlinux: |
| 922 | - asc_path = os.path.realpath(os.path.join(ascend_home_path, "x86_64-linux", "asc")) | 1158 | + asc_path = os.path.realpath( |
| 1159 | + os.path.join(ascend_home_path, "x86_64-linux", "asc") | ||
| 1160 | + ) | ||
| 923 | else: | 1161 | else: |
| 924 | - asc_path = os.path.realpath(os.path.join(ascend_home_path, "aarch64-linux", "asc")) | 1162 | + asc_path = os.path.realpath( |
| 1163 | + os.path.join(ascend_home_path, "aarch64-linux", "asc") | ||
| 1164 | + ) | ||
| 925 | if asc_path is None: | 1165 | if asc_path is None: |
| 926 | - asc_path = os.path.realpath(os.path.join(ascend_home_path, "compiler", "asc")) | 1166 | + asc_path = os.path.realpath( |
| 1167 | + os.path.join(ascend_home_path, "compiler", "asc") | ||
| 1168 | + ) | ||
| 927 | 1169 | ||
| 928 | options.append("-I" + os.path.join(asc_path, "impl", "adv_api")) | 1170 | options.append("-I" + os.path.join(asc_path, "impl", "adv_api")) |
| 929 | options.append("-I" + os.path.join(asc_path, "impl", "basic_api")) | 1171 | options.append("-I" + os.path.join(asc_path, "impl", "basic_api")) |
| @@ -946,7 +1188,9 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 946 | options.append("-I" + os.path.join(asc_path, "..", "..", "include", "ascendc")) | 1188 | options.append("-I" + os.path.join(asc_path, "..", "..", "include", "ascendc")) |
| 947 | options.append("-I" + os.path.join(asc_path, "..", "tikcpp", "tikcfw")) | 1189 | options.append("-I" + os.path.join(asc_path, "..", "tikcpp", "tikcfw")) |
| 948 | options.append("-I" + os.path.join(asc_path, "..", "tikcpp", "tikcfw", "impl")) | 1190 | options.append("-I" + os.path.join(asc_path, "..", "tikcpp", "tikcfw", "impl")) |
| 949 | - options.append("-I" + os.path.join(asc_path, "..", "tikcpp", "tikcfw", "interface")) | 1191 | + options.append( |
| 1192 | + "-I" + os.path.join(asc_path, "..", "tikcpp", "tikcfw", "interface") | ||
| 1193 | + ) | ||
| 950 | exist_dynamic_sub_ops = False | 1194 | exist_dynamic_sub_ops = False |
| 951 | 1195 | ||
| 952 | param_offset = [] | 1196 | param_offset = [] |
| @@ -980,7 +1224,9 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 980 | operator_info["dynamic_bin"] = sub_operator.dynamic_bin | 1224 | operator_info["dynamic_bin"] = sub_operator.dynamic_bin |
| 981 | exist_dynamic_sub_ops = True | 1225 | exist_dynamic_sub_ops = True |
| 982 | operator_info["sub_kernel_names"] = sub_operator.sub_kernel_names | 1226 | operator_info["sub_kernel_names"] = sub_operator.sub_kernel_names |
| 983 | - origin_aiv_kernel_name, origin_aic_kernel_name = self.find_sub_kernel_name(sub_operator.sub_kernel_names) | 1227 | + origin_aiv_kernel_name, origin_aic_kernel_name = self.find_sub_kernel_name( |
| 1228 | + sub_operator.sub_kernel_names | ||
| 1229 | + ) | ||
| 984 | sub_operator_info.append(operator_info) | 1230 | sub_operator_info.append(operator_info) |
| 985 | if sub_operator.dynamic_bin is None and sub_operator.split_mode > 1: | 1231 | if sub_operator.dynamic_bin is None and sub_operator.split_mode > 1: |
| 986 | for i in range(1, sub_operator.split_mode): | 1232 | for i in range(1, sub_operator.split_mode): |
| @@ -988,8 +1234,11 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 988 | new_sub_op_sub_kernel_names = [] | 1234 | new_sub_op_sub_kernel_names = [] |
| 989 | if sub_operator.aiv_bin is not None: | 1235 | if sub_operator.aiv_bin is not None: |
| 990 | if sub_operator.split_mode_in_json is None: | 1236 | if sub_operator.split_mode_in_json is None: |
| 991 | - split_o_path, new_kernel_name = \ | 1237 | + split_o_path, new_kernel_name = ( |
| 992 | - self.split_o_in_super_kernel(sub_operator.aiv_bin, origin_aiv_kernel_name, i) | 1238 | + self.split_o_in_super_kernel( |
| 1239 | + sub_operator.aiv_bin, origin_aiv_kernel_name, i | ||
| 1240 | + ) | ||
| 1241 | + ) | ||
| 993 | else: | 1242 | else: |
| 994 | split_o_path = sub_operator.aiv_bin[:-2] + f"_split{i}.o" | 1243 | split_o_path = sub_operator.aiv_bin[:-2] + f"_split{i}.o" |
| 995 | new_kernel_name = f"{origin_aiv_kernel_name}_split{i}" | 1244 | new_kernel_name = f"{origin_aiv_kernel_name}_split{i}" |
| @@ -997,8 +1246,11 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 997 | new_sub_op_sub_kernel_names.append(f"{new_kernel_name}") | 1246 | new_sub_op_sub_kernel_names.append(f"{new_kernel_name}") |
| 998 | if sub_operator.aic_bin is not None: | 1247 | if sub_operator.aic_bin is not None: |
| 999 | if sub_operator.split_mode_in_json is None: | 1248 | if sub_operator.split_mode_in_json is None: |
| 1000 | - split_o_path, new_kernel_name = \ | 1249 | + split_o_path, new_kernel_name = ( |
| 1001 | - self.split_o_in_super_kernel(sub_operator.aic_bin, origin_aic_kernel_name, i) | 1250 | + self.split_o_in_super_kernel( |
| 1251 | + sub_operator.aic_bin, origin_aic_kernel_name, i | ||
| 1252 | + ) | ||
| 1253 | + ) | ||
| 1002 | else: | 1254 | else: |
| 1003 | split_o_path = sub_operator.aic_bin[:-2] + f"_split{i}.o" | 1255 | split_o_path = sub_operator.aic_bin[:-2] + f"_split{i}.o" |
| 1004 | new_kernel_name = f"{origin_aic_kernel_name}_split{i}" | 1256 | new_kernel_name = f"{origin_aic_kernel_name}_split{i}" |
| @@ -1007,19 +1259,28 @@ f"ERROR: super kernel do not support self send/receive pair within 1 real stream | |||
| 1007 | cur_operator_info["sub_kernel_names"] = new_sub_op_sub_kernel_names | 1259 | cur_operator_info["sub_kernel_names"] = new_sub_op_sub_kernel_names |
| 1008 | sub_operator_info.append(cur_operator_info) | 1260 | sub_operator_info.append(cur_operator_info) |
| 1009 | elif sub_operator.split_mode > 1: | 1261 | elif sub_operator.split_mode > 1: |
| 1010 | - dynamic_func_names = sub_operator.called_kernel_name["dynamic_func_names"] | 1262 | + dynamic_func_names = sub_operator.called_kernel_name[ |
| 1263 | + "dynamic_func_names" | ||
| 1264 | + ] | ||
| 1011 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() | 1265 | kernel_meta_dir = CommonUtility.get_kernel_meta_dir() |
| 1012 | rename_file_path_list = [] | 1266 | rename_file_path_list = [] |
| 1013 | for i in range(1, sub_operator.split_mode): | 1267 | for i in range(1, sub_operator.split_mode): |
| 1014 | - rename_file_name = f'{sub_operator.kernel_name}_rename_file_{i}.txt' | 1268 | + rename_file_name = f"{sub_operator.kernel_name}_rename_file_{i}.txt" |
| 1015 | - rename_file_path_list.append(os.path.join(kernel_meta_dir, rename_file_name)) | 1269 | + rename_file_path_list.append( |
| 1016 | - new_kernel_names_list = \ | 1270 | + os.path.join(kernel_meta_dir, rename_file_name) |
| 1017 | -gen_symbol_rename_file(dynamic_func_names, rename_file_path_list, sub_operator.split_mode) | 1271 | + ) |
| 1272 | + new_kernel_names_list = gen_symbol_rename_file( | ||
| 1273 | + dynamic_func_names, rename_file_path_list, sub_operator.split_mode | ||
| 1274 | + ) | ||
| 1018 | orign_bin_path = operator_info["dynamic_bin"] | 1275 | orign_bin_path = operator_info["dynamic_bin"] |
| 1019 | for i in range(1, sub_operator.split_mode): | 1276 | for i in range(1, sub_operator.split_mode): |
| 1020 | cur_operator_info = {} | 1277 | cur_operator_info = {} |
| 1021 | - split_o_path = \ | 1278 | + split_o_path = split_dynamic_o_in_super_kernel( |
| 1022 | -split_dynamic_o_in_super_kernel(orign_bin_path, rename_file_path_list[i - 1], i, self.compile_log_path) | 1279 | + orign_bin_path, |
| 1280 | + rename_file_path_list[i - 1], | ||
| 1281 | + i, | ||
| 1282 | + self.compile_log_path, | ||
| 1283 | + ) | ||
| 1023 | cur_operator_info["dynamic_bin"] = split_o_path | 1284 | cur_operator_info["dynamic_bin"] = split_o_path |
| 1024 | cur_operator_info["sub_kernel_names"] = new_kernel_names_list[i - 1] | 1285 | cur_operator_info["sub_kernel_names"] = new_kernel_names_list[i - 1] |
| 1025 | sub_operator_info.append(cur_operator_info) | 1286 | sub_operator_info.append(cur_operator_info) |
| @@ -1048,5 +1309,5 @@ split_dynamic_o_in_super_kernel(orign_bin_path, rename_file_path_list[i - 1], i, | |||
| 1048 | "notify_param_offset": notify_param_offset, | 1309 | "notify_param_offset": notify_param_offset, |
| 1049 | "wait_param_offset": wait_param_offset, | 1310 | "wait_param_offset": wait_param_offset, |
| 1050 | "send_event_list": send_event_list, | 1311 | "send_event_list": send_event_list, |
| 1051 | - "recv_event_list": recv_event_list | 1312 | + "recv_event_list": recv_event_list, |
| 1052 | } | 1313 | } |
| @@ -1058,7 +1058,7 @@ TEST_F(SuperKernelGraphTest, CollectFusionFailStats_WithNodes) { | |||
| 1058 | "reasonDetail: scope fuse failed, " | 1058 | "reasonDetail: scope fuse failed, " |
| 1059 | "Insufficient stream task slots or event memory resources") != std::string::npos; | 1059 | "Insufficient stream task slots or event memory resources") != std::string::npos; |
| 1060 | const std::string deadlockDetail = | 1060 | const std::string deadlockDetail = |
| 1061 | - "reasonDetail: exist deadlock, " | 1061 | + "reasonDetail: deadlock exists, " |
| 1062 | "The wait node depends on a kernel node that requires more cores than available"; | 1062 | "The wait node depends on a kernel node that requires more cores than available"; |
| 1063 | hasDeadlockDetail = hasDeadlockDetail || entry.find(deadlockDetail) != std::string::npos; | 1063 | hasDeadlockDetail = hasDeadlockDetail || entry.find(deadlockDetail) != std::string::npos; |
| 1064 | } | 1064 | } |
| @@ -494,7 +494,7 @@ TEST_F(SkNodeTest, FusionFailReasonInfo_ScopeAndDeadlockDetails) { | |||
| 494 | EXPECT_EQ(deadlockInfo.GetDeadlockFailReason(), static_cast<DeadlockFailReason>(1)); | 494 | EXPECT_EQ(deadlockInfo.GetDeadlockFailReason(), static_cast<DeadlockFailReason>(1)); |
| 495 | EXPECT_EQ(FusionFailReasonToStr(deadlockInfo), "EXIST_DEADLOCK [KERNEL_INSUFFICIENT_CORES]"); | 495 | EXPECT_EQ(FusionFailReasonToStr(deadlockInfo), "EXIST_DEADLOCK [KERNEL_INSUFFICIENT_CORES]"); |
| 496 | EXPECT_EQ(FusionFailReasonDetailToStr(deadlockInfo), | 496 | EXPECT_EQ(FusionFailReasonDetailToStr(deadlockInfo), |
| 497 | - "exist deadlock, " | 497 | + "deadlock exists, " |
| 498 | "The wait node depends on a kernel node that requires more cores than available"); | 498 | "The wait node depends on a kernel node that requires more cores than available"); |
| 499 | EXPECT_STREQ(to_string(DeadlockFailReason::NOTIFY_NOT_IN_GRAPH), "NOTIFY_NOT_IN_GRAPH"); | 499 | EXPECT_STREQ(to_string(DeadlockFailReason::NOTIFY_NOT_IN_GRAPH), "NOTIFY_NOT_IN_GRAPH"); |
| 500 | EXPECT_STREQ(to_string(static_cast<DeadlockFailReason>(255)), "UNKNOWN_DEADLOCK_REASON"); | 500 | EXPECT_STREQ(to_string(static_cast<DeadlockFailReason>(255)), "UNKNOWN_DEADLOCK_REASON"); |
| @@ -551,10 +551,10 @@ TEST_F(SkNodeTest, FusionFailReasonStrings_CoverAllEnumNamesAndDetails) { | |||
| 551 | "exceeds the maximum number of kernels that the device can provide"}, | 551 | "exceeds the maximum number of kernels that the device can provide"}, |
| 552 | {FusionFailReason::RESET_TYPE_NODE, "RESET_TYPE_NODE", "reset type node in end"}, | 552 | {FusionFailReason::RESET_TYPE_NODE, "RESET_TYPE_NODE", "reset type node in end"}, |
| 553 | {FusionFailReason::ISOLATED_EVENT, "ISOLATED_EVENT", "There is no kernel node on the stream"}, | 553 | {FusionFailReason::ISOLATED_EVENT, "ISOLATED_EVENT", "There is no kernel node on the stream"}, |
| 554 | - {FusionFailReason::EXIST_DEADLOCK, "EXIST_DEADLOCK", "exist deadlock"}, | 554 | + {FusionFailReason::EXIST_DEADLOCK, "EXIST_DEADLOCK", "deadlock exists"}, |
| 555 | {FusionFailReason::SCOPE_FUSE_PART, "SCOPE_FUSE_PART", "scope fuse failed"}, | 555 | {FusionFailReason::SCOPE_FUSE_PART, "SCOPE_FUSE_PART", "scope fuse failed"}, |
| 556 | {FusionFailReason::EXTERNAL_DEPEND, "EXTERNAL_DEPEND", "event node has external dependency"}, | 556 | {FusionFailReason::EXTERNAL_DEPEND, "EXTERNAL_DEPEND", "event node has external dependency"}, |
| 557 | - {FusionFailReason::UNSUPPORT_EVENT_TYPE, "UNSUPPORT_EVENT_TYPE", "unsupport event type"}, | 557 | + {FusionFailReason::UNSUPPORT_EVENT_TYPE, "UNSUPPORT_EVENT_TYPE", "unsupported event type"}, |
| 558 | {FusionFailReason::MEMORY_WAIT_NODE_ONLY, "MEMORY_WAIT_NODE_ONLY", "No memory write exists"}, | 558 | {FusionFailReason::MEMORY_WAIT_NODE_ONLY, "MEMORY_WAIT_NODE_ONLY", "No memory write exists"}, |
| 559 | {FusionFailReason::MEMORY_WRITE_NODE_ONLY, "MEMORY_WRITE_NODE_ONLY", "only exists memory write nodes"}, | 559 | {FusionFailReason::MEMORY_WRITE_NODE_ONLY, "MEMORY_WRITE_NODE_ONLY", "only exists memory write nodes"}, |
| 560 | {FusionFailReason::DEFAULT_NODE, "DEFAULT_NODE", "default node uses aicpu resources"}, | 560 | {FusionFailReason::DEFAULT_NODE, "DEFAULT_NODE", "default node uses aicpu resources"}, |