diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index 579036bc..31035abe 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -959,7 +959,7 @@ Status GraphMemoryAssigner::AssignAtomicOutputMemory(const ge::NodePtr &node, ve output_list[output_index] = iter->second.mem_offset_; std::string batch_label; (void)ge::AttrUtils::GetStr(op_desc, ATTR_NAME_BATCH_LABEL, batch_label); - GELOGI("[IMAS]Atomic output : Set %s name[%s] optype[%s] output[%ld] offset to [%zu] stream_id[%ld] memtype[%ld] " + GELOGI("[IMAS]Atomic output : Set %s name[%s] optype[%s] output[%ld] offset to [%zu] stream_id[%ld] memtype[%u] " "size[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(), op_desc->GetName().c_str(), node->GetType().c_str(), output_index, iter->second.mem_offset_, op_desc->GetStreamId(), RT_MEMORY_HBM, size, size, batch_label.c_str()); @@ -1039,7 +1039,7 @@ Status GraphMemoryAssigner::AssignOrdinaryAtomicWorkspaceMemory(const ge::OpDesc (void)ge::AttrUtils::GetStr(op_desc, ATTR_NAME_BATCH_LABEL, batch_label); GELOGI( "[IMAS]Atomic ordinary workspace : Set %s name[%s] optype[%s] workspace[%lu] offset to [%zu] stream_id[%ld] " - "memtype[%ld] size[%ld] real_size[%ld] batch[%s].", + "memtype[%u] size[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), workspace_index, mem_type_iter->second.mem_offset_, op_desc->GetStreamId(), RT_MEMORY_HBM, workspace_size, workspace_size, batch_label.c_str()); @@ -1080,7 +1080,7 @@ Status GraphMemoryAssigner::AssignFusionAtomicWorkspaceMemory(const ge::OpDescPt (void)ge::AttrUtils::GetStr(op_desc, ATTR_NAME_BATCH_LABEL, batch_label); GELOGI( "[IMAS]Atomic fusion workspace : Set %s name[%s] optype[%s] workspace[%lu] offset to [%zu] stream_id[%ld] " - "memtype[%ld] ssize[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(), + "memtype[%u] ssize[%ld] real_size[%ld] batch[%s].", compute_graph_->GetName().c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str(), workspace_index, mem_type_iter->second.mem_offset_, op_desc->GetStreamId(), RT_MEMORY_HBM, workspace_size, workspace_size, batch_label.c_str()); diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index cda2fc42..c97636d3 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -809,7 +809,7 @@ Status HybridModelBuilder::VarNodeToTensor(const NodePtr &var_node, std::unique_ // var size is only for checking, will not allocate any memory by it tensor.reset(new(std::nothrow)TensorValue(dev_mem, static_cast(var_size))); GE_CHECK_NOTNULL(tensor); - GELOGI("Get var memory addr %p for node %s, size = %lld, mem_type=%u", dev_mem, var_name.c_str(), var_size, mem_type); + GELOGI("Get var memory addr %p for node %s, size = %ld, mem_type=%u", dev_mem, var_name.c_str(), var_size, mem_type); return SUCCESS; } diff --git a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc index c9f20381..48b5fe9a 100644 --- a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc +++ b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc @@ -222,7 +222,7 @@ Status RdmaNodeTask::ExtractTensor(TaskContext &context, vectorGetTensor(offset_index_.first, offset_index_.second, offset_tensor)) if (static_cast(offset_tensor.GetSize() / GetSizeByDataType(data_type)) != row_num) { - GELOGE(PARAM_INVALID, "num of offset and remote addr mismatch, offset size=%zu, remote_addr size=%lld, dtype=%s", + GELOGE(PARAM_INVALID, "num of offset and remote addr mismatch, offset size=%zu, remote_addr size=%ld, dtype=%s", offset_tensor.GetSize(), row_num, TypeUtils::DataTypeToSerialString(data_type).c_str()); return PARAM_INVALID; } @@ -244,7 +244,7 @@ Status RdmaNodeTask::ExtractTensor(TaskContext &context, vector(reinterpret_cast(tv->MutableData())); auto device_len = tv->GetSize() / row_num; if (device_len <= 0 || device_len > data[kVarTableIdxLen]) { - GELOGE(FAILED, "Local embedding length is out of range, expect %lld, but %lld exactly.", + GELOGE(FAILED, "Local embedding length is out of range, expect %ld, but %ld exactly.", data[kVarTableIdxLen], device_len); return FAILED; } diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 4f014714..bead5cd6 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -65,25 +65,9 @@ include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR}/proto/ge) include_directories(${CMAKE_BINARY_DIR}/proto/ge/proto) -set(COMMON_SRC_FILES - "${GE_CODE_DIR}/ge/common/properties_manager.cc" - "${GE_CODE_DIR}/ge/common/ge/plugin_manager.cc" - "${GE_CODE_DIR}/ge/common/ge/tbe_plugin_manager.cc" +set(GRAPH_SRC_FILES "${GE_CODE_DIR}/metadef/graph/option/ge_local_context.cc" "${GE_CODE_DIR}/metadef/graph/option/ge_context.cc" - "${GE_CODE_DIR}/ge/common/types.cc" - "${GE_CODE_DIR}/parser/parser/common/op_map.cc" - "${GE_CODE_DIR}/ge/common/fmk_error_codes.cc" - "${GE_CODE_DIR}/ge/common/op/ge_op_utils.cc" - "${GE_CODE_DIR}/ge/graph/manager/util/variable_accelerate_ctrl.cc" - "${GE_CODE_DIR}/ge/opskernel_manager/ops_kernel_manager.cc" - "${GE_CODE_DIR}/ge/generator/ge_generator.cc" - "${GE_CODE_DIR}/ge/generator/generator_api.cc" - "${GE_CODE_DIR}/ge/graph/common/omg_util.cc" - "${GE_CODE_DIR}/ge/graph/common/bcast.cc" - "${GE_CODE_DIR}/ge/common/util.cc" - "${GE_CODE_DIR}/ge/common/ge/op_tiling_manager.cc" - "${GE_CODE_DIR}/ge/init/gelib.cc" "${GE_CODE_DIR}/metadef/graph/ge_attr_define.cc" "${GE_CODE_DIR}/metadef/graph/anchor.cc" "${GE_CODE_DIR}/metadef/graph/ge_attr_value.cc" @@ -128,6 +112,38 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/metadef/register/tensor_assign.cpp" "${GE_CODE_DIR}/metadef/register/register_format_transfer.cc" "${GE_CODE_DIR}/metadef/graph/format_refiner.cc" + "${GE_CODE_DIR}/metadef/register/ops_kernel_builder_registry.cc" + "${GE_CODE_DIR}/metadef/register/op_tiling.cpp" + "${GE_CODE_DIR}/metadef/graph/utils/tuning_utils.cc" + "${GE_CODE_DIR}/metadef/register/op_tiling_registry.cpp" +) + +set(PARSER_SRC_FILES + "${GE_CODE_DIR}/parser/parser/common/op_map.cc" + "${GE_CODE_DIR}/parser/parser/common/pre_checker.cc" + "${GE_CODE_DIR}/parser/parser/common/convert/pb2json.cc" + "${GE_CODE_DIR}/parser/parser/common/parser_factory.cc" + "${GE_CODE_DIR}/parser/parser/common/model_saver.cc" + "${GE_CODE_DIR}/parser/parser/common/parser_types.cc" + "${GE_CODE_DIR}/parser/parser/common/parser_inner_ctx.cc" +) + +set(COMMON_SRC_FILES + "${GE_CODE_DIR}/ge/common/properties_manager.cc" + "${GE_CODE_DIR}/ge/common/ge/plugin_manager.cc" + "${GE_CODE_DIR}/ge/common/ge/tbe_plugin_manager.cc" + "${GE_CODE_DIR}/ge/common/types.cc" + "${GE_CODE_DIR}/ge/common/fmk_error_codes.cc" + "${GE_CODE_DIR}/ge/common/op/ge_op_utils.cc" + "${GE_CODE_DIR}/ge/graph/manager/util/variable_accelerate_ctrl.cc" + "${GE_CODE_DIR}/ge/opskernel_manager/ops_kernel_manager.cc" + "${GE_CODE_DIR}/ge/generator/ge_generator.cc" + "${GE_CODE_DIR}/ge/generator/generator_api.cc" + "${GE_CODE_DIR}/ge/graph/common/omg_util.cc" + "${GE_CODE_DIR}/ge/graph/common/bcast.cc" + "${GE_CODE_DIR}/ge/common/util.cc" + "${GE_CODE_DIR}/ge/common/ge/op_tiling_manager.cc" + "${GE_CODE_DIR}/ge/init/gelib.cc" "${GE_CODE_DIR}/ge/engine_manager/dnnengine_manager.cc" "${GE_CODE_DIR}/ge/opskernel_manager/ops_kernel_manager.cc" "${GE_CODE_DIR}/ge/session/session_manager.cc" @@ -311,17 +327,7 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/model_saver.cc" "${GE_CODE_DIR}/ge/hybrid/node_executor/aicpu/aicpu_ext_info.cc" "${GE_CODE_DIR}/ge/common/ge/datatype_util.cc" - "${GE_CODE_DIR}/metadef/register/ops_kernel_builder_registry.cc" - "${GE_CODE_DIR}/metadef/register/op_tiling.cpp" - "${GE_CODE_DIR}/metadef/graph/utils/tuning_utils.cc" - "${GE_CODE_DIR}/metadef/register/op_tiling_registry.cpp" "${GE_CODE_DIR}/ge/ge_local_engine/engine/host_cpu_engine.cc" - "${GE_CODE_DIR}/parser/parser/common/pre_checker.cc" - "${GE_CODE_DIR}/parser/parser/common/convert/pb2json.cc" - "${GE_CODE_DIR}/parser/parser/common/parser_factory.cc" - "${GE_CODE_DIR}/parser/parser/common/model_saver.cc" - "${GE_CODE_DIR}/parser/parser/common/parser_types.cc" - "${GE_CODE_DIR}/parser/parser/common/parser_inner_ctx.cc" "${GE_CODE_DIR}/ge/session/omg.cc" ) @@ -769,18 +775,45 @@ list(APPEND COMMON_SHARED_LIBRARIES hccl_stub error_manager_stub ) + +# build graph +add_library(ge_ut_graph STATIC + ${GRAPH_SRC_FILES} ${PARSER_SRC_FILES} ${PROTO_SRCS} ${PROTO_HDRS} +) + +target_compile_definitions(ge_ut_graph PRIVATE + google=ascend_private +) + +target_compile_options(ge_ut_graph PRIVATE + -g +) + +target_link_libraries(ge_ut_graph PRIVATE + $ + c_sec + ascend_protobuf + json +) + # build common -add_library(ge_ut_common STATIC ${COMMON_SRC_FILES} ${PROTO_SRCS} ${PROTO_HDRS}) +add_library(ge_ut_common STATIC ${COMMON_SRC_FILES} ${PROTO_HDRS}) target_compile_definitions(ge_ut_common PRIVATE google=ascend_private ) +target_compile_options(ge_ut_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_ut_common PRIVATE $ c_sec ascend_protobuf json + ge_ut_graph ) # build common format @@ -790,6 +823,11 @@ target_compile_definitions(ge_ut_common_format PRIVATE google=ascend_private ) +target_compile_options(ge_ut_common_format PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_ut_common_format PRIVATE $ c_sec @@ -804,6 +842,11 @@ target_compile_definitions(ge_prepare_common PRIVATE google=ascend_private ) +target_compile_options(ge_prepare_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_prepare_common PRIVATE $ c_sec @@ -818,6 +861,11 @@ target_compile_definitions(ge_optimize_common PRIVATE google=ascend_private ) +target_compile_options(ge_optimize_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_optimize_common PRIVATE $ ascend_protobuf @@ -832,6 +880,11 @@ target_compile_definitions(ge_partition_common PRIVATE google=ascend_private ) +target_compile_options(ge_partition_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_partition_common PRIVATE $ ascend_protobuf @@ -846,6 +899,11 @@ target_compile_definitions(ge_load_common PRIVATE google=ascend_private ) +target_compile_options(ge_load_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_load_common PRIVATE $ c_sec @@ -860,6 +918,11 @@ target_compile_definitions(ge_execute_common PRIVATE google=ascend_private ) +target_compile_options(ge_execute_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_execute_common PRIVATE $ c_sec @@ -874,6 +937,11 @@ target_compile_definitions(ge_build_common PRIVATE google=ascend_private ) +target_compile_options(ge_build_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_build_common PRIVATE $ c_sec @@ -888,6 +956,11 @@ target_compile_definitions(ge_pass_common PRIVATE google=ascend_private ) +target_compile_options(ge_pass_common PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_pass_common PRIVATE $ ascend_protobuf @@ -902,6 +975,11 @@ target_compile_definitions(ge_single_op PRIVATE google=ascend_private ) +target_compile_options(ge_single_op PRIVATE + -g + -Werror=format +) + target_link_libraries(ge_single_op PRIVATE $ ascend_protobuf @@ -920,6 +998,7 @@ add_executable(ut_libge_multiparts_utest target_compile_options(ut_libge_multiparts_utest PRIVATE -g --coverage -fprofile-arcs -ftest-coverage + -Werror=format ) target_compile_definitions(ut_libge_multiparts_utest PRIVATE @@ -942,6 +1021,7 @@ add_executable(ut_libge_others_utest target_compile_options(ut_libge_others_utest PRIVATE -g --coverage -fprofile-arcs -ftest-coverage + -Werror=format ) target_link_libraries(ut_libge_others_utest @@ -959,6 +1039,7 @@ add_executable(ut_libge_kernel_utest target_compile_options(ut_libge_kernel_utest PRIVATE -g --coverage -fprofile-arcs -ftest-coverage + -Werror=format ) target_link_libraries(ut_libge_kernel_utest @@ -977,6 +1058,7 @@ add_executable(ut_libge_distinct_load_utest target_compile_options(ut_libge_distinct_load_utest PRIVATE -g --coverage -fprofile-arcs -ftest-coverage + -Werror=format ) target_compile_definitions(ut_libge_distinct_load_utest PRIVATE