feat: support send and receive#13
Conversation
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 👍 / 👎.
92412fd to
41e0b95
Compare
Summary
This PR introduces blocking point-to-point Send/Recv support for InfiniCCL with an OpenMPI-based backend implementation, along with a dedicated example program for functionality verification.
The implementation currently uses host-staging for device buffers and blocking
MPI_Send/MPI_Recvinternally. The example covers basic Send/Recv correctness, zero-count behavior, ping/ping-pong cases, invalid peer validation, optional large-count testing, and heterogeneous NVIDIA + MetaX rank/device mapping.Changes
Public Send/Recv API
infiniSend()infiniRecv()Base Send/Recv Wrappers
src/base/send.h;src/base/recv.h;infiniInvalidArgumentfor invalid peer ranks.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 and Test Coverage
examples/send_recv.cc;size - 1;INFINI_SENDRECV_LARGE=1;Known Issues & Future Work
malloc/freeon each invocation. Future work may introduce reusable host buffer pools, pinned host memory, or allocator caching to reduce overhead.0) internally. Future extensions may expose tags or add request-based APIs if more advanced point-to-point patterns are needed.INFINI_SENDRECV_LARGE=1.Logs & Screenshots
all_reduce test (MetaX-NVIDIA heterogeneous)
all_reduce.log
all_gather test (MetaX-NVIDIA heterogeneous)
all_gather.log
send_recv test (MetaX-NVIDIA heterogeneous)
send_recv.log