diff --git a/projects/rccl/src/collectives/device/all_gather.h b/projects/rccl/src/collectives/device/all_gather.h index 59ee7b0eed..7a1e3e1da7 100644 --- a/projects/rccl/src/collectives/device/all_gather.h +++ b/projects/rccl/src/collectives/device/all_gather.h @@ -11,7 +11,7 @@ namespace { template - __device__ __forceinline__ void runRing(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runRing(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -79,7 +79,7 @@ namespace { template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { using Proto = ProtoSimple; runRing(args); } @@ -87,14 +87,14 @@ struct RunWorkElement struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; diff --git a/projects/rccl/src/collectives/device/all_reduce.h b/projects/rccl/src/collectives/device/all_reduce.h index 4ec8d3620a..6398388ed9 100644 --- a/projects/rccl/src/collectives/device/all_reduce.h +++ b/projects/rccl/src/collectives/device/all_reduce.h @@ -12,7 +12,7 @@ namespace { template - __device__ __forceinline__ void runRing(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runRing(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -115,7 +115,7 @@ namespace { } template - __device__ __forceinline__ void runTreeUpDown(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runTreeUpDown(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -187,7 +187,7 @@ namespace { } template - __device__ __forceinline__ void runTreeSplit(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runTreeSplit(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -276,7 +276,7 @@ namespace { template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { using Proto = ProtoSimple; runRing(args); } @@ -284,14 +284,14 @@ struct RunWorkElement struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runTreeUpDown>(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { static constexpr int COLLNET_COPY_THREADS = 64; const int tid = threadIdx.x; const int bid = args->coll.bid; @@ -389,28 +389,28 @@ struct RunWorkElement struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runTreeUpDown(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { LAUNCH_CLIQUE_KERNEL(AllReduceCliqueSplitKernel, RedOp, T, args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { LAUNCH_CLIQUE_KERNEL(AllReduceCliqueSplitKernel, RedOp, T, args); } }; diff --git a/projects/rccl/src/collectives/device/broadcast.h b/projects/rccl/src/collectives/device/broadcast.h index 31a9d2a503..be01d90836 100644 --- a/projects/rccl/src/collectives/device/broadcast.h +++ b/projects/rccl/src/collectives/device/broadcast.h @@ -10,7 +10,7 @@ namespace { template - __device__ __forceinline__ void runRing(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runRing(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -77,7 +77,7 @@ namespace { template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { using Proto = ProtoSimple; runRing(args); } @@ -85,14 +85,14 @@ struct RunWorkElement struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; diff --git a/projects/rccl/src/collectives/device/onerank_reduce.cu b/projects/rccl/src/collectives/device/onerank_reduce.cu index 89ef528484..54fd993ea3 100644 --- a/projects/rccl/src/collectives/device/onerank_reduce.cu +++ b/projects/rccl/src/collectives/device/onerank_reduce.cu @@ -12,7 +12,7 @@ namespace { template - __device__ __forceinline__ void oneRankReduce() { + __device__ __attribute__((noinline)) void oneRankReduce() { ncclWork *w = &ncclShmem->work; int tid = threadIdx.x; int tn = blockDim.x; diff --git a/projects/rccl/src/collectives/device/prims_ll.h b/projects/rccl/src/collectives/device/prims_ll.h index 8b8c5b86aa..8b3f84ac66 100644 --- a/projects/rccl/src/collectives/device/prims_ll.h +++ b/projects/rccl/src/collectives/device/prims_ll.h @@ -22,8 +22,6 @@ class Primitives: struct ncclConnInfo* recvConn = NULL; volatile uint64_t* recvConnHeadPtr = NULL; uint64_t recvConnHead; - uint64_t* barriers; - uint64_t* barrier_next; struct ncclConnInfo* sendConn = NULL; volatile int* sendConnFifoPtr = NULL; @@ -284,7 +282,7 @@ class Primitives: } template - __device__ __forceinline__ void LLGenericOp(intptr_t srcIx, intptr_t dstIx, int nelem, bool postOp) { + __device__ void LLGenericOp(intptr_t srcIx, intptr_t dstIx, int nelem, bool postOp) { constexpr int SRC = SrcBuf != -1 ? 1 : 0; constexpr int DST = DstBuf != -1 ? 1 : 0; T *srcElts = SrcBuf == -1 ? nullptr : userBufs[SrcBuf] + srcIx; @@ -389,12 +387,11 @@ class Primitives: public: __device__ Primitives( const int tid, const int nthreads, int const *recvPeers, int const *sendPeers, - void const *inputBuf, void *outputBuf, uint64_t redOpArg, int group=0, int connIndex=0 + void const *inputBuf, void *outputBuf, uint64_t redOpArg, int group=0 ): redOp(redOpArg), - tid(tid), nthreads(nthreads), wid(tid%WARP_SIZE), group(group), - stepLines(ncclShmem->comm.buffSizes[NCCL_PROTO_LL]/NCCL_STEPS/sizeof(ncclLLFifoLine)), - barriers(&ncclShmem->groups[group].barrier), barrier_next(ncclShmem->groups[group].barrier_next) { + tid(tid), nthreads(nthreads), wid(tid%WARP_SIZE), group(group&(uint16_t)0xFFFF), + stepLines(ncclShmem->comm.buffSizes[NCCL_PROTO_LL]/NCCL_STEPS/sizeof(ncclLLFifoLine)) { auto *channel = &ncclShmem->channel; // If we are going to support oneshot collNet + LL, then we would need to add connector index here diff --git a/projects/rccl/src/collectives/device/reduce.h b/projects/rccl/src/collectives/device/reduce.h index db8c235f2b..0bf2a98f2a 100644 --- a/projects/rccl/src/collectives/device/reduce.h +++ b/projects/rccl/src/collectives/device/reduce.h @@ -11,7 +11,7 @@ namespace { template - __device__ __forceinline__ void runRing(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runRing(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -71,7 +71,7 @@ namespace { template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { using Proto = ProtoSimple; runRing(args); } @@ -79,14 +79,14 @@ struct RunWorkElement struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; diff --git a/projects/rccl/src/collectives/device/reduce_scatter.h b/projects/rccl/src/collectives/device/reduce_scatter.h index a4d773c612..a5ee6aefa5 100644 --- a/projects/rccl/src/collectives/device/reduce_scatter.h +++ b/projects/rccl/src/collectives/device/reduce_scatter.h @@ -11,7 +11,7 @@ namespace { template - __device__ __forceinline__ void runRing(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void runRing(ncclWorkElem *args) { const int tid = threadIdx.x; const int nthreads = args->nThreads; const int bid = args->coll.bid; @@ -69,7 +69,7 @@ namespace { template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { using Proto = ProtoSimple; runRing(args); } @@ -77,14 +77,14 @@ struct RunWorkElement struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; template struct RunWorkElement { - __device__ __forceinline__ void run(ncclWorkElem *args) { + __device__ __attribute__((noinline)) void run(ncclWorkElem *args) { runRing(args); } }; diff --git a/projects/rccl/src/collectives/device/sendrecv.h b/projects/rccl/src/collectives/device/sendrecv.h index caad7950c1..698bccde53 100644 --- a/projects/rccl/src/collectives/device/sendrecv.h +++ b/projects/rccl/src/collectives/device/sendrecv.h @@ -11,7 +11,7 @@ template struct RunWork { - __device__ __forceinline__ void run(ncclWork *work) { + __device__ __attribute__((noinline)) void run(ncclWork *work) { int tid = threadIdx.x; int group = 0; const int rank = ncclShmem->comm.rank; diff --git a/projects/rccl/src/include/collectives.h b/projects/rccl/src/include/collectives.h index b65e81b3ea..10be4501a6 100644 --- a/projects/rccl/src/include/collectives.h +++ b/projects/rccl/src/include/collectives.h @@ -114,10 +114,10 @@ extern __device__ void NCCL_ONERANK_REDUCE_NAME(PreMulSum, double)(struct ncclWo //#define ALLGATHER_CHUNKSTEPS (NCCL_STEPS/2) //#define REDUCESCATTER_SLICESTEPS (NCCL_STEPS/4) //#define REDUCESCATTER_CHUNKSTEPS (NCCL_STEPS/2) -#define ALLREDUCE_SLICESTEPS 1 -#define ALLREDUCE_CHUNKSTEPS 1 -#define ALLGATHER_SLICESTEPS 1 -#define ALLGATHER_CHUNKSTEPS 1 +#define ALLREDUCE_SLICESTEPS 2 +#define ALLREDUCE_CHUNKSTEPS 4 +#define ALLGATHER_SLICESTEPS 4 +#define ALLGATHER_CHUNKSTEPS 4 #define REDUCESCATTER_SLICESTEPS 2 #define REDUCESCATTER_CHUNKSTEPS 4 #define BROADCAST_SLICESTEPS 1