2018-09-24 16:06:59 -07:00
|
|
|
/*************************************************************************
|
2022-01-07 06:39:55 -08:00
|
|
|
* Copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved.
|
2018-09-24 16:06:59 -07:00
|
|
|
*
|
|
|
|
|
* See LICENSE.txt for license information
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef NCCL_ENQUEUE_H_
|
|
|
|
|
#define NCCL_ENQUEUE_H_
|
|
|
|
|
|
2019-11-19 14:57:39 -08:00
|
|
|
#include "comm.h"
|
2018-09-24 16:06:59 -07:00
|
|
|
#include "group.h"
|
2019-11-19 14:57:39 -08:00
|
|
|
#include "collectives.h"
|
2022-05-24 02:02:31 -07:00
|
|
|
#include "utils.h"
|
2019-03-14 19:39:20 -07:00
|
|
|
|
2024-02-05 05:06:02 -08:00
|
|
|
#define NCCL_LL_ALIGNMENT_PER_THREAD sizeof(uint64_t)
|
|
|
|
|
#define NCCL_LL128_ALIGNMENT_PER_WARP 480
|
|
|
|
|
#define NCCL_SIMPLE_ALIGNMENT (WARP_SIZE * 8LL * 16LL)
|
|
|
|
|
#define NCCL_BYTES_ALIGNMENT 16
|
2021-07-08 14:12:04 -07:00
|
|
|
|
2023-02-27 02:48:21 -08:00
|
|
|
ncclResult_t ncclInitKernelsForDevice(int cudaArch, size_t* maxStackSize);
|
2018-12-13 15:56:12 -08:00
|
|
|
ncclResult_t ncclEnqueueCheck(struct ncclInfo* info);
|
2022-05-24 02:02:31 -07:00
|
|
|
ncclResult_t ncclLaunchPrepare(struct ncclComm* comm);
|
|
|
|
|
ncclResult_t ncclLaunchKernelBefore_NoUncapturedCuda(struct ncclComm* comm, struct ncclKernelPlan* plan);
|
|
|
|
|
ncclResult_t ncclLaunchKernel(struct ncclComm* comm, struct ncclKernelPlan* plan);
|
|
|
|
|
ncclResult_t ncclLaunchKernelAfter_NoCuda(struct ncclComm* comm, struct ncclKernelPlan* plan);
|
|
|
|
|
ncclResult_t ncclLaunchFinish(struct ncclComm* comm);
|
2024-06-11 01:28:01 -07:00
|
|
|
ncclResult_t ncclPrepareTasks(struct ncclComm* comm, bool* algoNeedConnect, bool* needConnect, ncclSimInfo_t* simInfo);
|
2024-12-18 08:26:06 -08:00
|
|
|
ncclResult_t ncclTasksRegAndEnqueue(struct ncclComm* comm);
|
|
|
|
|
|
|
|
|
|
static inline size_t ncclFuncSendCount(ncclFunc_t func, int nRanks, size_t count) {
|
|
|
|
|
return func == ncclFuncReduceScatter ? nRanks*count : count;
|
|
|
|
|
}
|
|
|
|
|
static inline size_t ncclFuncRecvCount(ncclFunc_t func, int nRanks, size_t count) {
|
|
|
|
|
return func == ncclFuncAllGather ? nRanks*count : count;
|
|
|
|
|
}
|
2025-04-23 20:46:36 -07:00
|
|
|
rccl_static_inline size_t ncclFuncMaxSendRecvCount(ncclFunc_t func, int nRanks, size_t count) {
|
2024-12-18 08:26:06 -08:00
|
|
|
return func == ncclFuncAllGather || func == ncclFuncReduceScatter ? nRanks*count : count;
|
|
|
|
|
}
|
2018-09-24 16:06:59 -07:00
|
|
|
|
|
|
|
|
#endif // End include guard
|