CMakeLists.txt 3.6 KB
Newer Older
Z
Zeng Jinle 已提交
1
cc_library(imperative_flag SRCS flags.cc DEPS gflags flags)
2
cc_library(var_helper SRCS var_helper.cc DEPS tensor phi_api)
Q
QingshuChen 已提交
3
IF(WITH_XPU)
4
cc_library(prepared_operator SRCS prepared_operator.cc DEPS xpu_op_list proto_desc operator device_context lod_tensor selected_rows_utils var_type_traits op_kernel_type data_transform nan_inf_utils phi_api phi_utils var_helper)
Q
QingshuChen 已提交
5
ELSE()
6
cc_library(prepared_operator SRCS prepared_operator.cc DEPS proto_desc operator device_context lod_tensor selected_rows_utils var_type_traits op_kernel_type data_transform nan_inf_utils phi_api phi_utils var_helper)
Q
QingshuChen 已提交
7
ENDIF()
8
cc_library(layer SRCS layer.cc DEPS prepared_operator math_function imperative_flag variable_helper op_registry var_helper phi_api)
9
add_subdirectory(jit)
10 11 12 13 14
if (WITH_GPU)
cc_library(layout_autotune SRCS layout_autotune.cc DEPS op_info phi_gpu_info)
else()
cc_library(layout_autotune SRCS layout_autotune.cc DEPS op_info)
endif()
J
Jiabin Yang 已提交
15
cc_library(amp SRCS amp_auto_cast.cc DEPS layer var_helper)
16
cc_library(tracer SRCS tracer.cc DEPS layer engine program_desc_tracer amp denormal garbage_collector var_helper layout_autotune)
17 18
cc_library(basic_engine SRCS basic_engine.cc DEPS layer gradient_accumulator switch_autotune)
cc_library(engine SRCS basic_engine.cc partial_grad_engine.cc DEPS layer gradient_accumulator switch_autotune)
Z
Zeng Jinle 已提交
19
cc_library(imperative_profiler SRCS profiler.cc DEPS flags)
20
if(NOT WIN32)
21
    if(WITH_NCCL OR WITH_RCCL)
22
        cc_library(imperative_all_reduce SRCS all_reduce.cc DEPS collective_helper device_context selected_rows_utils tensor)
23
        cc_library(nccl_context SRCS nccl_context.cc DEPS collective_helper device_context imperative_all_reduce var_type_traits)
24 25 26 27 28 29
        if(WITH_NCCL)
            nv_library(reducer SRCS reducer.cc reducer.cu DEPS layer imperative_all_reduce)
        endif()
        if(WITH_RCCL)
            hip_library(reducer SRCS reducer.cc reducer.cu DEPS layer imperative_all_reduce)
        endif()
30
    endif()
31 32 33 34
    if(WITH_XPU_BKCL)
        cc_library(bkcl_context SRCS bkcl_context.cc DEPS collective_helper device_context tensor var_type_traits)
        cc_library(reducer SRCS reducer.cc DEPS layer)
    endif()
35 36 37 38
    if(WITH_ASCEND_CL)
        cc_library(hccl_context SRCS hccl_context.cc DEPS collective_helper device_context tensor var_type_traits)
        cc_library(reducer SRCS reducer.cc DEPS layer)
    endif()
39 40
    if(WITH_CNCL)
        cc_library(cncl_context SRCS cncl_context.cc DEPS collective_helper device_context tensor var_type_traits)
Z
zn 已提交
41
	cc_library(reducer SRCS reducer.cc DEPS layer)
42
    endif()
K
kuizhiqing 已提交
43 44 45
    if(WITH_NCCL OR WITH_RCCL OR WITH_XPU_BKCL OR WITH_ASCEND_CL)
        cc_library(heter_ccl_context SRCS heter_ccl_context.cc DEPS collective_helper device_context tensor var_type_traits)
    endif()
46
    cc_library(data_loader SRCS data_loader.cc DEPS enforce)
47
endif(NOT WIN32)
48 49
if(WITH_GLOO)
    cc_library(imperative_gloo_context SRCS gloo_context.cc DEPS collective_helper device_context tensor var_type_traits)
Z
zn 已提交
50
    if ( WIN32 OR (NOT (WITH_NCCL OR WITH_RCCL OR WITH_XPU_BKCL OR WITH_ASCEND_CL OR WITH_CNCL) ))
51 52 53
        cc_library(reducer SRCS reducer.cc DEPS layer)
    endif()
endif()
J
Jiabin Yang 已提交
54

Q
qipengh 已提交
55 56 57 58
if(WITH_MLU)
    SET(MLU_DEPS mlu_baseop)
endif()

59
if(NOT WITH_ASCEND_CL)
Q
qipengh 已提交
60
cc_library(gradient_accumulator SRCS gradient_accumulator.cc DEPS blas operator lod_tensor selected_rows_utils selected_rows_functor var_type_traits layer math_function phi_tensor ${MLU_DEPS})
61
else()
62
cc_library(gradient_accumulator SRCS gradient_accumulator.cc DEPS blas operator lod_tensor selected_rows_utils selected_rows_functor var_type_traits layer math_function npu_op_runner phi_tensor)
63
endif()
64

J
Jiabin Yang 已提交
65
add_subdirectory(tests)