This commit is contained in:
lby 2022-08-16 13:06:27 +08:00
parent 2fcc176ae9
commit 787e66b422
4 changed files with 16 additions and 34 deletions

View File

@ -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")

View File

@ -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;
}

View File

@ -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<OpInfo> FindOp(const std::string &op_name, OpImplyType imply_type,
bool is_dynamic_shape = false);
protected:
inline static std::multimap<std::string, std::shared_ptr<OpInfo>> op_info_ = {};
BACKEND_EXPORT inline static std::multimap<std::string, std::shared_ptr<OpInfo>> op_info_;
private:
static bool RegOpFromLocalInfo();

View File

@ -1,7 +1,6 @@
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)
@ -10,7 +9,6 @@ if(ENABLE_D OR ENABLE_ACL)
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()
########### 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()