JuliaParallel / JuliaParallel/Dagger.jl
[RFC] Refactor scheduler to make it easy to modify by end-user code
- Dominant language
- Julia
- Stars
- 723
- Forks
- 90
- Avg merge
- 1d 37m
- Merged PRs (30d)
- 9
Description
The Dagger scheduler is (internally) a bit of a mess, with limited documentation and a lot of inter-dependent states which can break easily when modified. In order to support dynamic user-defined load balancing, dynamic DAG modification, GPU scheduling, and other features which touch core parts of the scheduler machinery, we should consider exposing more of the scheduler's decisions to the user while at the same time providing a semi-internal API which can be used to modify the scheduler's internal state without having to understand how everything fits together. In my opinion, the following things need to change in order for Dagger to support this:
- Callbacks at scheduler decision points
- Scheduler API to safely manipulate an active DAG (see below)
- Add field to `Thunk` that users can modify and query at runtime (for arbitrary data, such as location information (GPU device, coordinate in user-specified grid, etc.))
Examples of scheduler API functions might include:
- `append_thunk` - Appends a new `Thunk` to the DAG with provided inputs
- `replace_thunk` - Replace an existing `Thunk` with a new one, only valid if the `Thunk` has not executed yet
- `delete_thunk` - Deletes an existing `Thunk` from the DAG (including all dependent children), only valid if the `Thunk` has not executed yet
- `get_root`/`get_children`/`get_parents`/etc. - Queries the DAG
- `copy_dag` - Copy a DAG (potentially a subset of the whole graph) and make it ready for execution
- `spawn_scheduler` - Spawn a new scheduler, potentially fully independent of the current one, and have it execute a given DAG
Of course, one can argue that you can always replace the entire scheduler via the plugin mechanism, however that's a very crude way to achieve the above goals. I think the above items would allow Dagger to evolve into more roles than it can currently fulfil, and also make it easy to refactor much of the core logic into a simpler, more readable form.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.