From 29f4114f027fed903649a3c81babc5d52e8d41ae Mon Sep 17 00:00:00 2001 From: John Bachan Date: Wed, 18 Dec 2024 11:14:18 -0800 Subject: [PATCH 01/55] Fixes to all tests that divide buffers by nranks so that they trim buffer sizes to be multiples of 16 bytes. This ensures non-pow2 ranks have buffer addresses aligned suitably for performance. --- src/all_gather.cu | 8 +++----- src/all_reduce.cu | 4 ++-- src/alltoall.cu | 10 +++++----- src/broadcast.cu | 4 ++-- src/common.cu | 2 +- src/common.h | 2 +- src/gather.cu | 12 ++++++------ src/hypercube.cu | 6 +++--- src/reduce.cu | 4 ++-- src/reduce_scatter.cu | 8 +++----- src/scatter.cu | 12 ++++++------ src/sendrecv.cu | 4 ++-- 12 files changed, 36 insertions(+), 40 deletions(-) diff --git a/src/all_gather.cu b/src/all_gather.cu index 08312074..6db67e6d 100644 --- a/src/all_gather.cu +++ b/src/all_gather.cu @@ -7,10 +7,8 @@ #include "cuda_runtime.h" #include "common.h" -#define ALIGN 4 - -void AllGatherGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { - size_t base = (count/(ALIGN*nranks))*ALIGN; +void AllGatherGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { + size_t base = (count/nranks) & -(16/eltSize); *sendcount = base; *recvcount = base*nranks; *sendInplaceOffset = base; @@ -60,7 +58,7 @@ struct testColl allGatherTest = { void AllGatherGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - AllGatherGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + AllGatherGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t AllGatherRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/all_reduce.cu b/src/all_reduce.cu index a38eabe0..4aa1feea 100644 --- a/src/all_reduce.cu +++ b/src/all_reduce.cu @@ -7,7 +7,7 @@ #include "cuda_runtime.h" #include "common.h" -void AllReduceGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { +void AllReduceGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { *sendcount = count; *recvcount = count; *sendInplaceOffset = 0; @@ -55,7 +55,7 @@ struct testColl allReduceTest = { void AllReduceGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - AllReduceGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + AllReduceGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t AllReduceRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/alltoall.cu b/src/alltoall.cu index 41c7c4ae..dd085e54 100644 --- a/src/alltoall.cu +++ b/src/alltoall.cu @@ -7,12 +7,12 @@ #include "cuda_runtime.h" #include "common.h" -void AlltoAllGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { - *sendcount = (count/nranks)*nranks; - *recvcount = (count/nranks)*nranks; +void AlltoAllGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { + *paramcount = (count/nranks) & -(16/eltSize); + *sendcount = nranks*(*paramcount); + *recvcount = *sendcount; *sendInplaceOffset = 0; *recvInplaceOffset = 0; - *paramcount = count/nranks; } testResult_t AlltoAllInitData(struct threadArgs* args, ncclDataType_t type, ncclRedOp_t op, int root, int rep, int in_place) { @@ -74,7 +74,7 @@ struct testColl alltoAllTest = { void AlltoAllGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - AlltoAllGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + AlltoAllGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t AlltoAllRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/broadcast.cu b/src/broadcast.cu index 903066a2..67e9af2f 100644 --- a/src/broadcast.cu +++ b/src/broadcast.cu @@ -7,7 +7,7 @@ #include "cuda_runtime.h" #include "common.h" -void BroadcastGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { +void BroadcastGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { *sendcount = count; *recvcount = count; *sendInplaceOffset = 0; @@ -64,7 +64,7 @@ struct testColl broadcastTest = { void BroadcastGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - BroadcastGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + BroadcastGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t BroadcastRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/common.cu b/src/common.cu index e1f8a85f..6d103d79 100644 --- a/src/common.cu +++ b/src/common.cu @@ -571,7 +571,7 @@ void setupArgs(size_t size, ncclDataType_t type, struct threadArgs* args) { size_t count, sendCount, recvCount, paramCount, sendInplaceOffset, recvInplaceOffset; count = size / wordSize(type); - args->collTest->getCollByteCount(&sendCount, &recvCount, ¶mCount, &sendInplaceOffset, &recvInplaceOffset, (size_t)count, (size_t)nranks); + args->collTest->getCollByteCount(&sendCount, &recvCount, ¶mCount, &sendInplaceOffset, &recvInplaceOffset, (size_t)count, wordSize(type), (size_t)nranks); args->nbytes = paramCount * wordSize(type); args->sendBytes = sendCount * wordSize(type); diff --git a/src/common.h b/src/common.h index e6762e1c..478d7fb1 100644 --- a/src/common.h +++ b/src/common.h @@ -87,7 +87,7 @@ struct testColl { void (*getCollByteCount)( size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, - size_t count, int nranks); + size_t count, size_t eltSize, int nranks); testResult_t (*initData)(struct threadArgs* args, ncclDataType_t type, ncclRedOp_t op, int root, int rep, int in_place); void (*getBw)(size_t count, int typesize, double sec, double* algBw, double* busBw, int nranks); diff --git a/src/gather.cu b/src/gather.cu index 03ef4d9e..a4a7a30b 100644 --- a/src/gather.cu +++ b/src/gather.cu @@ -7,12 +7,12 @@ #include "cuda_runtime.h" #include "common.h" -void GatherGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { - *sendcount = count/nranks; - *recvcount = (count/nranks)*nranks; - *sendInplaceOffset = count/nranks; +void GatherGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { + *sendcount = (count/nranks) & -(16/eltSize); + *recvcount = (*sendcount)*nranks; + *sendInplaceOffset = *sendcount; *recvInplaceOffset = 0; - *paramcount = count/nranks; + *paramcount = *sendcount; } testResult_t GatherInitData(struct threadArgs* args, ncclDataType_t type, ncclRedOp_t op, int root, int rep, int in_place) { @@ -73,7 +73,7 @@ struct testColl gatherTest = { void GatherGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - GatherGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + GatherGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t GatherRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/hypercube.cu b/src/hypercube.cu index 5c1456f8..b3459c91 100644 --- a/src/hypercube.cu +++ b/src/hypercube.cu @@ -9,8 +9,8 @@ #define ALIGN 4 -void HyperCubeGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { - size_t base = (count/(ALIGN*nranks))*ALIGN; +void HyperCubeGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { + size_t base = (count/nranks) & -(16/eltSize); *sendcount = base; *recvcount = base*nranks; *sendInplaceOffset = base; @@ -78,7 +78,7 @@ struct testColl hyperCubeTest = { void HyperCubeGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - HyperCubeGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + HyperCubeGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t HyperCubeRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/reduce.cu b/src/reduce.cu index f2fa80dd..731abfa1 100644 --- a/src/reduce.cu +++ b/src/reduce.cu @@ -7,7 +7,7 @@ #include "cuda_runtime.h" #include "common.h" -void ReduceGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { +void ReduceGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { *sendcount = count; *recvcount = count; *sendInplaceOffset = 0; @@ -54,7 +54,7 @@ struct testColl reduceTest = { void ReduceGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - ReduceGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + ReduceGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t ReduceRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/reduce_scatter.cu b/src/reduce_scatter.cu index ed372e3b..35cfdd49 100644 --- a/src/reduce_scatter.cu +++ b/src/reduce_scatter.cu @@ -7,10 +7,8 @@ #include "cuda_runtime.h" #include "common.h" -#define ALIGN 4 - -void ReduceScatterGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { - size_t base = (count/(ALIGN*nranks))*ALIGN; +void ReduceScatterGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { + size_t base = (count/nranks) & -(16/eltSize); *sendcount = base*nranks; *recvcount = base; *sendInplaceOffset = 0; @@ -59,7 +57,7 @@ struct testColl reduceScatterTest = { void ReduceScatterGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - ReduceScatterGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + ReduceScatterGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t ReduceScatterRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/scatter.cu b/src/scatter.cu index 49d20e16..d1eec712 100644 --- a/src/scatter.cu +++ b/src/scatter.cu @@ -7,12 +7,12 @@ #include "cuda_runtime.h" #include "common.h" -void ScatterGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { - *sendcount = (count/nranks)*nranks; - *recvcount = count/nranks; +void ScatterGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { + *recvcount = (count/nranks) & -(16/eltSize); + *sendcount = (*recvcount)*nranks; *sendInplaceOffset = 0; - *recvInplaceOffset = count/nranks; - *paramcount = count/nranks; + *recvInplaceOffset = *recvcount; + *paramcount = *recvcount; } testResult_t ScatterInitData(struct threadArgs* args, ncclDataType_t type, ncclRedOp_t op, int root, int rep, int in_place) { @@ -69,7 +69,7 @@ struct testColl scatterTest = { void ScatterGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - ScatterGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + ScatterGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t ScatterRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { diff --git a/src/sendrecv.cu b/src/sendrecv.cu index c9eb5bb4..67a4898b 100644 --- a/src/sendrecv.cu +++ b/src/sendrecv.cu @@ -7,7 +7,7 @@ #include "cuda_runtime.h" #include "common.h" -void SendRecvGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, int nranks) { +void SendRecvGetCollByteCount(size_t *sendcount, size_t *recvcount, size_t *paramcount, size_t *sendInplaceOffset, size_t *recvInplaceOffset, size_t count, size_t eltSize, int nranks) { *sendcount = count; *recvcount = count; *sendInplaceOffset = 0; @@ -68,7 +68,7 @@ struct testColl sendRecvTest = { void SendRecvGetBuffSize(size_t *sendcount, size_t *recvcount, size_t count, int nranks) { size_t paramcount, sendInplaceOffset, recvInplaceOffset; - SendRecvGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, nranks); + SendRecvGetCollByteCount(sendcount, recvcount, ¶mcount, &sendInplaceOffset, &recvInplaceOffset, count, /*eltSize=*/1, nranks); } testResult_t SendRecvRunTest(struct threadArgs* args, int root, ncclDataType_t type, const char* typeName, ncclRedOp_t op, const char* opName) { From cb6a46fdd677783eec470e3df09aa138891bfebf Mon Sep 17 00:00:00 2001 From: David Addison Date: Thu, 23 Jan 2025 12:57:51 -0800 Subject: [PATCH 02/55] Update CUDA gencodes Add support for Blackwell sm100 and sm120 from CUDA 12.8 Add support for Hopper sm90 from CUDA 12.0 --- src/Makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 393de8e4..5737092a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,15 +16,30 @@ CUDARTLIB ?= cudart CUDA_VERSION = $(strip $(shell which $(NVCC) >/dev/null && $(NVCC) --version | grep release | sed 's/.*release //' | sed 's/\,.*//')) CUDA_MAJOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 1) +CUDA_MINOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 2) # Better define NVCC_GENCODE in your environment to the minimal set # of archs to reduce compile time. -ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 11; echo $$?),0) +ifeq ($(shell test "0$(CUDA_MAJOR)" -eq 12 -a "0$(CUDA_MINOR)" -ge 8 -o "0$(CUDA_MAJOR)" -ge 13; echo $$?),0) +# Include Blackwell support if we're using CUDA12.8 or above +NVCC_GENCODE ?= -gencode=arch=compute_80,code=sm_80 \ + -gencode=arch=compute_90,code=sm_90 \ + -gencode=arch=compute_100,code=sm_100 \ + -gencode=arch=compute_120,code=sm_120 \ + -gencode=arch=compute_120,code=compute_120 +else ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 12; echo $$?),0) NVCC_GENCODE ?= -gencode=arch=compute_60,code=sm_60 \ -gencode=arch=compute_61,code=sm_61 \ -gencode=arch=compute_70,code=sm_70 \ - -gencode=arch=compute_80,code=sm_80 \ - -gencode=arch=compute_80,code=compute_80 + -gencode=arch=compute_80,code=sm_80 \ + -gencode=arch=compute_90,code=sm_90 \ + -gencode=arch=compute_90,code=compute_90 +else ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 11; echo $$?),0) +NVCC_GENCODE ?= -gencode=arch=compute_60,code=sm_60 \ + -gencode=arch=compute_61,code=sm_61 \ + -gencode=arch=compute_70,code=sm_70 \ + -gencode=arch=compute_80,code=sm_80 \ + -gencode=arch=compute_80,code=compute_80 else NVCC_GENCODE ?= -gencode=arch=compute_35,code=sm_35 \ -gencode=arch=compute_50,code=sm_50 \ From a89cf07fe879e1c0187a4f617f873ae47d69af6b Mon Sep 17 00:00:00 2001 From: Junyu Ma Date: Thu, 23 Jan 2025 11:09:09 -0800 Subject: [PATCH 03/55] Perftests: Introduce NCCL_TESTS_SPLIT env `NCCL_TESTS_SPLIT` serves as new way of computing the color for splitting communicators. Will be overrided by `NCCL_TESTS_SPLIT_MASK`. Examples: NCCL_TESTS_SPLIT_MASK="0x7" # color = rank & 0x7. What we do today to run on a DGX with one GPU per node. NCCL_TESTS_SPLIT="AND 0x7" # color = rank & 0x7. New way to run on one GPU per node on a DGX, equivalent to NCCL_TESTS_SPLIT_MASK=0x7 NCCL_TESTS_SPLIT="MOD 72" # color = rank % 72. One GPU per NVLink domain on an NVL72 system. NCCL_TESTS_SPLIT="DIV 72" # color = rank / 72. Intra NVLink domain on NVL72. You can also use: "%" "&" "|" "/" for short. Extra spaces in the middle will be automatically ignored. Not case sensitive. The followings are all equivalent: NCCL_TESTS_SPLIT="%0x7" NCCL_TESTS_SPLIT="%0b111" NCCL_TESTS_SPLIT="AND 7" NCCL_TESTS_SPLIT="and 0x7" --- src/common.cu | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/common.cu b/src/common.cu index 6d103d79..9277ea2b 100644 --- a/src/common.cu +++ b/src/common.cu @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include "cuda.h" #include "../verifiable/verifiable.h" @@ -892,6 +894,26 @@ int main(int argc, char* argv[]) { return 0; } +#ifdef MPI_SUPPORT +// parse int for base 2/10/16, will ignore first whitespaces +static bool parseInt(char *s, int *num) { + char *p = NULL; + if (!s || !num) + return false; + while (*s && isspace(*s)) ++s; + if (!*s) return false; + + if (strncasecmp(s, "0b", 2) == 0) + *num = (int)strtoul(s + 2, &p, 2); + else + *num = (int)strtoul(s, &p, 0); + + if (p == s) + return false; + return true; +} +#endif + testResult_t run() { int totalProcs = 1, proc = 0, ncclProcs = 1, ncclProc = 0, color = 0; int localRank = 0; @@ -909,10 +931,33 @@ testResult_t run() { if (hostHashs[p] == hostHashs[proc]) localRank++; } - char* str = getenv("NCCL_TESTS_SPLIT_MASK"); - uint64_t mask = str ? strtoul(str, NULL, 16) : 0; + char *splitMaskEnv = NULL; + if (splitMaskEnv = getenv("NCCL_TESTS_SPLIT_MASK")) { + color = proc & strtoul(splitMaskEnv, NULL, 16); + } else if (splitMaskEnv = getenv("NCCL_TESTS_SPLIT")) { + if ( + (strncasecmp(splitMaskEnv, "AND", strlen("AND")) == 0 && parseInt(splitMaskEnv + strlen("AND"), &color)) || + (strncasecmp(splitMaskEnv, "&", strlen("&")) == 0 && parseInt(splitMaskEnv + strlen("&"), &color)) + ) + color = proc & color; + if ( + (strncasecmp(splitMaskEnv, "OR", strlen("OR")) == 0 && parseInt(splitMaskEnv + strlen("OR"), &color)) || + (strncasecmp(splitMaskEnv, "|", strlen("|")) == 0 && parseInt(splitMaskEnv + strlen("|"), &color)) + ) + color = proc | color; + if ( + (strncasecmp(splitMaskEnv, "MOD", strlen("MOD")) == 0 && parseInt(splitMaskEnv + strlen("MOD"), &color)) || + (strncasecmp(splitMaskEnv, "%", strlen("%")) == 0 && parseInt(splitMaskEnv + strlen("%"), &color)) + ) + color = proc % color; + if ( + (strncasecmp(splitMaskEnv, "DIV", strlen("DIV")) == 0 && parseInt(splitMaskEnv + strlen("DIV"), &color)) || + (strncasecmp(splitMaskEnv, "/", strlen("/")) == 0 && parseInt(splitMaskEnv + strlen("/"), &color)) + ) + color = proc / color; + } + MPI_Comm mpi_comm; - color = proc & mask; MPI_Comm_split(MPI_COMM_WORLD, color, proc, &mpi_comm); MPI_Comm_size(mpi_comm, &ncclProcs); MPI_Comm_rank(mpi_comm, &ncclProc); From 903918fc545fff518adf5411a8d5b3c99f5aceab Mon Sep 17 00:00:00 2001 From: Sylvain Jeaugey Date: Thu, 6 Feb 2025 14:10:07 +0100 Subject: [PATCH 04/55] Add NCCL_TESTS_SPLIT documentation in the README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 44e406a6..957f6afb 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,23 @@ All tests support the same set of arguments : * `-R,--local_register <1/0>` enable local buffer registration on send/recv buffers. Default : 0. * `-T,--timeout