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

The motivation for not fusioning fff(k) into the kernel #19

Closed
Doraemonzzz opened this issue Mar 8, 2023 · 2 comments
Closed

The motivation for not fusioning fff(k) into the kernel #19

Doraemonzzz opened this issue Mar 8, 2023 · 2 comments

Comments

@Doraemonzzz
Copy link

Thanks for your great work. Here I want to ask why fft(k) is not fused into the kernel, is it a performance issue?
I mean why is it implemented as follows:

def fftconv_fast(u, k, D, dropout_mask):
     """Fuse padding + rfft + pointwise mult + ifft + multiply with D + gelu + dropout
     """
     seqlen = u.shape[-1]
     fft_size = 2 * seqlen
     k_f = torch.fft.rfft(k, n=fft_size)
     out = fftconv_fwd(u, k_f, D, dropout_mask, fft_size)
     return out

instead of:

def fftconv_fast(u, k, D, dropout_mask):
     """Fuse padding + rfft + pointwise mult + ifft + multiply with D + gelu + dropout
     """
     seqlen = u.shape[-1]
     fft_size = 2 * seqlen
     out = fftconv_fwd(u, k, D, dropout_mask, fft_size)
     return out
@DanFu09
Copy link
Contributor

DanFu09 commented Mar 8, 2023 via email

@Doraemonzzz
Copy link
Author

Make sense. Thanks.

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

No branches or pull requests

2 participants