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
1 change: 1 addition & 0 deletions doc/PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ And :
To obtain a bus bandwidth which should be independent of the number of ranks _n_, we apply a correction factor to the algorithm bandwidth :

* AllReduce : 2*(_n_-1)/_n_
* AllReduce (In-Network Reduction): (n-1)/(n+1)
* ReduceScatter : (_n_-1)/_n_
* AllGather : (_n_-1)/_n_
* Broadcast : 1
Expand Down
11 changes: 10 additions & 1 deletion src/all_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@ void AllReduceGetBw(size_t count, int typesize, double sec, double* algBw, doubl
double baseBw = (double)(count * typesize) / 1.0E9 / sec;

*algBw = baseBw;
double factor = ((double)(2*(nranks - 1)))/((double)nranks);

const char* nccl_algo = getenv("NCCL_ALGO");

double factor;
if (nccl_algo != nullptr && (strcmp(nccl_algo, "NVLS") == 0 || strcmp(nccl_algo, "NVLSTREE") == 0)) {
factor = ((double)(nranks - 1)) / ((double)(nranks + 1));
} else {
factor = ((double)(2 * (nranks - 1))) / ((double)nranks);
}

*busBw = baseBw * factor;
}

Expand Down