Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7003 Discussions

Large 1D FFT fails with multiple of a prime number.

Julianis
Beginner
1,368 Views

One of our client reported an error on a specific size 1D FFT.
After some investigations we found out the issue was related to the size of the data.

We do 1D FFT, complex numbers in float (single precision), in place configuration (DFTI_INPLACE), and the we link mkl_sequential_dll.lib.

When the number of complex is 205'213'539, the DftiComputeForward() function returns an error code DFTI_INCONSISTENT_CONFIGURATION (3).

We did some tests to pinpoint the problem:

300M points, success
205'212'539, failure (this value is a multiple of 7, 7x29'316'077)
200'000'033 (prime number > 200M), success
100M, success
33'000'001 (prime number > 33M), success
2*33'000'001, success
34'000'009 (prime number > 34M), success
2*34'000'009, failure
3*50'000'017 (prime number > 50M), failure

It seems the FFT implementation has 2 paths, radix or non radix:
- the non radix path (when we use a prime number) can do the calculations on whatever size
- the radix path (when we use a multiple of prime number) seems to have a limit around radix * 33M

The errors have been reproduced with MKL 2022.1 and 2024.0.
Latest version didn't solve the issue unfortunately.

I understand the radix path can have limitations to the number of elements, but in this case, I would expect a fallback to the non radix path instead of failing.

0 Kudos
1 Solution
Gennady_F_Intel
Moderator
794 Views

The fix of the problem available into the latest MKL 2024 u1 which has been released this week and available to download.

here is the log I captured while linking the case against MKL 2024 u1 and while using Verbose mode :


Intel(R) oneAPI Math Kernel Library Version 2024.1-Product Build 20240215 for Intel(R) 64 architecture applications

Example basic_sp_complex_dft_1d

Forward and backward single-precision complex in-place 1D FFTs

Configuration parameters:

 DFTI_PRECISION   = DFTI_SINGLE

 DFTI_FORWARD_DOMAIN = DFTI_COMPLEX

 DFTI_DIMENSION   = 1

 DFTI_LENGTHS    = {205213539}

Create DFTI descriptor

Commit DFTI descriptor

Allocate input array

Initialize input for forward transform

Compute forward transform

MKL_VERBOSE oneMKL 2024.0 Update 1 Product build 20240215 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) enabled processors, Lnx 2.40GHz sequential

MKL_VERBOSE FFT(scfi205213539,tLim:1,desc:0x55bf372031c0) 35.78s CNR:OFF Dyn:1 FastMM:1

...DftiComputeForward returns 0 Verify the result of forward FFT


 Verify the result, errthr = 1.65e-05

 Verified, maximum error was 4.52e-07

Initialize input for backward transform

Compute backward transform

MKL_VERBOSE FFT(scbi205213539,tLim:1,desc:0x55bf372031c0) 32.04s CNR:OFF Dyn:1 FastMM:1

Verify the result of backward FFT




View solution in original post

0 Kudos
12 Replies
Gennady_F_Intel
Moderator
1,362 Views

Could you try to link against ILP64 mode? Check how to do that with MKL Linker Adviser.

--Gennady

0 Kudos
Julianis
Beginner
1,355 Views

Sorry I didn't specify it, but we are already linking against mkl_intel_ilp64_dll.lib.

To be specific we link against:

mkl_core_dll.lib
mkl_intel_ilp64_dll.lib
mkl_intel_thread_dll.lib

Regards

0 Kudos
Gennady_F_Intel
Moderator
1,354 Views

Then please build the reproducer which will help us to check this case on our end.

0 Kudos
Julianis
Beginner
1,341 Views

I modified the basic_sp_complex_dft_1d.c sample to reproduce the problem.

0 Kudos
Gennady_F_Intel
Moderator
1,273 Views

We reproduced the behavior and will investigate the reason. The status would be updated here.

--Gennady


0 Kudos
Gennady_F_Intel
Moderator
1,193 Views

I have to confirmed that this is the real issue. We are planning to fix it the nearest update which we are planning to release the next eom. I will keep you informed when it happen.

--Gennady


0 Kudos
Julianis
Beginner
1,191 Views

Great, thanks for the support !

0 Kudos
Gennady_F_Intel
Moderator
1,126 Views

Juilian,

Could you give us all problem sizes where do you see the problem beyond of those you already shared?

We fixed the problem and need to check all cases where do you see the problem.

--Gennady


0 Kudos
Julianis
Beginner
1,044 Views

Hello,

sorry for the late answer, I was on vacation.

I identified the following dimensions which reproduce the issue:

int N = 1*34'000'009; // OK
//int N = 2*34'000'009; // FAILS
//int N = 3*34'000'009; // FAILS
//int N = 7*34'000'009; // FAILS
//int N = 11*34'000'009; // FAILS
//int N = 13*34'000'009; // FAILS
//int N = 17*34'000'009; // FAILS
//int N = 19*34'000'009; // FAILS
//int N = 23*34'000'009; // FAILS
//int N = 29*34'000'009; // FAILS
// i guess the issue is the following
//int N = {prime number}*34'000'009; // FAILS

Regards

0 Kudos
Gennady_F_Intel
Moderator
1,037 Views
0 Kudos
Gennady_F_Intel
Moderator
795 Views

The fix of the problem available into the latest MKL 2024 u1 which has been released this week and available to download.

here is the log I captured while linking the case against MKL 2024 u1 and while using Verbose mode :


Intel(R) oneAPI Math Kernel Library Version 2024.1-Product Build 20240215 for Intel(R) 64 architecture applications

Example basic_sp_complex_dft_1d

Forward and backward single-precision complex in-place 1D FFTs

Configuration parameters:

 DFTI_PRECISION   = DFTI_SINGLE

 DFTI_FORWARD_DOMAIN = DFTI_COMPLEX

 DFTI_DIMENSION   = 1

 DFTI_LENGTHS    = {205213539}

Create DFTI descriptor

Commit DFTI descriptor

Allocate input array

Initialize input for forward transform

Compute forward transform

MKL_VERBOSE oneMKL 2024.0 Update 1 Product build 20240215 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) enabled processors, Lnx 2.40GHz sequential

MKL_VERBOSE FFT(scfi205213539,tLim:1,desc:0x55bf372031c0) 35.78s CNR:OFF Dyn:1 FastMM:1

...DftiComputeForward returns 0 Verify the result of forward FFT


 Verify the result, errthr = 1.65e-05

 Verified, maximum error was 4.52e-07

Initialize input for backward transform

Compute backward transform

MKL_VERBOSE FFT(scbi205213539,tLim:1,desc:0x55bf372031c0) 32.04s CNR:OFF Dyn:1 FastMM:1

Verify the result of backward FFT




0 Kudos
Julianis
Beginner
692 Views

I confirm the problem is fixed with the latest mkl version.

Thank you

0 Kudos
Reply