Skip to content

Commit c2d2b66

Browse files
authored
Migrate process_group to phi [fluid_ops] (#67243)
* Fix * Fix * Fix * Fix * Fix
1 parent 413d127 commit c2d2b66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+894
-861
lines changed
Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,4 @@
1-
cc_library(
2-
process_group
3-
SRCS process_group.cc
4-
DEPS phi common xxhash)
5-
61
cc_library(
72
eager_reducer
83
SRCS reducer.cc
9-
DEPS eager_api process_group phi common string_helper)
10-
11-
if(WITH_DISTRIBUTE)
12-
cc_library(
13-
process_group_gloo
14-
SRCS process_group_gloo.cc gloo_send_recv.cc
15-
DEPS phi common eager_api gloo_wrapper)
16-
endif()
17-
18-
if(WITH_NCCL OR WITH_RCCL)
19-
cc_library(
20-
process_group_nccl
21-
SRCS process_group_nccl.cc common.cc
22-
DEPS process_group phi common collective_helper device_context
23-
${DEVICE_EVENT_LIBS})
24-
25-
cc_library(
26-
async_load
27-
SRCS async_load.cc
28-
DEPS device_context phi common ${DEVICE_EVENT_LIBS})
29-
30-
endif()
31-
32-
if(WITH_XPU_BKCL)
33-
cc_library(
34-
process_group_bkcl
35-
SRCS process_group_bkcl.cc bkcl_tools.cc common.cc
36-
DEPS process_group phi common collective_helper device_context)
37-
endif()
38-
39-
if(WITH_MPI)
40-
cc_library(
41-
process_group_mpi
42-
SRCS process_group_mpi.cc mpi_tools.cc common.cc
43-
DEPS collective_helper device_context)
44-
endif()
45-
46-
if(WITH_CUSTOM_DEVICE)
47-
cc_library(
48-
process_group_custom
49-
SRCS process_group_custom.cc custom_ccl_tools.cc common.cc
50-
DEPS process_group phi common collective_helper device_context)
51-
endif()
52-
53-
set(COMM_UTILS_DEPS process_group)
54-
if(WITH_NCCL OR WITH_RCCL)
55-
set(COMM_UTILS_DEPS ${PROCESS_GROUP_UTILS_DEPS} process_group_nccl)
56-
endif()
57-
if(WITH_CUSTOM_DEVICE)
58-
set(COMM_UTILS_DEPS ${PROCESS_GROUP_UTILS_DEPS} process_group_custom)
59-
endif()
60-
cc_library(
61-
processgroup_comm_utils
62-
SRCS processgroup_comm_utils.cc
63-
DEPS ${COMM_UTILS_DEPS})
4+
DEPS eager_api phi common string_helper)

paddle/fluid/distributed/collective/process_group.cc

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
1+
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -14,55 +14,4 @@
1414

1515
#pragma once
1616

17-
#include <chrono>
18-
#include <memory>
19-
#include <optional>
20-
#include <string>
21-
#include <unordered_map>
22-
#include <vector>
23-
24-
#include "paddle/common/errors.h"
25-
#include "paddle/phi/core/dense_tensor.h"
26-
#include "paddle/phi/core/device_context.h"
2717
#include "paddle/phi/core/distributed/collective/process_group.h"
28-
#include "paddle/phi/core/distributed/types.h"
29-
#include "paddle/phi/core/distributed/utils.h"
30-
#include "paddle/phi/core/enforce.h"
31-
32-
namespace paddle {
33-
namespace distributed {
34-
35-
using phi::distributed::AllreduceOptions;
36-
using phi::distributed::BarrierOptions;
37-
using phi::distributed::BroadcastOptions;
38-
using phi::distributed::CommType;
39-
using phi::distributed::GatherOptions;
40-
using phi::distributed::GetPartialTensor;
41-
using phi::distributed::ReduceOp;
42-
using phi::distributed::ReduceOptions;
43-
using phi::distributed::ReduceScatterOptions;
44-
using phi::distributed::ScatterOptions;
45-
constexpr int kIgnoreId = -1;
46-
47-
using phi::distributed::ProcessGroup;
48-
using phi::distributed::ProcessGroupIdMap;
49-
using phi::distributed::ProcessGroupMapFromGid;
50-
51-
static void CheckTensorContiguous(const phi::DenseTensor& tensor) {
52-
if (!tensor.meta().is_contiguous()) {
53-
PADDLE_THROW(
54-
common::errors::InvalidArgument("The tensor must be contiguous"));
55-
}
56-
}
57-
58-
static void CheckTensorContiguous(const std::vector<phi::DenseTensor>& inputs) {
59-
for (const auto& tensor : inputs) {
60-
if (!tensor.meta().is_contiguous()) {
61-
PADDLE_THROW(
62-
common::errors::InvalidArgument("The tensor must be contiguous"));
63-
}
64-
}
65-
}
66-
67-
} // namespace distributed
68-
} // namespace paddle

0 commit comments

Comments
 (0)