Skip to content

Add worker_key parameter to Adaptive#1992

Merged
mrocklin merged 1 commit into
dask:masterfrom
mrocklin:adaptive-key
May 30, 2018
Merged

Add worker_key parameter to Adaptive#1992
mrocklin merged 1 commit into
dask:masterfrom
mrocklin:adaptive-key

Conversation

@mrocklin

Copy link
Copy Markdown
Member

This allows adaptive clusters to intelligently close down groups of
workers based on some logical association.

See dask/dask-jobqueue#63 for motivation

cc @jhamman

This allows adaptive clusters to intelligently close down groups of
workers based on some logical association.

See dask/dask-jobqueue#63 for motivation
@mrocklin

Copy link
Copy Markdown
Member Author

@jhamman any luck with this? My current plan is to wait on you to try things. No rush, I just wanted to make sure that you weren't waiting on me to merge this.

@jhamman

jhamman commented May 23, 2018

Copy link
Copy Markdown
Member

@mrocklin - So far so good. I'm testing this branch along with my mods in dask/dask-jobqueue#63 and things are working much better. I'll give this PR a quick review now.

@jhamman jhamman 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.

This all seems to work much better so apart from a few questions, I'm happy to see these changes.

if workers is None:
workers = self.workers_to_close()
workers = self.workers_to_close(key=self.worker_key,
minimum=self.minimum)

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.

what is the logic for passing in minimum here? Should you also pass in maximum?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Minimum here corresponds to the minimum number of workers that we want to keep. The workers_to_close function is a slightly nicer place to handle this than outside. For example if workers_to_close tells us that we need to close all of our workers, we then look at minimum and see that we need one, which worker should we keep? Also, which other workers should we keep that are in the same group. Suddenly we have to replicate the grouping logic.

Maximum doesn't make sense because we're only reducing the number of workers, not increasing them.

future)
return future
else:
return sync(self.loop, func, *args, **kwargs)

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.

Is this related to the grouped worker issue? (I'm not following)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Something was slightly nicer if we switched to using self.sync here (this is a common pattern in the client). I decided to clean this up as part of this PR.

@jhamman

jhamman commented May 23, 2018

Copy link
Copy Markdown
Member

I just wanted to make sure that you weren't waiting on me to merge this

My thought is that we can wait on merging this until we have a strong reason to do so (either dask/dask-jobqueue#63 or pressure from somewhere else). I imagine its quite possible that we'll iterate a bit more here before I'm done with dask/dask-jobqueue#63 .

@jhamman

jhamman commented May 30, 2018

Copy link
Copy Markdown
Member

@mrocklin - save my few questions above, this seems to working and I'd like to see it merged in the next few days. Currently, this is blocking dask/dask-jobqueue#63.

@mrocklin

Copy link
Copy Markdown
Member Author

I'm fine to merge this any time. I'll give you a chance to respond to recent commentary but I'll merge after you give the go-ahead.

@jhamman

jhamman commented May 30, 2018

Copy link
Copy Markdown
Member

Thanks @mrocklin - go ahead and merge whenever now.

@mrocklin mrocklin merged commit 828ebf1 into dask:master May 30, 2018
@mrocklin mrocklin deleted the adaptive-key branch May 30, 2018 17:35
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.

2 participants