RPC: use RDMA completion channel to not spin - #29440
Merged
Merged
Conversation
ggerganov
reviewed
Sep 25, 2026
Member
|
I'll run a few tests tomorrow. cc @rgerganov |
ggerganov
approved these changes
Sep 26, 2026
ggerganov
left a comment
Member
There was a problem hiding this comment.
In transport-apple.cpp, add a TODO comment to implement similar mechanism. Add a reference to this PR.
rgerganov
approved these changes
Sep 27, 2026
| static constexpr size_t RDMA_CHUNK = 256 * 1024; // 256 KiB per send/recv (fits default 8 MiB memlock) | ||
| static constexpr int RDMA_RX_DEPTH = 24; // pre-posted recv ring: 24 × 256 KiB = 6 MiB | ||
| // keep polling the CQ for this long after the last activity, then sleep until the next completion | ||
| static constexpr auto RDMA_SPIN_TIME = std::chrono::milliseconds(100); |
Member
There was a problem hiding this comment.
I don't quite understand why we need this but I guess this is how it works
Member
There was a problem hiding this comment.
My guess is that if we sleep unconditionally without a spin/polling phase, there will be a performance hit from the large amount of sleep + wake cycles.
pierreguillot
pushed a commit
to Ircam-Partiels/llama.cpp
that referenced
this pull request
Oct 1, 2026
* RPC: use RDMA completion queue to not spin * add TODO for apple RDMA
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.
Overview
Currently the RPC server spins 100% on
rdma_poll, we can arm a completion channel to wake up the thread when there is an event or a peer disconnect. I saw no performance drop with RPC-sm layeror-sm tensorwith this change, the only change was the CPU went from 100% to 0.1% usage.Additional information
Requirements