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

Feature: Add basic NCCL communication space backend #128

Draft
wants to merge 37 commits into
base: develop
Choose a base branch
from

Conversation

dssgabriel
Copy link
Collaborator

This is still very much WIP and cannot build at the moment. I am simply opening the PR so that folks meeting at SC24 can exchange on it. 👍

@dssgabriel dssgabriel self-assigned this Nov 14, 2024
@dssgabriel dssgabriel marked this pull request as draft November 14, 2024 18:46
@dssgabriel dssgabriel added the enhancement New feature or request label Nov 15, 2024
CMake module for finding NCCL was taken from pytorch repo. Need to look
into licensing rules.
This change allows users to avoid having to use backend-specific
reduction types when calling KokkosComm functions.
NCCL can now be enabled without explicitly requiring enabling MPI.

However, need to check that MPI is still an available dependency as it
is the fallback communication backend!
Copy link
Member

@cedricchevalier19 cedricchevalier19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts.

#if defined(KOKKOSCOMM_ENABLE_MPI)
class Mpi;
using DefaultCommunicationSpace = Mpi;
using FallbackCommunicationSpace = Mpi;
#elif defined(KOKKOSCOMM_ENABLE_NCCL)
class Mpi;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should depend on MPI in this case.

return true;
}
}
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you block one request if none of the input is ready?

KokkosExecutionSpace ExecSpace = Kokkos::DefaultExecutionSpace,
CommunicationSpace CommSpace = DefaultCommunicationSpace>
auto reduce(Handle<ExecSpace, CommSpace>& h, const SendView& sv, RecvView& rv, int root) -> Req<CommSpace> {
return Impl::Reduce<SendView, RecvView, RedOp, ExecSpace, CommSpace>(h, sv, rv, root);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not exactly understand how it will work. Don't we need to call it execute()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I fixed this in 9c185af (#128).

space.cuda_stream());
RecvPacker::unpack_into(space, rv, recv_args.view);
} else {
space.fence(); // is this fence necessary?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this fence.

space.cuda_stream());
RecvPacker::unpack_into(space, rv, recv_args.view);
} else {
space.fence(); // is this fence necessary?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed in my opinion.

namespace KokkosComm::Experimental::nccl::Impl::Packer {

template <KokkosView View>
struct NcclArgs {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PackedViewNccl or something like that will be a better name. Looking at the following code, I thought NCClArgs was an NCCL thing.

dssgabriel and others added 8 commits December 16, 2024 18:15
This changes matches the high-level API for point-to-point
communications.
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
@cwpearson
Copy link
Collaborator

I think it builds now. My workstation has GPU-aware MPI problems, so I need to fix those before continuing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants