Radway 82 reslice memory estimator#700
Merged
yousefmoazzam merged 6 commits intomainfrom Apr 24, 2026
Merged
Conversation
05ea726 to
264b6e2
Compare
The `numpy.split()` function only creates views of the original array (see https://numpy.org/doc/2.4/reference/generated/numpy.split.html), which means that it doesn't cause any allocations to occur, so there's no need to include the size of the split arrays in the value of the peak allocation prior to the ring algorithm running.
The split arrays given as input to the `alltoall_ring()` function will not be deallocated during the execution of the function, because there exists references to them (and thus to the underlying data) during the entireity of `alltoall_ring()`. Due to how reference counting and function calls work in python, only when `alltoall_ring()` returns to its caller `reslice()` could there be the possibility of the array that was initially split by `reslice()` being deallocated. (And even then, the `reslice()` function gets its input `data` from its caller, so I think the original array that was split can't be deallocated in `reslice()` either, it must happen further up in the call stack). Therefore, even after the ring algorithm has completed in `alltoall_ring()`, the input is still allocated and thus its size must be accounted for in the peak allocation size after the ring algorithm.
264b6e2 to
7d3ac23
Compare
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.
Fixes #ISSUE
Checklist
user-release-notelabel in order to include this PR in the "NotableChanges for Users" section in release notes