Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase parallelism in allgatherv #525

Merged
merged 3 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions cpp/include/raft/comms/detail/mpi_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,11 @@ class mpi_comms : public comms_iface {
datatype_t datatype,
cudaStream_t stream) const
{
RAFT_EXPECTS(size_ <= 2048,
"# NCCL operations between ncclGroupStart & ncclGroupEnd shouldn't exceed 2048.");
// From: "An Empirical Evaluation of Allgatherv on Multi-GPU Systems" -
// https://arxiv.org/pdf/1812.05964.pdf Listing 1 on page 4.
RAFT_NCCL_TRY(ncclGroupStart());
for (int root = 0; root < size_; ++root) {
RAFT_NCCL_TRY(
ncclBroadcast(sendbuf,
Expand All @@ -287,6 +290,7 @@ class mpi_comms : public comms_iface {
nccl_comm_,
stream));
}
RAFT_NCCL_TRY(ncclGroupEnd());
}

void gather(const void* sendbuff,
Expand Down
4 changes: 4 additions & 0 deletions cpp/include/raft/comms/detail/std_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ class std_comms : public comms_iface {
{
// From: "An Empirical Evaluation of Allgatherv on Multi-GPU Systems" -
// https://arxiv.org/pdf/1812.05964.pdf Listing 1 on page 4.
RAFT_EXPECTS(size_ <= 2048,
"# NCCL operations between ncclGroupStart & ncclGroupEnd shouldn't exceed 2048.");
RAFT_NCCL_TRY(ncclGroupStart());
for (int root = 0; root < num_ranks_; ++root) {
size_t dtype_size = get_datatype_size(datatype);
RAFT_NCCL_TRY(ncclBroadcast(sendbuf,
Expand All @@ -377,6 +380,7 @@ class std_comms : public comms_iface {
nccl_comm_,
stream));
}
RAFT_NCCL_TRY(ncclGroupEnd());
}

void gather(const void* sendbuff,
Expand Down