fkodom / fft-conv-pytorch

Implementation of 1D, 2D, and 3D FFT convolutions in PyTorch. Much faster than direct convolutions for large kernel sizes.
MIT License
474 stars 58 forks source link

can't work on GPU? #1

Closed libonwpu closed 3 years ago

libonwpu commented 3 years ago

Dear authors,

I am interested in this work and thanks for your share. I find this function can't work on GPU. Is it true?

fkodom commented 3 years ago

You're exactly right, that was a bug on my part. I just pushed a fix for this. Thank you for pointing this out! I missed this when updating for PyTorch 1.7.

However, FFT convolution is usually slower than direct convolution on the GPU. Direct conv is just so fast on GPU, you'd need really, really kernel sizes before FFT conv was faster. If you need GPU execution, you're almost certainly better off using direct convolution.