Group tasks into partitions which all execute on the same worker #1559
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a very basic implementation of an idea that I think would be useful. I'm creating the PR to create discussion and decide whether it would be useful to take it further.
Worker restrictions on
Client.get
,Client.compute
,Client.persist
etc. are hard physical restrictions.It would be useful to allow some flexibility and instead group tasks together into a partition which all execute on the same worker. This would give the scheduler flexibility when choosing which worker to schedule the first task in the partition. Once the first task is scheduled, all tasks within that partition would then have to execute on that worker, ensuring data locality.
In the following pseudo-code for e.g. A, B and C each have four chunks of size 250.
When submitting the task graph representing D, it would be useful to assign the first chunk in each array to a partition, the second to another and so on, to ensure data locality.
At present, this is specified as another restriction in
Client.get
I would like to fold the
partitions
functionality intoworker_restrictions
but the worker/hostname handling is sticky and I didn't want to mess with it too much. Something likeworkers=['Alice', 'tcp://123.456.789.10.11.12:8080/', 'parta']
, whereparta
is treated as a partition if no matching worker name or host name is matched.I could also see this being renamed to
task_group
for e.g.I'd welcome your input on this -- I'd imagine integrating this with the rest of the scheduling functionality would be tricky.