diff --git a/paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc b/paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc index f2303ff4cabf31eb2fcf53bd24a2dfb8a7ab30a6..116b13d3301d780875580867a8d53e91b2781145 100644 --- a/paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc +++ b/paddle/fluid/framework/details/nccl_all_reduce_op_handle.cc @@ -50,10 +50,6 @@ void NCCLAllReduceOpHandle::RunImpl() { auto &lod_tensor = s->FindVar(var_name)->Get(); void *buffer = const_cast(lod_tensor.data()); - uintptr_t buf = reinterpret_cast(buffer); - if (buf % sizeof(float) != 0) { - VLOG(3) << "Buffer is not aligned " << buf; - } if (dtype == -1) { dtype = platform::ToNCCLDataType(lod_tensor.type()); diff --git a/paddle/fluid/platform/nccl_helper.h b/paddle/fluid/platform/nccl_helper.h index 29990043206509e4192bfff84832f09ef127d9dd..ecdd98987dd41985c7ac77a7fceb356e15f6cd3b 100644 --- a/paddle/fluid/platform/nccl_helper.h +++ b/paddle/fluid/platform/nccl_helper.h @@ -36,12 +36,10 @@ inline ncclDataType_t ToNCCLDataType(std::type_index type) { class NCCLGroupGuard { public: - inline NCCLGroupGuard() { - mutex().lock(); - PADDLE_ENFORCE(dynload::ncclGroupStart()); - } + inline NCCLGroupGuard() { PADDLE_ENFORCE(dynload::ncclGroupStart()); } inline ~NCCLGroupGuard() { + mutex().lock(); PADDLE_ENFORCE(dynload::ncclGroupEnd()); mutex().unlock(); }