JuliaMath / JuliaMath/AbstractFFTs.jl

Allow plans to have fewer dimensions than the data

Open
#122 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
134
Forks
40
PR merge metrics
No merged PRs in 30d

Description

I think it's a good idea to allow FFT plans to be applied to data that has more dimensions than the plan, as long as those are only the trailing dimensions. The expected behaviour in this case would be a batched FFT.
CUDA.jl PR https://github.com/JuliaGPU/CUDA.jl/pull/1903 initially implemented this behaviour for CUFFT, but it was removed because it is not in accordance with AbstractFFTs.

As an example
```
using CUDA
A = CUDA.rand(100); B = CUDA.rand(100,10);
plan = CUDA.CUFFT.plan_fft(A)
plan * A # works
plan * B # doesn't work
```
In this case the expected behaviour would be `(plan * B)[:,i] == (plan * B[:,i])`.

You'd only need a single plan to apply the plan to data in different batch sizes as well. E.g. in the following situation:
```
A = rand(100,10); B = rand(100,20); C = rand(100)
```
I'd like to have a plan that performs an FFT along the first dimension, but can apply to both `A` and `B`. It's a very common setup e.g. in ML applications, that the batch size is variable and not set when allocating the model.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.