|
|
|
@ -6,7 +6,7 @@ ms_build_flatbuffers("de_tensor.fbs" ${CMAKE_CURRENT_SOURCE_DIR} generated_engin
|
|
|
|
|
file(GLOB_RECURSE _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
|
|
|
|
|
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)
|
|
|
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
# Try to find numa header file and its library
|
|
|
|
|
FIND_PATH(NUMA_INCLUDE_DIR numa.h)
|
|
|
|
|
MESSAGE("Numa include dir is: ${NUMA_INCLUDE_DIR}")
|
|
|
|
@ -18,24 +18,31 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
NUMA_INCLUDE_DIR
|
|
|
|
|
NUMA_LIBRARY
|
|
|
|
|
)
|
|
|
|
|
if (NUMA_FOUND)
|
|
|
|
|
if(NUMA_FOUND)
|
|
|
|
|
ADD_DEFINITIONS(-DNUMA_ENABLED)
|
|
|
|
|
MESSAGE("Numa package found")
|
|
|
|
|
else()
|
|
|
|
|
MESSAGE(FATAL_ERROR "Numa package not found, try 'sudo yum install numactl-devel' or 'sudo apt-get install libnuma-dev'")
|
|
|
|
|
MESSAGE(FATAL_ERROR
|
|
|
|
|
"Numa package not found, try 'sudo yum install numactl-devel' or 'sudo apt-get install libnuma-dev'")
|
|
|
|
|
endif()
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (NUMA_FOUND)
|
|
|
|
|
if(NUMA_FOUND)
|
|
|
|
|
ADD_DEFINITIONS(-DCACHE_LOCAL_CLIENT)
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(engine-cache-client OBJECT
|
|
|
|
|
cache_client.cc
|
|
|
|
|
cache_fbb.cc
|
|
|
|
|
cache_request.cc)
|
|
|
|
|
|
|
|
|
|
if (ENABLE_CACHE)
|
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-delete-abstract-non-virtual-dtor")
|
|
|
|
|
else()
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-rpath,$ORIGIN:$ORIGIN/lib")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_CACHE)
|
|
|
|
|
ms_grpc_generate(CACHE_GRPC_SRCS CACHE_GRPC_HDRS cache_grpc.proto)
|
|
|
|
|
target_sources(engine-cache-client PUBLIC ${CACHE_GRPC_SRCS}
|
|
|
|
|
cache_grpc_client.cc
|
|
|
|
@ -53,7 +60,7 @@ if (ENABLE_CACHE)
|
|
|
|
|
storage_manager.cc
|
|
|
|
|
storage_container.cc)
|
|
|
|
|
|
|
|
|
|
if (ENABLE_ASAN)
|
|
|
|
|
if(ENABLE_ASAN)
|
|
|
|
|
target_compile_options(engine-cache-server PRIVATE -fsanitize=address)
|
|
|
|
|
target_compile_options(engine-cache-server PRIVATE -fno-omit-frame-pointer)
|
|
|
|
|
target_compile_options(engine-cache-server PRIVATE -ggdb)
|
|
|
|
@ -61,7 +68,7 @@ if (ENABLE_CACHE)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_executable(cache_server cache_main.cc)
|
|
|
|
|
if (ENABLE_GPU)
|
|
|
|
|
if(ENABLE_GPU)
|
|
|
|
|
target_link_libraries(cache_server
|
|
|
|
|
engine-cache-server
|
|
|
|
|
_c_dataengine
|
|
|
|
@ -86,26 +93,28 @@ if (ENABLE_CACHE)
|
|
|
|
|
pthread)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (USE_GLOG)
|
|
|
|
|
if(USE_GLOG)
|
|
|
|
|
target_link_libraries(cache_server mindspore::glog)
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (NUMA_FOUND)
|
|
|
|
|
if(NUMA_FOUND)
|
|
|
|
|
target_link_libraries(cache_server numa)
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_executable(cache_admin cache_admin.cc cache_admin_arg.cc)
|
|
|
|
|
target_link_libraries(cache_admin _c_dataengine _c_mindrecord mindspore::protobuf ${PYTHON_LIBRARIES} pthread)
|
|
|
|
|
|
|
|
|
|
if (USE_GLOG)
|
|
|
|
|
if(USE_GLOG)
|
|
|
|
|
target_link_libraries(cache_admin mindspore::glog)
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_dependencies(engine-cache-server generated_engine_files)
|
|
|
|
|
|
|
|
|
|
else ()
|
|
|
|
|
set_target_properties(cache_admin PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH})
|
|
|
|
|
set_target_properties(cache_server PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH})
|
|
|
|
|
else()
|
|
|
|
|
ms_protobuf_generate(CACHE_PROTO_SRCS CACHE_PROTO_HDRS cache_grpc.proto)
|
|
|
|
|
target_sources(engine-cache-client PUBLIC ${CACHE_PROTO_SRCS})
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_dependencies(engine-cache-client generated_engine_files)
|
|
|
|
|