Dask backend returns early if no workers allocated
See original GitHub issueIf the cluster has no workers, the dask backend returns immediately.
In [1]: from dask.distributed import Client, LocalCluster
In [2]: cluster = LocalCluster(n_workers=0)
In [3]: client = Client(cluster)
In [4]: import joblib
In [5]: with joblib.parallel_backend('dask'):
...: results = joblib.Parallel(verbose=100)(joblib.delayed(lambda x: x**2)(x) for x in range(10))
...:
[Parallel(n_jobs=-1)]: Using backend DaskDistributedBackend with 0 concurrent workers.
[Parallel(n_jobs=-1)]: Done 0 out of 0 | elapsed: 0.0s finished
In [6]: import dask
In [7]: joblib.__version__
Out[7]: '0.13.0'
In [8]: dask.__version__
Out[8]: '1.0.0'
In this case the backend should probably hang until a worker is added, or error immediately. This is complicated since the number of workers could change dynamically during computation. I’m not sure what’s best here.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
No workers info available after scale() with SLURMCluster #376
I have a very similar issue with #246. After I create the cluster and scale it the nodes are running but no CPUs...
Read more >API — Dask.distributed 2022.12.1 documentation
Reset local state. Optionally wait for workers to return. Workers without nannies are shut down, hoping an external deployment system will restart them....
Read more >Source code for distributed.scheduler - Dask documentation
Reset local state. Optionally wait for workers to return. Workers without nannies are shut down, hoping an external deployment system will restart them....
Read more >Source code for distributed.scheduler
Reset local state. Optionally wait for workers to return. Workers without nannies are shut down, hoping an external deployment system will restart them....
Read more >Worker — Dask.distributed 2022.12.1 documentation
It stores the results of these tasks locally and serves them to other workers or clients on demand. If the worker is asked...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just encountered this bug myself today on a script with dask-jobqueue…
Maybe erroring by default is a good idea but we should also have an option to be able to wait for the first worker to be provisioned.
For the record, this issue is now fixed in joblib 0.13.1.