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

Re-order execution plan to enable more operations to run in-place #405

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

robertknight
Copy link
Owner

@robertknight robertknight commented Nov 12, 2024

After creating the initial execution plan by traversing the graph backwards from the requested outputs, re-order it by traversing the plan forwards and choosing a preferred operator to run from the frontier of runnable operators at each step. The initial logic for picking the next operator is to choose the first non-in-place operator if there is one (eg. Shape) or the first operator otherwise.

This re-ordering increases the likelihood that an operator which can run in-place is able to do so, because its in-place input is less likely to be required by a non in-place op that runs later.

Fixes #98.
See also #399 (comment).

After creating the initial execution plan by traversing the graph backwards from
the requested outputs, re-order it by traversing the plan forwards and choosing
a preferred operator to run from the frontier of runnable operators at each
step. The initial logic for picking the next operator is to choose the first
non-in-place operator if there is one (eg. Shape) or the first operator
otherwise.

This re-ordering increases the likelihood that an operator which can run
in-place is able to do so, because its in-place input is less likely to be
required by a non in-place op that runs later.

Fixes #98
See also #399 (comment).
@robertknight robertknight marked this pull request as ready for review November 13, 2024 08:49
@robertknight robertknight merged commit 24da48c into main Nov 13, 2024
2 checks passed
@robertknight robertknight deleted the sort-plan branch November 13, 2024 08:49
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.

Make execution planner smarter to enable running more operators in-place
1 participant