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

10 11 12 13 14
if(WITH_DISTRIBUTE)
  cc_library(
    processgroup_gloo
    SRCS ProcessGroupGloo.cc
    DEPS phi_api eager_api gloo_wrapper)
15
endif()
16

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

37
if(WITH_ASCEND_CL)
38 39 40 41 42 43 44 45 46 47 48
  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)
49 50
    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
      set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
51 52 53
      set_source_files_properties(
        ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
                                        ${DISTRIBUTE_COMPILE_FLAGS})
54
    endif()
55

56 57 58 59 60 61 62 63 64 65
    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 已提交
66
  endif()
67
endif()
68 69 70 71 72 73 74 75 76 77 78 79 80

if(WITH_CUSTOM_DEVICE)
  cc_library(
    processgroup_custom
    SRCS ProcessGroupCustom.cc CustomCCLTools.cc Common.cc
    DEPS phi_backends
         place
         enforce
         collective_helper
         device_context
         phi_api
         eager_api)
endif()