diff --git a/flagcx/adaptor/adaptor.h b/flagcx/adaptor/adaptor.h index 2684c0f..116bb15 100644 --- a/flagcx/adaptor/adaptor.h +++ b/flagcx/adaptor/adaptor.h @@ -64,12 +64,6 @@ struct flagcxCCLAdaptor { // Group semantics flagcxResult_t (*groupStart)(); flagcxResult_t (*groupEnd)(); - - // Memory functions - flagcxResult_t (*memAlloc)(void** ptr, size_t size); - flagcxResult_t (*memFree)(void *ptr); - flagcxResult_t (*commRegister)(const flagcxHomoComm_t comm, void* buff, size_t size, void** handle); - flagcxResult_t (*commDeregister)(const flagcxHomoComm_t comm, void* handle); }; const int MAX_VENDOR_LEN = 128; @@ -122,4 +116,4 @@ struct flagcxDeviceAdaptor { } // end extern "C" #endif -#endif // end include guard \ No newline at end of file +#endif // end include guard diff --git a/flagcx/adaptor/cncl_adaptor.cc b/flagcx/adaptor/cncl_adaptor.cc index 42264e2..03a4942 100644 --- a/flagcx/adaptor/cncl_adaptor.cc +++ b/flagcx/adaptor/cncl_adaptor.cc @@ -240,28 +240,6 @@ flagcxResult_t cnclAdaptorGroupEnd() { return (flagcxResult_t)c2f_ret_map[cnclGroupEnd()]; } -flagcxResult_t cnclAdaptorMemAlloc(void** ptr, size_t size) { - cnrtMalloc(ptr, size); - return flagcxSuccess; -} - -flagcxResult_t cnclAdaptorMemFree(void *ptr) { - cnrtFree(ptr); - return flagcxSuccess; -} - -flagcxResult_t cnclAdaptorCommRegister(const flagcxHomoComm_t comm, void* buff, - size_t size, void** handle) { - //return (flagcxResult_t)cnclCommRegister(comm->base, buff, size, handle); - return flagcxUnhandledDeviceError; -} - -//TODO: unsupported -flagcxResult_t cnclAdaptorCommDeregister(const flagcxHomoComm_t comm, void* handle) { - //return (flagcxResult_t)cnclCommDeregister(comm->base, handle); - return flagcxUnhandledDeviceError; -} - struct flagcxCCLAdaptor cnclAdaptor = { "CNCL", // Basic functions @@ -293,12 +271,7 @@ struct flagcxCCLAdaptor cnclAdaptor = { cnclAdaptorRecv, // Group semantics cnclAdaptorGroupStart, - cnclAdaptorGroupEnd, - // Memory functions - cnclAdaptorMemAlloc, - cnclAdaptorMemFree, - cnclAdaptorCommRegister, - cnclAdaptorCommDeregister + cnclAdaptorGroupEnd }; #endif // USE_CAMBRICON_ADAPTOR diff --git a/flagcx/adaptor/ixnccl_adaptor.cc b/flagcx/adaptor/ixnccl_adaptor.cc index 8113721..1034d25 100644 --- a/flagcx/adaptor/ixnccl_adaptor.cc +++ b/flagcx/adaptor/ixnccl_adaptor.cc @@ -182,23 +182,6 @@ flagcxResult_t ixncclAdaptorGroupEnd() { return (flagcxResult_t)ncclGroupEnd(); } -// flagcxResult_t ixncclAdaptorMemAlloc(void** ptr, size_t size) { -// return (flagcxResult_t)ncclMemAlloc(ptr, size); -// } - -// flagcxResult_t ixncclAdaptorMemFree(void *ptr) { -// return (flagcxResult_t)ncclMemFree(ptr); -// } - -// flagcxResult_t ixncclAdaptorCommRegister(const flagcxHomoComm_t comm, void* buff, -// size_t size, void** handle) { -// return (flagcxResult_t)ncclCommRegister(comm->base, buff, size, handle); -// } - -// flagcxResult_t ixncclAdaptorCommDeregister(const flagcxHomoComm_t comm, void* handle) { -// return (flagcxResult_t)ncclCommDeregister(comm->base, handle); -// } - struct flagcxCCLAdaptor ixncclAdaptor = { "IXNCCL", // Basic functions @@ -230,12 +213,7 @@ struct flagcxCCLAdaptor ixncclAdaptor = { ixncclAdaptorRecv, // Group semantics ixncclAdaptorGroupStart, - ixncclAdaptorGroupEnd, - // Memory functions - NULL, - NULL, - NULL, - NULL + ixncclAdaptorGroupEnd }; #endif // USE_ILUVATAR_COREX_ADAPTOR diff --git a/flagcx/adaptor/nccl_adaptor.cc b/flagcx/adaptor/nccl_adaptor.cc index 1f98c89..72cf3b8 100644 --- a/flagcx/adaptor/nccl_adaptor.cc +++ b/flagcx/adaptor/nccl_adaptor.cc @@ -182,23 +182,6 @@ flagcxResult_t ncclAdaptorGroupEnd() { return (flagcxResult_t)ncclGroupEnd(); } -flagcxResult_t ncclAdaptorMemAlloc(void** ptr, size_t size) { - return (flagcxResult_t)ncclMemAlloc(ptr, size); -} - -flagcxResult_t ncclAdaptorMemFree(void *ptr) { - return (flagcxResult_t)ncclMemFree(ptr); -} - -flagcxResult_t ncclAdaptorCommRegister(const flagcxHomoComm_t comm, void* buff, - size_t size, void** handle) { - return (flagcxResult_t)ncclCommRegister(comm->base, buff, size, handle); -} - -flagcxResult_t ncclAdaptorCommDeregister(const flagcxHomoComm_t comm, void* handle) { - return (flagcxResult_t)ncclCommDeregister(comm->base, handle); -} - struct flagcxCCLAdaptor ncclAdaptor = { "NCCL", // Basic functions @@ -230,12 +213,7 @@ struct flagcxCCLAdaptor ncclAdaptor = { ncclAdaptorRecv, // Group semantics ncclAdaptorGroupStart, - ncclAdaptorGroupEnd, - // Memory functions - ncclAdaptorMemAlloc, - ncclAdaptorMemFree, - ncclAdaptorCommRegister, - ncclAdaptorCommDeregister + ncclAdaptorGroupEnd }; #endif // USE_NVIDIA_ADAPTOR diff --git a/flagcx/flagcx.cc b/flagcx/flagcx.cc index f848153..ec2ae59 100644 --- a/flagcx/flagcx.cc +++ b/flagcx/flagcx.cc @@ -424,47 +424,3 @@ flagcxResult_t flagcxGroupEnd() { } return flagcxHeteroGroupEnd(); } - -flagcxResult_t flagcxStreamCreate(flagcxStream_t *stream) { - return deviceAdaptor->streamCreate(stream); -} - -flagcxResult_t flagcxStreamSynchronize(flagcxStream_t stream) { - return deviceAdaptor->streamSynchronize(stream); -} - -flagcxResult_t flagcxStreamDestroy(flagcxStream_t stream) { - return deviceAdaptor->streamDestroy(stream); -} - -flagcxResult_t flagcxMemAlloc(void** ptr, size_t size) { - if (is_homo_comm()) { - return cclAdaptor->memAlloc(ptr, size); - } - // TODO: to be implemented. - return flagcxNotSupported; -} - -flagcxResult_t flagcxMemFree(void *ptr) { - if (is_homo_comm()) { - return cclAdaptor->memFree(ptr); - } - // TODO: to be implemented. - return flagcxNotSupported; -} - -flagcxResult_t flagcxCommRegister(const flagcxComm_t comm, void* buff, size_t size, void** handle) { - if (is_homo_comm()) { - return cclAdaptor->commRegister(comm->homo_comm, buff, size, handle); - } - // TODO: to be implemented. - return flagcxNotSupported; -} - -flagcxResult_t flagcxCommDeregister(const flagcxComm_t comm, void* handle) { - if (is_homo_comm()) { - return cclAdaptor->commDeregister(comm->homo_comm, handle); - } - // TODO: to be implemented. - return flagcxNotSupported; -} diff --git a/flagcx/include/flagcx.h b/flagcx/include/flagcx.h index 18affaf..c6cf280 100644 --- a/flagcx/include/flagcx.h +++ b/flagcx/include/flagcx.h @@ -101,13 +101,6 @@ flagcxResult_t flagcxHandleInit(flagcxHandlerGroup_t* handler); flagcxResult_t flagcxHandleFree(flagcxHandlerGroup_t handler); -/* Malloc and free function for all types of FLAGCX optimizations - * (e.g. user buffer registration). The actual allocated size might - * be larger than requested due to granularity requirement. */ -flagcxResult_t flagcxMemAlloc(void** ptr, size_t size); - -flagcxResult_t flagcxMemFree(void *ptr); - /* Return the version of the FlagCX library in the supplied integer. * It contains the underlying adaptor library version and FlagCX core version */ @@ -163,12 +156,6 @@ flagcxResult_t flagcxCommGetDeviceNumber(const flagcxComm_t comm, int* device); /* Returns the user-ordered "rank" associated with the communicator. */ flagcxResult_t flagcxCommUserRank(const flagcxComm_t comm, int* rank); -/* Register device-side buffer for zero-copy operation */ -flagcxResult_t flagcxCommRegister(const flagcxComm_t comm, void* buff, size_t size, void** handle); - -/* Deregister device-side buffer */ -flagcxResult_t flagcxCommDeregister(const flagcxComm_t comm, void* handle); - /* * Collective communication operations * @@ -354,25 +341,6 @@ flagcxResult_t flagcxGroupStart(); */ flagcxResult_t flagcxGroupEnd(); -/* - * Stream semantics - */ - -/* -* Stream Create -*/ -flagcxResult_t flagcxStreamCreate(flagcxStream_t *stream); - -/* -* Stream Synchronize -*/ -flagcxResult_t flagcxStreamSynchronize(flagcxStream_t stream); - -/* -* Stream Destroy -*/ -flagcxResult_t flagcxStreamDestroy(flagcxStream_t stream); - #ifdef __cplusplus } // end extern "C" #endif