-
Notifications
You must be signed in to change notification settings - Fork 241
Memory refactor #1205
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
Memory refactor #1205
Conversation
|
/ok to test cf4dc9d |
|
/ok to test 19e4b8f |
b5ae007 to
cce7f6c
Compare
rparolin
left a comment
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.
Generally looks good to me. I left some general comments that I consider non-blocking.
@leofang Any major concerns you'd like to see address before this gets merged?
|
/ok to test ff3820f |
| from ._buffer import * # noqa: F403 | ||
| from ._device_memory_resource import * # noqa: F403 | ||
| from ._ipc import * # noqa: F403 | ||
| from ._legacy import * # noqa: F403 | ||
| from ._virtual_memory_resource import * # noqa: F403 |
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.
Style: Would be better to call out what's being imported. Maintaining __all__ or having to chasing after each module for their __all__ is not fun. I don't recall we ever maintain __all__ in any other modules.
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 guess I have the opposite preference. E.g., if I add something to, say, _buffer I find it easier to update the __all__ list there rather than in a separate file.
|
Major refactoring of the memory package.
Overview
This PR refactors the
_memory.pyxmodule into a dedicated package (_memory/) to address its growing size and complexity, which were hindering further development. The primary goals are to physically separate the code into more manageable submodules, simplify the internal logic, and enhance the overall structure, including the addition of.pxdheaders for better Cython integration.Major Changes
_memory.pyxinto submodules, the major ones being the following:_buffer.*_dmr.*_ipc.*_vmm.*.pxd) for public definitions to improve modularity and type safety.DeviceMemoryResourceto isolate IPC-related code, reducing coupling.IPCDataclass to encapsulate relevant data members and eliminating a redundantuuidfield.Minor Improvements
__all__lists to modules for explicit control over exports._handleinstead of_mempool_handle).