CMakeLists.txt 9.1 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
cc_library(fetch_async_op_handle SRCS fetch_async_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory)
7 8

cc_library(share_tensor_buffer_functor SRCS share_tensor_buffer_functor.cc DEPS framework_proto scope place operator op_registry) 
Y
Yu Yang 已提交
9
cc_library(computation_op_handle SRCS computation_op_handle.cc DEPS framework_proto scope place operator op_registry)
10
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 已提交
11
cc_library(rpc_op_handle SRCS rpc_op_handle.cc DEPS framework_proto scope place operator op_registry)
W
Wu Yi 已提交
12
cc_library(fetch_barrier_op_handle SRCS fetch_barrier_op_handle.cc DEPS framework_proto scope place operator op_registry)
13
cc_library(multi_devices_helper SRCS multi_devices_helper.cc DEPS graph graph_helper)
Z
Zeng Jinle 已提交
14

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

T
tangwei12 已提交
17
if(WITH_PSCORE)
T
tangwei12 已提交
18 19 20 21
    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})
    set_source_files_properties(threaded_ssa_graph_executor.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
    set_source_files_properties(async_ssa_graph_executor.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
22 23
endif()

24

Y
Yu Yang 已提交
25
if(WITH_GPU)
W
WangXi 已提交
26
    nv_library(nan_inf_utils SRCS nan_inf_utils_detail.cc nan_inf_utils_detail.cu DEPS framework_proto scope place)
C
chengduoZH 已提交
27
    nv_library(all_reduce_op_handle SRCS all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
G
gongweibao 已提交
28
            dynload_cuda variable_visitor)
C
chengduo 已提交
29
    nv_library(fused_all_reduce_op_handle SRCS fused_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
Z
Zeng Jinle 已提交
30
            dynload_cuda variable_visitor place device_memory_aligment)
31 32
    nv_library(grad_merge_all_reduce_op_handle SRCS grad_merge_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor
            ddim memory dynload_cuda variable_visitor place device_memory_aligment all_reduce_op_handle fused_all_reduce_op_handle)
G
gongweibao 已提交
33 34 35 36 37 38

    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()

39 40
    if(WITH_DISTRIBUTE)
        nv_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
T
tangwei12 已提交
41
                ddim dynload_cuda selected_rows_functor)
42 43 44 45
    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 已提交
46
    nv_library(broadcast_op_handle SRCS broadcast_op_handle.cc DEPS op_handle_base scope ddim memory variable_visitor dynload_cuda)
47
    nv_library(fused_broadcast_op_handle SRCS fused_broadcast_op_handle.cc DEPS broadcast_op_handle)
48 49 50 51 52 53 54 55
elseif(WITH_ROCM)
    hip_library(nan_inf_utils SRCS nan_inf_utils_detail.cc nan_inf_utils_detail.cu DEPS framework_proto scope place)
    hip_library(all_reduce_op_handle SRCS all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
            dynload_cuda variable_visitor)
    hip_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 place device_memory_aligment)
    hip_library(grad_merge_all_reduce_op_handle SRCS grad_merge_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor
            ddim memory dynload_cuda variable_visitor place device_memory_aligment all_reduce_op_handle fused_all_reduce_op_handle)
C
chengduoZH 已提交
56

57 58 59 60 61 62 63 64 65
    if(WITH_DISTRIBUTE)
        hip_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
                    ddim dynload_cuda selected_rows_functor)
    else()
        hip_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
                    ddim dynload_cuda selected_rows_functor)
    endif()
    hip_library(broadcast_op_handle SRCS broadcast_op_handle.cc DEPS op_handle_base scope ddim memory variable_visitor dynload_cuda)
    hip_library(fused_broadcast_op_handle SRCS fused_broadcast_op_handle.cc DEPS broadcast_op_handle)
Y
Yu Yang 已提交
66
else()
W
WangXi 已提交
67
    cc_library(nan_inf_utils SRCS nan_inf_utils_detail.cc DEPS framework_proto scope place)
68
    cc_library(all_reduce_op_handle SRCS all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
C
chengduoZH 已提交
69
             variable_visitor)
C
chengduo 已提交
70
    cc_library(fused_all_reduce_op_handle SRCS fused_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor ddim memory
Z
Zeng Jinle 已提交
71
            variable_visitor place device_memory_aligment)
72 73
    cc_library(grad_merge_all_reduce_op_handle SRCS grad_merge_all_reduce_op_handle.cc DEPS op_handle_base scope lod_tensor
            ddim memory variable_visitor place device_memory_aligment all_reduce_op_handle fused_all_reduce_op_handle)
74 75
    if(WITH_DISTRIBUTE)
        cc_library(reduce_op_handle SRCS reduce_op_handle.cc DEPS op_handle_base variable_visitor scope
T
tangwei12 已提交
76
                ddim selected_rows_functor)
77 78 79 80
    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 已提交
