-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rdma: simplify init / delay posting rx buffers #772
Merged
Merged
Conversation
This file contains 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
Since NCCL generally uses a different thread for initializing the plugin and creating communicators, the quick hack of leaving a mostly configured endpoint from init just resulted in us leaking resources; that endpoint was never actually going to be used. The whole reason for the refcount hack in init was a bug in EFA on P5en at launch where destroying and rapidly creating a new QP when the old QP had rx buffers attached could cause an error. Rather than keep the whole endpoint around and leaking resources, just delay the parts of the operation that were causing races until after init, when the first communicator is created. Now, endpoint creation during init() doesn't post buffers and is immediately destroyed, avoiding the whole leak. And because either listen or connect will be called before a process does any communication, this doesn't impact correctness. Signed-off-by: Brian Barrett <[email protected]>
a7e8436
to
84d19d7
Compare
I find it really hard to approve this with the confidence that this isn't going to break some user somewhere, but given that the record shows I also approved the original PR that introduced this refcnt hack, I have no right to recuse myself. |
aws-nslick
approved these changes
Jan 28, 2025
mozarhua
approved these changes
Jan 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rauteric
reviewed
Jan 28, 2025
mozarhua
added a commit
to mozarhua/aws-ofi-nccl
that referenced
this pull request
Jan 29, 2025
When aborting with no connection established, there were QPs leaked if any domain and endpoint left open. This patch adds domain and endpoint cleanup logic at the beginning of rdma and sendrecv device release to prevent the QP leak. Note the logic can be triggered without aws#772. Signed-off-by: Mozar Huang <[email protected]>
mozarhua
added a commit
to mozarhua/aws-ofi-nccl
that referenced
this pull request
Jan 29, 2025
When aborting with no connection established, there were QPs leaked if any domain and endpoint left open. This patch adds domain and endpoint cleanup logic at the beginning of rdma and sendrecv device release to prevent the QP leak. Note the logic can be triggered without aws#772. Signed-off-by: Mozar Huang <[email protected]>
mozarhua
added a commit
to mozarhua/aws-ofi-nccl
that referenced
this pull request
Jan 30, 2025
When aborting with no connection established, there were QPs leaked if any domain and endpoint left open. This patch adds domain and endpoint cleanup logic at the beginning of rdma and sendrecv device release to prevent the QP leak. Note the logic can be triggered without aws#772. Signed-off-by: Mozar Huang <[email protected]>
bwbarrett
pushed a commit
that referenced
this pull request
Jan 30, 2025
When aborting with no connection established, there were QPs leaked if any domain and endpoint left open. This patch adds domain and endpoint cleanup logic at the beginning of rdma and sendrecv device release to prevent the QP leak. Note the logic can be triggered without #772. Signed-off-by: Mozar Huang <[email protected]>
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.
Since NCCL generally uses a different thread for initializing the plugin and creating communicators, the quick hack of leaving a mostly configured endpoint from init just resulted in us leaking resources; that endpoint was never actually going to be used. The whole reason for the refcount hack in init was a bug in EFA on P5en at launch where destroying and rapidly creating a new QP when the old QP had rx buffers attached could cause an error.
Rather than keep the whole endpoint around and leaking resources, just delay the parts of the operation that were causing races until after init, when the first communicator is created. Now, endpoint creation during init() doesn't post buffers and is immediately destroyed, avoiding the whole leak. And because either listen or connect will be called before a process does any communication, this doesn't impact correctness.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.