Skip to content

AbstractInterpreter: add a hook to customize bestguess calculation #50744

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

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

aviatesk
Copy link
Member

Currently, the code that updates bestguess using ReturnNode information includes hardcodes that relate to Conditional and LimitedAccuracy. These behaviors are actually lattice-dependent and therefore should be overloadable by AbstractInterpreter.

Additionally, particularly in Diffractor, a clever strategy is required to update return types in a way that it takes into account information from both the original method and its rule method
(xref: JuliaDiff/Diffractor.jl#202). This also requires such an overload to exist.
In response to these needs, this commit introduces an implementation of a hook named update_bestguess!.

@nanosoldier runbenchmarks("inference", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - no performance regressions were detected. A full report can be found here.

Currently, the code that updates `bestguess` using `ReturnNode`
information includes hardcodes that relate to `Conditional` and
`LimitedAccuracy`. These behaviors are actually lattice-dependent and
therefore should be overloadable by `AbstractInterpreter`.

Additionally, particularly in Diffractor, a clever strategy is required
to update return types in a way that it takes into account information
from both the original method and its rule method
(xref: JuliaDiff/Diffractor.jl#202). This also requires such an overload
to exist.
In response to these needs, this commit introduces an implementation of
a hook named `update_bestguess!`.
@aviatesk aviatesk force-pushed the avi/bestguess-overload branch from 8d57b1b to 61699f6 Compare August 1, 2023 16:13
@aviatesk aviatesk merged commit 8066c29 into master Aug 1, 2023
@aviatesk aviatesk deleted the avi/bestguess-overload branch August 1, 2023 20:54
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.

3 participants