feat: support ReduceScatter with OpenMPI backend implementation#12
Merged
Ziminli merged 3 commits intoMay 19, 2026
Merged
Conversation
ReduceScatter with OpenMPI backend implementationFeat/support reducescatterReduceScatter with OpenMPI backend implementation
Ziminli
requested changes
May 19, 2026
Modified file: - `include/comm.h` Added files: - `src/base/reduce_scatter.h` - `src/ompi/impl/reduce_scatter.h` - `examples/reduce_scatter.cc`
…reduce_scatter.h`
a1e30e7 to
af38416
Compare
Ziminli
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces an OpenMPI-based implementation of ReduceScatter, along with a complete example program for functionality verification and basic performance evaluation.
Changes
infiniReduceScatter(), including:src/base/reduce_scatter.h;src/ompi/impl/reduce_scatter.h;include/infiniccl.h.examples/reduce_scatter.ccsimilar toexamples/all_reduce.ccfor correctness verification and simple performance testing.Known Issues & Future Work
MPI_Reduce_scatter_block, which prevents overlap between communication and computation. Future work may introduce non-blocking collectives (MPI_Reduce_scatter_block) and stream-aware asynchronous execution to improve concurrency and performance.malloc/freeon every invocation. This may introduce noticeable overhead in high-frequency workloads. Future work may add reusable buffer pools, allocator caching, and pinned host memory support to improve transfer efficiency and reduce allocation overhead.1 << 20elements) may fail with mlx5 RC RDMA_READ errors due to UCX rendezvous RDMA_READ path limitations. This requires settingUCX_RNDV_SCHEME=put_zcopyto force a safe put-based transfer protocol. Without this setting, large-message AllGather execution is unstable on some NIC configurations.kAvg) is performed via a CPU-side loop after the MPI call. While functionally correct, this is not optimal for largerecv_count. Future work may move scaling into the MPI operation (where supported) or use a more efficient vectorized/device-side post-processing step.recv_countis cast tointfor MPI (with a safety check). Extremely large messages exceedingINT_MAXelements are rejected. This is acceptable for current use cases but may needMPI_Countsupport in future MPI-4+ integrations for very large tensors.Logs & Screenshots
all_reduce test (MetaX-NVIDIA heterogeneous)
all_reduce.log
all_gather test (MetaX-NVIDIA heterogeneous)
all_gather.log
reduce_scatter test (MetaX-NVIDIA heterogeneous)
reduce_scatter.log