Skip to content

Use a mix of processes and threads when processes is not specified - #375

Merged
lesteve merged 4 commits into
dask:masterfrom
lesteve:default-processes-as-local-cluster
Dec 6, 2019
Merged

lesteve merged 4 commits into
dask:masterfrom
lesteve:default-processes-as-local-cluster

Conversation

@lesteve

@lesteve lesteve commented Dec 2, 2019

Copy link
Copy Markdown
Member

Fixes #332, closes #334.

@lesteve
lesteve force-pushed the default-processes-as-local-cluster branch from cb3da6c to 377015d Compare December 2, 2019 06:42
@lesteve

lesteve commented Dec 2, 2019

Copy link
Copy Markdown
Member Author

@jennirinker I took over your PR #334, any comments let me know!

@guillaumeeb guillaumeeb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've nothing to say about the code, but I'm not sure I like this default heuristic... I prefer when things are explicit. Maybe at least add some documentation on this?

Anyway, if everybody think it's better this way, then go for it.

@lesteve

lesteve commented Dec 4, 2019

Copy link
Copy Markdown
Member Author

Good point, I will add some documentation in the docstring for the default value of processes.

I have to say I don't remember why/how the mix of processes/threads was chosen for LocalCluster but I trust there was a good reason behind it.

My main worry is that the default (when specifying only cores and not processes) is going to use only multithreading and will make dask-jobqueue look bad in most cases (Python functions which don't release the GIL).

@mrocklin

mrocklin commented Dec 4, 2019

Copy link
Copy Markdown
Member

The heuristic was intended to find a good balance between the two. My experience is that machines with 20+ cores don't get full parallelism with only threads, and that separating these into a few processes tends to help. It could be though that workloads that run on HPC centers tend to be more GIL friendly (more numpy, less text). I don't know though.

I've never really regretted having large nodes cut up into a few processes, so In general I'm mildly in favor of this change. I can understand not wanting it too though for explicitness.

@lesteve

lesteve commented Dec 6, 2019

Copy link
Copy Markdown
Member Author

I pushed an entry in changelog. I am going to merge this one.

@lesteve lesteve changed the title Use same heuristics as LocalCluster for repartition between processes and threads Use a mix of processes and threads when processes is not specified Dec 6, 2019
@lesteve
lesteve merged commit 7343632 into dask:master Dec 6, 2019
@lesteve
lesteve deleted the default-processes-as-local-cluster branch December 6, 2019 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants