Skip to content

Commit 9cc1be8

Browse files
authored
1 parent 2b79496 commit 9cc1be8

File tree

5 files changed

+183
-213
lines changed

5 files changed

+183
-213
lines changed

paddle/fluid/operators/collective/partial_allgather_op.cc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "paddle/fluid/operators/collective/partial_allgather_op.h"
15+
#include "paddle/fluid/framework/data_type.h"
16+
#include "paddle/fluid/framework/lod_tensor.h"
17+
#include "paddle/fluid/framework/op_registry.h"
1618

1719
namespace paddle {
1820
namespace operators {
@@ -83,13 +85,3 @@ REGISTER_OPERATOR(
8385
paddle::framework::EmptyGradOpMaker<paddle::framework::OpDesc>,
8486
paddle::framework::EmptyGradOpMaker<paddle::imperative::OpBase>,
8587
ops::PartialAllGatherOpInplaceInferer)
86-
87-
PD_REGISTER_STRUCT_KERNEL(partial_allgather,
88-
CPU,
89-
ALL_LAYOUT,
90-
ops::PartialAllGatherOpCPUKernel,
91-
float,
92-
double,
93-
int,
94-
int64_t,
95-
phi::dtype::float16) {}

paddle/fluid/operators/collective/partial_allgather_op.cu.cc

Lines changed: 0 additions & 163 deletions
This file was deleted.

paddle/fluid/operators/collective/partial_allgather_op.h

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "paddle/phi/core/kernel_registry.h"
16+
17+
namespace phi {
18+
19+
template <typename T, typename Context>
20+
void PartialAllGatherOpCPUKernel(const Context &dev_ctx,
21+
const DenseTensor &x,
22+
int nranks,
23+
int rank,
24+
int ring_id,
25+
bool use_calc_stream,
26+
DenseTensor *out) {
27+
PADDLE_THROW(common::errors::Unavailable(
28+
"Do not support partial_allgather for cpu kernel now."));
29+
}
30+
31+
} // namespace phi
32+
33+
PD_REGISTER_KERNEL(partial_allgather,
34+
CPU,
35+
ALL_LAYOUT,
36+
phi::PartialAllGatherOpCPUKernel,
37+
float,
38+
double,
39+
int,
40+
int64_t,
41+
phi::dtype::float16) {}

0 commit comments

Comments
 (0)