Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ else ifeq ($(USE_CAMBRICON), 1)
CCL_LINK = -lcncl
ADAPTOR_FLAG = -DUSE_CAMBRICON_ADAPTOR
else ifeq ($(USE_METAX), 1)
DEVICE_LIB = $(DEVICE_HOME)/lib64
DEVICE_INCLUDE = $(DEVICE_HOME)/include
CCL_LIB = $(CCL_HOME)/lib64
CCL_INCLUDE = $(CCL_HOME)/include
DEVICE_LIB = $(DEVICE_HOME)/lib
DEVICE_INCLUDE = $(DEVICE_HOME)/include $(DEVICE_HOME)/include/mcr
DEVICE_COMPILER = $(DEVICE_HOME)/mxgpu_llvm/bin/mxcc
CCL_LIB = $(CCL_HOME)/lib
CCL_INCLUDE = $(CCL_HOME)/include/mccl
CCL_LINK = -lmccl
ADAPTOR_FLAG = -DUSE_METAX_ADAPTOR
else ifeq ($(USE_MUSA), 1)
Expand Down
55 changes: 50 additions & 5 deletions flagcx/adaptor/ccl/mccl_adaptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,65 @@ flagcxResult_t mcclAdaptorCommGetAsyncError(flagcxInnerComm_t comm,
(mcclResult_t *)asyncError);
}

// TODO: unsupported
#if MCCL_VERSION_CODE >= MCCL_VERSION(2, 30, 4)
flagcxResult_t mcclAdaptorMemAlloc(void **ptr, size_t size) {
return (flagcxResult_t)mcclMemAlloc(ptr, size);
}

flagcxResult_t mcclAdaptorMemFree(void *ptr) {
return (flagcxResult_t)mcclMemFree(ptr);
}

flagcxResult_t mcclAdaptorCommRegister(flagcxInnerComm_t comm, void *buff,
size_t size, void **handle) {
return (flagcxResult_t)mcclCommRegister(comm->base, buff, size, handle);
}

flagcxResult_t mcclAdaptorCommDeregister(flagcxInnerComm_t comm, void *handle) {
return (flagcxResult_t)mcclCommDeregister(comm->base, handle);
}

flagcxResult_t mcclAdaptorCommWindowRegister(flagcxInnerComm_t comm, void *buff,
size_t size,
flagcxInnerWindow_t *win,
int winFlags) {
if (*win == NULL) {
FLAGCXCHECK(flagcxCalloc(win, 1));
}
mcclWindow_t mcclWin = NULL;
flagcxResult_t res = (flagcxResult_t)mcclCommWindowRegister(
comm->base, buff, size, &mcclWin, winFlags);
if (res == flagcxSuccess) {
(*win)->base = mcclWin;
(*win)->winFlags = winFlags;
} else {
free(*win);
*win = NULL;
}
return res;
}

flagcxResult_t mcclAdaptorCommWindowDeregister(flagcxInnerComm_t comm,
flagcxInnerWindow_t win) {
flagcxResult_t res = flagcxSuccess;
res = (flagcxResult_t)mcclCommWindowDeregister(comm->base, win->base);
free(win);
return res;
}
#else //MCCL_VERSION_CODE < MCCL_VERSION(2, 30, 4)
flagcxResult_t mcclAdaptorMemAlloc(void **ptr, size_t size) {
return flagcxNotSupported;
}

// TODO: unsupported
flagcxResult_t mcclAdaptorMemFree(void *ptr) { return flagcxNotSupported; }
flagcxResult_t mcclAdaptorMemFree(void *ptr) {
return flagcxNotSupported;
}

// TODO: unsupported
flagcxResult_t mcclAdaptorCommRegister(flagcxInnerComm_t comm, void *buff,
size_t size, void **handle) {
return flagcxNotSupported;
}

// TODO: unsupported
flagcxResult_t mcclAdaptorCommDeregister(flagcxInnerComm_t comm, void *handle) {
return flagcxNotSupported;
}
Expand All @@ -116,6 +160,7 @@ flagcxResult_t mcclAdaptorCommWindowDeregister(flagcxInnerComm_t comm,
flagcxInnerWindow_t win) {
return flagcxNotSupported;
}
#endif // MCCL_VERSION_CODE >= MCCL_VERSION(2, 30, 4)

flagcxResult_t mcclAdaptorReduce(const void *sendbuff, void *recvbuff,
size_t count, flagcxDataType_t datatype,
Expand Down
Loading
Loading