81
    cc_library(broadcast_op_handle SRCS broadcast_op_handle.cc DEPS op_handle_base scope ddim memory variable_visitor)
82
    cc_library(fused_broadcast_op_handle SRCS fused_broadcast_op_handle.cc DEPS broadcast_op_handle)
Y
Yu Yang 已提交
83
endif()
C
chengduoZH 已提交
84 85 86

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

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

89
set(SSA_GRAPH_EXECUTOR_DEPS graph framework_proto
90
    multi_devices_helper
91 92 93
    reference_count_pass
    eager_deletion_pass
    buffer_shared_inplace_op_pass
94
    buffer_shared_cross_op_memory_reuse_pass
95
    inplace_addto_op_pass
96
    set_reader_device_info_utils)
S
sneaxiy 已提交
97 98
cc_library(ssa_graph_executor SRCS ssa_graph_executor.cc DEPS ${SSA_GRAPH_EXECUTOR_DEPS})

Y
Yu Yang 已提交
99 100
cc_library(threaded_ssa_graph_executor SRCS threaded_ssa_graph_executor.cc DEPS fetch_op_handle ssa_graph_executor scope
        simple_threadpool device_context)
101

Y
Yancey1989 已提交
102 103
cc_library(parallel_ssa_graph_executor SRCS parallel_ssa_graph_executor.cc DEPS threaded_ssa_graph_executor)

104
set(ASYNC_SSA_GRAPH_EXECUTOR_DEPS threaded_ssa_graph_executor)
T
tangwei12 已提交
105

106
cc_library(async_ssa_graph_executor SRCS async_ssa_graph_executor.cc DEPS ${ASYNC_SSA_GRAPH_EXECUTOR_DEPS})
Q
can run  
Qiao Longfei 已提交
107

C
chengduoZH 已提交
108
cc_test(broadcast_op_test SRCS broadcast_op_handle_test.cc DEPS var_handle op_handle_base scope ddim memory
C
chengduoZH 已提交
109
        device_context broadcast_op_handle)
C
chengduoZH 已提交
110
cc_test(gather_op_test SRCS gather_op_handle_test.cc DEPS var_handle op_handle_base scope ddim memory
C
chengduoZH 已提交
111
        device_context gather_op_handle)
112 113 114

cc_library(scope_buffered_monitor SRCS scope_buffered_monitor.cc DEPS scope profiler selected_rows)
cc_library(scope_buffered_ssa_graph_executor SRCS scope_buffered_ssa_graph_executor.cc DEPS ssa_graph_executor scope_buffered_monitor)
Y
yuyang18 已提交
115 116
#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 )
117 118
cc_library(bind_threaded_ssa_graph_executor SRCS bind_threaded_ssa_graph_executor.cc
        DEPS fetch_op_handle gflags ssa_graph_executor scope simple_threadpool device_context)
Y
Stash  
yuyang18 已提交
119
cc_library(fast_threaded_ssa_graph_executor SRCS fast_threaded_ssa_graph_executor.cc
120
        DEPS fetch_async_op_handle ssa_graph_executor scope simple_threadpool device_context)
121
cc_test(fused_broadcast_op_test SRCS fused_broadcast_op_handle_test.cc DEPS fused_broadcast_op_handle)
122

H
hong 已提交
123 124
cc_test(exception_holder_test SRCS exception_holder_test.cc )

125 126
set(IR_PASS_DEPS graph_viz_pass multi_devices_graph_pass
    multi_devices_graph_print_pass multi_devices_graph_check_pass
Z
Zhang Ting 已提交
127
    fuse_elewise_add_act_pass fuse_bn_act_pass fuse_bn_add_act_pass 
128 129 130
    multi_batch_merge_pass 
    fuse_relu_depthwise_conv_pass
    lock_free_optimize_pass
131 132 133 134
    sequential_execution_pass
    all_reduce_deps_pass
    add_reader_dependency_pass
    modify_op_lock_and_record_event_pass
135 136
    coalesce_grad_tensor_pass fuse_all_reduce_op_pass backward_optimizer_op_deps_pass
    fuse_adam_op_pass fuse_sgd_op_pass fuse_momentum_op_pass
Z
Zeng Jinle 已提交
137 138
    sync_batch_norm_pass runtime_context_cache_pass graph_to_program_pass
    fix_op_run_order_pass)
139
if(NOT APPLE AND NOT WIN32 AND (WITH_GPU OR WITH_ROCM))
140 141 142
  set(IR_PASS_DEPS ${IR_PASS_DEPS} fusion_group_pass)
endif()
cc_library(build_strategy SRCS build_strategy.cc DEPS pass_builder ${IR_PASS_DEPS})
143 144
cc_test(build_strategy_test SRCS build_strategy_test.cc
        DEPS build_strategy op_registry op_proto_maker graph)
Z
Zeng Jinle 已提交
145 146 147 148

if (WITH_MKLDNN)
  target_link_libraries(build_strategy mkldnn_placement_pass)
endif()