Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduling using stateless co-groups algorithm #7394

Closed
wants to merge 20 commits into from

Conversation

gjoseph92
Copy link
Collaborator

@gjoseph92 gjoseph92 commented Dec 13, 2022

This is a rough/minimal implementation of using the stateless co-assignment algorithm in dask/dask#9755 for scheduling while queuing is active, for evaluating #7298 (see that issue for more general takeaways and discussion).

One nice thing here is a (nearly) static definition of is_rootish. At least, it no longer depends on cluster size or task group size.

To preserve co-assignment, we submit all root-ish tasks in a co-group to worker at once, even if it means oversaturating the worker. Unfortunately, this means that the tendency of the algorithm to make too large of groups can cause us to assign far too many tasks at once, causing root task oversaturation. To avoid this, we try to ignore cogroups that look "too big" by a very rough heuristic. Of course, that also means we lose co-assignment for those groups.

Another issue was how the algorithm likes to co-group tasks like split-shuffle or rechunk-split—the opposite of what we'd want, since it's critical to run those on the same worker as the input task, and not transfer the large input.

Grouping of a task-based shuffle

mydask

We work around that with a little hack in is_rootish that skips tasks with dependencies that aren't tiny.

Overall

If the cogroup algorithm were more predictable and could guarantee it wouldn't make too large of groups, this would be pretty reasonable and not too invasive to add.

Opening this as a PR just for posterity and future reference; not planning to merge (and please don't review).

obviously profoundly slow; want to figure out what logic works before we think about what to pre-compute.

note that I doubt this works at all without being able to oversaturate workers with a family. otherwise, with single-threaded workers, we'll just keep jumping along to a new worker for every task.
this probably isn't quite the right way to do it; only works if root tasks really are in priority order (which I guess they are??)?
hoping this makes `getitem`s in `test_anom_mean` not be queued anymore? (not actually sure if it matter that they were queued though, fwiw)
need to figure out good strategies/helpers for assertions. currently not trying to abstract too much before we know what we need. would like tests to be relatively flexible / insensitive to changes in cogrouping behavior. just assert no transfers and even load. (even load is harder; haven't figured that out yet.)
adding replicas doesn't transition state, of course.
`_remove_key` could take a ton of time. list wasn't necessary; we weren't using ordering for anything.
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.

1 participant