Re: [Ecp-aurora-sdk-discuss] [mkl] fft normalization 1d vs 2d
I found the FORWARD_SCALE and BACKWARD_SCALE config parameters. I checked and the default values, for both 1d and 2d, are 1 and 1, so unless I am misunderstanding, the 2d FFT should also not be doing normalization, so the result should be the same as from cuFFT. I also tried setting them to 1 (double or float depending on type used) and that doesn't change anything. So this looks like a bug to me. I created a plain MKL example, which is basically doing the same thing, but producing the expected (unnormalized) result. See attached. -Bryce On 4/10/21 11:15, Bryce Allen via Ecp-aurora-sdk-discuss wrote:
Hi,
I am creating test cases for a GPU fft wrapper library, that wraps cuFFT, hipFFT, and oneAPI MKL dft. For 2d and 3d tests, I am using the delta function - zero everywhere except for one point in the center of the input matrix where it has the value 1. The FFT transform of this function is ones everywhere, so it makes it particularly convenient for writing multi-d tests.
When I run this test in cuFFT, it produces unnormalized result, e.g. for a 17x17 matrix as input, if I forward transform then backwards transform it, I get a 17x17 real matrix with 289 in the central (8,8) spot, and values very near zero everywhere else. With MKL dft, I get result matrix that is already normalized - the central point is already 1 or very close to 1.
For 1d FFT, MKL dft produces unnormalized results when round-tripping like this. So I am confused that this is different for 2d. Is there a reason for this discrepancy?
For reference, my 2d test case is here: https://github.com/bd4/gtensor/blob/pr/fft-hip-fix/tests/test_fft.cxx#L357
and the wrapper interface is here: https://github.com/bd4/gtensor/blob/pr/fft-hip-fix/include/gt-fft/backend/sy...
Thanks, Bryce
participants (1)
-
Bryce Allen