Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed convolution in arbitrary dimension and with arbitrary kernel size #1248

Open
mrfh92 opened this issue Oct 16, 2023 · 2 comments · May be fixed by #1291
Open

Distributed convolution in arbitrary dimension and with arbitrary kernel size #1248

mrfh92 opened this issue Oct 16, 2023 · 2 comments · May be fixed by #1291
Assignees

Comments

@mrfh92
Copy link
Collaborator

mrfh92 commented Oct 16, 2023

It is well-known that convolution is (up to constants and conventions) the same as applying Fourier transform, a pointwise multiplication, and inverse Fourier transform. Since we will soon have a distributed FFT available in Heat (see #1097) it is time to think about how this can be exploited to implement convolution for DNDarrays of arbitrary dimensions and arbitrary kernel sizes.

Some first thoughts:

  • the approach of convolution via FFT will be more efficient than traditional convolution only in the case of very large kernels (hats an exotic, but interesting use-case)
  • "boundary conditions" have to be handeled via careful choice of padding
  • see https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.fftconvolve.html#scipy.signal.fftconvolve for convolution-by-FFT in SciPy
  • dealing with the "standard case" (zero-padding and no stride, as done in SciPy) seems to be rather straight-forward; including a stride (as in PyTorchs convolve_...-functions) seems to require some additional work but in principal stil possible using the FFT-approach (?): it should suffice to implement and apply downsampling
@mrfh92
Copy link
Collaborator Author

mrfh92 commented Dec 6, 2023

my idea for a start: use the existing implementation of parallel FFT in Heat to implement roughly the functionality of scipy.signal.fftconvolve (also using the same API)

Copy link
Contributor

github-actions bot commented Dec 6, 2023

@LScheib LScheib linked a pull request Dec 7, 2023 that will close this issue
5 tasks
@LScheib LScheib removed their assignment Dec 21, 2023
@mrfh92 mrfh92 self-assigned this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants