CMakeLists.txt 5.9 KB
Newer Older
X
Xin Pan 已提交
1
cc_library(var_handle SRCS var_handle.cc DEPS place framework_proto node)
C
chengduoZH 已提交
2
cc_library(op_handle_base SRCS op_handle_base.cc DEPS var_handle device_context lod_tensor)
3

Y
Yu Yang 已提交
4
cc_library(scale_loss_grad_op_handle SRCS scale_loss_grad_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory)
Y
Yu Yang 已提交
5
cc_library(fetch_op_handle SRCS fetch_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory)
6 7

cc_library(share_tensor_buffer_functor SRCS share_tensor_buffer_functor.cc DEPS framework_proto scope place operator op_registry) 
Y
Yu Yang 已提交
8
cc_library(computation_op_handle SRCS computation_op_handle.cc DEPS framework_proto scope place operator op_registry)
9
cc_library(share_tensor_buffer_op_handle SRCS share_tensor_buffer_op_handle.cc DEPS op_handle_base scope computation_op_handle share_tensor_buffer_functor)
Y
Yancey1989 已提交
10
cc_library(rpc_op_handle SRCS rpc_op_handle.cc DEPS framework_proto scope place operator op_registry)
W
Wu Yi 已提交
11
cc_library(fetch_barrier_op_handle SRCS fetch_barrier_op_handle.cc DEPS framework_proto scope place operator op_registry)
X
Xin Pan 已提交
12
cc_library(multi_devices_helper SRCS multi_devices_helper.cc DEPS graph graph_helper)
Z
Zeng Jinle 已提交
13

C
chengduoZH 已提交
14 15
cc_library(variable_visitor SRCS variable_visitor.cc DEPS lod_tensor selected_rows)

16 17 18 19 20 21 22
if(WITH_DISTRIBUTE)
    if(NOT WITH_GRPC)
        set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
        set_source_files_properties(reduce_op_handle.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
    endif()
endif()

23

Y
Yu Yang 已提交
24
if(WITH_GPU)
C
chengduoZH 已提交
25
    nv_library(all_reduce_op_handle SRCS all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
G
gongweibao 已提交
26
            dynload_cuda variable_visitor)
C
chengduo 已提交
27 28
    nv_library(fused_all_reduce_op_handle SRCS fused_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
            dynload_cuda variable_visitor)
G
gongweibao 已提交
29 30 31 32 33 34

    if(WITH_DGC)
        nv_library(sparse_all_reduce_op_handle SRCS sparse_all_reduce_op_handle.cc DEPS op_handle_base scope 
            lod_tensor ddim memory dynload_cuda variable_visitor dgc all_reduce_op_handle)
    endif()

35 36
    if(WITH_DISTRIBUTE)
        nv_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
37
            ddim dynload_cuda selected_rows_functor sendrecvop_rpc)
38 39 40 41
    else()
        nv_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
            ddim dynload_cuda selected_rows_functor)
    endif()
C
chengduoZH 已提交
42
    nv_library(broadcast_op_handle SRCS broadcast_op_handle.cc DEPS op_handle_base scope ddim memory variable_visitor dynload_cuda)
43
    nv_library(fused_broadcast_op_handle SRCS fused_broadcast_op_handle.cc DEPS broadcast_op_handle)
C
chengduoZH 已提交
44

Y
Yu Yang 已提交
45
else()
46
    cc_library(all_reduce_op_handle SRCS all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
C
chengduoZH 已提交
47
             variable_visitor)
C
chengduo 已提交
48 49
    cc_library(fused_all_reduce_op_handle SRCS fused_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
            variable_visitor)
50 51
    if(WITH_DISTRIBUTE)
        cc_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
52
            ddim selected_rows_functor sendrecvop_rpc)
53 54 55 56
    else()
        cc_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
            ddim selected_rows_functor)
    endif()
C
chengduoZH 已提交
57
    cc_library(broadcast_op_handle SRCS broadcast_op_handle.cc DEPS op_handle_base scope ddim memory variable_visitor)
58
    cc_library(fused_broadcast_op_handle SRCS fused_broadcast_op_handle.cc DEPS broadcast_op_handle)
