Uh oh!
There was an error while loading. Please reload this page.
Memory refactor - #1205
Conversation
Andy-Jost
commented
Nov 7, 2025
/ok to test cf4dc9d |
Andy-Jost
commented
Nov 10, 2025
/ok to test 19e4b8f |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b5ae007 to
cce7f6cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Andy-Jost
commented
Nov 12, 2025
/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.
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.
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.
Uh oh!
There was an error while loading. Please reload this page.
|
Uh oh!
There was an error while loading. Please reload this page.
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).