nbabel icon indicating copy to clipboard operation
nbabel copied to clipboard

Impact of fastmath?

Open stuartarchibald opened this issue 4 years ago • 3 comments

Thanks for producing these benchmarks, it's great to see these comparisons made. I was wondering about the impact of fastmath, this seems to be enabled here for Fortran: https://github.com/paugier/nbabel/blob/e68441a717bd984f712938299b092d9f63431272/fortran/Makefile#L11 and here for C++: https://github.com/paugier/nbabel/blob/e68441a717bd984f712938299b092d9f63431272/cpp/Makefile#L17 and transonic/pythran here: https://github.com/paugier/nbabel/blob/e68441a717bd984f712938299b092d9f63431272/py/Makefile#L30

Does removing this flag from the above, or indeed adding it to Julia, Rust and Numba change the results?

stuartarchibald avatar Jan 06 '21 11:01 stuartarchibald

Thanks for the interest and the remark. Indeed fastmath has an effect. I added it for Numba in https://github.com/paugier/nbabel/commit/bfe5e3a077acf91a6e42f8b6dffa8c4d0ea0598f

paugier avatar Jan 06 '21 13:01 paugier

Beware that fastmath doesn't guarantee IEEE compliance and may impact the numerical quality of the results. I would advise not to use it.

jfalcou avatar Jun 03 '21 15:06 jfalcou

fastmath was used when possible for the different implementations. So it's kind of fair. We could also choose to disable it for all implementations.

paugier avatar Jun 04 '21 13:06 paugier