-
Notifications
You must be signed in to change notification settings - Fork 21
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
solve_for_H
in CarbonChemistry
throws GPU exceptions
#228
Comments
I tried to reproduce this on CPU and didn't get an error for ~100million iterations, is that consistent with what you've seen? It's strange that it's erroring when checking that the initial guesses are bracketing but only on GPU since it shouldn't be doing anything different.
Maybe the problem with a super wide range is that if the residual it solves for is not monotonic, then the wide initial guesses might not be bracketing. I went Bisection because the solve failed to converge when it was using some initial value method, but maybe it would be better to find an initial value method that we can impose bounds on, and then start it from e.g. pH = 7. |
I think I went up to ~50 million iterations and also couldn't get an error. I wonder if it's just a GPU thing, but I'll also try narrowing the pH range and seeing if that helps. |
Narrowing the pH range did not help and doing more investigating I realized I actually had NaNs in the simulation 🤦 I guess Sorry for the false alarm. Will close this issue as resolved! |
I noticed that a few Oceananigans + LOBSTER simulations crashed due to some GPU exception. Re-running Julia with the
-g2
flag produced a stack trace pointing to thesolve_for_H
function as being the source of the GPU exception. I'm guessing the root solver could not converge for some reason?It happens after hundreds of thousands of Oceananigans iterations, so I'm not sure if it's just bad numbers going in. I tried reproducing by calling
CarbonChemistry()
directly with random numbers but so far I have not been able to reproduce.Was wondering if anyone has encountered a similar issue.
The only thing I could see is that the upper and lower pH bounds for the solve are super wide (0 <= pH <= 14). Not sure if this could be contributing, but would it make sense to narrow the range to more reasonable values, say 6-12?
https://github.com/OceanBioME/OceanBioME.jl/blob/main/src/Models/CarbonChemistry/carbon_chemistry.jl#L133-L134
Here's the GPU exception stack trace:
The text was updated successfully, but these errors were encountered: