-
Notifications
You must be signed in to change notification settings - Fork 16
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
Using optimistix to solve optimization problems in parallel? #106
Comments
I think you should be able to do this by using the existing Optimistix optimizers (no needed to define a new If you wanted to do this in a step-by-step fashion like you Optax example then see interactively step through a solve. The more common Optimistix APIs are to use In your example above, note that it might be simpler to apply a single |
Ah okay thank you for the insight—I had been reading through this example of the advanced API, but I assumed there would be an issue with the fact that each optimization is evaluating its own termination condition. Using the optimistix.minimise API would be ideal, but I did not realize it could be vmapped for this reason. lmagining modifying the “interactively step through a solve”, I would think this requires making a call to something like a vmapped “step” and “terminate” with a while loop termination when all problems have converged. Along this reasoning, some problems will have already converged in a given call to the vmapped “step” and “terminate”. Out of curiosity, how will this behave under the hood? I am also wondering what should I consider when evaluating GPU performance of a vmap like this. |
The overall computational cost will be The reason for this is that under the hood, batch-of-loop is transformed into loop-of-batch, with any already-terminated batch elements running an iteration whose output is then ignored. The loop terminates when all batch elements have terminated. The reason for this is in part driven by GPU concerns: the above is a SIMD-friendly way of expressing batches of loops. FWIW all of the above is just the normal behaviour of |
Okay this really clears things up! Thanks so much, this was puzzling me. I had not thought through this in context of the general behavior of |
Hello! I would like to integrate
optimistix
into my work, but I would appreciate some insight from others more experienced in the package because I believe my problem will require usage of a more advanced API. The defining feature of my problem is that I have many independent similar optimization problems (~ 100) to solve in parallel. I am currently addressing this by usingoptax
and vmapping over both my loss function evaluations and my parameter updates. Pseudocode for this is the following:I am wondering if a similar approach is possible in
optimistix
. From reading through the documentation, it seems to me that I could directly work withAbstractDescent
andAbstractSearch
objects to step through a similar loop, but perhaps it won't be possible to use theAbstractMinimiser
API. I am also interested to hear if there are other recommendations you may have.The text was updated successfully, but these errors were encountered: