feat(mpi): add non-blocking reduce (mpi:ireduce)#198
Conversation
91e723f to
3ecb363
Compare
b939894 to
04ba07a
Compare
|
I am adding a unit test on this because it fails on MPI + CUDA for a reason I don't understand yet. |
|
Honestly, I am completely lost on why this fails on OMPI + CUDA... I reworked the MPI packing logic to use If someone has an idea about what is wrong with the test/the |
|
@dssgabriel can you comment this issue and tell us what is needed to merge this PR. |
|
Okay, so the issue is that Open MPI does not implement non-blocking reduction operations with CUDA buffers.
Some work was done (started by @devreal 🙂), but it does not seem to have been picked up by anyone on the Open MPI team?
Do we want to voice our needs and open an issue on the Open MPI repo too? |
|
I will mark this function as unimplemented if running the Open MPI impl. |
|
The failing jobs are expected since we error out on Open MPI. Do we merge like this @cedricchevalier19 @cwpearson ? |
|
Can you add something to skip these tests with OpenMPI? I'll prefer if the CI to always pass on the main branch. |
4d878cc to
e718bdc
Compare
|
It looks like the issue on the compile-only job is due to improper @cedricchevalier19 Do you want to merge like this, or should we attempt fixing this first? |
|
I'll prefer not to merge something with broken tests. |
24ac107 to
9c9bf5a
Compare
1f40de3 to
30d2133
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds support for non-blocking reduce operations (mpi::ireduce) to KokkosComm, preparing the functionality for exposure in the core API. The changes are based on two previous PRs: #187 (reduction operator conversion) and #188 (CommunicationSpace refactoring).
Changes:
- Added new non-blocking reduce function
KokkosComm::mpi::ireducewith support for both contiguous and non-contiguous views - Refactored MPI packer implementation to use a common contiguous view utility and moved from
KokkosComm::ImpltoKokkosComm::mpi::Implnamespace - Updated header organization to support both MPI and NCCL communication spaces simultaneously (changed from
#elifto separate#ifblocks)
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| unit_tests/mpi/test_ireduce.cpp | New test file for non-blocking reduce with contiguous 1D views |
| unit_tests/CMakeLists.txt | Adds test configuration for the new ireduce test |
| src/KokkosComm/mpi/reduce.hpp | Implements new ireduce function and updates existing reduce functions with namespace changes |
| src/KokkosComm/mpi/impl/packer.hpp | Refactors packer to use common contiguous view utilities and updates namespace |
| src/KokkosComm/mpi/impl/pack_traits.hpp | Updates namespace from KokkosComm::Impl to KokkosComm::mpi::Impl |
| src/KokkosComm/mpi/send.hpp | Updates PackTraits namespace references and adds label parameter to pack calls |
| src/KokkosComm/mpi/recv.hpp | Updates PackTraits namespace references |
| src/KokkosComm/mpi/isend.hpp | Updates PackTraits namespace references and adds label parameter to pack calls |
| src/KokkosComm/mpi/irecv.hpp | Updates PackTraits namespace references |
| src/KokkosComm/mpi/allreduce.hpp | Adds static_assert for unsupported Open MPI + CUDA/HIP configuration and formatting updates |
| src/KokkosComm/collective.hpp | Updates includes to add allreduce.hpp and reduce.hpp, removes redundant infrastructure includes |
| src/KokkosComm/point_to_point.hpp | Adds MPI isend/irecv includes and removes redundant NCCL infrastructure includes |
| src/KokkosComm/KokkosComm.hpp | Changes from mutually exclusive #elif to separate #if blocks to allow both MPI and NCCL simultaneously, adds NCCL collective includes |
| unit_tests/test_sendrecv.cpp | Refactors to use ExecSpace alias and explicit Handle construction |
| unit_tests/test_allreduce.cpp | Adds GTEST_SKIP guards for Open MPI + CUDA/HIP, formatting updates |
| unit_tests/test_allgather.cpp | Updates communication space names from Mpi/Nccl to MpiSpace/NcclSpace |
| unit_tests/mpi/test_reduce.cpp | Adds include for mpi.h and Kokkos_Core.hpp |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Needed to propagate changes to isend/irecv which were using our first attempt at doing non-contiguous view packing. Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
`static_assert(false)` always triggers a compilation failure, even in templated functions that are never instantiated, until [CWG2518/P2593](https://cplusplus.github.io/CWG/issues/2518.html). This is a workaround that allows us to have a type-dependent `false` value that can only be evaluated at template instantiation-time, thus avoiding spurious static assertions failures in functions that are never called. This workaround is only temporarily needed for disabling reduce/all-reduce support for Open MPI+CUDA/HIP combinations, which don't work, and will be removed once host staging is implemented for the MPI backend. Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
With non-contiguous data support. Disabled when MPI impl is Open MPI & Kokkos CUDA/HIP backend are active. Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Skip when Open MPI + CUDA/HIP Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
aae9fcc to
5949734
Compare
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
ae8a0b1 to
dea249e
Compare
Only disable `ireduce` and `iallreduce` when the Views are in CUDA or HIP execution spaces. Used `V::execution_space` instead of `V::memory_space` because there are multiple flavors of those, which MPI impls don't distinguish as far as support goes (it also makes for a big ugly boolean expression).
dea249e to
21e2227
Compare
|
@cedricchevalier19 This is (finally!) ready for review and merging. |
cedricchevalier19
left a comment
There was a problem hiding this comment.
Add context for #ifdef
Co-authored-by: Cédric Chevalier <cedric.chevalier019@proton.me>
Co-authored-by: Cédric Chevalier <cedric.chevalier019@proton.me>
cedricchevalier19
left a comment
There was a problem hiding this comment.
Thanks a lot @dssgabriel!
Prepare for exposure in "core" API.
Based on #187 and #188.