question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dask backend returns early if no workers allocated

See original GitHub issue

If 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.

xref https://github.com/dask/dask-yarn/issues/46

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ogriselcommented, Jan 8, 2019

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.

0reactions
ogriselcommented, Jan 14, 2019

For the record, this issue is now fixed in joblib 0.13.1.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found