diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index fbbf1f04..443f5213 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -355,6 +355,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportDa reporter_data.deviceId = device_id; ret = memcpy_s(reporter_data.tag, MSPROF_ENGINE_MAX_TAG_LEN + 1, tag_name.c_str(), tag_name.size()); GE_IF_BOOL_EXEC(ret != EOK, GELOGE(ret, "Report data tag [%s] memcpy error!", tag_name.c_str()); return;); + std::lock_guard lock(mutex_report_); for (size_t i = 0; i < index; ++i) { reporter_data.data = (unsigned char *)data.c_str() + report_max_len * i; reporter_data.dataLen = report_max_len; @@ -375,7 +376,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportDa reporter_data.dataLen = data.size(); ret = memcpy_s(reporter_data.tag, MSPROF_ENGINE_MAX_TAG_LEN + 1, tag_name.c_str(), tag_name.size()); GE_IF_BOOL_EXEC(ret != EOK, GELOGE(ret, "Report data tag [%s] memcpy error!", tag_name.c_str()); return;); - + std::lock_guard lock(mutex_report_); cb_ret = CallMsprofReport(reporter_data); GE_IF_BOOL_EXEC(cb_ret != 0, GELOGE(cb_ret, "Reporter data [%s] failed, ret:%d", tag_name.c_str(), cb_ret); return;); diff --git a/ge/common/profiling/profiling_manager.h b/ge/common/profiling/profiling_manager.h index ab344204..af9fce06 100755 --- a/ge/common/profiling/profiling_manager.h +++ b/ge/common/profiling/profiling_manager.h @@ -118,6 +118,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager { map subs_dev_module_; // key: device_id, value: profiling on module uint32_t subscribe_count_; std::mutex mutex_; + std::mutex mutex_report_; MsprofCallback prof_cb_; std::string fp_point_; std::string bp_point_; diff --git a/ge/ir_build/option_utils.cc b/ge/ir_build/option_utils.cc index dede758f..1be996b2 100755 --- a/ge/ir_build/option_utils.cc +++ b/ge/ir_build/option_utils.cc @@ -523,11 +523,9 @@ Status CheckDynamicInputParamValid(string &dynamic_batch_size, string &dynamic_i } if (!dynamic_batch_size.empty()) { - if (input_shape_range.find(":") != string::npos) { - if (!CheckDynamicBatchSizeInputShapeValid(shape_map, dynamic_batch_size)) { - GELOGE(ge::PARAM_INVALID, "[Check][DynamicBatchSizeInputShape] input_shape: %s invalid.", input_shape.c_str()); - return ge::PARAM_INVALID; - } + if (!CheckDynamicBatchSizeInputShapeValid(shape_map, dynamic_batch_size)) { + GELOGE(ge::PARAM_INVALID, "[Check][DynamicBatchSizeInputShape] input_shape: %s invalid.", input_shape.c_str()); + return ge::PARAM_INVALID; } } diff --git a/inc/external/ge/ge_api_types.h b/inc/external/ge/ge_api_types.h index 96e773ab..cef3fc42 100644 --- a/inc/external/ge/ge_api_types.h +++ b/inc/external/ge/ge_api_types.h @@ -361,6 +361,7 @@ using RunAsyncCallback = std::function