This pull request addresses #66. Basically, the memory footprint of the Lamino operator is too large.
Approach
There are two approaches used in this pull request.
First, the checkerboard method for FFT shifting is implemented. This method uses properties of the FFT such that multiplying an array with a checkerboard of -1, 1 before and after the FFT is applied is equivalent to performing an FFT shift before and after.
Second, I dropped in the CuPy FFT functions that allow for the overwrite_x parameter which enables in-place FFT operations if available.
These two approaches have reduced the memory consumption of the Lamino operator by approximately half. Here is the memory usage before the changes:
Purpose
This pull request addresses #66. Basically, the memory footprint of the Lamino operator is too large.
Approach
There are two approaches used in this pull request.
First, the checkerboard method for FFT shifting is implemented. This method uses properties of the FFT such that multiplying an array with a checkerboard of -1, 1 before and after the FFT is applied is equivalent to performing an FFT shift before and after.
Second, I dropped in the CuPy FFT functions that allow for the
overwrite_x
parameter which enables in-place FFT operations if available.These two approaches have reduced the memory consumption of the Lamino operator by approximately half. Here is the memory usage before the changes:
Here is the memory usage after the changes:
This is for
n=16*14, ntheta=8*14, tilt=np.pi/3, eps=1e-3
with the Lamino adjoint test.Pre-Merge Checklists
Submitter
yapf
to format python code.Reviewer