-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Test failure on Windows #4623
Comments
This is a little strange given these tests pass in CI builds (unit tests are run for all builds). Looking at the test code the expected value should be NaN so not sure why it is -NaN in your build. Any chance something is redefining the NAN macro in your setup? onnxruntime/onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc Lines 294 to 298 in 222fd08
The Cast implementation uses std::stof in this case to convert the input so wouldn't be affected by the NAN macro
|
No I don't have any macro redefinition for Also I noticed there's nan-specific check.
|
Not sure why the nan-specific check isn't being satisfied. It is on my machine, and expected is actually
Are you able to step into that call in a debugger? On Windows 10 it is defined in corecrt_math.h so wondering if there's something different in your setup.
|
Maybe it is some strange compiler optimization? We do have extra /GL and /LTCG but I think the negative sign is already strange in the first place. |
Any chance you're using /fp:fast? https://docs.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior?view=vs-2019 |
I don't add that explicitly.
I can try adding an extra |
Same error when I append
|
I'm not sure why std::isnan is failing to return true. Both What happens if you build without any of the extra flags? |
So far:
Trying to remove |
Quote from the stackoverflow answer:
Love that. Seems people also found their msvc has negative NAN. |
Removing |
@skottmckay |
Multiple of our CI builds enable LTO (all the release package builds do) and we don't see any issues there. Given that, what would be actionable from an onnxruntime perspective? |
This is a strong (meaning I don't have other clue) indication about either msvc or ort was wrong.
We had trouble enabling ort's LTO flag due to conflict with protobuf used elsewhere in our system.
|
I was able to repro. You could try this change to workaround it: https://github.com/microsoft/onnxruntime/compare/skottmckay/WorkaroundLinkerBug Or alternatively just using |
Great! |
No - I looked at the generated assembly and tried a few things to make it behave. If you have time to create a minimal repro of the issue to file a VS bug please do. If the change works for you I'll create a PR for it. |
Will test and that you know. |
It fixes it on my machine, but as I don't know the internal details of what the LTCG issue is I don't know if re-ordering the std::isinf and std::isnan will fix it with all MSVC toolchains. As such, additional data points showing it works would be very helpful. |
Of course. Saying just because I'm working on tight schedule so maybe there are some delay. |
Works for me |
Describe the bug
System information
Screenshots
The text was updated successfully, but these errors were encountered: