|
|
|
@ -84,6 +84,15 @@ function(op_library TARGET)
|
|
|
|
|
message(FATAL_ERROR "The op library ${TARGET} should contains at least one .cc file")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
#remove windows unsupported op
|
|
|
|
|
if (WIN32)
|
|
|
|
|
foreach(windows_unsupport_op "nccl_op" "gen_nccl_id_op")
|
|
|
|
|
if ("${TARGET}" STREQUAL "${windows_unsupport_op}")
|
|
|
|
|
return()
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
|
|
list(LENGTH op_library_DEPS op_library_DEPS_len)
|
|
|
|
|
if (${op_library_DEPS_len} GREATER 0)
|
|
|
|
|
set(DEPS_OPS ${TARGET} ${DEPS_OPS} PARENT_SCOPE)
|
|
|
|
@ -180,19 +189,19 @@ function(op_library TARGET)
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
add_subdirectory(math)
|
|
|
|
|
if (NOT WIN32)
|
|
|
|
|
add_subdirectory(nccl)
|
|
|
|
|
|
|
|
|
|
if(WITH_GPU)
|
|
|
|
|
op_library(nccl_op DEPS nccl_common)
|
|
|
|
|
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(ncclAllReduce);\n")
|
|
|
|
|
else()
|
|
|
|
|
set(DEPS_OPS ${DEPS_OPS} nccl_op)
|
|
|
|
|
endif()
|
|
|
|
|
endif() # NOT WIN32
|
|
|
|
|
|
|
|
|
|
set(DISTRIBUTE_DEPS "")
|
|
|
|
|
if(WITH_DISTRIBUTE)
|
|
|
|
|
add_subdirectory(distributed)
|
|
|
|
|
|
|
|
|
|
set(DISTRIBUTE_DEPS "")
|
|
|
|
|
if(WITH_GRPC)
|
|
|
|
|
set(DISTRIBUTE_DEPS sendrecvop_grpc grpc++_unsecure grpc_unsecure gpr cares zlib protobuf node)
|
|
|
|
@ -221,7 +230,7 @@ if(WITH_DISTRIBUTE)
|
|
|
|
|
#set_source_files_properties(send_recv_op_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
|
|
|
|
|
#cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS prefetch_op send_op
|
|
|
|
|
# listen_and_serv_op sum_op executor SERIAL)
|
|
|
|
|
if(WITH_GPU)
|
|
|
|
|
if(WITH_GPU AND NOT WIN32)
|
|
|
|
|
set_source_files_properties(test_send_nccl_id.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
|
|
|
|
|
cc_test(test_send_nccl_id SRCS test_send_nccl_id.cc DEPS listen_and_serv_op ${DISTRIBUTE_DEPS} executor SERIAL)
|
|
|
|
|
if(WITH_GRPC)
|
|
|
|
@ -232,7 +241,7 @@ if(WITH_DISTRIBUTE)
|
|
|
|
|
set_source_files_properties(gen_nccl_id_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
|
|
|
|
|
else()
|
|
|
|
|
set(DEPS_OPS ${DEPS_OPS} gen_nccl_id_op)
|
|
|
|
|
endif()
|
|
|
|
|
endif() # WITH_GPU AND NOT WIN32
|
|
|
|
|
else()
|
|
|
|
|
set(DEPS_OPS ${DEPS_OPS} checkpoint_notify_op prefetch_op recv_op listen_and_serv_op send_op send_barrier_op fetch_barrier_op gen_nccl_id_op)
|
|
|
|
|
endif()
|
|
|
|
@ -329,5 +338,7 @@ cc_test(beam_search_op_test SRCS beam_search_op_test.cc DEPS lod_tensor beam_sea
|
|
|
|
|
cc_test(strided_memcpy_test SRCS strided_memcpy_test.cc DEPS tensor memory)
|
|
|
|
|
cc_test(save_load_op_test SRCS save_load_op_test.cc DEPS save_op load_op)
|
|
|
|
|
cc_test(save_load_combine_op_test SRCS save_load_combine_op_test.cc DEPS save_combine_op load_combine_op)
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
|
nv_test(nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context)
|
|
|
|
|
endif()
|
|
|
|
|
nv_test(dropout_op_test SRCS dropout_op_test.cc DEPS dropout_op tensor)
|
|
|
|
|