fix: deregister NIXL scratch tensors after refit receive#457
Open
yafshar wants to merge 2 commits into
Open
Conversation
Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
17498de to
8b952f6
Compare
…h-registration-leak
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.
Summary
Fixes a NIXL registration leak in the scratch receive path.
MxRefitReceiver.receive_weights_scratch()allocates fresh GPU scratch tensors per receive and registers them viaNixlTransferManager.register_tensors(). Previously, this flow invokedregister_memory()without retaining or releasing the returned registration descriptors, causing registrations to accumulate across repeated refits.This change scopes scratch tensor registrations to the duration of a single receive and ensures they are deregistered immediately after the transfer completes. Persistent tensor registrations are now tracked and released on shutdown, preserving existing publisher assumptions about stable, long-lived metadata.
Changes
NixlTransferManager.temporary_registered_tensors()for scoped, one-shot registrations.receive_weights_scratch().MxRefitReceiverfromMxV2RefitReceiver.shutdown().Validation
Baseline metadata grew linearly across repeated scratch receives:
After this patch, metadata stayed bounded:
Validation command: