-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add python wrapper for system memory resource #1605
Conversation
2f0ae85
to
352ab6d
Compare
Apologies, Lawrence and are swamped with multiple large P0 efforts going into this release. I'll try to get to this today. |
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.
Looks fine, but I question whether we want to add more options to initialize
.
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.
Thanks for compromising, @rongou ! As part of our upcoming Python refactoring, we should consider how to make it easier to handle setting MRs more generically.
pass | ||
|
||
|
||
cdef class SamHeadroomResourceAdaptor(DeviceMemoryResource): |
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.
An adaptor accepts another resource as an argument (e.g. a logging adaptor adds logging, but passes through to the underlying MR). This is not an adaptor, it is implemented like an entirely new resource.
Adaptors must be composable. It cannot be specific to the System MR and must accept other MRs if it is to be an adaptor.
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.
Should we redesign this so that the SystemMemoryResource has an argument headroom
and we don't need the "adaptor" at all? Or rename this so it's not an adaptor?
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.
The C++ side has both the system mr and the adaptor, but I guess we don't have to strictly mirror it in python. I'd be happy to have a single SystemMemoryResource with an argument.
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.
Done.
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.
I think there's room for future improvement here, but we definitely can't do that in this PR so I don't want to hold things up for this release.
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.
Approving again post the final split of classes on the Python side.
/merge |
Description
Follow up on #1581 to add access to the system memory resource in python.
Fixes #1622
Checklist