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
L
LiYuRio 已提交
31
         dense_tensor)
32
  if(WITH_DISTRIBUTE AND WITH_PSCORE)
33 34
    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
      set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
35 36 37
      set_source_files_properties(
        ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
                                        ${DISTRIBUTE_COMPILE_FLAGS})
38
    endif()
39 40 41
    cc_library(
      processgroup_heter
      SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc
L
Leo Chen 已提交
42
      DEPS place enforce collective_helper device_context phi_api eager_api)
L
lilong12 已提交
43
  endif()
44
endif()
L
lilong12 已提交
45

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

53
if(WITH_ASCEND_CL)
54 55 56 57 58 59 60 61 62 63 64
  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)
65 66
    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
      set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
67 68 69
      set_source_files_properties(
        ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
                                        ${DISTRIBUTE_COMPILE_FLAGS})
70
    endif()
71

72 73 74 75 76 77 78 79 80 81
    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 已提交
82
  endif()
83
endif()
84 85 86 87 88

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