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

Parallelization Depreceated #3220

Closed
ThomasWolf0701 opened this issue Jan 7, 2022 · 2 comments
Closed

Parallelization Depreceated #3220

ThomasWolf0701 opened this issue Jan 7, 2022 · 2 comments
Labels
question Question about Optuna.

Comments

@ThomasWolf0701
Copy link

ThomasWolf0701 commented Jan 7, 2022

As 2.7 seems to have deprecated n_jobs how to do parallelization now, what to do now ?

So far i have been using:

study = optuna.create_study(sampler=sampler,storage='sqlite:///example_loky.db')

with parallel_backend('loky'):
    study.optimize(cat_objective, n_trials=niter, n_jobs=njobs_optuna,gc_after_trial=True)

So far this worked well. The tutorial offers a new solution but this literally suggest to manually open multiple terminals.
This is not really feasible in an automized setting where everything is handled from within Python. Also there are multiple preprocessing steps also in the scripts not just model training.

Would it be possible to choose a process based backend for paralellization ?
From my understanding loky uses forking on Linux instead of thread based paralleization ?

I´ve been using mlr3 in R so far and parallelization was pretty easy without setting up a database or starting multiple terminals. Even for bayesian optimization. While Optuna is really amazing, parallelization seem overly complicated and changing all the time.

@ThomasWolf0701 ThomasWolf0701 added the question Question about Optuna. label Jan 7, 2022
@nzw0301
Copy link
Member

nzw0301 commented Jan 7, 2022

As in #2937, Optuna plans to re-introduce the n_jobs option: undo the deprecation of n_jobs. So you can use this as the latest stable optuna.

@nzw0301
Copy link
Member

nzw0301 commented Jan 8, 2022

I suppose the issue creator looks happy with my answer, so let me close this issue. Please feel free to re-open if you ask the further question on n_jobs.

@nzw0301 nzw0301 closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about Optuna.
Projects
None yet
Development

No branches or pull requests

2 participants