-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[core][RDT] Fix nixl garbage collection after the object is freed #57138
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
Changes from all commits
db5243d
2963e99
b96f79f
2d04c30
57a15e0
8b8ce0d
63394b8
defe92b
fbae7b6
63f80dd
099652c
631b56a
950c536
3fa8c22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import time | ||
| from typing import TYPE_CHECKING, List, Tuple | ||
| from typing import TYPE_CHECKING, Any, List, Tuple | ||
|
|
||
| from nixl._api import nixl_agent, nixl_agent_config | ||
|
|
||
|
|
@@ -87,9 +87,11 @@ def recv( | |
| break | ||
|
|
||
| nixl_agent.release_xfer_handle(xfer_handle) | ||
| nixl_agent.deregister_memory(local_descs) | ||
| nixl_agent.remove_remote_agent(remote_name) | ||
dayshah marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm a little confused on why we would remove the agent but not deregister the memory if the send is sync we'll re-register the memory on every send anyways
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| def get_nixl_metadata(self, tensors: List["torch.Tensor"]) -> Tuple[bytes, bytes]: | ||
| def get_nixl_metadata( | ||
| self, tensors: List["torch.Tensor"] | ||
| ) -> Tuple[Any, bytes, bytes]: | ||
| """Get NIXL metadata for a set of tensors. | ||
|
|
||
| Args: | ||
|
|
@@ -104,6 +106,10 @@ def get_nixl_metadata(self, tensors: List["torch.Tensor"]) -> Tuple[bytes, bytes | |
| reg_descs = nixl_agent.register_memory(tensors) | ||
| xfer_descs = reg_descs.trim() | ||
| return ( | ||
| reg_descs, | ||
| nixl_agent.get_serialized_descs(xfer_descs), | ||
| nixl_agent.get_agent_metadata(), | ||
| ) | ||
|
|
||
| def deregister_memory(self, descs: Any): | ||
| self._nixl_agent.deregister_memory(descs) | ||
Uh oh!
There was an error while loading. Please reload this page.