Skip to content

How to use disableReorderFourStep in normal mode to implement convolution #205

@Vandermode

Description

@Vandermode

Hi, I was wondering how to use disableReorderFourStep in normal FFT+multiplication+IFFT mode for convolution.

For a large-sized input with multiload, the performConvolution mode works well by either setting disableReorderFourStep to compute the kernel, or manually transposing the kernel following axis_split

However, normal FFT + multiplication + IFFT mode with disableReorderFourStep leads to incorrect results.
I want to use disableReorderFourStep to optimize the distributed-memory-FFT-based convolution algorithm (which cannot leverage the native convolution mode directly)

app_conv = VkFFTApp(img.shape, dtype=np.complex64, ndim=2, inplace=True, r2c=False, convolve=True, convolve_conj=0)
app_dr = VkFFTApp(img.shape, dtype=np.complex64, ndim=2, inplace=True, r2c=False, convolve=False, convolve_conj=0, disableReorderFourStep=disableReorderFourStep)

K_gpu = app_dr.fft(k_gpu)
app_dr.fft(d_gpu)
d_gpu *= K_gpu
app_dr.ifft(d_gpu)

Test code can be found in
https://github.com/Vandermode/pyvkfft/blob/8ff5cc6ed74eae5e235e59ec661a88c4c45e7b8f/examples/test_fft_conv.py#L210

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions