-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(multimodal): bound MmKwargsNixlSender.cleanup and always release buffers #12759
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
Merged
rmccorm4
merged 6 commits into
ai-dynamo:main
from
yifjiang:fix/mm-nixl-cleanup-unbounded-wait
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d1a9be5
fix(multimodal): bound MmKwargsNixlSender.cleanup and always release …
yifjiang c983905
test: fix import ordering flagged by isort
yifjiang d4f9351
fix(multimodal): correct _encode_item return annotation
yifjiang dfe1e31
fix(multimodal): await all transfers before release; re-raise release…
yifjiang 9dadb3a
fix(multimodal): re-raise completion errors; add pytest timeouts
yifjiang 06f2e15
fix(multimodal): keep cleanup() best-effort per review
yifjiang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
_release_allloops N synchronous native releases here:op.__exit__()→_release()→Descriptor.deregister_with_connector()→connection._nixl.deregister_memory(), which is a blocking native call. This runs inside async cleanup() on the single frontend, once per request. If deregister_memory isn't cheap, this stalls the event loop proportional to the buffer count. Could we confirm the perf impact, or maybe offloading viarun_in_executor?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.
Measured it rather than guessing — you were right to ask, and the answer is that it is cheap.
Timed
op.__exit__()->_release()->deregister_memory()per buffer, real NIXL on GB200:So ~5 us per release: ~0.02 ms of event-loop time for a 4-image request, 0.2 ms for 20 buffers. That is below the cost of a
run_in_executorhand-off, so I have left it inline and recorded the numbers in the_release_alldocstring so the question does not have to be re-derived later.Leaving this thread open rather than resolving it — if you would still prefer the executor defensively (e.g. you expect pathological buffer counts per request that I have not exercised), say so and I will switch it.