converter plugin

This commit is contained in:
sjtujayyyy 2022-10-25 16:59:32 +08:00 committed by Steven
parent 2d498df2ef
commit da4519e726
6 changed files with 9 additions and 50 deletions

View File

@ -551,11 +551,9 @@ if(PLATFORM_ARM64)
install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME}) COMPONENT ${RUNTIME_COMPONENT_NAME})
endif() endif()
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME}) COMPONENT ${RUNTIME_COMPONENT_NAME})
endif() endif()
endif()
if(MSLITE_ENABLE_DPICO_ATC_ADAPTER) if(MSLITE_ENABLE_DPICO_ATC_ADAPTER)
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/dpico/libdpico_atc_adapter.so install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/dpico/libdpico_atc_adapter.so
@ -951,11 +949,9 @@ else()
RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME}) RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
endif() endif()
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME}) COMPONENT ${RUNTIME_COMPONENT_NAME})
endif() endif()
endif()
if(MSLITE_ENABLE_DPICO_ATC_ADAPTER) if(MSLITE_ENABLE_DPICO_ATC_ADAPTER)
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/dpico/libdpico_atc_adapter.so install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/dpico/libdpico_atc_adapter.so

View File

@ -588,12 +588,6 @@ if(MSLITE_ENABLE_RUNTIME_CONVERT)
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)
if(MSLITE_ENABLE_ACL)
target_link_libraries(mindspore-lite lite_acl_mid
mindspore_shared_lib)
target_link_libraries(mindspore-lite_static lite_acl_mid
mindspore_shared_lib)
endif()
endif() endif()
if(SUPPORT_CUDA AND NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE) if(SUPPORT_CUDA AND NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)

View File

@ -240,10 +240,6 @@ if(MSLITE_ENABLE_MODEL_OBF)
target_link_libraries(lite-test ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so) target_link_libraries(lite-test ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so)
endif() endif()
if(MSLITE_ENABLE_CONVERTER AND MSLITE_ENABLE_ACL)
target_link_libraries(lite-test lite_acl_mid mindspore_shared_lib)
endif()
if(MSLITE_ENABLE_KERNEL_EXECUTOR) if(MSLITE_ENABLE_KERNEL_EXECUTOR)
target_link_libraries(lite-test kernel_executor) target_link_libraries(lite-test kernel_executor)
endif() endif()

View File

@ -245,10 +245,6 @@ if(MSLITE_ENABLE_CONTROLFLOW)
set(LITE_SRC ${LITE_SRC} ${CONTROL_FLOW_KERNEL_SRC}) set(LITE_SRC ${LITE_SRC} ${CONTROL_FLOW_KERNEL_SRC})
endif() endif()
if(NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
set(LITE_SRC ${LITE_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/adapter/acl/acl_pass.cc)
endif()
if(MSLITE_ENABLE_MINDRT) if(MSLITE_ENABLE_MINDRT)
add_compile_definitions(ENABLE_MINDRT) add_compile_definitions(ENABLE_MINDRT)
include_directories(${CORE_DIR}/mindrt) include_directories(${CORE_DIR}/mindrt)
@ -395,11 +391,6 @@ target_link_libraries(mindspore_converter
mindir_proto_mid mindir_proto_mid
_mindspore_transform_express_ir_obj) _mindspore_transform_express_ir_obj)
if(MSLITE_ENABLE_ACL AND NOT MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
target_link_libraries(mindspore_converter
lite_acl_mid)
endif()
if(NOT MSVC) if(NOT MSVC)
target_link_libraries(mindspore_converter pthread) target_link_libraries(mindspore_converter pthread)
endif() endif()

View File

@ -20,10 +20,7 @@ file(GLOB ACL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/infer/*.cc ${CMAKE_CURRENT_SOURCE_DIR}/infer/*.cc
) )
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE) set(ACL_SRC ${ACL_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/acl_pass.cc)
set(ACL_SRC ${ACL_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/acl_pass.cc)
endif()
set(ENABLE_ACL on) set(ENABLE_ACL on)
set(MODE_ASCEND_ACL off) set(MODE_ASCEND_ACL off)
@ -33,14 +30,7 @@ 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) set_property(SOURCE ${ACL_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_LITE)
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
add_library(ascend_pass_plugin SHARED ${ACL_SRC}) add_library(ascend_pass_plugin SHARED ${ACL_SRC})
target_link_libraries(ascend_pass_plugin mindspore_shared_lib) target_link_libraries(ascend_pass_plugin mindspore_shared_lib)
add_dependencies(ascend_pass_plugin mindspore_shared_lib) add_dependencies(ascend_pass_plugin mindspore_shared_lib)
add_dependencies(ascend_pass_plugin fbs_inner_src) add_dependencies(ascend_pass_plugin fbs_inner_src)
else()
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)
endif()

View File

@ -427,14 +427,6 @@ int AnfTransform::RunGraphPass(const FuncGraphPtr &old_graph, const std::shared_
} }
int AnfTransform::RunConvertPass(const FuncGraphPtr &old_graph, const std::shared_ptr<ConverterPara> &param) { int AnfTransform::RunConvertPass(const FuncGraphPtr &old_graph, const std::shared_ptr<ConverterPara> &param) {
#ifndef ENABLE_CLOUD_FUSION_INFERENCE
auto acl_pass = std::make_shared<opt::AclPass>(param);
CHECK_NULL_RETURN(acl_pass);
if (!acl_pass->Run(old_graph)) {
MS_LOG(ERROR) << "Acl pass failed.";
return RET_ERROR;
}
#endif
if (param->device.find("Ascend") != std::string::npos) { if (param->device.find("Ascend") != std::string::npos) {
if (opt::AclPassPlugin::GetInstance().HasPluginSo()) { if (opt::AclPassPlugin::GetInstance().HasPluginSo()) {
auto acl_pass_ptr = opt::AclPassPlugin::GetInstance().CreateAclPass(param); auto acl_pass_ptr = opt::AclPassPlugin::GetInstance().CreateAclPass(param);