I have a strict dependency on optuna for my personal project. For that, I want to integrate optuna with [ray] - [tune] (another dependency).
However, due to define-by-run strategy of Optuna as opposed to define-and-run for [hyperopt] (and most of the other strategies), I am finding it difficult to integrate, since I cannot define search space separately.
If anyone could shed some light on this, it would be of great help.
This is great! Does anyone have a good idea as to how to do this?
There's two possible ways (and we could do both):
@sile are you involved with Optuna? what do you think?
Hi @richardliaw,
Thank you for sharing your ideas!
I'm a developer of Optuna and I think that it's great if Optuna and Ray will be integrated together.
The first way you wrote seems a straightforward way to achieve that.
The second way also sounds interesting but I cannot imagine the detail as I'm not familiar with Ray.
@g-votte If you have any comments, please let us know.
Ah, speaking of integration: Ray also has a joblib backend. Similar to what is proposed here (https://github.com/optuna/optuna/issues/1381), you can do:
from ray.util.joblib import register_ray
register_ray()
with joblib.parallel_backend('ray', n_jobs=n_jobs):
study.optimize(objective, n_trials=100, n_jobs=n_jobs)
which effectively allows optuna to scale across many machines and take advantage of Ray's distributed execution.
Great! Thank you for your information!
This is currently done in #10044.
Most helpful comment
This is currently done in #10044.