-
Notifications
You must be signed in to change notification settings - Fork 68
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
Use right caller for isapplicable usage #2151
Conversation
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
Doesn't help as much as I hoped. So maybe I do have to try the other variant. |
x/ref #2152 |
ft, tt = EnzymeRules._annotate_tt(atype) | ||
rule_atype = Tuple{typeof(EnzymeRules.forward), <:FwdConfig, <:Annotation{ft}, Type{<:Annotation}, tt...} | ||
rule_argtypes = Any[Core.Const(EnzymeRules.forward), FwdConfig, Annotation{ft}, Type{<:Annotation}, tt...] | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically we'll need to change this to not be exclusive (e.g. you can have both forward_rules and reverse_rules set)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache is split on forward vs reverse. So we only need to look at it for each.
profile data |
okay changing the inner isactive part to the native interpreter brings "indirect function call return type analysis" back to 7s from 54s |
src/compiler/interpreter.jl
Outdated
@@ -233,7 +233,7 @@ function Core.Compiler.abstract_call_gf_by_type( | |||
sv::AbsIntState, | |||
max_methods::Int, | |||
) | |||
if Core.Compiler.nmatches(inactive_meta.info) != 0 | |||
if inactive_meta.info isa Core.Compiler.MethodMatchInfo && Core.Compiler.nmatches(inactive_meta.info) != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What other things have you seen here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NoCallInfo
I am not sure I follow? |
Before this PR the "indirect function call return type analysis" test ran in ~7 seconds. With this PR it runs in ~54 seconds. Changing
to
reduces it back to ~7s |
However regardless independent of the native interpreter stuff (not pushed) this PR breaks invalidations, per CI:
I also think inference time is not fixed yet =/ |
b23b076
to
400e81c
Compare
Originally I was thinking something like:
E.g. doing an abstract call against the rules function and checking how many matches we would get,
this ought to do the edge handling for us. But this change is more minimal.