Skip to content

Multi-GPU communication using NCCL#39

Merged
wavefunction91 merged 4 commits into
wavefunction91:masterfrom
dmclark17:clark/nccl
Mar 25, 2021
Merged

Multi-GPU communication using NCCL#39
wavefunction91 merged 4 commits into
wavefunction91:masterfrom
dmclark17:clark/nccl

Conversation

@dmclark17

Copy link
Copy Markdown
Contributor

This change adds support for NCCL (https://developer.nvidia.com/nccl) to do device-side multi-gpu communication, specifically the all-reduce. To make the feature optional, I tried to replicate the scheme used for MAGMA. It seems to work on my end, but please feel free to make suggestions/refactor it as you see fit.

I also moved the symmetrize matrix portion of the code to the device and separated the device-to-host transfer of VXC, EXC and NEL into its own function.

@wavefunction91 wavefunction91 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks great overall - I'll build on Summit to get some more concrete numbers for how this works at scale

MPI_Comm_rank( this->comm_, &world_rank );
MPI_Comm_size( this->comm_, &world_size );

#ifdef GAUXC_ENABLE_NCCL

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks like we might want to add a lifetime manager for ncclComm_t ala how we did cuda_stream, etc. We generally want to steer clear of explicit setup/teardown in the user space code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good; I will also plan on adding a nccl_util.hpp file with similar functionality as magma_util.hpp. Do you think it makes more sense to store the ncclComm_t object in XCCudaData with the CUDA stream and magma queue, or in the DefaultXCCudaIntegrator since the MPI comm object seems to be at that level?

@wavefunction91 wavefunction91 merged commit 4dffdf0 into wavefunction91:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants