The following joblib.Parallel arguments are currently provided as strings to joblib when they should be integers:
pre_dispatchbatch_sizemax_nbytes* Minimal Code/Config snippet to reproduce *
wget https://raw.githubusercontent.com/facebookresearch/hydra/master/examples/tutorials/basic/your_first_hydra_app/1_simple_cli/my_app.py
python my_app.py hydra.launcher.batch_size=1 hydra/launcher=joblib -m
* Stack trace/error message *
[2020-10-27 18:20:48,363][HYDRA] Joblib.Parallel(n_jobs=-1,backend=loky,prefer=processes,require=None,verbose=0,timeout=None,pre_dispatch=2*n_jobs,batch_size=1,temp_folder=None,max_nbytes=None,mmap_mode=r) is launching 1 jobs
[2020-10-27 18:20:48,363][HYDRA] Launching jobs, sweep output dir : multirun/2020-10-27/18-20-48
[2020-10-27 18:20:48,363][HYDRA] #0 :
Traceback (most recent call last):
File "/Users/odelalleau/src/hydra/hydra/_internal/utils.py", line 207, in run_and_report
return func()
File "/Users/odelalleau/src/hydra/hydra/_internal/utils.py", line 364, in <lambda>
lambda: hydra.multirun(
File "/Users/odelalleau/src/hydra/hydra/_internal/hydra.py", line 136, in multirun
return sweeper.sweep(arguments=task_overrides)
File "/Users/odelalleau/src/hydra/hydra/_internal/core_plugins/basic_sweeper.py", line 154, in sweep
results = self.launcher.launch(batch, initial_job_idx=initial_job_idx)
File "/Users/odelalleau/src/hydra/plugins/hydra_joblib_launcher/hydra_plugins/hydra_joblib_launcher/joblib_launcher.py", line 45, in launch
return _core.launch(
File "/Users/odelalleau/src/hydra/plugins/hydra_joblib_launcher/hydra_plugins/hydra_joblib_launcher/_core.py", line 89, in launch
runs = Parallel(**joblib_cfg)(
File "/Users/odelalleau/.local/lib/python3.8/site-packages/joblib/parallel.py", line 715, in __init__
raise ValueError(
ValueError: batch_size must be 'auto' or a positive integer, got: '1'
(with max_nbytes it also crashes due to the string issue, pre_dispatch actually runs but not sure what happens exactly since it's given as a string)
Running without error, providing appropriate integer arguments to joblib.Parallel when they should be integers (obviously there are situations where they should remain strings).
Thx for reporting @odelalleau. will take a look at this today or tomorrow.
@omry
Since struct config is not supporting Union types for now, and for several of the fields we need Union[str, int], is there any better alternative to just do Any for the fields?
I think string and manually convert to integer if it's a number before passing to joblib.
I think string and manually convert to integer if it's a number before passing to joblib.
sounds good. I will also update the documentation to make it more clear.
reopen, (it was auto-closed)
still need to
check plugin version before you bump it. I usually bump AFTER release.
check plugin version before you bump it. I usually bump AFTER release.
Thx!
Could you grant me permission to release joblib_launcher as well when you get a chance? (I don't think I have it)
fixed and released. Closing...
Most helpful comment
I think string and manually convert to integer if it's a number before passing to joblib.