-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
NativeInterpreter vs custom AbstractInterpreters giving different inference results #55638
Comments
Probably nothing. There's a known limitation of inference where a previously cached result can improve the precision of a later-inferred result even if the recursion heuristics would have cut of inference for said later query. It's just not worth doing the the work to determine if you're in this case. |
Thanks for the response @Keno -- is there anything written down about this? I'm interested, and would quite like to get to the bottom of this, because it's causing problems for both Enzyme.jl and Tapir.jl (see issues linked above and the issues which have now referenced this one) -- it seems to cause rather innocuous looking things to fail to infer, and have a serious impact on performance. |
I think there's various issues about it, but regardless, the thing to figure out is not why there is a difference between Base and the custom absint, but what is causing the custom absint's inference to be limited, and then either improve the heuristic or override it for a particular case. |
This was discussed on slack, but I've opened an issue here at @oscardssmith 's suggestion.
The issue is that type inference for the below example when using the
NativeInterpreter
(correctly) infersVector{Float64}
, while the Cthulhu.jl and (soon-to-be-renamed) Tapir.jl interpreters both inferAbstractVector
. I guess technically this isn't "incorrect", it's just a less precise result, but it would certainly be nice to figure out what we're doing wrong in Cthulhu.jl and Tapir.jl to see this degraded result.I've not dug into the detail of type inference yet, so I'm not sure where this discrepancy might be coming from. Would greatly appreciate any advice on how to get started debugging this!
Reproducibility:
Associated Cthulhu.jl issue.
Associated Tapir.jl issue.
Note: It's also an issue in Enzyme.jl, but I figured links to two packages was probably sufficient!
The text was updated successfully, but these errors were encountered: