提交 c0c2e159 编写于 作者: Y Yu Yang

NCCL AllReduce

上级 3f88fad0
......@@ -50,10 +50,6 @@ void NCCLAllReduceOpHandle::RunImpl() {
auto &lod_tensor = s->FindVar(var_name)->Get<LoDTensor>();
void *buffer = const_cast<void *>(lod_tensor.data<void>());
uintptr_t buf = reinterpret_cast<uintptr_t>(buffer);
if (buf % sizeof(float) != 0) {
VLOG(3) << "Buffer is not aligned " << buf;
}
if (dtype == -1) {
dtype = platform::ToNCCLDataType(lod_tensor.type());
......
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册