diff --git a/mindspore/ccsrc/CMakeLists.txt b/mindspore/ccsrc/CMakeLists.txt index c26e23daf79..288bb29a4ae 100644 --- a/mindspore/ccsrc/CMakeLists.txt +++ b/mindspore/ccsrc/CMakeLists.txt @@ -13,14 +13,6 @@ set(FBS_FILES ) ms_build_flatbuffers(FBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}../../schema generated_fbs_files ${SERVER_FLATBUFFER_OUTPUT}) -if(ENABLE_D OR ENABLE_ACL) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) - set(MINDSPORE_RPATH - ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) -endif() - ## Function for setting NVCC flag function(set_nvcc_flag CUDA_NVCC_FLAGS) # Detect gpu archs by cudaGetDeviceProperties. @@ -483,8 +475,6 @@ if(ENABLE_GPU) target_link_libraries(mindspore_backend PRIVATE mindspore_gpu) endif() -set_target_properties(_c_expression PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH}) - if(CMAKE_SYSTEM_NAME MATCHES "Windows") target_link_libraries(mindspore PUBLIC mindspore::pybind11_module) target_link_libraries(_c_expression PRIVATE -Wl,--whole-archive mindspore -Wl,--no-whole-archive mindspore_core @@ -506,6 +496,7 @@ else() target_link_libraries(_c_expression PRIVATE mindspore::pybind11_module) endif() +set_target_properties(_c_expression PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH}) if(USE_GLOG) target_link_libraries(_c_expression PRIVATE mindspore::glog) endif() @@ -514,11 +505,6 @@ if(ENABLE_GPU) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries(_c_expression PRIVATE mindspore::ssl mindspore::crypto) endif() - if(ENABLE_MPI) - set_target_properties(_ms_mpi PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH}) - set_target_properties(nvidia_collective PROPERTIES INSTALL_RPATH ${ORIGIN_PATH}) - set_target_properties(gpu_collective PROPERTIES INSTALL_RPATH ${ORIGIN_PATH}) - endif() endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin") diff --git a/mindspore/ccsrc/backend/common/optimizer/const_input_to_attr_factory.cc b/mindspore/ccsrc/backend/common/optimizer/const_input_to_attr_factory.cc index 650e6d1da41..36cc9502cf0 100644 --- a/mindspore/ccsrc/backend/common/optimizer/const_input_to_attr_factory.cc +++ b/mindspore/ccsrc/backend/common/optimizer/const_input_to_attr_factory.cc @@ -52,8 +52,7 @@ void ConstInputToAttrRegister::RegConstToAttr(const std::string &name, const std auto key = GenerateKey(name, backend, is_dynamic_shape); auto find = input_to_attr_.find(key); if (find != input_to_attr_.end()) { - MS_LOG(WARNING) << "This node(" << key << ")" - << " has been registered."; + return; } input_to_attr_[key] = input_to_attr; } diff --git a/mindspore/ccsrc/kernel/oplib/oplib.h b/mindspore/ccsrc/kernel/oplib/oplib.h index 9df44f5473d..9b0f5b857f2 100644 --- a/mindspore/ccsrc/kernel/oplib/oplib.h +++ b/mindspore/ccsrc/kernel/oplib/oplib.h @@ -27,16 +27,16 @@ namespace mindspore { namespace kernel { -class BACKEND_EXPORT OpLib { +class OpLib { public: OpLib() = default; virtual ~OpLib() = default; - static bool RegOp(const std::string &json_string, const std::string &impl_path); + BACKEND_EXPORT static bool RegOp(const std::string &json_string, const std::string &impl_path); static std::shared_ptr FindOp(const std::string &op_name, OpImplyType imply_type, bool is_dynamic_shape = false); protected: - inline static std::multimap> op_info_ = {}; + BACKEND_EXPORT inline static std::multimap> op_info_; private: static bool RegOpFromLocalInfo(); diff --git a/mindspore/ccsrc/plugin/device/ascend/CMakeLists.txt b/mindspore/ccsrc/plugin/device/ascend/CMakeLists.txt index e4c23cd344a..a253bad9a80 100644 --- a/mindspore/ccsrc/plugin/device/ascend/CMakeLists.txt +++ b/mindspore/ccsrc/plugin/device/ascend/CMakeLists.txt @@ -1,16 +1,14 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_BINARY_DIR}) -if(ENABLE_D OR ENABLE_ACL) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/lib64) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) - set(MINDSPORE_RPATH - ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) - set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) -endif() +set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/lib64) +set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64) +set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/lib64) +set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/opp/op_impl/built-in/ai_core/tbe/op_tiling) +set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) +set(MINDSPORE_RPATH + ${MINDSPORE_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) +set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) ########### mindspore_ascend.so ##### set(ASCEND_SUB_COMP @@ -35,10 +33,9 @@ add_library(mindspore_ascend SHARED ${ASCEND_SUB_OBJECTS_SRC}) target_link_libraries(mindspore_ascend PUBLIC mindspore_backend_common) target_link_libraries(mindspore_ascend PRIVATE mindspore_core mindspore_common proto_input mindspore::protobuf) target_link_libraries(mindspore_ascend PRIVATE securec) - -set_target_properties(mindspore_ascend PROPERTIES INSTALL_RPATH $ORIGIN) target_link_libraries(mindspore_ascend PRIVATE mindspore::dnnl mindspore::mkldnn mindspore::ssl mindspore::crypto nnacl) +set_target_properties(mindspore_ascend PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH}) if(ENABLE_DEBUGGER) # debugger: link grpc @@ -51,7 +48,7 @@ if(ENABLE_D) find_library(GE_RUNNER ge_runner ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(GRAPH graph ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(HCCL hccl ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) - target_link_libraries(mindspore_ascend PUBLIC ${GE_RUNNER} ${GRAPH} ${HCCL}) + target_link_libraries(mindspore_ascend PRIVATE ${GE_RUNNER} ${GRAPH} ${HCCL}) target_link_libraries(mindspore_ascend PRIVATE mindspore::event mindspore::event_pthreads mindspore::event_openssl -Wl,--no-as-needed mindspore::event_core ps_cache) endif() @@ -70,7 +67,7 @@ if(MODE_ASCEND_ALL) find_library(adump_server libadump_server.a ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(OPTILING optiling ${ASCEND_CANN_OPP_PATH} ${ASCEND_TOOLKIT_OPP_PATH}) - target_link_libraries(mindspore_ascend PUBLIC ${RUNTIME_LIB} ${TSDCLIENT} ${DATATRANSFER} ${ERROR_MANAGER} + target_link_libraries(mindspore_ascend PRIVATE ${RUNTIME_LIB} ${TSDCLIENT} ${DATATRANSFER} ${ERROR_MANAGER} -Wl,--no-as-needed ${OPTILING} ${PLATFORM} ${ACL} ${ACL_TDT_CHANNEL} ${OPT_FEATURE} ${PROFILING}) target_link_libraries(mindspore_ascend PRIVATE ${adump_server}) endif()