Skip to content

Remove --nprocs keyword from dask-worker command? #2471

Closed

Description

@mrocklin

This ends up causing confusion and isn't best practice in production. I wonder if we should start to deprecate this keyword argument instead.

cc @lesteve @guillaumeeb @jcrist @jacobtomlinson

Activity

  1. lesteve commented on Jan 21, 2019

    @lesteve
    Member

    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.

  2. mrocklin commented on Jan 21, 2019

    @mrocklin
    MemberAuthor

    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

  3. guillaumeeb commented on Jan 21, 2019

    @guillaumeeb
    Member

    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!

    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.

  4. jhamman commented on Jan 21, 2019

    @jhamman
    Member

    What is a dask-worker?

    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.

  5. dhirschfeld commented on Jan 22, 2019

    @dhirschfeld
    Contributor

    I've always found the nprocs argument a bit ambiguous and have avoided using it in favour of simply running the dask-worker command multiple times.

    In particular, it doesn't seem to compose well with other arguments such as specifying ports - e.g. #899

  6. guillaumeeb commented on Jan 23, 2019

    @guillaumeeb
    Member

    I like @jhamman's idea to change nprocs name!

  7. added
    documentation
    good first issue
    on Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions