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,10 +551,8 @@ if(PLATFORM_ARM64)
install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME})
endif()
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME})
endif()
install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME})
endif()
if(MSLITE_ENABLE_DPICO_ATC_ADAPTER)
@ -951,10 +949,8 @@ else()
RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
endif()
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME})
endif()
install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
COMPONENT ${RUNTIME_COMPONENT_NAME})
endif()
if(MSLITE_ENABLE_DPICO_ATC_ADAPTER)

View File

@ -588,12 +588,6 @@ if(MSLITE_ENABLE_RUNTIME_CONVERT)
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)
target_link_libraries(mindspore-lite_static lite_acl_mid
mindspore_shared_lib)
endif()
endif()
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)
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)
target_link_libraries(lite-test kernel_executor)
endif()

View File

@ -245,10 +245,6 @@ if(MSLITE_ENABLE_CONTROLFLOW)
set(LITE_SRC ${LITE_SRC} ${CONTROL_FLOW_KERNEL_SRC})
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)
add_compile_definitions(ENABLE_MINDRT)
include_directories(${CORE_DIR}/mindrt)
@ -395,11 +391,6 @@ target_link_libraries(mindspore_converter
mindir_proto_mid
_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)
target_link_libraries(mindspore_converter pthread)
endif()

View File

@ -20,10 +20,7 @@ file(GLOB ACL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/infer/*.cc
)
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
set(ACL_SRC ${ACL_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/acl_pass.cc)
endif()
set(ACL_SRC ${ACL_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/acl_pass.cc)
set(ENABLE_ACL on)
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)
if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE)
add_library(ascend_pass_plugin SHARED ${ACL_SRC})
target_link_libraries(ascend_pass_plugin mindspore_shared_lib)
add_dependencies(ascend_pass_plugin mindspore_shared_lib)
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()
add_library(ascend_pass_plugin SHARED ${ACL_SRC})
target_link_libraries(ascend_pass_plugin mindspore_shared_lib)
add_dependencies(ascend_pass_plugin mindspore_shared_lib)
add_dependencies(ascend_pass_plugin fbs_inner_src)

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) {
#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 (opt::AclPassPlugin::GetInstance().HasPluginSo()) {
auto acl_pass_ptr = opt::AclPassPlugin::GetInstance().CreateAclPass(param);