From 81aab2e5e09f5c9e1b1b4e4a7f0391da6ca88cb3 Mon Sep 17 00:00:00 2001 From: xuanyue Date: Thu, 23 Sep 2021 19:33:18 +0800 Subject: [PATCH] do not open flatbuffer and protobuf --- cmake/package_lite.cmake | 10 +--------- mindspore/lite/build_lite.sh | 4 ++-- mindspore/lite/tools/converter/export_model.cc | 2 +- .../lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh | 2 -- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/cmake/package_lite.cmake b/cmake/package_lite.cmake index 7ed5857d316..3c257d6443f 100644 --- a/cmake/package_lite.cmake +++ b/cmake/package_lite.cmake @@ -437,10 +437,8 @@ else() COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${TOP_DIR}/mindspore/lite/tools/converter/ops/ops_def.h DESTINATION ${CONVERTER_ROOT_DIR}/include COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/proto/ DESTINATION ${CONVERTER_ROOT_DIR}/include/proto - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/schema/ DESTINATION ${CONVERTER_ROOT_DIR}/include/schema - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "schema_generated.h" EXCLUDE) install(DIRECTORY ${flatbuffers_INC}/ DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party COMPONENT ${RUNTIME_COMPONENT_NAME}) install(DIRECTORY ${glog_LIBPATH}/../include/glog/ DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party/glog @@ -448,12 +446,6 @@ else() install(DIRECTORY ${TOP_DIR}/third_party/securec/include/ DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party/securec COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${protobuf_INC}/google DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party - COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(FILES ${protobuf_LIBPATH}/libprotobuf.a DESTINATION ${CONVERTER_ROOT_DIR}/lib - COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(FILES ${flatbuffers_LIBPATH}/libflatbuffers.a DESTINATION ${CONVERTER_ROOT_DIR}/lib - COMPONENT ${RUNTIME_COMPONENT_NAME}) install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin.so diff --git a/mindspore/lite/build_lite.sh b/mindspore/lite/build_lite.sh index f9bc92c7e3f..7be98011e23 100755 --- a/mindspore/lite/build_lite.sh +++ b/mindspore/lite/build_lite.sh @@ -237,13 +237,13 @@ build_lite() { compile_nnie_script=${BASEPATH}/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh cd ${BASEPATH}/../ if [[ "${local_lite_platform}" == "x86_64" ]]; then - sh ${compile_nnie_script} -I x86_64 -b nnie_3516_master -j $THREAD_NUM + sh ${compile_nnie_script} -I x86_64 -b nnie_3516_master_dev -j $THREAD_NUM if [[ $? -ne 0 ]]; then echo "compile x86_64 for nnie failed." exit 1 fi elif [[ "${local_lite_platform}" == "arm32" ]]; then - sh ${compile_nnie_script} -I arm32 -b nnie_3516_master -j $THREAD_NUM + sh ${compile_nnie_script} -I arm32 -b nnie_3516_master_dev -j $THREAD_NUM if [[ $? -ne 0 ]]; then echo "compile arm32 for nnie failed." exit 1 diff --git a/mindspore/lite/tools/converter/export_model.cc b/mindspore/lite/tools/converter/export_model.cc index 25fc90465bf..5e7bb159c8c 100644 --- a/mindspore/lite/tools/converter/export_model.cc +++ b/mindspore/lite/tools/converter/export_model.cc @@ -201,7 +201,7 @@ STATUS ExportModel(const FuncGraphPtr &graph, const converter::Flags *flags) { return RET_ERROR; } (void)Manage(mirror_graph, true); - if (!RunOptimizerPass(mirror_graph, {"ToNHWCFormat", "InferShapePass", "DecreaseTransposeAlgo"})) { + if (!RunOptimizerPass(mirror_graph, {"ToNHWCFormat", "InferShapePass"})) { MS_LOG(ERROR) << "Run transpose opt pass failed."; return RET_ERROR; } diff --git a/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh b/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh index ac7d085ff47..32ce905ed75 100644 --- a/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh +++ b/mindspore/lite/tools/providers/NNIE/Hi3516D/compile_nnie.sh @@ -39,8 +39,6 @@ function Run_Build_x86() { cd ${open_source_ms_path}/output/ || exit 1 # remove unused static library - rm ./mindspore-lite-${version}-linux-x64/tools/converter/lib/libprotobuf.a - rm ./mindspore-lite-${version}-linux-x64/tools/converter/lib/libflatbuffers.a echo "cp new nnie so to release pkg success" rm ${open_source_ms_path}/output/mindspore-lite-${version}-linux-x64.tar.gz tar -zcf ./mindspore-lite-${version}-linux-x64.tar.gz ./mindspore-lite-${version}-linux-x64/