Skip to content

Commit b2f7ab6

Browse files
author
lilong12
authored
bug fix, test=develop (#28648)
1 parent 8f2656e commit b2f7ab6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ template <typename T>
2626
class RecvOpV2CUDAKernel : public framework::OpKernel<T> {
2727
public:
2828
void Compute(const framework::ExecutionContext &ctx) const override {
29+
#if defined(PADDLE_WITH_NCCL) && NCCL_VERSION_CODE >= 2703
2930
int rid = ctx.Attr<int>("ring_id");
3031
PADDLE_ENFORCE_GE(
3132
rid, 0,
@@ -44,7 +45,6 @@ class RecvOpV2CUDAKernel : public framework::OpKernel<T> {
4445
framework::proto::VarType::Type type =
4546
framework::proto::VarType::Type(data_type);
4647

47-
#if defined(PADDLE_WITH_NCCL) && NCCL_VERSION_CODE >= 2703
4848
cudaStream_t stream = nullptr;
4949
auto place = ctx.GetPlace();
5050
auto comm = platform::NCCLCommContext::Instance().Get(rid, place);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ template <typename T>
2626
class SendOpV2CUDAKernel : public framework::OpKernel<T> {
2727
public:
2828
void Compute(const framework::ExecutionContext& ctx) const override {
29+
#if defined(PADDLE_WITH_NCCL) && NCCL_VERSION_CODE >= 2703
2930
auto x = ctx.Input<framework::LoDTensor>("X");
3031
int numel = x->numel();
3132

@@ -42,7 +43,6 @@ class SendOpV2CUDAKernel : public framework::OpKernel<T> {
4243
"The peer (%d) for send_v2 op must be non-negative.", peer));
4344
cudaStream_t stream = nullptr;
4445
auto place = ctx.GetPlace();
45-
#if defined(PADDLE_WITH_NCCL) && NCCL_VERSION_CODE >= 2703
4646
auto comm = platform::NCCLCommContext::Instance().Get(rid, place);
4747
if (ctx.Attr<bool>("use_calc_stream")) {
4848
auto dev_ctx = platform::DeviceContextPool::Instance().Get(place);

0 commit comments

Comments
 (0)