feat: support send and receive with OpenMPI backend implementation#13
feat: support send and receive with OpenMPI backend implementation#13GordonYang1 wants to merge 2 commits into
send and receive with OpenMPI backend implementation#13Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92412fdd4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Runtime<kDev>::Memcpy(host_buf, send_buff, total_bytes, | ||
| Runtime<kDev>::MemcpyDeviceToHost); | ||
| Runtime<kDev>::StreamSynchronize( | ||
| static_cast<Runtime<kDev>::Stream>(stream)); |
There was a problem hiding this comment.
Propagate failed device-to-host sends
When the send buffer is an invalid/stale device pointer or the selected runtime reports a stream error, this path still continues to MPI_Send and returns success because both Runtime<kDev>::Memcpy and StreamSynchronize results are ignored. That can send uninitialized staging data and hide the actual failure; these runtime calls should be checked and returned, as the existing collective implementations do with CHECK_STATUS.
Useful? React with 👍 / 👎.
| Runtime<kDev>::Memcpy(recv_buff, host_buf, total_bytes, | ||
| Runtime<kDev>::MemcpyHostToDevice); |
There was a problem hiding this comment.
Propagate failed host-to-device receives
When the receive destination is an invalid/stale device pointer or the H2D copy fails, infiniRecv still frees the staging buffer and returns success because the Runtime<kDev>::Memcpy result is ignored. In that scenario the MPI receive completed but the user's device buffer was not updated, so callers get silent data corruption instead of an error status.
Useful? React with 👍 / 👎.
41e0b95 to
fca4f46
Compare
4181112 to
b379193
Compare
send and receive with OpenMPI backend implementation
b379193 to
4531920
Compare
Summary
This PR introduces blocking point-to-point
Send/Recvsupport for InfiniCCL with an OpenMPI-based backend implementation, along with an example program for functionality verification and basic performance evaluation.The public APIs follow the NCCL point-to-point parameter order through
infiniSend()andinfiniRecv(). The current implementation uses host-staging for device buffers and blockingMPI_Send/MPI_Recvinternally.Changes
Public Send/Recv API
infiniSend();infiniRecv().Base Send/Recv Wrappers
src/base/send.h;src/base/recv.h;infiniInvalidArgumentfor invalid user inputs.OpenMPI-based Send/Recv Implementation
src/ompi/impl/send.h;src/ompi/impl/recv.h;MPI_SendandMPI_Recv;INT_MAX-bounded MPI chunks.Send/Recv Example
examples/send_recv.cc;all_reduce,all_gather,reduce_scatter,broadcast, andall_to_all;Known Issues & Future Work
malloc/freeon every invocation. This may introduce 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.0) internally. Future extensions may expose tags or add request-based APIs if more advanced point-to-point patterns are needed.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
broadcast test (MetaX-NVIDIA heterogeneous)
broadcast.log
all_to_all test (MetaX-NVIDIA heterogeneous)
all_to_all.log
send_recv test (MetaX-NVIDIA heterogeneous)
send_recv.log