optimas-org / optimas

Optimization at scale, powered by libEnsemble
https://optimas.readthedocs.io
Other
22 stars 13 forks source link

latest release pulls in ax 0.4 #208

Closed berceanu closed 3 months ago

berceanu commented 3 months ago

Latest stable release of optimas on PyPI (0.5.0 at the time of writing), has an ax dependency specified as ax-platform >= 0.3.4. Right now this pulls in ax 0.4, which doesn't work, on the fbpic example it gives:

ImportError: cannot import name 'manual_seed' from 'ax.service.ax_client' 

In order to avoid this in the future, perhaps the dependencies on ax-platform (and maybe libensemble as well) in pyproject.toml could be narrower, ie limited to 0.4.x instead of >= 0.4.0?

AngelFP commented 3 months ago

Hi @berceanu,

Good timing! We were just today preparing a new release (https://github.com/optimas-org/optimas/releases/tag/v0.6.0) that includes support for the latest Ax version (#206). You should already be able to get optimas v0.6.0 from PyPI.

berceanu commented 3 months ago

Good, now imagine the following scenario: some time from now, Ax releases a new version, which is no longer 100% compatible with optimas 0.6. It would take some time for a new optimas 0.7 release which will be compatible with this new version of Ax, and during this time the users that will install the latest stable optimas will not have a working version, because right now the dependency on Ax is specified as >= 0.4.0 and will always pull the latest.

Or am I missing something?

AngelFP commented 3 months ago

That's a general question about how to handle dependencies. Do you want to force a particular version, or allow a wider range? The first one gives you a certain peace of mind, but might easily lead to conflicts with other libraries in your environment if they require a different version.

So, I think that in principle we should be as flexible as possible, but all the last few releases of Ax have broken something in optimas (even the small releases like 0.3.5 or 0.3.7, so not even 0.3.x is safe!). Right now we can catch and fix this early because our tests run every day, but we could consider pinning a particlar version for each optimas release.

AngelFP commented 3 months ago

In any case, imagine that Ax 0.4.1 comes out and breaks something. Even though optimas would install it by default, you can still install 0.4.0 manually.

berceanu commented 3 months ago

Hi @AngelFP, thanks for the detailed reply, you made some very good points. I was not aware that even patch number Ax releases can still break things, I thought one could at least get away with pinning the minor release number, eg 0.3.x of Ax in each optimas release.

AngelFP commented 3 months ago

My hope is that this will get better in the future. In previous releases we were using some low-level functions from Ax that are probably not meant for everyone, and which were the reason behind some of these issues. We've been slowly moving away from that, so hopefully this will be more robust going forward.