Skip to content
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

float32 vs float64 difference issues #11

Open
JMGilbert opened this issue Aug 30, 2022 · 1 comment
Open

float32 vs float64 difference issues #11

JMGilbert opened this issue Aug 30, 2022 · 1 comment

Comments

@JMGilbert
Copy link
Contributor

This commit introduces a change that allows for consistent replication between machines, but changes the values of SCCs relative to their prior values. Without this chunk of code, different machines give different results for powers of coefficients, which leads to larger differences in SCCs. This may be related to the fact that np.longdouble returns np.float128 on one machine, and np.longdouble on another. Some kind of changes probably need to be considered to ensure that SCCs run consistently between machines and can be replicated from prior results.

@brews
Copy link
Member

brews commented Sep 10, 2022

Hey @JMGilbert. When you have a second, I was curious: In the change you're pointing to in 4adfb60, explicitly casting anomaly to np.float64 appears to solve the issue but do you know what dtype anomaly is when it's not float64 and creating problems?

Just feeling this out without making dramatic changes: An alternative might be to replace those key calls to np.power() with np.float_power() rather than explicitly casting anomaly to float64 at the top of the function. np.float_power() uses at least float64 for the calculation. In contrast, I think np.power() is going to use whatever dtype the first input is by default.

If I wanted to test to see if this or another solution works, what would I need to run? How to replicate the original problem you had? You had to test this on two different machines, as I recall...? This wasn't something that the tests in tests/ picked up on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants