Is ispc deterministic or is it possible to make it be?

77 views
Skip to first unread message

David Nadaski

unread,
Feb 26, 2020, 1:59:44 AM2/26/20
to Intel SPMD Program Compiler Users
I've seen a slide from SIGGRAPH 2019 whose page 45 says "to increase floating point precision/determinism, don't use --opt=fast-maths and do use --opt=disable-fma"
My question is if doing as the slides suggests makes programs compiled w/ ispc completely deterministic.

Dmitry Babokin

unread,
Feb 26, 2020, 2:08:53 AM2/26/20
to ispc-...@googlegroups.com
Non-determenism on this slide refers to allowing compiler to rearrange/reassociate/optimize floating point expression in the way that it may change numeric value of the result (but still being valid result in terms of satisfying the same mathematical formula in the source code).

Note, compiled binary will produce the same value. Different versions of compiler may produce binaries, which produce different numeric values (when --opt=fast-maths is used).

Dmitry.

On Tue, Feb 25, 2020 at 10:59 PM David Nadaski <da...@horugame.com> wrote:
I've seen a slide from SIGGRAPH 2019 whose page 45 says "to increase floating point precision/determinism, don't use --opt=fast-maths and do use --opt=disable-fma"
My question is if doing as the slides suggests makes programs compiled w/ ispc completely deterministic.

--
You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ispc-users/c4b16788-b476-4f9a-b22b-37d22997e839%40googlegroups.com.

David Nadaski

unread,
Feb 26, 2020, 2:14:34 AM2/26/20
to Intel SPMD Program Compiler Users
Thanks so much for the quick reply Dmitry.
So if I'm getting you right, with fast-maths off and disable-fma on, I can pretty much run any floating point calculations and the results are always guaranteed to be deterministic (the same), even across platforms/architectures/etc. as long as I'm using the same version of the compiler?
If so that would be fantastic.

David

Dmitry Babokin

unread,
Feb 26, 2020, 2:53:46 AM2/26/20
to ispc-...@googlegroups.com
We don't guarantee bit reproducibility for floating point results across platforms (especially across x86 / ARM) - we never specifically tested for that. But I would expect that in most of the cases the same results. If you find the case with different results, please report them, I would be interested to see them.

By the way, LLVM doesn't generally provide bit reproducibility for FP computations. But they are working on the mode, which would enable that. We are going to reuse it.

Dmitry

--
You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-users+...@googlegroups.com.

David Nadaski

unread,
Feb 26, 2020, 3:25:24 AM2/26/20
to Intel SPMD Program Compiler Users
Thank you - my primary target is Windows 10 x64 for now, so if I can get determinism between two computers running win10 that should be enough for my needs. I'll report back should the calculations diverge. Once again thanks for your help, I very much appreciate it.

David

On Wednesday, February 26, 2020 at 1:53:46 AM UTC-6, Dmitry Babokin wrote:
We don't guarantee bit reproducibility for floating point results across platforms (especially across x86 / ARM) - we never specifically tested for that. But I would expect that in most of the cases the same results. If you find the case with different results, please report them, I would be interested to see them.

By the way, LLVM doesn't generally provide bit reproducibility for FP computations. But they are working on the mode, which would enable that. We are going to reuse it.

Dmitry

On Tue, Feb 25, 2020 at 11:14 PM David Nadaski <da...@horugame.com> wrote:
Thanks so much for the quick reply Dmitry.
So if I'm getting you right, with fast-maths off and disable-fma on, I can pretty much run any floating point calculations and the results are always guaranteed to be deterministic (the same), even across platforms/architectures/etc. as long as I'm using the same version of the compiler?
If so that would be fantastic.

David

On Wednesday, February 26, 2020 at 12:59:44 AM UTC-6, David Nadaski wrote:
I've seen a slide from SIGGRAPH 2019 whose page 45 says "to increase floating point precision/determinism, don't use --opt=fast-maths and do use --opt=disable-fma"
My question is if doing as the slides suggests makes programs compiled w/ ispc completely deterministic.

--
You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages