-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make possible to not use fast math #29
Comments
Some quotes from: illwieckz dixit:
blaztinn dixit:
|
- Add USE_LTO to enable LTO, enabled by default. - Add USE_EXTRA_OPTIMIZATION to also enable -O3 when it is not used by default enabled by default. - Add USE_FAST_MATH, to produce reproducible CRN files this should be disabled, disabled by default. - Increase warning verbosity level. - Generate maximum amount of debug information, including macro definitions. - Always disable strict aliasing, the code requires it to always be disabled. Fixes #29
What kind of "reproducibility" are we talking about here?
It sounds like blaztinn had a very specific use case like "we want to hit the cache most of time when building with any of the 3 versions of the compiler devs in our shop have installed right now" which doesn't generalize to most users. |
I would prefer if doing the release packages from the same source produce the same packages, be it on Linux on amd64 or on macOS on arm64. |
Another good example of how fast math may produce different things while not being wrong: https://stackoverflow.com/questions/6430448/why-doesnt-gcc-optimize-aaaaaa-to-aaaaaa Q:
A:
It is probably not a big problem to disable fast math to produce a release build of packages, while enabling fast math to produce nightly builds of the same packages. |
In #51 I make the usage of fast math optional (and also make sure it is also used with MSVC when enabled, unlike before): Now another question is: should this option be enabled by default or not? Maybe enabling it by default is not bad, people with specific need of reproducibility would look at the available options anyway. |
- Add USE_LTO to enable LTO, enabled by default. - Add USE_EXTRA_OPTIMIZATION to also enable -O3 when it is not used by default enabled by default. - Add USE_FAST_MATH, to produce reproducible CRN files this should be disabled, enabled by default. - Increase warning verbosity level. - Generate maximum amount of debug information, including macro definitions. - Always disable strict aliasing, the code requires it to always be disabled. Fixes #29
Getting the same results on all systems with SSE instructions might be doable. The GCC default float handling, Visual Studio 2022+
Doesn't sound like a great idea to me. Tests with a testing build become less relevant the more differences there are from a release build. |
I made the Having the option makes possible for specific needs to disable that easily, while most people would just be happy to benefit from the fastest tool. |
- Add USE_LTO to enable LTO, enabled by default. - Add USE_EXTRA_OPTIMIZATION to also enable -O3 when it is not used by default enabled by default. - Add USE_FAST_MATH, to produce reproducible CRN files this should be disabled, enabled by default. - Increase warning verbosity level. - Generate maximum amount of debug information, including macro definitions. - Always disable strict aliasing, the code requires it to always be disabled. Fixes #29
- Add USE_LTO to enable LTO, enabled by default. - Add USE_EXTRA_OPTIMIZATION to also enable -O3 when it is not used by default enabled by default. - Add USE_FAST_MATH, to produce reproducible CRN files this should be disabled, enabled by default. - Increase warning verbosity level. - Generate maximum amount of debug information, including macro definitions. - Always disable strict aliasing, the code requires it to always be disabled. Fixes #29
- Add USE_LTO to enable LTO, enabled by default. - Add USE_EXTRA_OPTIMIZATION to also enable -O3 when it is not used by default enabled by default. - Add USE_FAST_MATH, to produce reproducible CRN files this should be disabled, enabled by default. - Increase warning verbosity level. - Generate maximum amount of debug information, including macro definitions. - Always disable strict aliasing, the code requires it to always be disabled. Fixes #29
- Add USE_LTO to enable LTO, enabled by default. - Add USE_EXTRA_OPTIMIZATION to also enable -O3 when it is not used by default enabled by default. - Add USE_FAST_MATH, to produce reproducible CRN files this should be disabled, enabled by default. - Increase warning verbosity level. - Generate maximum amount of debug information, including macro definitions. - Always disable strict aliasing, the code requires it to always be disabled. Fixes #29
See:
He said:
So we may want to disable fast-math, and maybe even pass -nofast-math to be 100% sure some environment variables doesn't introduce it again. The related patch only affects the legacy Makefile so someone has to implement it in CMake as well.
The text was updated successfully, but these errors were encountered: