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

Upgrading Optuna from v2.x.x to v3.0.0 #2162

Open
himkt opened this issue Apr 20, 2022 · 11 comments · May be fixed by #2360
Open

Upgrading Optuna from v2.x.x to v3.0.0 #2162

himkt opened this issue Apr 20, 2022 · 11 comments · May be fixed by #2360
Labels

Comments

@himkt
Copy link
Contributor

himkt commented Apr 20, 2022

Sorry but it is not a feature request.

Related: optuna/optuna#2941

Summary

Thank you for integrating Optuna, hyperparameter optimization library. We, Optuna dev-team, are working on the next major version of the library Optuna v3. In Optuna v3, we will deprecate distributions used in:

from optuna.distributions import (
BaseDistribution,
CategoricalChoiceType,
CategoricalDistribution,
DiscreteUniformDistribution,
IntLogUniformDistribution,
IntUniformDistribution,
LogUniformDistribution,
UniformDistribution,
)

We will introduce FloatDistribution and IntDistribution. So distributions in hydra_optuna_sweeper will have to be updated:

  • UniformDistribution(low, high) => FloatDistribution(low, high)
  • DiscreteUniformDistribution(low, high, q) => FloatDistribution(low, high, step)
  • LogUniformDistribution(low, high) => FloatDistribution(low, high, log=True)
  • IntUniformDistribution(low, high) => IntDistribution(low, high)
  • IntUniformDistribution(low, high, step) => IntDistribution(low, high, step)
  • IntLogUniformDistribution(low, high) => IntDistribution(low, high, log=True)

Now hydra optuna plugin installs the latest Optuna. Users will see the deprecation warnings in the Optuna v3 release. #2163 restricts the constraint to avoid such warnings. Note that it doesn't mean Optuna v3 is imcompatible with Optuna v2. It only shows warnings and deprecated distributions are internally converted to appropriate distributions.

root@b9ffe3ebef50:/work/plugins/hydra_optuna_sweeper# python example/sphere.py --multirun
/work/plugins/hydra_optuna_sweeper/hydra_plugins/hydra_optuna_sweeper/_impl.py:109: FutureWarning: DiscreteUniformDistribution has been deprecated in v3.0.0. This feature will be removed in v6.0.0. See https://github.com/optuna/optuna/releases/tag/v3.0.0. Use :class:`~optuna.distributions.FloatDistribution` instead.
  return DiscreteUniformDistribution(value.start, value.stop, value.step)
[I 2022-04-20 06:13:41,041] A new study created in memory with name: sphere
[2022-04-20 06:13:41,042][HYDRA] Study name: sphere
[2022-04-20 06:13:41,043][HYDRA] Storage: None
[2022-04-20 06:13:41,043][HYDRA] Sampler: TPESampler
[2022-04-20 06:13:41,043][HYDRA] Directions: ['minimize']

Motivation

I open this issue to let hydra developers know about our next major release.
And also, I will open a PR to add a version constraint to avoid installing Optuna v3.

We will back here when the release is available.

If you have some concerns or questions, please feel free to contact Optuna dev-team.
🔗 optuna/optuna#2941

Additional context

Add any other context or screenshots about the feature request here.

@himkt himkt added the enhancement Enhanvement request label Apr 20, 2022
@Jasha10 Jasha10 added optuna sweep blocked Can't make progress labels Apr 20, 2022
@Jasha10
Copy link
Collaborator

Jasha10 commented Apr 20, 2022

Thanks @himkt! I'm labeling this issue as "blocked" until Optuna 3.0 is released.

@keisuke-umezawa keisuke-umezawa linked a pull request Aug 29, 2022 that will close this issue
@Jasha10 Jasha10 removed the blocked Can't make progress label Oct 24, 2022
@atgilles
Copy link

Any update on this request, as optuna v3 has been released?

@himkt
Copy link
Contributor Author

himkt commented May 24, 2023

So sorry for that, and thank you for reminding. We will proceed that.

@atgilles
Copy link

Thank you

@himkt
Copy link
Contributor Author

himkt commented May 25, 2023

I just asked @keisuke-umezawa to get #2360 back to active.

@ridvan-eksi
Copy link

Optuna is now at version 3.6.1, but optuna_sweeper dependency is still at 2.10.0. Is there any plan to update this requirement?

@odelalleau
Copy link
Collaborator

Optuna is now at version 3.6.1, but optuna_sweeper dependency is still at 2.10.0. Is there any plan to update this requirement?

I'm afraid some third-party plugins like this one currently lack proper support -- ideally someone who uses it would need to step up and help maintain it.

@ridvan-eksi
Copy link

I would be happy to make the changes mentioned in this issue. To start with, current latest version of Optuna is fully compatible with Optuna 2.10.x, which means Optuna dependency in this plugin can safely be updated to the 3.x without any change to the current plugin code. Would that be okay?

@odelalleau
Copy link
Collaborator

I would be happy to make the changes mentioned in this issue. To start with, current latest version of Optuna is fully compatible with Optuna 2.10.x, which means Optuna dependency in this plugin can safely be updated to the 3.x without any change to the current plugin code. Would that be okay?

Yes! We need someone to confirm it works though (I'm not sure to which extent CI covers this plugin well enough)

@ridvan-eksi
Copy link

I am actively using the latest version of Optuna with this plugin, and it works perfectly. It does have the deprecation warnings about some distributions which will need to be updated in the plugin, but it's not a blocker.

@himkt
Copy link
Contributor Author

himkt commented Apr 20, 2024

I'm so sorry @odelalleau @ridvan-eksi (thank you so much @ridvan-eksi for raising your hand to help Optuna plugin dev 🙇). I'm got back online here, please let me know if I can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants