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
Remove --nprocs keyword from dask-worker command? #2471
This ends up causing confusion and isn't best practice in production
Can you elaborate why it is not good practice and the problems this can cause? Also what would be the proposed replacement?
As far as dask-jobqueue is concerned, nprocs seems useful in the sense that it allows to put multiple workers in a single job. I don't have a precise exemple in mind, but sometimes you may want less jobs with more than one worker per job.
Can you elaborate why it is not good practice and the problems this can cause?
It's just confusing. There is a lot of ambiguous behavior like what you experienced with --resources. It's not clear how --nprocs interacts with other keywords.
Also what would be the proposed replacement?
Calling dask-worker many times
As far as dask-jobqueue is concerned, nprocs seems useful in the sense that it allows to put multiple workers in a single job. I don't have a precise exemple in mind, but sometimes you may want less jobs with more than one worker per job.
I wonder if we might be able to resolve this problem with shell scripting instead
I agree that --nprocs is confusing at first with --memory or --resources. However, I don't like the proposed replacements. This can surely be resolved in dask-jobqueue or other places with shell scripting, but I don't like that very much.
Definitly in a job queuing system, you often want less jobs with more resources!
Extrapolating from the docs a bit, a Worker is object that, executing from a single process, "contains a ThreadPool that it uses to evaluate tasks as requested by the scheduler".
So, I agree the --nprocs argument is confusing because a Worker doesn't use multiple processes. The help string on the cli does get it right though:
--nprocs INTEGER Number of worker processes to launch. Defaults to one.
I would argue that the command line argument is just poorly named but that the functionality is valuable. If we moved nprocs --> num_workers, I think this would clear up some of the confusion. We would just need to be sure to be clear, this argument is merely for convenience and is the equivalent to calling dask-worker${num_workers} times.
Furthermore, this would help define the behavior of the other arguments to the dask-worker cli as per worker process.
Activity
lesteve commentedon Jan 21, 2019
Can you elaborate why it is not good practice and the problems this can cause? Also what would be the proposed replacement?
As far as dask-jobqueue is concerned,
nprocsseems useful in the sense that it allows to put multiple workers in a single job. I don't have a precise exemple in mind, but sometimes you may want less jobs with more than one worker per job.mrocklin commentedon Jan 21, 2019
It's just confusing. There is a lot of ambiguous behavior like what you experienced with
--resources. It's not clear how--nprocsinteracts with other keywords.Calling
dask-workermany timesI wonder if we might be able to resolve this problem with shell scripting instead
guillaumeeb commentedon Jan 21, 2019
I agree that
--nprocsis confusing at first with--memoryor--resources. However, I don't like the proposed replacements. This can surely be resolved in dask-jobqueue or other places with shell scripting, but I don't like that very much.Definitly in a job queuing system, you often want less jobs with more resources!
I would instead propose to clarify it in the docs, at least in the command help https://github.com/dask/distributed/blob/master/distributed/cli/dask_worker.py#L71.
jhamman commentedon Jan 21, 2019
What is a dask-worker?
Extrapolating from the docs a bit, a
Workeris object that, executing from a single process, "contains a ThreadPool that it uses to evaluate tasks as requested by the scheduler".So, I agree the
--nprocsargument is confusing because aWorkerdoesn't use multiple processes. The help string on the cli does get it right though:I would argue that the command line argument is just poorly named but that the functionality is valuable. If we moved
nprocs --> num_workers, I think this would clear up some of the confusion. We would just need to be sure to be clear, this argument is merely for convenience and is the equivalent to callingdask-worker${num_workers}times.Furthermore, this would help define the behavior of the other arguments to the dask-worker cli as per worker process.
dhirschfeld commentedon Jan 22, 2019
I've always found the
nprocsargument a bit ambiguous and have avoided using it in favour of simply running thedask-workercommand multiple times.In particular, it doesn't seem to compose well with other arguments such as specifying ports - e.g. #899
guillaumeeb commentedon Jan 23, 2019
I like @jhamman's idea to change
nprocsname!