From 6426aab7d328b6c4937ecf4b5b478dc219fa7b3b Mon Sep 17 00:00:00 2001 From: lichun Date: Tue, 23 Mar 2021 15:33:00 +0800 Subject: [PATCH] Bugfix: support unknown control op subgraph --- ge/CMakeLists.txt | 104 +++++++++++------------ ge/common/CMakeLists.txt | 4 +- ge/executor/CMakeLists.txt | 4 +- ge/ge_local_engine/CMakeLists.txt | 6 +- ge/host_cpu_engine/CMakeLists.txt | 4 +- ge/offline/CMakeLists.txt | 2 +- tests/ut/ge/hybrid/ge_hybrid_unittest.cc | 1 + 7 files changed, 63 insertions(+), 62 deletions(-) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index bd9edd86..9f2b21d7 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -28,59 +28,59 @@ set(PROTO_HEADER_LIST "${METADEF_DIR}/proto/op_mapping_info.proto" ) -protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) -protobuf_generate(ge PROTO_CLIENT_SRCS PROTO_CLIENT_HDRS ${PROTO_CLIENT_LIST}) -protobuf_generate(ge PROTO_HEADER_SRCS PROTO_HEADER_HDRS ${PROTO_HEADER_LIST}) -protobuf_generate(ge_client PROTO_CLIENT_HEADER_SRCS PROTO_CLIENT_HEADER_HDRS ${PROTO_HEADER_LIST}) +#protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) +#protobuf_generate(ge PROTO_CLIENT_SRCS PROTO_CLIENT_HDRS ${PROTO_CLIENT_LIST}) +#protobuf_generate(ge PROTO_HEADER_SRCS PROTO_HEADER_HDRS ${PROTO_HEADER_LIST}) +#protobuf_generate(ge_client PROTO_CLIENT_HEADER_SRCS PROTO_CLIENT_HEADER_HDRS ${PROTO_HEADER_LIST}) -if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) -############ libge_proto_common.a ############ -add_library(ge_proto_common STATIC - ${PROTO_HEADER_HDRS} - ${PROTO_SRCS} -) - -target_compile_definitions(ge_proto_common PRIVATE - PROTOBUF_INLINE_NOT_IN_HEADERS=0 - google=ascend_private -) - -target_compile_options(ge_proto_common PRIVATE - -O2 - -fno-common -) - -target_link_libraries(ge_proto_common PRIVATE - $ - ascend_protobuf -) - -############ libge_proto_client.a ############ -add_library(ge_proto_client STATIC - ${PROTO_CLIENT_HEADER_HDRS} - ${PROTO_CLIENT_SRCS} -) - -target_compile_definitions(ge_proto_client PRIVATE - PROTOBUF_INLINE_NOT_IN_HEADERS=0 - google=ascend_private -) - -target_include_directories(ge_proto_client PRIVATE - ${CMAKE_BINARY_DIR}/proto/ge_client - ${CMAKE_BINARY_DIR}/proto/ge_client/proto -) - -target_compile_options(ge_proto_client PRIVATE - -O2 - -fno-common -) - -target_link_libraries(ge_proto_client PRIVATE - $ - ascend_protobuf -) -endif () +#if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) +############# libge_proto_common.a ############ +#add_library(ge_proto_common STATIC +# ${PROTO_HEADER_HDRS} +# ${PROTO_SRCS} +#) +# +#target_compile_definitions(ge_proto_common PRIVATE +# PROTOBUF_INLINE_NOT_IN_HEADERS=0 +# google=ascend_private +#) +# +#target_compile_options(ge_proto_common PRIVATE +# -O2 +# -fno-common +#) +# +#target_link_libraries(ge_proto_common PRIVATE +# $ +# ascend_protobuf +#) +# +############# libge_proto_client.a ############ +#add_library(ge_proto_client STATIC +# ${PROTO_CLIENT_HEADER_HDRS} +# ${PROTO_CLIENT_SRCS} +#) +# +#target_compile_definitions(ge_proto_client PRIVATE +# PROTOBUF_INLINE_NOT_IN_HEADERS=0 +# google=ascend_private +#) +# +#target_include_directories(ge_proto_client PRIVATE +# ${CMAKE_BINARY_DIR}/proto/ge_client +# ${CMAKE_BINARY_DIR}/proto/ge_client/proto +#) +# +#target_compile_options(ge_proto_client PRIVATE +# -O2 +# -fno-common +#) +# +#target_link_libraries(ge_proto_client PRIVATE +# $ +# ascend_protobuf +#) +#endif () ################################################################## set(TRAIN_SRC_LIST diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 75cb8ad1..585a42cb 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -15,8 +15,8 @@ set(PROTO_LIST "${METADEF_DIR}/proto/tensorflow/versions.proto" ) -protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) -protobuf_generate(ge_static PROTO_STATIC_SRCS PROTO_STATIC_HDRS ${PROTO_LIST}) +#protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) +#protobuf_generate(ge_static PROTO_STATIC_SRCS PROTO_STATIC_HDRS ${PROTO_LIST}) set(SRC_LIST "context/ctx.cc" diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index 363900d0..31f8dc4b 100644 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -7,8 +7,8 @@ set(PROTO_LIST "${METADEF_DIR}/proto/dump_task.proto" ) -protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) -protobuf_generate(ge_static PROTO_STATIC_SRCS PROTO_STATIC_HDRS ${PROTO_LIST}) +#protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) +#protobuf_generate(ge_static PROTO_STATIC_SRCS PROTO_STATIC_HDRS ${PROTO_LIST}) set(SRC_LIST "ge_executor.cc" diff --git a/ge/ge_local_engine/CMakeLists.txt b/ge/ge_local_engine/CMakeLists.txt index ab767ccb..affd8f5a 100755 --- a/ge/ge_local_engine/CMakeLists.txt +++ b/ge/ge_local_engine/CMakeLists.txt @@ -19,9 +19,9 @@ set(OPS_KERNEL_SRC_LIST "ops_kernel_store/op/no_op.cc" ) -protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) -protobuf_generate(ge_ops_shared PROTO_OPS_SHARED_SRCS PROTO_OPS_SHARED_HDRS ${PROTO_LIST}) -protobuf_generate(ge_ops_static PROTO_OPS_STATIC_SRCS PROTO_OPS_STATIC_HDRS ${PROTO_LIST}) +#protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) +#protobuf_generate(ge_ops_shared PROTO_OPS_SHARED_SRCS PROTO_OPS_SHARED_HDRS ${PROTO_LIST}) +#protobuf_generate(ge_ops_static PROTO_OPS_STATIC_SRCS PROTO_OPS_STATIC_HDRS ${PROTO_LIST}) ############ libge_local_engine.so ############ add_library(ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS}) diff --git a/ge/host_cpu_engine/CMakeLists.txt b/ge/host_cpu_engine/CMakeLists.txt index 8d84ee28..950a1e5c 100644 --- a/ge/host_cpu_engine/CMakeLists.txt +++ b/ge/host_cpu_engine/CMakeLists.txt @@ -2,8 +2,8 @@ set(PROTO_LIST "${METADEF_DIR}/proto/task.proto" ) -protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) -protobuf_generate(ge_atcstub PROTO_ATCSTUB_SRCS PROTO_ATCSTUB_HDRS ${PROTO_LIST}) +#protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) +#protobuf_generate(ge_atcstub PROTO_ATCSTUB_SRCS PROTO_ATCSTUB_HDRS ${PROTO_LIST}) set(SRC_LIST "engine/host_cpu_engine.cc" diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index 87589859..1e8a6cc5 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -5,7 +5,7 @@ set(PROTO_LIST "${METADEF_DIR}/proto/task.proto" ) -protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) +#protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) set(SRC_LIST "main.cc" diff --git a/tests/ut/ge/hybrid/ge_hybrid_unittest.cc b/tests/ut/ge/hybrid/ge_hybrid_unittest.cc index 8d8f0a78..e244eb2f 100644 --- a/tests/ut/ge/hybrid/ge_hybrid_unittest.cc +++ b/tests/ut/ge/hybrid/ge_hybrid_unittest.cc @@ -283,6 +283,7 @@ TEST_F(UtestGeHybrid, unfold_subgraphs_success) { auto partitioned_call_op_desc = MakeShared("partitioned_call", PARTITIONEDCALL); auto partitioned_call_node = root_graph->AddNode(partitioned_call_op_desc); partitioned_call_node->GetOpDesc()->AddSubgraphName("sub_graph"); + partitioned_call_node->GetOpDesc()->SetSubgraphInstanceName(0, "sub_graph"); sub_sub_graph1->AddSubGraph(sub_sub_graph1); sub_sub_graph2->AddSubGraph(sub_sub_graph2);