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

Support for nested root finders #86

Closed
djbower opened this issue Oct 18, 2024 · 4 comments
Closed

Support for nested root finders #86

djbower opened this issue Oct 18, 2024 · 4 comments
Labels
question User queries

Comments

@djbower
Copy link

djbower commented Oct 18, 2024

I just wanted to confirm that Optimistix supports nested root finders? I'm getting a ValueError related to closure:

  def __call__(self, x):
>       return self.fn(x, self.args)
E       ValueError: Closure-converted function called with different dynamic arguments to the example arguments provided.

If so, I'll spend more time trying to figure out the problem.

@patrick-kidger
Copy link
Owner

Optimistix does support this! It looks like you're probably running into a known issue when using an old version of Equinox and a new version of JAX. Upgrading to the latest version of Equinox (by coincidence I've also just released v0.11.8, give it a try!) should probably resolve this.

@patrick-kidger patrick-kidger added the question User queries label Oct 18, 2024
@djbower
Copy link
Author

djbower commented Oct 18, 2024

Indeed it was an easy fix - I'm running with equinox 0.11.8 and Jax 0.4.33 and all works as expected now. Interestingly, with Jax 0.4.34 I ran into a different error.

@patrick-kidger
Copy link
Owner

For JAX 0.4.34 -- I've just ran into an issue here myself; possibly it's the same one! I've got a possible fix for Optimistix in #87 and for Lineax in patrick-kidger/lineax#111 .

(For reference, Optimistix depends on both Lineax and Equinox, which is why I'm mentioning them here.)

Can you give those a try and see if those fix things for you? If so, great, and I'll do a release! If not I'd love to have a MWE.

@djbower
Copy link
Author

djbower commented Dec 19, 2024

I've not ran into this problem since, so closing the issue with my current setup:

optimistix = "0.0.9"
jax = "0.4.38"
equinox = "0.11.10"

@djbower djbower closed this as completed Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question User queries
Projects
None yet
Development

No branches or pull requests

2 participants