Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

DGEMM inconsistent results

Pedersen__M
Beginner
420 Views

We have an application that uses DGEMM for matrix multiplication.

To ease comparison of different version we would like it to give exactly same results each time it runs.

We have tried with the following project settings, but it still gives different results from run to run:

- Fortran - Optimization - Optimization: Disable

- Fortran - Optimization - Parallelization: No

- Fortran - Floating Point - Floating Point Model: Precise

- Fortran - libraries - Use Intel math kernel library: Sequential

 

Furthermore we have added:

CALL MKL_SET_NUM_THREADS(1)

 

Are there more settings that we are missing

0 Kudos
2 Replies
TimP
Honored Contributor III
420 Views

Did you look into control of data alignment and mkl conditional numerical reproducibility?

0 Kudos
mecej4
Honored Contributor III
420 Views

Are you compiling DGEMM from source? Otherwise, most of the options that you listed would have no effect on the results that DGEMM gives, since the pre-compiled code of DGEMM would be in the MKL (or other) library. If you are not choosing different /Qx or /Qax options between runs, and you are still getting differences, I think that you should check the arguments that are being passed to DGEMM. 

When you find differences, how big are those? Please quantify. If possible, provide a reproducer.

0 Kudos
Reply