Performance

Reuse compatible plans and output buffers for repeated transforms; see Plans and buffers. Measure compilation and planning separately from repeated execution.

CPU and CUDA GPU

Representative forward-transform measurements (Julia 1.10.12, FFTW 1.10.0, CUDA 5.11.3; AMD EPYC 7543 with four FFTW threads and NVIDIA A40):

TypeShapeCPU (ms)GPU (ms)SpeedupSpeedup with transfers
Float324,0960.04070.06080.67×0.50×
Float32256 × 2561.4760.063523.2×12.0×
Float32128 × 128 × 1289.3470.36325.8×6.20×
Float64128 × 128 × 12819.9601.13717.6×5.95×

Times are warmed medians with reusable plans (FFTW ESTIMATE; up to 100 samples or one second per trial). GPU calls are synchronized; compilation and planning are excluded. The GPU column uses resident arrays; the last column includes transfers to and from the CPU. Speedup is CPU time divided by GPU time. Results depend on hardware and array size; small arrays can favor the CPU.

The measurement script is test/gpu/benchmarks.jl.

Reactant

Compiled execution with Reactant 0.2.292 and Enzyme 0.13.216, using Float32 arrays of size 64 × 64 × 64:

OperationCPU (ms)A40 GPU (ms)Speedup
Transform0.7500.08598.73×
Gradient1.2050.115910.4×

Medians of 100 warmed, synchronized calls; compilation and transfers are excluded. The CPU backend uses its default settings with four CPU cores allocated. The gradient includes the transform and a scalar loss. See test/reactant/benchmarks.jl for the workload.