CMakeLists.txt 2.4 KB
Newer Older
1 2 3
cc_library(
  processgroup
  SRCS ProcessGroup.cc
L
LiYuRio 已提交
4
  DEPS dense_tensor)
5 6 7 8
cc_library(
  processgroup_stream
  SRCS ProcessGroupStream.cc
  DEPS dense_tensor)
9 10 11
cc_library(
  eager_reducer
  SRCS reducer.cc
12
  DEPS eager_api processgroup processgroup_stream phi_api string_helper)
13

14 15 16 17 18
if(WITH_DISTRIBUTE)
  cc_library(
    processgroup_gloo
    SRCS ProcessGroupGloo.cc
    DEPS phi_api eager_api gloo_wrapper)
19
endif()
20

S
ShenLiang 已提交
21
if(WITH_NCCL OR WITH_RCCL)
22 23 24
  cc_library(
    processgroup_nccl
    SRCS ProcessGroupNCCL.cc NCCLTools.cc Common.cc
25 26 27 28 29 30
    DEPS processgroup
         processgroup_stream
         place
         enforce
         collective_helper
         device_context
31
         ${DEVICE_EVENT_LIBS}
L
LiYuRio 已提交
32
         dense_tensor)
33
  if(WITH_DISTRIBUTE AND WITH_PSCORE)
34 35
    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
      set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
36 37 38
      set_source_files_properties(
        ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
                                        ${DISTRIBUTE_COMPILE_FLAGS})
39
    endif()
40 41 42
    cc_library(
      processgroup_heter
      SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc
L
Leo Chen 已提交
43
      DEPS place enforce collective_helper device_context phi_api eager_api)
L
lilong12 已提交
44
  endif()
45
endif()
L
lilong12 已提交
46

W
wuhuachaocoding 已提交
47 48 49 50 51 52 53
if(WITH_MPI)
  cc_library(
    processgroup_mpi
    SRCS ProcessGroupMPI.cc MPITools.cc Common.cc
    DEPS collective_helper device_context)
endif()

54
if(WITH_ASCEND_CL)
55 56 57 58 59 60 61 62 63 64 65
  cc_library(
    processgroup_hccl
    SRCS ProcessGroupHCCL.cc HCCLTools.cc Common.cc
    DEPS place
         npu_stream
         enforce
         collective_helper
         device_context
         phi_api
         eager_api)
  if(WITH_DISTRIBUTE AND WITH_PSCORE)
66 67
    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
      set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
68 69 70
      set_source_files_properties(
        ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
                                        ${DISTRIBUTE_COMPILE_FLAGS})
71
    endif()
72

73 74 75 76 77 78 79 80 81 82
    cc_library(
      processgroup_heter
      SRCS ProcessGroupHeter.cc HCCLTools.cc Common.cc
      DEPS place
           npu_stream
           enforce
           collective_helper
           device_context
           phi_api
           eager_api)
L
lilong12 已提交
83
  endif()
84
endif()
85 86 87 88 89

if(WITH_CUSTOM_DEVICE)
  cc_library(
    processgroup_custom
    SRCS ProcessGroupCustom.cc CustomCCLTools.cc Common.cc
90 91
    DEPS processgroup phi_backends place enforce collective_helper
         device_context)
92
endif()