-
Notifications
You must be signed in to change notification settings - Fork 635
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
Disable delta computation on code block node #7282
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
This PR disables delta computation on code block node.
Delta computation
Delta computation is a VM feature which takes a series of AST nodes compiled by a Dynamo UI node in an execution session, and computes delta AST nodes of these nodes and cached nodes that it executes in last session, and only executes delta nodes.
For example, the VM initially runs a code block node:
Then this code block node is modified to
Though this code block node sends all AST nodes to the VM, the VM will do delta computation and only executes
b = 3;
. The value ofc
will be updated.Issues
Though delta computation looks avoids to do unnecessary computation, it fails in some cases. The fundamental issue is delta computation is temporal : it depends on both the last and current states; whereas the whole graph execution is not temporal: the output of the graph should is determined by current state without referring to the previous state.
Here we show three failure cases.
Case 1: Self modification
Code block node below is modified from state 1 to state 2. Delta AST nodes of these two states will be
a[1] = "foo"
. But after execution the value ofa
will be{"foo", "foo", 3}
, instead of being{1, "foo", 3}
.Case 2: Multiple assignment to a variable
Code block node below is modified from state 1 to state 2. Delta AST nodes are empty, so the value
a
will still be2
instead of being1
.Case 3: Change order
Code block node below is modified from state 1 to state 2. Delta AST nodes are empty, so the value
a
will still be2
instead of being1
.To make delta computation work correctly, the VM should be able to undo changes. E.g., undoing
a = 2
in case 3 and including this undo operation in delta AST nodes, but it is impossible in current VM implementation, not to mention if some execution incur side-effects on external world (like deleting a file).In all, delta computation on code block node should be disabled. In the long term, we might disable delta computation completely.
Note disabling delta computation doesn't fix all issues. It could still fail at the following case where change comes from other node:
In this case we have to do force re-execution of code block node if any upstream node is modified.
Declarations
Check these if you believe they are true
*.resx
filesFYIs
@monikaprabhu @riteshchandawar @Benglin @sharadkjaiswal @aparajit-pratap