Skip to content

Radway 82 reslice memory estimator#700

Merged
yousefmoazzam merged 6 commits intomainfrom
radway_82_reslice_memory_estimator
Apr 24, 2026
Merged

Radway 82 reslice memory estimator#700
yousefmoazzam merged 6 commits intomainfrom
radway_82_reslice_memory_estimator

Conversation

@ferenc-gh
Copy link
Copy Markdown
Collaborator

Fixes #ISSUE

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation
  • I have added the user-release-note label in order to include this PR in the "Notable
    Changes for Users" section in release notes

@yousefmoazzam yousefmoazzam force-pushed the radway_82_reslice_memory_estimator branch from 05ea726 to 264b6e2 Compare April 24, 2026 11:19
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.
@yousefmoazzam yousefmoazzam force-pushed the radway_82_reslice_memory_estimator branch from 264b6e2 to 7d3ac23 Compare April 24, 2026 11:22
@yousefmoazzam yousefmoazzam merged commit fc5cf8b into main Apr 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants