Skip to content

Should we default to multiple processes (rather than multiple threads)? #332

Closed

Description

@lesteve
from dask_jobqueue import SLURMCluster
cluster = SLURMCluster(cores=4, memory='16GB')
[line for line in cluster.job_script().splitlines() if 'dask_worker' in line]

Excerpt of the output:

python -m distributed.cli.dask_worker --nthreads 4 ...

So by default we use one dask worker with 4 threads. This does not seem ideal.
In a Python world (because of the GIL), using multi-processing by default for parallelism is more likely to increase performance.

Maybe we can use the same heuristic of processes vs threads as LocalCluster (distributed.deploy.local.nprocesses_nthreads):
https://github.com/dask/distributed/blob/ad0c7c23c384e981e0622c36e7fb132429becc34/distributed/deploy/local.py#L211
summary of the heuristic:

  • if cores <= 4, processes=cores, threads_per_process=1
  • if cores > 4, processes ~= sqrt(cores), threads_per_process ~= sqrt(cores) and processes > threads_per_process

Activity

  1. mrocklin commented on Aug 29, 2019

    @mrocklin
    Member

    That seems like a decent heuristic if processes=None

  2. added
    help wanted
    good first issue
    on Aug 29, 2019
  3. added this to the 0.7.1 milestone on Dec 1, 2019
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

    good first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions