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

[executor] Introduce on-the-fly scheduling for Read/Allocate/Write keys #814

Merged
merged 52 commits into from
Apr 17, 2024

Conversation

wlawt
Copy link
Contributor

@wlawt wlawt commented Apr 3, 2024

Closes #701, #709 .

Overview

The executor keeps track of a dependency graph to determine if a task is executable or not.

Properties of the dependency graph:

  • There is a graph for every key.
  • The nodes in the graph represent the task and the type of access its requesting for that key (Read/Allocate/Write).
  • Generally, nodes in the graph are Write keys. Unless, if, it's the first node in the graph (i.e., the graph was empty), and it is a Read access, then it is also a node.
  • An edge is formed between Write-Write, Read-Write, or Write-Read nodes.
  • An edge is formed to the same node (self-edge) every time a Read is requested

Test Plan

  • Added unit tests in executor_test.go, coverage is ~97.5%
  • Existing unit tests in executor_test.go pass
  • Integration tests pass
  • CI (with load & sync testing)

@wlawt wlawt changed the title Scheduler v3 [executor] on-the-fly scheduling for read/allocate/write keys Apr 3, 2024
@wlawt wlawt force-pushed the scheduler-v3 branch 3 times, most recently from a6d133a to 37f4d5f Compare April 4, 2024 14:48
@wlawt wlawt self-assigned this Apr 4, 2024
executor/executor.go Outdated Show resolved Hide resolved
executor/executor.go Outdated Show resolved Hide resolved
executor/executor.go Outdated Show resolved Hide resolved
executor/executor_test.go Outdated Show resolved Hide resolved
* random perm per conflict key

* fix dont block on ourself and edit TestTwoConflictKeys to track this

* keep reading/readers relationship

* make reading a map

* comments

* clarify use of map for reading

* simplify rng for conflict and unique perm
// maxDependencies must be greater than the maximum number of dependencies
// any single task could have. This is used to ensure a dependent task
// does not begin executing a task until all dependencies have been enqueued.
const maxDependencies = 100_000_000
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the last tweak we should make is to make this a param you provide in New. I think this const is "jank".

@wlawt wlawt changed the title [executor] on-the-fly scheduling for read/allocate/write keys [executor] Introduce on-the-fly scheduling for read/allocate/write keys Apr 17, 2024
@wlawt wlawt changed the title [executor] Introduce on-the-fly scheduling for read/allocate/write keys [executor] Introduce on-the-fly scheduling for Read/Allocate/Write keys Apr 17, 2024
// It is assumed that no single task has more than [maxDependencies]. If
// this invariant is violated, some tasks will never execute and this code
// could deadlock.
// It is assumed that no single task has more than [maxDependencies].
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment should be above New imo.

@patrick-ogrady patrick-ogrady enabled auto-merge (squash) April 17, 2024 17:44
@patrick-ogrady patrick-ogrady merged commit 203e78b into main Apr 17, 2024
25 checks passed
@patrick-ogrady patrick-ogrady deleted the scheduler-v3 branch April 17, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[executor] parallelizing reads in the execution engine
2 participants