Y
Yu Yang 已提交
59
endif()
C
chengduoZH 已提交
60 61 62

cc_library(gather_op_handle SRCS gather_op_handle.cc DEPS op_handle_base scope ddim memory variable_visitor)

S
sneaxiy 已提交
63
cc_library(eager_deletion_op_handle SRCS eager_deletion_op_handle.cc DEPS lod_tensor selected_rows reference_count_pass_helper)
Y
yuyang18 已提交
64

65
set(SSA_GRAPH_EXECUTOR_DEPS graph framework_proto sequential_execution_pass modify_op_lock_and_record_event_pass all_reduce_deps_pass reference_count_pass eager_deletion_pass buffer_shared_inplace_op_pass buffer_shared_cross_op_memory_reuse_pass)
S
sneaxiy 已提交
66 67
cc_library(ssa_graph_executor SRCS ssa_graph_executor.cc DEPS ${SSA_GRAPH_EXECUTOR_DEPS})

Y
Yu Yang 已提交
68 69
cc_library(threaded_ssa_graph_executor SRCS threaded_ssa_graph_executor.cc DEPS fetch_op_handle ssa_graph_executor scope
        simple_threadpool device_context)
70

Y
Yancey1989 已提交
71 72
cc_library(parallel_ssa_graph_executor SRCS parallel_ssa_graph_executor.cc DEPS threaded_ssa_graph_executor)

73 74 75 76 77
set(ASYNC_SSA_GRAPH_EXECUTOR_DEPS threaded_ssa_graph_executor)
if(WITH_DISTRIBUTE)
    list(APPEND ASYNC_SSA_GRAPH_EXECUTOR_DEPS communicator)
endif()
cc_library(async_ssa_graph_executor SRCS async_ssa_graph_executor.cc DEPS ${ASYNC_SSA_GRAPH_EXECUTOR_DEPS})
Q
can run  
Qiao Longfei 已提交
78

C
chengduoZH 已提交
79
cc_test(broadcast_op_test SRCS broadcast_op_handle_test.cc DEPS var_handle op_handle_base scope ddim memory
C
chengduoZH 已提交
80
        device_context broadcast_op_handle)
C
chengduoZH 已提交
81
cc_test(gather_op_test SRCS gather_op_handle_test.cc DEPS var_handle op_handle_base scope ddim memory
C
chengduoZH 已提交
82
        device_context gather_op_handle)
Y
yuyang18 已提交
83
cc_library(scope_buffered_ssa_graph_executor SRCS scope_buffered_ssa_graph_executor.cc DEPS ssa_graph_executor)
Y
yuyang18 已提交
84 85
#cc_test(reduce_op_handle_test SRCS reduce_op_handle_test.cc DEPS var_handle op_handle_base scope ddim memory
#        device_context reduce_op_handle )
Y
Stash  
yuyang18 已提交
86 87
cc_library(fast_threaded_ssa_graph_executor SRCS fast_threaded_ssa_graph_executor.cc
        DEPS fetch_op_handle ssa_graph_executor scope simple_threadpool device_context)
88
cc_test(fused_broadcast_op_test SRCS fused_broadcast_op_handle_test.cc DEPS fused_broadcast_op_handle)
89

90 91 92 93 94 95
if(WITH_NGRAPH) 
  set(NGRAPH_BS_DEPS ngraph)
else()
  set(NGRAPH_BS_DEPS)
endif()

96 97
cc_library(build_strategy SRCS build_strategy.cc DEPS
        graph_viz_pass multi_devices_graph_pass
X
Xin Pan 已提交
98
        multi_devices_graph_print_pass multi_devices_graph_check_pass
99
        fuse_elewise_add_act_pass multi_batch_merge_pass 
C
chengduo 已提交
100
        fuse_relu_depthwise_conv_pass
101
        lock_free_optimize_pass
102
        coalesce_grad_tensor_pass fuse_all_reduce_op_pass backward_optimizer_op_deps_pass
103 104
        fuse_adam_op_pass fuse_sgd_op_pass fuse_momentum_op_pass
        ${NGRAPH_BS_DEPS})