From 89da2f19c8831751bfe1288638060ecc1958f9e9 Mon Sep 17 00:00:00 2001 From: LiYuRio <63526175+LiYuRio@users.noreply.github.com> Date: Tue, 23 May 2023 17:08:55 +0800 Subject: [PATCH] fix nccl version (#53942) --- paddle/fluid/operators/collective/alltoall_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_allgather_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_allreduce_max_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_broadcast_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_concat_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_embedding_op.cu | 4 ++-- paddle/fluid/operators/collective/c_identity_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_reducescatter_op.cu.cc | 2 +- paddle/fluid/operators/collective/c_split_op.cu | 2 +- paddle/fluid/operators/collective/mp_allreduce_sum_op.cu.cc | 2 +- paddle/fluid/operators/collective/partial_allgather_op.cu.cc | 2 +- paddle/fluid/operators/collective/partial_recv_op.cu.cc | 2 +- paddle/fluid/operators/collective/partial_send_op.cu.cc | 2 +- paddle/fluid/operators/collective/recv_v2_op.cu.cc | 2 +- paddle/fluid/operators/collective/send_v2_op.cu.cc | 2 +- paddle/fluid/platform/device/gpu/nccl_helper.h | 4 ++-- paddle/phi/core/utils/data_type.h | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/paddle/fluid/operators/collective/alltoall_op.cu.cc b/paddle/fluid/operators/collective/alltoall_op.cu.cc index aacd76af4af..0ae338c745a 100644 --- a/paddle/fluid/operators/collective/alltoall_op.cu.cc +++ b/paddle/fluid/operators/collective/alltoall_op.cu.cc @@ -98,7 +98,7 @@ PD_REGISTER_STRUCT_KERNEL(alltoall, ops::AllToAllOpCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/c_allgather_op.cu.cc b/paddle/fluid/operators/collective/c_allgather_op.cu.cc index 70b7d70dc93..c3eff905851 100644 --- a/paddle/fluid/operators/collective/c_allgather_op.cu.cc +++ b/paddle/fluid/operators/collective/c_allgather_op.cu.cc @@ -95,7 +95,7 @@ PD_REGISTER_STRUCT_KERNEL(c_allgather, ops::CAllGatherOpCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/c_allreduce_max_op.cu.cc b/paddle/fluid/operators/collective/c_allreduce_max_op.cu.cc index 9be9674bb08..277988b5691 100644 --- a/paddle/fluid/operators/collective/c_allreduce_max_op.cu.cc +++ b/paddle/fluid/operators/collective/c_allreduce_max_op.cu.cc @@ -28,7 +28,7 @@ PD_REGISTER_STRUCT_KERNEL(c_allreduce_max, ALL_LAYOUT, ops::CAllReduceMaxCUDAKernel, float, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif double, diff --git a/paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc b/paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc index 8e45b7e43b2..76d809cd234 100644 --- a/paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc +++ b/paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc @@ -28,7 +28,7 @@ PD_REGISTER_STRUCT_KERNEL(c_allreduce_sum, ALL_LAYOUT, ops::CAllReduceSumCUDAKernel, float, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif double, diff --git a/paddle/fluid/operators/collective/c_broadcast_op.cu.cc b/paddle/fluid/operators/collective/c_broadcast_op.cu.cc index d0d3ebb1394..e37657a1747 100644 --- a/paddle/fluid/operators/collective/c_broadcast_op.cu.cc +++ b/paddle/fluid/operators/collective/c_broadcast_op.cu.cc @@ -100,7 +100,7 @@ PD_REGISTER_STRUCT_KERNEL(c_broadcast, int64_t, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { diff --git a/paddle/fluid/operators/collective/c_concat_op.cu.cc b/paddle/fluid/operators/collective/c_concat_op.cu.cc index dc47c184c22..1760b6ea390 100644 --- a/paddle/fluid/operators/collective/c_concat_op.cu.cc +++ b/paddle/fluid/operators/collective/c_concat_op.cu.cc @@ -137,7 +137,7 @@ PD_REGISTER_STRUCT_KERNEL(c_concat, double, int, int64_t, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { diff --git a/paddle/fluid/operators/collective/c_embedding_op.cu b/paddle/fluid/operators/collective/c_embedding_op.cu index 4861b5d26ab..758734ada66 100644 --- a/paddle/fluid/operators/collective/c_embedding_op.cu +++ b/paddle/fluid/operators/collective/c_embedding_op.cu @@ -239,7 +239,7 @@ PD_REGISTER_STRUCT_KERNEL(c_embedding, ops::CEmbeddingCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { @@ -251,7 +251,7 @@ PD_REGISTER_STRUCT_KERNEL(c_embedding_grad, ops::CEmbeddingGradCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { diff --git a/paddle/fluid/operators/collective/c_identity_op.cu.cc b/paddle/fluid/operators/collective/c_identity_op.cu.cc index 3d5f16c218c..9571168db15 100644 --- a/paddle/fluid/operators/collective/c_identity_op.cu.cc +++ b/paddle/fluid/operators/collective/c_identity_op.cu.cc @@ -25,7 +25,7 @@ PD_REGISTER_STRUCT_KERNEL(c_identity, double, int, int64_t, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { diff --git a/paddle/fluid/operators/collective/c_reducescatter_op.cu.cc b/paddle/fluid/operators/collective/c_reducescatter_op.cu.cc index 35053b1511f..edae8feb612 100644 --- a/paddle/fluid/operators/collective/c_reducescatter_op.cu.cc +++ b/paddle/fluid/operators/collective/c_reducescatter_op.cu.cc @@ -87,7 +87,7 @@ PD_REGISTER_STRUCT_KERNEL(c_reducescatter, ops::CReduceScatterOpCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/c_split_op.cu b/paddle/fluid/operators/collective/c_split_op.cu index b01ed790e85..0b3e2aaf781 100644 --- a/paddle/fluid/operators/collective/c_split_op.cu +++ b/paddle/fluid/operators/collective/c_split_op.cu @@ -123,7 +123,7 @@ PD_REGISTER_STRUCT_KERNEL(c_split, double, int, int64_t, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { diff --git a/paddle/fluid/operators/collective/mp_allreduce_sum_op.cu.cc b/paddle/fluid/operators/collective/mp_allreduce_sum_op.cu.cc index b6af2dbd1c8..b4773a8eb54 100644 --- a/paddle/fluid/operators/collective/mp_allreduce_sum_op.cu.cc +++ b/paddle/fluid/operators/collective/mp_allreduce_sum_op.cu.cc @@ -31,7 +31,7 @@ PD_REGISTER_STRUCT_KERNEL(mp_allreduce_sum, double, int, int64_t, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif plat::float16) { diff --git a/paddle/fluid/operators/collective/partial_allgather_op.cu.cc b/paddle/fluid/operators/collective/partial_allgather_op.cu.cc index 2374f4a4aed..d22fd70bd0f 100644 --- a/paddle/fluid/operators/collective/partial_allgather_op.cu.cc +++ b/paddle/fluid/operators/collective/partial_allgather_op.cu.cc @@ -108,7 +108,7 @@ PD_REGISTER_STRUCT_KERNEL(partial_allgather, ops::PartialAllGatherOpCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/partial_recv_op.cu.cc b/paddle/fluid/operators/collective/partial_recv_op.cu.cc index b0df94194e4..0c33ca7c25c 100644 --- a/paddle/fluid/operators/collective/partial_recv_op.cu.cc +++ b/paddle/fluid/operators/collective/partial_recv_op.cu.cc @@ -124,7 +124,7 @@ PD_REGISTER_STRUCT_KERNEL(partial_recv, ops::PartialRecvOpCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/partial_send_op.cu.cc b/paddle/fluid/operators/collective/partial_send_op.cu.cc index dc24ea01fc9..4f9fc41bc4e 100644 --- a/paddle/fluid/operators/collective/partial_send_op.cu.cc +++ b/paddle/fluid/operators/collective/partial_send_op.cu.cc @@ -123,7 +123,7 @@ PD_REGISTER_STRUCT_KERNEL(partial_send, ops::PartialSendCUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/recv_v2_op.cu.cc b/paddle/fluid/operators/collective/recv_v2_op.cu.cc index bfa12f91194..28058aa4868 100644 --- a/paddle/fluid/operators/collective/recv_v2_op.cu.cc +++ b/paddle/fluid/operators/collective/recv_v2_op.cu.cc @@ -238,7 +238,7 @@ PD_REGISTER_STRUCT_KERNEL(recv_v2, ops::RecvOpV2CUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/operators/collective/send_v2_op.cu.cc b/paddle/fluid/operators/collective/send_v2_op.cu.cc index adea7db0b80..a80dc1f91e4 100644 --- a/paddle/fluid/operators/collective/send_v2_op.cu.cc +++ b/paddle/fluid/operators/collective/send_v2_op.cu.cc @@ -223,7 +223,7 @@ PD_REGISTER_STRUCT_KERNEL(send_v2, ops::SendOpV2CUDAKernel, float, double, -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 plat::bfloat16, #endif int, diff --git a/paddle/fluid/platform/device/gpu/nccl_helper.h b/paddle/fluid/platform/device/gpu/nccl_helper.h index 8dd0639ce72..6afcd2eb7cd 100644 --- a/paddle/fluid/platform/device/gpu/nccl_helper.h +++ b/paddle/fluid/platform/device/gpu/nccl_helper.h @@ -59,7 +59,7 @@ inline ncclDataType_t ToNCCLDataType(framework::proto::VarType::Type type) { return ncclUint8; } else if (type == framework::proto::VarType::BOOL) { return ncclUint8; -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 } else if (type == framework::proto::VarType::BF16) { return ncclBfloat16; #endif @@ -86,7 +86,7 @@ inline ncclDataType_t ToNCCLDataType(phi::DataType type) { return ncclInt8; } else if (type == phi::DataType::BOOL) { return ncclUint8; -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 } else if (type == phi::DataType::BFLOAT16) { return ncclBfloat16; #endif diff --git a/paddle/phi/core/utils/data_type.h b/paddle/phi/core/utils/data_type.h index 16b73e0f2ba..018672e45b5 100644 --- a/paddle/phi/core/utils/data_type.h +++ b/paddle/phi/core/utils/data_type.h @@ -229,7 +229,7 @@ inline ncclDataType_t ToNCCLDataType(DataType type) { return ncclInt8; } else if (type == DataType::BOOL) { return ncclUint8; -#if NCCL_VERSION_CODE >= 21000 +#if NCCL_VERSION_CODE >= 21000 && CUDA_VERSION >= 11000 } else if (type == DataType::BFLOAT16) { return ncclBfloat16; #endif -- GitLab