You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SLURM cluster running only one worker when resources specified #304
I believe I have the same issue with resources as #230. My goal is to run several jobs; each one requires a GPU and should be placed on a separate worker.
This starts running and makes 4 workers on different slurm instances, which is all great. However, like the issue, only one of them actually ends up running, with the others just idling. I wonder if the resources aren't specified per worker, but only one of them gets them, or something?
I tried the workaround suggested in #230, specifying cores=1, but while that works, in my case it does actually seem to use only one core, which makes my code run much more slowly.
However, like the issue, only one of them actually ends up running, with the others just idling
What do you mean by idling? How many jobs do you see with sstat? What do you see when you look at your cluster object for example print(cluster) or cluster + Shift-Enter inside a notebook.
I wonder if the resources aren't specified per worker, but only one of them gets them, or something?
The resources are specified by dask worker. IIRC when you use cores=8, processes=1 and do cluster.scale(1) you have one dask worker with 8 threads. If you use cores=4, processes=2 and do cluster.scale(2) you have 2 dask workers with 4 threads each. One way to look at the number of dask workers you have with len(client.scheduler_info()['workers']) (it may be in the cluster widget inside a notebook too, not sure).
Note that if you have one GPU resource per worker as you do and you use .submit specifying the resource {'GPU': 1}, that means that only one task can run in parallel on this worker. If you do not specify resource in .submit, you can run 8 tasks in parallel.
The distributed resource doc is here. If you see a way to improve the doc there or the doc in dask-jobqueue, let us know!
#230 was in the end a problem when using resources with adaptive scaling. You don't seem to be using adaptive mode.
I'll recommand to use scale instead of start_worker, but mainly to make sure all the workers are started before submitting the tasks. Job stealing with resources doesn't seem to work well, so the first worker to start may be assigned all the tasks before others are set up. You can use client.wait_for_workers to do this.
Activity
lesteve commentedon Jul 30, 2019
Thanks a lot for creating a new issue!
What do you mean by idling? How many jobs do you see with
sstat? What do you see when you look at your cluster object for exampleprint(cluster)orcluster+ Shift-Enter inside a notebook.The resources are specified by dask worker. IIRC when you use
cores=8,processes=1and docluster.scale(1)you have one dask worker with 8 threads. If you usecores=4,processes=2and docluster.scale(2)you have 2 dask workers with 4 threads each. One way to look at the number of dask workers you have withlen(client.scheduler_info()['workers'])(it may be in theclusterwidget inside a notebook too, not sure).Note that if you have one GPU resource per worker as you do and you use
.submitspecifying the resource{'GPU': 1}, that means that only one task can run in parallel on this worker. If you do not specify resource in.submit, you can run 8 tasks in parallel.The
distributedresource doc is here. If you see a way to improve the doc there or the doc in dask-jobqueue, let us know!guillaumeeb commentedon Jul 30, 2019
Hi,
#230 was in the end a problem when using resources with adaptive scaling. You don't seem to be using adaptive mode.
I'll recommand to use
scaleinstead ofstart_worker, but mainly to make sure all the workers are started before submitting the tasks. Job stealing with resources doesn't seem to work well, so the first worker to start may be assigned all the tasks before others are set up. You can useclient.wait_for_workersto do this.guillaumeeb commentedon Feb 1, 2020
Closing this one as stale. @martiningram feel free to reopen if you still have problems.