Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/infiniccl/cambricon/infiniccl_cambricon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ inline cnclDataType_t getCnclDtype(infiniDtype_t datatype) {
return cnclFloat32;
case INFINI_DTYPE_F16:
return cnclFloat16;
case INFINI_DTYPE_BF16:
return cnclBfloat16;
default:
std::cerr << "Unsupported data type: " << datatype << std::endl;
std::abort();
Expand Down Expand Up @@ -89,14 +91,13 @@ infiniStatus_t allReduce(
infinicclComm_t comm,
infinirtStream_t stream) {

if (datatype != INFINI_DTYPE_F32 && datatype != INFINI_DTYPE_F16) {
return INFINI_STATUS_BAD_PARAM;
}
CHECK_DTYPE(datatype, INFINI_DTYPE_F32, INFINI_DTYPE_F16, INFINI_DTYPE_BF16);

CHECK_CNCL(cnclAllReduce(sendbuf, recvbuf, count, getCnclDtype(datatype),
getCnclRedOp(op), getCnclComm(comm),
getCambriconStream(stream)));

return INFINI_STATUS_SUCCESS;
}

} // namespace infiniccl::cambricon
Loading