Decrease default value to prevent overflow in 32-bit.#176
Decrease default value to prevent overflow in 32-bit.#176johannahaffner merged 10 commits intopatrick-kidger:devfrom
Conversation
|
Created a |
|
We're failing pre-commit checks due to a new version of pyright, I'll fix this when I have time. |
|
Should this be something like |
|
Sure, I can add a comment! A |
|
This one should be safe from JAX initialisation, I believe. :) |
|
Indeed it is. To address the pyright complaints, I've added ignore statements wherever I could not find an ergonomic way to use Regarding our |
|
We're getting the test failure reported here, which seems to be due to numerical bad luck: #172 |
|
...and another one in GMRES, although I don't see how that one could be due to the changes I made. |
cba733f to
4f6a054
Compare
|
@PTNobel could you take a look at this? We're getting test failures for LSMR from tests that involve the computation of a JVP. The generated matrices should have permissible condition numbers: we've previously set a cutoff for the condition number at Right now I'm decreasing condition numbers to see at which values these tests will pass, but that is a little empirical and unsatisfactory. Besides, if there is a numerical problem underneath this that we should catch, then this is maybe a good canary in the coal mine. |
|
Happy to look at it. It is Thanksgiving here in the US, so I'm a bit busy the next few days. Feel free to ping me if it haven't finished in a week. |
tests/helpers.py
Outdated
| elif isinstance(solver, lx.GMRES): | ||
| cond_cutoff = 900 | ||
| elif isinstance(solver, lx.LSMR): | ||
| cond_cutoff = 800 |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
|
@PTNobel here is the requested ping Hope you had a wonderful thanksgiving with your family! |
0aaa51f to
20ef068
Compare
|
The So everything is a bit heuristic here, and I only have some observations:
What I think is going on here is that some unlucky random streams cause things to fail here. Given that we do guard against high condition numbers, this is potentially a serious issue affecting the reliability of As a practical next step, I've reset |
|
I also note that the CI passed in #182. While the initialisation of the |
lineax/_solver/lsmr.py
Outdated
| if jnp.issubdtype(dtype, jnp.complexfloating): | ||
| real_dtype = jnp.finfo(dtype).dtype | ||
| else: | ||
| real_dtype = dtype |
There was a problem hiding this comment.
We have a complex_to_real_dtype function that can be used in place of this. (And I think the if statement here is unnecessary, the jnp.finfo trick should work for real dtypes too.)
|
Just crossed my mind - do you think |
|
Just noting that the last CI run actually passed :D |
Fixes #175 (comment).