diff --git a/CMakeLists.txt b/CMakeLists.txt index fd23d496878..dc3eb112e70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,15 +110,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") add_subdirectory(mindspore/ccsrc) add_subdirectory(mindspore/core) -if(DEFINED ENV{ENABLE_CLOUD_AND_LITE}) - set(ENABLE_CLOUD_AND_LITE $ENV{ENABLE_CLOUD_AND_LITE}) -endif() -if(ENABLE_CLOUD_AND_LITE) - set(ENV{MSLITE_ENABLE_RUNTIME_CONVERT} "on") - set(ENV{MSLITE_ENABLE_ACL} "on") - add_subdirectory(mindspore/lite) -endif() - if(ENABLE_TESTCASES OR ENABLE_CPP_ST) add_subdirectory(tests) endif() diff --git a/cmake/external_libs/protobuf.cmake b/cmake/external_libs/protobuf.cmake index 1bcfc9f15ed..7697c0de72b 100644 --- a/cmake/external_libs/protobuf.cmake +++ b/cmake/external_libs/protobuf.cmake @@ -99,11 +99,7 @@ function(common_protobuf_generate path c_var h_var) endfunction() function(ms_protobuf_generate c_var h_var) - if(NOT ENABLE_CLOUD_AND_LITE) common_protobuf_generate(${CMAKE_BINARY_DIR}/proto ${c_var} ${h_var} ${ARGN}) - else() - common_protobuf_generate(${CMAKE_BINARY_DIR}/proto/lite ${c_var} ${h_var} ${ARGN}) - endif() set(${c_var} ${${c_var}} PARENT_SCOPE) set(${h_var} ${${h_var}} PARENT_SCOPE) endfunction() diff --git a/cmake/package.cmake b/cmake/package.cmake index debbf1a1443..15274ef9d2d 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -272,14 +272,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows") ) endif() -if(ENABLE_CLOUD_AND_LITE) - install( - TARGETS mindspore-lite mslite_converter_plugin - DESTINATION ${INSTALL_LIB_DIR} - COMPONENT mindspore - ) -endif() - # set python files file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/*.py) install( diff --git a/mindspore/core/CMakeLists.txt b/mindspore/core/CMakeLists.txt index 962a91f57fc..cd5254a1dca 100644 --- a/mindspore/core/CMakeLists.txt +++ b/mindspore/core/CMakeLists.txt @@ -13,7 +13,7 @@ if(NOT(BUILD_LITE)) add_subdirectory(mindrt) endif() -if(NOT ENABLE_COVERAGE AND (CMAKE_SIZEOF_VOID_P EQUAL 4 OR NOT BUILD_LITE OR DEFINED ENV{ENABLE_CLOUD_AND_LITE})) +if(NOT ENABLE_COVERAGE AND (CMAKE_SIZEOF_VOID_P EQUAL 4 OR NOT BUILD_LITE)) file(GLOB_RECURSE CORE_OPS_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ops/*.cc") if(ENABLE_SECURITY) file(GLOB_RECURSE _INFER_SUMMARY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ops/*_summary.cc") diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index cfc8eb6bef5..68d67de6d37 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -14,16 +14,8 @@ set(MSLITE_REGISTRY_DEVICE "off" CACHE STRING "Compile Mindspore Lite that suppo currently supported devices: Hi3516D/Hi3519A/Hi3559A/SD3403") set(MSLITE_MICRO_PLATFORM "auto" CACHE STRING "Platform of micro static library micro static, \ currently supported : cortex-m7/auto") -if(NOT ENABLE_CLOUD_AND_LITE) - set(MSLITE_MINDDATA_IMPLEMENT "lite_cv" CACHE STRING "off, lite_cv, cloud, or full") -else() - remove_definitions(-DUSE_GLOG) - add_compile_definitions(ENABLE_CLOUD_AND_LITE) - if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "aarch64") - set(PLATFORM_ARM64 "on") - set(MACHINE_LINUX_ARM64 "on") - endif() -endif() +set(MSLITE_MINDDATA_IMPLEMENT "lite_cv" CACHE STRING "off, lite_cv, cloud, or full") + option(MSLITE_ENABLE_NPU "enable npu, only arm64 or arm32 support" off) option(MSLITE_ENABLE_TRAIN "enable train" on) option(MSLITE_ENABLE_SSE "enable SSE instruction set, only x86_64 support" off) @@ -561,10 +553,9 @@ include_directories(${CCSRC_DIR}/minddata/dataset) include(${TOP_DIR}/cmake/utils.cmake) include(${TOP_DIR}/cmake/dependency_utils.cmake) include(${TOP_DIR}/cmake/dependency_securec.cmake) -if(NOT ENABLE_CLOUD_AND_LITE) - # include(${TOP_DIR}/cmake/external_libs/flatbuffers.cmake) - set(MSLITE_DEPS_FLATBUFFERS on) -endif() + +# include(${TOP_DIR}/cmake/external_libs/flatbuffers.cmake) +set(MSLITE_DEPS_FLATBUFFERS on) if(MSLITE_GPU_BACKEND STREQUAL opencl) # include(${TOP_DIR}/cmake/external_libs/opencl.cmake) @@ -573,10 +564,8 @@ endif() if(MSLITE_ENABLE_CONVERTER OR MSLITE_MINDDATA_IMPLEMENT STREQUAL "full" OR MSLITE_MINDDATA_IMPLEMENT STREQUAL "wrapper" OR MSLITE_ENABLE_TOOLS OR MSLITE_ENABLE_KERNEL_EXECUTOR) - if(NOT ENABLE_CLOUD_AND_LITE) - # include(${TOP_DIR}/cmake/external_libs/json.cmake) - set(MSLITE_DEPS_JSON on) - endif() + # include(${TOP_DIR}/cmake/external_libs/json.cmake) + set(MSLITE_DEPS_JSON on) endif() if(DEFINED ARCHS) @@ -645,7 +634,7 @@ if(ENABLE_MODEL_OBF) set(OBF_LIBS libmsdeobfuscator-lite.so) endif() -if((MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_RUNTIME_GLOG) AND NOT ENABLE_CLOUD_AND_LITE) +if((MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_RUNTIME_GLOG)) # include(${TOP_DIR}/cmake/external_libs/glog.cmake) set(MSLITE_DEPS_GLOG on) endif() @@ -660,37 +649,29 @@ endfunction() if(MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_KERNEL_EXECUTOR) find_required_package(Patch) - if(NOT ENABLE_CLOUD_AND_LITE) - # include(${TOP_DIR}/cmake/external_libs/protobuf.cmake) - set(MSLITE_DEPS_PROTOBUF on) - endif() + # include(${TOP_DIR}/cmake/external_libs/protobuf.cmake) + set(MSLITE_DEPS_PROTOBUF on) endif() -if(NOT APPLE AND NOT ENABLE_CLOUD_AND_LITE) +if(NOT APPLE) if(PLATFORM_X86_64 OR MACHINE_LINUX_ARM64) - if(NOT ENABLE_CLOUD_AND_LITE) - set(MSLITE_DEPS_PYBIND11 on) - endif() + set(MSLITE_DEPS_PYBIND11 on) endif() endif() if(MSLITE_ENABLE_CONVERTER) - if(NOT ENABLE_CLOUD_AND_LITE) - set(MSLITE_DEPS_OPENCV on) - set(MSLITE_DEPS_EIGEN on) - endif() + set(MSLITE_DEPS_OPENCV on) + set(MSLITE_DEPS_EIGEN on) endif() if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE) - if(NOT ENABLE_CLOUD_AND_LITE) - set(MSLITE_DEPS_MKLDNN on) - set(MSLITE_DEPS_LIBEVENT on) - set(MSLITE_DEPS_PYBIND11 on) - set(MSLITE_DEPS_OPENSSL on) - endif() + set(MSLITE_DEPS_MKLDNN on) + set(MSLITE_DEPS_LIBEVENT on) + set(MSLITE_DEPS_PYBIND11 on) + set(MSLITE_DEPS_OPENSSL on) endif() -if(MSLITE_ENABLE_MODEL_ENCRYPTION AND NOT ENABLE_CLOUD_AND_LITE) +if(MSLITE_ENABLE_MODEL_ENCRYPTION) set(MSLITE_DEPS_OPENSSL on) endif() @@ -804,11 +785,9 @@ if(ANDROID_NDK_TOOLCHAIN_INCLUDED) endif() add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src) -if(NOT ENABLE_CLOUD_AND_LITE) - add_subdirectory(${CCSRC_DIR}/plugin/device/cpu/kernel/nnacl build) -endif() +add_subdirectory(${CCSRC_DIR}/plugin/device/cpu/kernel/nnacl build) -if(MSLITE_ENABLE_TOOLS AND NOT ENABLE_CLOUD_AND_LITE) +if(MSLITE_ENABLE_TOOLS) if(NOT MSLITE_COMPILE_TWICE) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/benchmark) endif() @@ -827,7 +806,7 @@ if(NOT WIN32 AND MSLITE_ENABLE_TESTCASES) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test) endif() -if(NOT APPLE AND NOT ENABLE_CLOUD_AND_LITE) +if(NOT APPLE) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/file_list.cmake) include(${TOP_DIR}/cmake/package_lite.cmake) diff --git a/mindspore/lite/cmake/lite_compile_definitions.cmake b/mindspore/lite/cmake/lite_compile_definitions.cmake index 479dac6f36e..b2b39b8ce91 100644 --- a/mindspore/lite/cmake/lite_compile_definitions.cmake +++ b/mindspore/lite/cmake/lite_compile_definitions.cmake @@ -1,10 +1,5 @@ add_compile_definitions(BUILD_LITE) -if(ENABLE_CLOUD_AND_LITE) - remove_definitions(-DUSE_GLOG) - add_compile_definitions(ENABLE_CLOUD_AND_LITE) -endif() - add_definitions(-DVERSION_STR=\"${VERSION_STR}\") if(MACHINE_LINUX_ARM64) diff --git a/mindspore/lite/cmake/lite_options.cmake b/mindspore/lite/cmake/lite_options.cmake index 398e5f7c9b0..f49a0230236 100644 --- a/mindspore/lite/cmake/lite_options.cmake +++ b/mindspore/lite/cmake/lite_options.cmake @@ -10,14 +10,8 @@ set(MSLITE_REGISTRY_DEVICE "off" CACHE STRING "Compile Mindspore Lite that suppo currently supported devices: Hi3516D/Hi3519A/Hi3559A/SD3403") set(MSLITE_MICRO_PLATFORM "auto" CACHE STRING "Platform of micro static library micro static, \ currently supported : cortex-m7/auto") -if(NOT ENABLE_CLOUD_AND_LITE) - set(MSLITE_MINDDATA_IMPLEMENT "lite_cv" CACHE STRING "off, lite_cv, cloud, or full") -else() - if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "aarch64") - set(PLATFORM_ARM64 "on") - set(MACHINE_LINUX_ARM64 "on") - endif() -endif() +set(MSLITE_MINDDATA_IMPLEMENT "lite_cv" CACHE STRING "off, lite_cv, cloud, or full") + option(MSLITE_ENABLE_NPU "enable npu, only arm64 or arm32 support" off) option(MSLITE_ENABLE_TRAIN "enable train" on) option(MSLITE_ENABLE_SSE "enable SSE instruction set, only x86_64 support" off) diff --git a/mindspore/lite/cmake/secure_option.cmake b/mindspore/lite/cmake/secure_option.cmake index 9a9e4651f86..649cf35e470 100644 --- a/mindspore/lite/cmake/secure_option.cmake +++ b/mindspore/lite/cmake/secure_option.cmake @@ -1,4 +1,4 @@ -if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT ENABLE_CLOUD_AND_LITE) +if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(CMAKE_SKIP_RPATH TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_SKIP_INSTALL_RPATH TRUE) diff --git a/mindspore/lite/src/CMakeLists.txt b/mindspore/lite/src/CMakeLists.txt index 2be49744590..73dcd453aa8 100644 --- a/mindspore/lite/src/CMakeLists.txt +++ b/mindspore/lite/src/CMakeLists.txt @@ -388,9 +388,7 @@ set(TRAIN_SRC ) if(MSLITE_ENABLE_MINDRT) - if(NOT ENABLE_CLOUD_AND_LITE) - add_subdirectory(${CORE_DIR}/mindrt mindspore_mindrt) - endif() + add_subdirectory(${CORE_DIR}/mindrt mindspore_mindrt) set(LITE_SRC ${LITE_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/runtime/lite_mindrt.cc ${CMAKE_CURRENT_SOURCE_DIR}/runtime/mindrt_executor.cc @@ -581,12 +579,10 @@ if(MSLITE_ENABLE_RUNTIME_CONVERT) cpu_kernel_mid ccsrc_src_mid converter_src_mid lite_exporter_mid config_parser_mid mslite_converter_plugin mindspore_core coder_mid mindir_serializer_mid mindspore::protobuf ${SECUREC_LIBRARY}) - if(NOT ENABLE_CLOUD_AND_LITE) - target_link_libraries(mindspore-lite - ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj) - target_link_libraries(mindspore-lite_static - ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj) - endif() + target_link_libraries(mindspore-lite + ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj) + target_link_libraries(mindspore-lite_static + ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj) if(MSLITE_ENABLE_ACL) target_link_libraries(mindspore-lite lite_acl_mid mindspore_shared_lib) @@ -648,7 +644,3 @@ if(MSLITE_ENABLE_ACL) target_link_libraries(mindspore-lite ascend_kernel_mid) target_link_libraries(mindspore-lite_static ascend_kernel_mid) endif() - -if(ENABLE_CLOUD_AND_LITE) - set_target_properties(mindspore-lite PROPERTIES INSTALL_RPATH $ORIGIN) -endif() diff --git a/mindspore/lite/tools/common/protobuf_utils.h b/mindspore/lite/tools/common/protobuf_utils.h index 5ff838b2db7..def39885bf8 100644 --- a/mindspore/lite/tools/common/protobuf_utils.h +++ b/mindspore/lite/tools/common/protobuf_utils.h @@ -20,11 +20,7 @@ #include #include #include "google/protobuf/message.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/caffe.pb.h" -#else #include "proto/caffe.pb.h" -#endif #include "include/errorcode.h" #include "schema/inner/model_generated.h" diff --git a/mindspore/lite/tools/converter/CMakeLists.txt b/mindspore/lite/tools/converter/CMakeLists.txt index 127056e4e3d..5f84a4ae146 100644 --- a/mindspore/lite/tools/converter/CMakeLists.txt +++ b/mindspore/lite/tools/converter/CMakeLists.txt @@ -91,16 +91,13 @@ add_subdirectory(registry) add_subdirectory(preprocess) add_subdirectory(config_parser) add_subdirectory(micro/coder) -if(NOT ENABLE_CLOUD_AND_LITE) - add_subdirectory(${CORE_DIR} mindspore_core) -endif() +add_subdirectory(${CORE_DIR} mindspore_core) + if(MSLITE_ENABLE_ACL) set(MODE_ASCEND_ACL ON) include_directories(${TOP_DIR}/graphengine/inc/external) - if(NOT ENABLE_CLOUD_AND_LITE) - include(${TOP_DIR}/cmake/dependency_graphengine.cmake) - endif() + include(${TOP_DIR}/cmake/dependency_graphengine.cmake) add_subdirectory(adapter/acl) link_directories(${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) endif() @@ -303,9 +300,8 @@ add_dependencies(ccsrc_src_mid fbs_src fbs_inner_src) target_compile_definitions(ccsrc_src_mid PRIVATE BACKEND_DLL) target_compile_definitions(converter_src_mid PRIVATE BACKEND_DLL) -if(NOT ENABLE_CLOUD_AND_LITE) - add_dependencies(mindspore_converter nnacl_mid) -endif() +add_dependencies(mindspore_converter nnacl_mid) + if((NOT WIN32) AND MSLITE_ENABLE_DPICO_ATC_ADAPTER) add_dependencies(mindspore_converter dpico_atc_adapter) endif() @@ -357,12 +353,11 @@ if(ENABLE_CONVERT_PYTORCH_MODEL) target_link_libraries(mindspore_converter pytorch_parser_mid) endif() -if(NOT ENABLE_CLOUD_AND_LITE) - target_link_libraries(mindspore_converter - ccsrc_debug_common_mid_ - mindir_proto_mid - _mindspore_transform_express_ir_obj) -endif() +target_link_libraries(mindspore_converter + ccsrc_debug_common_mid_ + mindir_proto_mid + _mindspore_transform_express_ir_obj) + if(MSLITE_ENABLE_ACL) target_link_libraries(mindspore_converter lite_acl_mid diff --git a/mindspore/lite/tools/converter/adapter/acl/CMakeLists.txt b/mindspore/lite/tools/converter/adapter/acl/CMakeLists.txt index 7017e792c9b..6090bf17510 100644 --- a/mindspore/lite/tools/converter/adapter/acl/CMakeLists.txt +++ b/mindspore/lite/tools/converter/adapter/acl/CMakeLists.txt @@ -18,53 +18,12 @@ file(GLOB ACL_SRC set(ENABLE_ACL on) set(MODE_ASCEND_ACL off) -if(NOT ENABLE_CLOUD_AND_LITE) - add_subdirectory(${TOP_DIR}/mindspore/ccsrc/transform/graph_ir _mindspore_transform_graph_ir_obj) - add_subdirectory(${TOP_DIR}/mindspore/ccsrc/cxx_api mindspore_shared_lib) -endif() +add_subdirectory(${TOP_DIR}/mindspore/ccsrc/transform/graph_ir _mindspore_transform_graph_ir_obj) +add_subdirectory(${TOP_DIR}/mindspore/ccsrc/cxx_api mindspore_shared_lib) + set_property(SOURCE ${ACL_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) add_library(lite_acl_mid OBJECT ${ACL_SRC}) target_link_libraries(lite_acl_mid mindspore_shared_lib) add_dependencies(lite_acl_mid mindspore_shared_lib) add_dependencies(lite_acl_mid fbs_inner_src) - -if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "cloud") - set(MSLITE_ENABLE_CLOUD_MIND_DATA ON) - # find python - include(${TOP_DIR}/mindspore/lite/cmake/python.cmake) - if(Python3_FOUND) - set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}") - set(PYTHON_LIBRARIES "${Python3_LIBRARIES}") - else() - find_python_package(py_inc py_lib) - set(PYTHON_INCLUDE_DIRS "${py_inc}") - set(PYTHON_LIBRARIES "${py_lib}") - endif() - message("Python version: ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") - message("PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}") - message("PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}") - include_directories(${PYTHON_INCLUDE_DIRS}) - # MindData - add_compile_definitions(ENABLE_LITE_TENSOR) - add_compile_definitions(ENABLE_PYTHON) - set(ENABLE_PYTHON ON) - - include(${TOP_DIR}/cmake/external_libs/sentencepiece.cmake) - include(${TOP_DIR}/cmake/external_libs/jpeg_turbo.cmake) - include(${TOP_DIR}/cmake/external_libs/tinyxml2.cmake) - include(${TOP_DIR}/cmake/external_libs/icu4c.cmake) - include(${TOP_DIR}/cmake/external_libs/sqlite.cmake) - include(${TOP_DIR}/cmake/external_libs/pybind11.cmake) - include(${TOP_DIR}/cmake/external_libs/cppjieba.cmake) - include(${TOP_DIR}/cmake/external_libs/re2.cmake) - include(${TOP_DIR}/cmake/external_libs/c-ares.cmake) - include(${TOP_DIR}/cmake/external_libs/absl.cmake) - include(${TOP_DIR}/cmake/external_libs/grpc.cmake) - - set(MINDDATA_DIR ${CCSRC_DIR}/minddata/dataset) - include_directories("${MINDDATA_DIR}/kernels/image") - - add_subdirectory(${CCSRC_DIR}/minddata/mindrecord _c_mindrecord) - add_subdirectory(${CCSRC_DIR}/minddata/dataset _c_dataengine) -endif() diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.h b/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.h index f5a9bc4007a..76432e7b4de 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.h +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_inspector.h @@ -22,11 +22,7 @@ #include #include #include -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/caffe.pb.h" -#else #include "proto/caffe.pb.h" -#endif #include "include/errorcode.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_model_parser.h b/mindspore/lite/tools/converter/parser/caffe/caffe_model_parser.h index 29c3fe0caea..8e1f97cbc32 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_model_parser.h +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_model_parser.h @@ -23,11 +23,7 @@ #include #include "include/registry/model_parser.h" #include "include/registry/model_parser_registry.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/caffe.pb.h" -#else #include "proto/caffe.pb.h" -#endif #include "ops/primitive_c.h" using STATUS = int; diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h b/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h index 9a78135e3dd..99589ec1824 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h @@ -21,11 +21,7 @@ #include #include "google/protobuf/message.h" #include "schema/inner/model_generated.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/caffe.pb.h" -#else #include "proto/caffe.pb.h" -#endif #include "tools/converter/parser/caffe/caffe_node_parser.h" #include "include/errorcode.h" #include "src/common/log_adapter.h" diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser_registry.h b/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser_registry.h index c61993ab6c8..1c1b844341b 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser_registry.h +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser_registry.h @@ -20,11 +20,7 @@ #include #include #include "tools/converter/parser/caffe/caffe_node_parser.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/caffe.pb.h" -#else #include "proto/caffe.pb.h" -#endif namespace mindspore::lite { class CaffeNodeParserRegistry { diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.h b/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.h index f3dcde161f7..2d4a9ff5ecf 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.h +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.h @@ -30,11 +30,7 @@ #include "include/registry/model_parser.h" #include "include/registry/model_parser_registry.h" #include "tools/converter/parser/onnx/onnx_node_parser_registry.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/onnx.pb.h" -#else #include "proto/onnx.pb.h" -#endif #include "schema/inner/model_generated.h" namespace mindspore { diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h b/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h index a98afd89eb7..0e0ed34e63f 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_node_parser.h @@ -21,11 +21,7 @@ #include #include #include "google/protobuf/message.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/onnx.pb.h" -#else #include "proto/onnx.pb.h" -#endif #include "include/errorcode.h" #include "src/common/log_adapter.h" #include "schema/inner/model_generated.h" diff --git a/mindspore/lite/tools/converter/parser/tf/tf_model_parser.h b/mindspore/lite/tools/converter/parser/tf/tf_model_parser.h index b72bda79ce1..368be5f59a3 100644 --- a/mindspore/lite/tools/converter/parser/tf/tf_model_parser.h +++ b/mindspore/lite/tools/converter/parser/tf/tf_model_parser.h @@ -24,13 +24,8 @@ #include #include #include -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/graph.pb.h" -#include "proto/lite/node_def.pb.h" -#else #include "proto/graph.pb.h" #include "proto/node_def.pb.h" -#endif #include "schema/inner/model_generated.h" #include "securec/include/securec.h" #include "tools/common/tensor_util.h" diff --git a/mindspore/lite/tools/converter/parser/tf/tf_node_parser.h b/mindspore/lite/tools/converter/parser/tf/tf_node_parser.h index 6270a733b4f..352aa1d6395 100644 --- a/mindspore/lite/tools/converter/parser/tf/tf_node_parser.h +++ b/mindspore/lite/tools/converter/parser/tf/tf_node_parser.h @@ -22,11 +22,7 @@ #include #include #include "tools/converter/parser/tf/tf_util.h" -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/graph.pb.h" -#else #include "proto/graph.pb.h" -#endif #include "ops/primitive_c.h" #include "mindspore/core/utils/check_convert_utils.h" #include "nnacl/op_base.h" diff --git a/mindspore/lite/tools/converter/parser/tf/tf_util.h b/mindspore/lite/tools/converter/parser/tf/tf_util.h index 977931cad1d..112f6430092 100644 --- a/mindspore/lite/tools/converter/parser/tf/tf_util.h +++ b/mindspore/lite/tools/converter/parser/tf/tf_util.h @@ -19,11 +19,7 @@ #include #include -#ifdef ENABLE_CLOUD_AND_LITE -#include "proto/lite/node_def.pb.h" -#else #include "proto/node_def.pb.h" -#endif #include "ir/dtype/type_id.h" #include "include/errorcode.h" #include "schema/inner/model_generated.h" diff --git a/mindspore/lite/tools/mindir_exporter/CMakeLists.txt b/mindspore/lite/tools/mindir_exporter/CMakeLists.txt index 8c8a1c1b223..be18cb0e91c 100644 --- a/mindspore/lite/tools/mindir_exporter/CMakeLists.txt +++ b/mindspore/lite/tools/mindir_exporter/CMakeLists.txt @@ -14,13 +14,9 @@ add_library(mindir_proto_mid OBJECT ${PROTO_SRCS}) add_compile_definitions(MINDIR_EXPORT_TENSOR_LAYOUT_CLIP) add_compile_definitions(COMMON_DLL) -if(NOT ENABLE_CLOUD_AND_LITE) -# if(NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE) - set(MINDIR_EXPORT_DIR ${CCSRC_DIR}/transform/express_ir) - add_subdirectory(${MINDIR_EXPORT_DIR} mindir_exporter) - add_dependencies(_mindspore_transform_express_ir_obj mindir_proto_mid) -# endif() -endif() +set(MINDIR_EXPORT_DIR ${CCSRC_DIR}/transform/express_ir) +add_subdirectory(${MINDIR_EXPORT_DIR} mindir_exporter) +add_dependencies(_mindspore_transform_express_ir_obj mindir_proto_mid) add_library(mindir_serializer_mid OBJECT ${MINDIR_EXPORTER_SRC_LIST} diff --git a/mindspore/lite/tools/mindir_exporter/mindir_serializer.cc b/mindspore/lite/tools/mindir_exporter/mindir_serializer.cc index 13f2850123e..250e530c4a3 100644 --- a/mindspore/lite/tools/mindir_exporter/mindir_serializer.cc +++ b/mindspore/lite/tools/mindir_exporter/mindir_serializer.cc @@ -31,7 +31,6 @@ namespace mindspore::lite { constexpr const size_t TOTAL_SAVE = 1024 * 1024 * 1024; constexpr const int64_t OFFSET = 64; -#ifndef ENABLE_CLOUD_AND_LITE namespace { bool DeleteDirRecursively(const std::string &dir_name) { DIR *dir = opendir(dir_name.c_str()); @@ -402,18 +401,12 @@ int MindIRSerializer::SaveProtoToFile(mind_ir::ModelProto *model_proto, const st ChangeFileMode(realpath.value(), S_IRUSR); return RET_OK; } -#endif int MindIRSerialize(const std::shared_ptr ¶m, const FuncGraphPtr &func_graph) { -#ifndef ENABLE_CLOUD_AND_LITE if (!param->export_mindir) { return RET_OK; } mindspore::lite::MindIRSerializer serializer; return serializer.Save(param, func_graph); -#else - MS_LOG(INFO) << "No need to serialize mindir when load model online."; - return RET_OK; -#endif } } // namespace mindspore::lite diff --git a/mindspore/lite/tools/mindir_exporter/mindir_serializer.h b/mindspore/lite/tools/mindir_exporter/mindir_serializer.h index 03cf791f9db..046023228a2 100644 --- a/mindspore/lite/tools/mindir_exporter/mindir_serializer.h +++ b/mindspore/lite/tools/mindir_exporter/mindir_serializer.h @@ -29,7 +29,6 @@ #include "tools/converter/cxx_api/converter_para.h" namespace mindspore::lite { -#ifndef ENABLE_CLOUD_AND_LITE class MindIRSerializer { public: MindIRSerializer() = default; @@ -72,7 +71,6 @@ class MindIRSerializer { std::fstream *data_fs_ = nullptr; std::shared_ptr fs_{}; }; -#endif // export func_graph int MindIRSerialize(const std::shared_ptr ¶m, const FuncGraphPtr &func_graph); } // namespace mindspore::lite diff --git a/scripts/build/parse_device.sh b/scripts/build/parse_device.sh index cb076b949f9..338ae0ac643 100755 --- a/scripts/build/parse_device.sh +++ b/scripts/build/parse_device.sh @@ -56,7 +56,6 @@ parse_device() ENABLE_CPU="on" export ENABLE_MPI="on" export ENABLE_AKG="on" - export ENABLE_CLOUD_AND_LITE="on" else echo "Invalid value ${DEVICE_VERSION} for option -V" usage