This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

What is rocFFT?

What is rocFFT?#

Introduction#

The rocFFT library is an implementation of the discrete Fast Fourier Transform (FFT) written in HIP for GPU devices. The code is open and hosted here: ROCmSoftwarePlatform/rocFFT

The rocFFT library provides a fast and accurate platform for calculating discrete FFTs. It supports the following features:

  • Half (FP16), single, and double precision floating point formats

  • 1D, 2D, and 3D transforms

  • Computation of transforms in batches

  • Real and complex FFTs

  • Arbitrary lengths, with optimizations for combinations of powers of 2, 3, 5, 7, 11, 13, and 17

rocFFT also has experimental support for:

  • Distributing transforms across multiple GPU devices in a single process

  • Distributing transforms across multiple MPI (Message Passing Interface) processes

FFT Computation#

The FFT is an implementation of the Discrete Fourier Transform (DFT) that makes use of symmetries in the DFT definition to reduce the mathematical complexity from O(N2) to O(NlogN).

What is computed by the library? Here are the formulas:

For a 1D complex DFT:

x~j=k=0n1xkexp(±i2πjkn) for j=0,1,,n1

Where, xk are the complex data to be transformed, x~j are the transformed data, and the sign ± determines the direction of the transform: for forward and + for backward.

For a 2D complex DFT:

x~jk=q=0m1r=0n1xrqexp(±i2πjrn)exp(±i2πkqm)

For j=0,1,,n1 and k=0,1,,m1, where, xrq are the complex data to be transformed, x~jk are the transformed data, and the sign ± determines the direction of the transform.

For a 3D complex DFT:

x~jkl=s=0p1q=0m1r=0n1xrqsexp(±i2πjrn)exp(±i2πkqm)exp(±i2πlsp)

For j=0,1,,n1 and k=0,1,,m1 and l=0,1,,p1, where xrqs are the complex data to be transformed, x~jkl are the transformed data, and the sign ± determines the direction of the transform.