-
Notifications
You must be signed in to change notification settings - Fork 75
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
TD3: optimize destabilization by aborting transfer function when unchanged #364
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
This collects the dependencies of a variable (opposite of infl).
When widen iteration ends, everything is unchanged, so would always abort. Instead we disable aborting then, to force narrowing to happen at least once.
… switch to Narrow is unsound
Merging into the branch |
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.
This is an attempt to optimize destabilization by making the resolving reluctant (not the destabilization).
The problem and intuition is that when something gets destabilized, the propagating changes might not change everything all the way to the end of the program (or a
called
variable). At some point the result might be unchanged, but the outersolve
call will still evaluate the transfer function once more to observe that each layer going up is unchanged. If all the inputs to the transfer function (computation tree) are unchanged, then this is unnecessary computation (the result will be the same as before).The trick is the following: if all dependencies (in
destab_dep
) of a variable are unchanged, then the lasteval
will raiseAbortEq
, which will be caught outside the transfer function. This is necessary because if something has changed, then the only way to know the new dependencies (which may be different) is to evaluate the black box of the transfer function.The functions
solve
,simple_solve
andeval
are changed to return a boolean indicating whether a change occurred or not.This is still not sufficient to behave correctly because a destabilized variable might be solved (and thus made stable again) before another influenced variable of it is solved again. Thus the changed value might incorrectly appear as unchanged.
To combat this problem, a front (in
destab_front
) of destabilized variables is tracked. Initially it consists of the first layer of destablized variables (the rest are still destabilized recursively, but not added to the front). When a variable in the front changes (during a latersolve
), it pushes the front forward to its influences variables (before destabilization, indestab_infl
). If however it doesn't change, then the front dies out there and all destabilized variables after the died front never have to be reevaluated.TODO
space
variant. (Can be enabled withoutabort
, fails withabort
.)FromSpec
to firstgetl
all values forCfg.prev
before executing any of the transfer functions. This could provide earlier abort opportunities.interactive
.