forked from mindspore-Ecosystem/mindspore
remove ENABLE_CLOUD_AND_LITE
This commit is contained in:
parent
26405d4f4b
commit
f09f6b1ee6
|
@ -110,15 +110,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
|
||||||
add_subdirectory(mindspore/ccsrc)
|
add_subdirectory(mindspore/ccsrc)
|
||||||
add_subdirectory(mindspore/core)
|
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)
|
if(ENABLE_TESTCASES OR ENABLE_CPP_ST)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -99,11 +99,7 @@ function(common_protobuf_generate path c_var h_var)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(ms_protobuf_generate c_var h_var)
|
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})
|
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(${c_var} ${${c_var}} PARENT_SCOPE)
|
||||||
set(${h_var} ${${h_var}} PARENT_SCOPE)
|
set(${h_var} ${${h_var}} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
@ -272,14 +272,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CLOUD_AND_LITE)
|
|
||||||
install(
|
|
||||||
TARGETS mindspore-lite mslite_converter_plugin
|
|
||||||
DESTINATION ${INSTALL_LIB_DIR}
|
|
||||||
COMPONENT mindspore
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set python files
|
# set python files
|
||||||
file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/*.py)
|
file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/*.py)
|
||||||
install(
|
install(
|
||||||
|
|
|
@ -13,7 +13,7 @@ if(NOT(BUILD_LITE))
|
||||||
add_subdirectory(mindrt)
|
add_subdirectory(mindrt)
|
||||||
endif()
|
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")
|
file(GLOB_RECURSE CORE_OPS_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ops/*.cc")
|
||||||
if(ENABLE_SECURITY)
|
if(ENABLE_SECURITY)
|
||||||
file(GLOB_RECURSE _INFER_SUMMARY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ops/*_summary.cc")
|
file(GLOB_RECURSE _INFER_SUMMARY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ops/*_summary.cc")
|
||||||
|
|
|
@ -14,16 +14,8 @@ set(MSLITE_REGISTRY_DEVICE "off" CACHE STRING "Compile Mindspore Lite that suppo
|
||||||
currently supported devices: Hi3516D/Hi3519A/Hi3559A/SD3403")
|
currently supported devices: Hi3516D/Hi3519A/Hi3559A/SD3403")
|
||||||
set(MSLITE_MICRO_PLATFORM "auto" CACHE STRING "Platform of micro static library micro static, \
|
set(MSLITE_MICRO_PLATFORM "auto" CACHE STRING "Platform of micro static library micro static, \
|
||||||
currently supported : cortex-m7/auto")
|
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")
|
||||||
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()
|
|
||||||
option(MSLITE_ENABLE_NPU "enable npu, only arm64 or arm32 support" off)
|
option(MSLITE_ENABLE_NPU "enable npu, only arm64 or arm32 support" off)
|
||||||
option(MSLITE_ENABLE_TRAIN "enable train" on)
|
option(MSLITE_ENABLE_TRAIN "enable train" on)
|
||||||
option(MSLITE_ENABLE_SSE "enable SSE instruction set, only x86_64 support" off)
|
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/utils.cmake)
|
||||||
include(${TOP_DIR}/cmake/dependency_utils.cmake)
|
include(${TOP_DIR}/cmake/dependency_utils.cmake)
|
||||||
include(${TOP_DIR}/cmake/dependency_securec.cmake)
|
include(${TOP_DIR}/cmake/dependency_securec.cmake)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
|
||||||
# include(${TOP_DIR}/cmake/external_libs/flatbuffers.cmake)
|
# include(${TOP_DIR}/cmake/external_libs/flatbuffers.cmake)
|
||||||
set(MSLITE_DEPS_FLATBUFFERS on)
|
set(MSLITE_DEPS_FLATBUFFERS on)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSLITE_GPU_BACKEND STREQUAL opencl)
|
if(MSLITE_GPU_BACKEND STREQUAL opencl)
|
||||||
# include(${TOP_DIR}/cmake/external_libs/opencl.cmake)
|
# 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"
|
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)
|
OR MSLITE_ENABLE_TOOLS OR MSLITE_ENABLE_KERNEL_EXECUTOR)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
# include(${TOP_DIR}/cmake/external_libs/json.cmake)
|
||||||
# include(${TOP_DIR}/cmake/external_libs/json.cmake)
|
set(MSLITE_DEPS_JSON on)
|
||||||
set(MSLITE_DEPS_JSON on)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEFINED ARCHS)
|
if(DEFINED ARCHS)
|
||||||
|
@ -645,7 +634,7 @@ if(ENABLE_MODEL_OBF)
|
||||||
set(OBF_LIBS libmsdeobfuscator-lite.so)
|
set(OBF_LIBS libmsdeobfuscator-lite.so)
|
||||||
endif()
|
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)
|
# include(${TOP_DIR}/cmake/external_libs/glog.cmake)
|
||||||
set(MSLITE_DEPS_GLOG on)
|
set(MSLITE_DEPS_GLOG on)
|
||||||
endif()
|
endif()
|
||||||
|
@ -660,37 +649,29 @@ endfunction()
|
||||||
|
|
||||||
if(MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_KERNEL_EXECUTOR)
|
if(MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_KERNEL_EXECUTOR)
|
||||||
find_required_package(Patch)
|
find_required_package(Patch)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
# include(${TOP_DIR}/cmake/external_libs/protobuf.cmake)
|
||||||
# include(${TOP_DIR}/cmake/external_libs/protobuf.cmake)
|
set(MSLITE_DEPS_PROTOBUF on)
|
||||||
set(MSLITE_DEPS_PROTOBUF on)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE AND NOT ENABLE_CLOUD_AND_LITE)
|
if(NOT APPLE)
|
||||||
if(PLATFORM_X86_64 OR MACHINE_LINUX_ARM64)
|
if(PLATFORM_X86_64 OR MACHINE_LINUX_ARM64)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
set(MSLITE_DEPS_PYBIND11 on)
|
||||||
set(MSLITE_DEPS_PYBIND11 on)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSLITE_ENABLE_CONVERTER)
|
if(MSLITE_ENABLE_CONVERTER)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
set(MSLITE_DEPS_OPENCV on)
|
||||||
set(MSLITE_DEPS_OPENCV on)
|
set(MSLITE_DEPS_EIGEN on)
|
||||||
set(MSLITE_DEPS_EIGEN on)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
|
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
set(MSLITE_DEPS_MKLDNN on)
|
||||||
set(MSLITE_DEPS_MKLDNN on)
|
set(MSLITE_DEPS_LIBEVENT on)
|
||||||
set(MSLITE_DEPS_LIBEVENT on)
|
set(MSLITE_DEPS_PYBIND11 on)
|
||||||
set(MSLITE_DEPS_PYBIND11 on)
|
set(MSLITE_DEPS_OPENSSL on)
|
||||||
set(MSLITE_DEPS_OPENSSL on)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSLITE_ENABLE_MODEL_ENCRYPTION AND NOT ENABLE_CLOUD_AND_LITE)
|
if(MSLITE_ENABLE_MODEL_ENCRYPTION)
|
||||||
set(MSLITE_DEPS_OPENSSL on)
|
set(MSLITE_DEPS_OPENSSL on)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -804,11 +785,9 @@ if(ANDROID_NDK_TOOLCHAIN_INCLUDED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
add_subdirectory(${CCSRC_DIR}/plugin/device/cpu/kernel/nnacl build)
|
||||||
add_subdirectory(${CCSRC_DIR}/plugin/device/cpu/kernel/nnacl build)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSLITE_ENABLE_TOOLS AND NOT ENABLE_CLOUD_AND_LITE)
|
if(MSLITE_ENABLE_TOOLS)
|
||||||
if(NOT MSLITE_COMPILE_TWICE)
|
if(NOT MSLITE_COMPILE_TWICE)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/benchmark)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/benchmark)
|
||||||
endif()
|
endif()
|
||||||
|
@ -827,7 +806,7 @@ if(NOT WIN32 AND MSLITE_ENABLE_TESTCASES)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE AND NOT ENABLE_CLOUD_AND_LITE)
|
if(NOT APPLE)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/file_list.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/file_list.cmake)
|
||||||
include(${TOP_DIR}/cmake/package_lite.cmake)
|
include(${TOP_DIR}/cmake/package_lite.cmake)
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
add_compile_definitions(BUILD_LITE)
|
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}\")
|
add_definitions(-DVERSION_STR=\"${VERSION_STR}\")
|
||||||
|
|
||||||
if(MACHINE_LINUX_ARM64)
|
if(MACHINE_LINUX_ARM64)
|
||||||
|
|
|
@ -10,14 +10,8 @@ set(MSLITE_REGISTRY_DEVICE "off" CACHE STRING "Compile Mindspore Lite that suppo
|
||||||
currently supported devices: Hi3516D/Hi3519A/Hi3559A/SD3403")
|
currently supported devices: Hi3516D/Hi3519A/Hi3559A/SD3403")
|
||||||
set(MSLITE_MICRO_PLATFORM "auto" CACHE STRING "Platform of micro static library micro static, \
|
set(MSLITE_MICRO_PLATFORM "auto" CACHE STRING "Platform of micro static library micro static, \
|
||||||
currently supported : cortex-m7/auto")
|
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")
|
||||||
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()
|
|
||||||
option(MSLITE_ENABLE_NPU "enable npu, only arm64 or arm32 support" off)
|
option(MSLITE_ENABLE_NPU "enable npu, only arm64 or arm32 support" off)
|
||||||
option(MSLITE_ENABLE_TRAIN "enable train" on)
|
option(MSLITE_ENABLE_TRAIN "enable train" on)
|
||||||
option(MSLITE_ENABLE_SSE "enable SSE instruction set, only x86_64 support" off)
|
option(MSLITE_ENABLE_SSE "enable SSE instruction set, only x86_64 support" off)
|
||||||
|
|
|
@ -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_RPATH TRUE)
|
||||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||||
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
||||||
|
|
|
@ -388,9 +388,7 @@ set(TRAIN_SRC
|
||||||
)
|
)
|
||||||
|
|
||||||
if(MSLITE_ENABLE_MINDRT)
|
if(MSLITE_ENABLE_MINDRT)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
add_subdirectory(${CORE_DIR}/mindrt mindspore_mindrt)
|
||||||
add_subdirectory(${CORE_DIR}/mindrt mindspore_mindrt)
|
|
||||||
endif()
|
|
||||||
set(LITE_SRC ${LITE_SRC}
|
set(LITE_SRC ${LITE_SRC}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/runtime/lite_mindrt.cc
|
${CMAKE_CURRENT_SOURCE_DIR}/runtime/lite_mindrt.cc
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/runtime/mindrt_executor.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
|
cpu_kernel_mid ccsrc_src_mid converter_src_mid lite_exporter_mid
|
||||||
config_parser_mid mslite_converter_plugin mindspore_core coder_mid
|
config_parser_mid mslite_converter_plugin mindspore_core coder_mid
|
||||||
mindir_serializer_mid mindspore::protobuf ${SECUREC_LIBRARY})
|
mindir_serializer_mid mindspore::protobuf ${SECUREC_LIBRARY})
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
target_link_libraries(mindspore-lite
|
||||||
target_link_libraries(mindspore-lite
|
ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj)
|
||||||
ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj)
|
target_link_libraries(mindspore-lite_static
|
||||||
target_link_libraries(mindspore-lite_static
|
ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj)
|
||||||
ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj)
|
|
||||||
endif()
|
|
||||||
if(MSLITE_ENABLE_ACL)
|
if(MSLITE_ENABLE_ACL)
|
||||||
target_link_libraries(mindspore-lite lite_acl_mid
|
target_link_libraries(mindspore-lite lite_acl_mid
|
||||||
mindspore_shared_lib)
|
mindspore_shared_lib)
|
||||||
|
@ -648,7 +644,3 @@ if(MSLITE_ENABLE_ACL)
|
||||||
target_link_libraries(mindspore-lite ascend_kernel_mid)
|
target_link_libraries(mindspore-lite ascend_kernel_mid)
|
||||||
target_link_libraries(mindspore-lite_static ascend_kernel_mid)
|
target_link_libraries(mindspore-lite_static ascend_kernel_mid)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CLOUD_AND_LITE)
|
|
||||||
set_target_properties(mindspore-lite PROPERTIES INSTALL_RPATH $ORIGIN)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "google/protobuf/message.h"
|
#include "google/protobuf/message.h"
|
||||||
#ifdef ENABLE_CLOUD_AND_LITE
|
|
||||||
#include "proto/lite/caffe.pb.h"
|
|
||||||
#else
|
|
||||||
#include "proto/caffe.pb.h"
|
#include "proto/caffe.pb.h"
|
||||||
#endif
|
|
||||||
#include "include/errorcode.h"
|
#include "include/errorcode.h"
|
||||||
#include "schema/inner/model_generated.h"
|
#include "schema/inner/model_generated.h"
|
||||||
|
|
||||||
|
|
|
@ -91,16 +91,13 @@ add_subdirectory(registry)
|
||||||
add_subdirectory(preprocess)
|
add_subdirectory(preprocess)
|
||||||
add_subdirectory(config_parser)
|
add_subdirectory(config_parser)
|
||||||
add_subdirectory(micro/coder)
|
add_subdirectory(micro/coder)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
add_subdirectory(${CORE_DIR} mindspore_core)
|
||||||
add_subdirectory(${CORE_DIR} mindspore_core)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSLITE_ENABLE_ACL)
|
if(MSLITE_ENABLE_ACL)
|
||||||
set(MODE_ASCEND_ACL ON)
|
set(MODE_ASCEND_ACL ON)
|
||||||
include_directories(${TOP_DIR}/graphengine/inc/external)
|
include_directories(${TOP_DIR}/graphengine/inc/external)
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
include(${TOP_DIR}/cmake/dependency_graphengine.cmake)
|
||||||
include(${TOP_DIR}/cmake/dependency_graphengine.cmake)
|
|
||||||
endif()
|
|
||||||
add_subdirectory(adapter/acl)
|
add_subdirectory(adapter/acl)
|
||||||
link_directories(${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
link_directories(${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
|
||||||
endif()
|
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(ccsrc_src_mid PRIVATE BACKEND_DLL)
|
||||||
target_compile_definitions(converter_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)
|
||||||
add_dependencies(mindspore_converter nnacl_mid)
|
|
||||||
endif()
|
|
||||||
if((NOT WIN32) AND MSLITE_ENABLE_DPICO_ATC_ADAPTER)
|
if((NOT WIN32) AND MSLITE_ENABLE_DPICO_ATC_ADAPTER)
|
||||||
add_dependencies(mindspore_converter dpico_atc_adapter)
|
add_dependencies(mindspore_converter dpico_atc_adapter)
|
||||||
endif()
|
endif()
|
||||||
|
@ -357,12 +353,11 @@ if(ENABLE_CONVERT_PYTORCH_MODEL)
|
||||||
target_link_libraries(mindspore_converter pytorch_parser_mid)
|
target_link_libraries(mindspore_converter pytorch_parser_mid)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
target_link_libraries(mindspore_converter
|
||||||
target_link_libraries(mindspore_converter
|
ccsrc_debug_common_mid_
|
||||||
ccsrc_debug_common_mid_
|
mindir_proto_mid
|
||||||
mindir_proto_mid
|
_mindspore_transform_express_ir_obj)
|
||||||
_mindspore_transform_express_ir_obj)
|
|
||||||
endif()
|
|
||||||
if(MSLITE_ENABLE_ACL)
|
if(MSLITE_ENABLE_ACL)
|
||||||
target_link_libraries(mindspore_converter
|
target_link_libraries(mindspore_converter
|
||||||
lite_acl_mid
|
lite_acl_mid
|
||||||
|
|
|
@ -18,53 +18,12 @@ file(GLOB ACL_SRC
|
||||||
|
|
||||||
set(ENABLE_ACL on)
|
set(ENABLE_ACL on)
|
||||||
set(MODE_ASCEND_ACL off)
|
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/transform/graph_ir _mindspore_transform_graph_ir_obj)
|
add_subdirectory(${TOP_DIR}/mindspore/ccsrc/cxx_api mindspore_shared_lib)
|
||||||
add_subdirectory(${TOP_DIR}/mindspore/ccsrc/cxx_api mindspore_shared_lib)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_property(SOURCE ${ACL_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE)
|
set_property(SOURCE ${ACL_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE)
|
||||||
add_library(lite_acl_mid OBJECT ${ACL_SRC})
|
add_library(lite_acl_mid OBJECT ${ACL_SRC})
|
||||||
target_link_libraries(lite_acl_mid mindspore_shared_lib)
|
target_link_libraries(lite_acl_mid mindspore_shared_lib)
|
||||||
add_dependencies(lite_acl_mid mindspore_shared_lib)
|
add_dependencies(lite_acl_mid mindspore_shared_lib)
|
||||||
add_dependencies(lite_acl_mid fbs_inner_src)
|
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()
|
|
||||||
|
|
|
@ -22,11 +22,7 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#ifdef ENABLE_CLOUD_AND_LITE
|
|
||||||
#include "proto/lite/caffe.pb.h"
|
|
||||||
#else
|
|
||||||
#include "proto/caffe.pb.h"
|
#include "proto/caffe.pb.h"
|
||||||
#endif
|
|
||||||
#include "include/errorcode.h"
|
#include "include/errorcode.h"
|
||||||
|
|
||||||
namespace mindspore {
|
namespace mindspore {
|
||||||
|
|
|
@ -23,11 +23,7 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "include/registry/model_parser.h"
|
#include "include/registry/model_parser.h"
|
||||||
#include "include/registry/model_parser_registry.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"
|
#include "proto/caffe.pb.h"
|
||||||
#endif
|
|
||||||
#include "ops/primitive_c.h"
|
#include "ops/primitive_c.h"
|
||||||
|
|
||||||
using STATUS = int;
|
using STATUS = int;
|
||||||
|
|
|
@ -21,11 +21,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "google/protobuf/message.h"
|
#include "google/protobuf/message.h"
|
||||||
#include "schema/inner/model_generated.h"
|
#include "schema/inner/model_generated.h"
|
||||||
#ifdef ENABLE_CLOUD_AND_LITE
|
|
||||||
#include "proto/lite/caffe.pb.h"
|
|
||||||
#else
|
|
||||||
#include "proto/caffe.pb.h"
|
#include "proto/caffe.pb.h"
|
||||||
#endif
|
|
||||||
#include "tools/converter/parser/caffe/caffe_node_parser.h"
|
#include "tools/converter/parser/caffe/caffe_node_parser.h"
|
||||||
#include "include/errorcode.h"
|
#include "include/errorcode.h"
|
||||||
#include "src/common/log_adapter.h"
|
#include "src/common/log_adapter.h"
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "tools/converter/parser/caffe/caffe_node_parser.h"
|
#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"
|
#include "proto/caffe.pb.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mindspore::lite {
|
namespace mindspore::lite {
|
||||||
class CaffeNodeParserRegistry {
|
class CaffeNodeParserRegistry {
|
||||||
|
|
|
@ -30,11 +30,7 @@
|
||||||
#include "include/registry/model_parser.h"
|
#include "include/registry/model_parser.h"
|
||||||
#include "include/registry/model_parser_registry.h"
|
#include "include/registry/model_parser_registry.h"
|
||||||
#include "tools/converter/parser/onnx/onnx_node_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"
|
#include "proto/onnx.pb.h"
|
||||||
#endif
|
|
||||||
#include "schema/inner/model_generated.h"
|
#include "schema/inner/model_generated.h"
|
||||||
|
|
||||||
namespace mindspore {
|
namespace mindspore {
|
||||||
|
|
|
@ -21,11 +21,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "google/protobuf/message.h"
|
#include "google/protobuf/message.h"
|
||||||
#ifdef ENABLE_CLOUD_AND_LITE
|
|
||||||
#include "proto/lite/onnx.pb.h"
|
|
||||||
#else
|
|
||||||
#include "proto/onnx.pb.h"
|
#include "proto/onnx.pb.h"
|
||||||
#endif
|
|
||||||
#include "include/errorcode.h"
|
#include "include/errorcode.h"
|
||||||
#include "src/common/log_adapter.h"
|
#include "src/common/log_adapter.h"
|
||||||
#include "schema/inner/model_generated.h"
|
#include "schema/inner/model_generated.h"
|
||||||
|
|
|
@ -24,13 +24,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#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/graph.pb.h"
|
||||||
#include "proto/node_def.pb.h"
|
#include "proto/node_def.pb.h"
|
||||||
#endif
|
|
||||||
#include "schema/inner/model_generated.h"
|
#include "schema/inner/model_generated.h"
|
||||||
#include "securec/include/securec.h"
|
#include "securec/include/securec.h"
|
||||||
#include "tools/common/tensor_util.h"
|
#include "tools/common/tensor_util.h"
|
||||||
|
|
|
@ -22,11 +22,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "tools/converter/parser/tf/tf_util.h"
|
#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"
|
#include "proto/graph.pb.h"
|
||||||
#endif
|
|
||||||
#include "ops/primitive_c.h"
|
#include "ops/primitive_c.h"
|
||||||
#include "mindspore/core/utils/check_convert_utils.h"
|
#include "mindspore/core/utils/check_convert_utils.h"
|
||||||
#include "nnacl/op_base.h"
|
#include "nnacl/op_base.h"
|
||||||
|
|
|
@ -19,11 +19,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#ifdef ENABLE_CLOUD_AND_LITE
|
|
||||||
#include "proto/lite/node_def.pb.h"
|
|
||||||
#else
|
|
||||||
#include "proto/node_def.pb.h"
|
#include "proto/node_def.pb.h"
|
||||||
#endif
|
|
||||||
#include "ir/dtype/type_id.h"
|
#include "ir/dtype/type_id.h"
|
||||||
#include "include/errorcode.h"
|
#include "include/errorcode.h"
|
||||||
#include "schema/inner/model_generated.h"
|
#include "schema/inner/model_generated.h"
|
||||||
|
|
|
@ -14,13 +14,9 @@ add_library(mindir_proto_mid OBJECT ${PROTO_SRCS})
|
||||||
add_compile_definitions(MINDIR_EXPORT_TENSOR_LAYOUT_CLIP)
|
add_compile_definitions(MINDIR_EXPORT_TENSOR_LAYOUT_CLIP)
|
||||||
add_compile_definitions(COMMON_DLL)
|
add_compile_definitions(COMMON_DLL)
|
||||||
|
|
||||||
if(NOT ENABLE_CLOUD_AND_LITE)
|
set(MINDIR_EXPORT_DIR ${CCSRC_DIR}/transform/express_ir)
|
||||||
# if(NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
|
add_subdirectory(${MINDIR_EXPORT_DIR} mindir_exporter)
|
||||||
set(MINDIR_EXPORT_DIR ${CCSRC_DIR}/transform/express_ir)
|
add_dependencies(_mindspore_transform_express_ir_obj mindir_proto_mid)
|
||||||
add_subdirectory(${MINDIR_EXPORT_DIR} mindir_exporter)
|
|
||||||
add_dependencies(_mindspore_transform_express_ir_obj mindir_proto_mid)
|
|
||||||
# endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(mindir_serializer_mid OBJECT
|
add_library(mindir_serializer_mid OBJECT
|
||||||
${MINDIR_EXPORTER_SRC_LIST}
|
${MINDIR_EXPORTER_SRC_LIST}
|
||||||
|
|
|
@ -31,7 +31,6 @@ namespace mindspore::lite {
|
||||||
constexpr const size_t TOTAL_SAVE = 1024 * 1024 * 1024;
|
constexpr const size_t TOTAL_SAVE = 1024 * 1024 * 1024;
|
||||||
constexpr const int64_t OFFSET = 64;
|
constexpr const int64_t OFFSET = 64;
|
||||||
|
|
||||||
#ifndef ENABLE_CLOUD_AND_LITE
|
|
||||||
namespace {
|
namespace {
|
||||||
bool DeleteDirRecursively(const std::string &dir_name) {
|
bool DeleteDirRecursively(const std::string &dir_name) {
|
||||||
DIR *dir = opendir(dir_name.c_str());
|
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);
|
ChangeFileMode(realpath.value(), S_IRUSR);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int MindIRSerialize(const std::shared_ptr<ConverterPara> ¶m, const FuncGraphPtr &func_graph) {
|
int MindIRSerialize(const std::shared_ptr<ConverterPara> ¶m, const FuncGraphPtr &func_graph) {
|
||||||
#ifndef ENABLE_CLOUD_AND_LITE
|
|
||||||
if (!param->export_mindir) {
|
if (!param->export_mindir) {
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
mindspore::lite::MindIRSerializer serializer;
|
mindspore::lite::MindIRSerializer serializer;
|
||||||
return serializer.Save(param, func_graph);
|
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
|
} // namespace mindspore::lite
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "tools/converter/cxx_api/converter_para.h"
|
#include "tools/converter/cxx_api/converter_para.h"
|
||||||
|
|
||||||
namespace mindspore::lite {
|
namespace mindspore::lite {
|
||||||
#ifndef ENABLE_CLOUD_AND_LITE
|
|
||||||
class MindIRSerializer {
|
class MindIRSerializer {
|
||||||
public:
|
public:
|
||||||
MindIRSerializer() = default;
|
MindIRSerializer() = default;
|
||||||
|
@ -72,7 +71,6 @@ class MindIRSerializer {
|
||||||
std::fstream *data_fs_ = nullptr;
|
std::fstream *data_fs_ = nullptr;
|
||||||
std::shared_ptr<system::FileSystem> fs_{};
|
std::shared_ptr<system::FileSystem> fs_{};
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
// export func_graph
|
// export func_graph
|
||||||
int MindIRSerialize(const std::shared_ptr<ConverterPara> ¶m, const FuncGraphPtr &func_graph);
|
int MindIRSerialize(const std::shared_ptr<ConverterPara> ¶m, const FuncGraphPtr &func_graph);
|
||||||
} // namespace mindspore::lite
|
} // namespace mindspore::lite
|
||||||
|
|
|
@ -56,7 +56,6 @@ parse_device()
|
||||||
ENABLE_CPU="on"
|
ENABLE_CPU="on"
|
||||||
export ENABLE_MPI="on"
|
export ENABLE_MPI="on"
|
||||||
export ENABLE_AKG="on"
|
export ENABLE_AKG="on"
|
||||||
export ENABLE_CLOUD_AND_LITE="on"
|
|
||||||
else
|
else
|
||||||
echo "Invalid value ${DEVICE_VERSION} for option -V"
|
echo "Invalid value ${DEVICE_VERSION} for option -V"
|
||||||
usage
|
usage
|
||||||
|
|
Loading…
Reference in New Issue