Skip to content
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

Add hook in inference recursion resolution for external AbstractInter… #36401

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 23, 2020

…preter

This extends hookability to the same-frame comparison in inference's
recursion cycle detection. The case I ran into that made this necessary
is a recursive, nested AD transform. In this case, inference must detect
if two frames have different orders of derivatives (e.g. the primitive
for -, again calls -; the external interpreter makes sure that
inference results for these end up in different caches).

…preter

This extends hookability to the same-frame comparison in inference's
recursion cycle detection. The case I ran into that made this necessary
is a recursive, nested AD transform. In this case, inference must detect
if two frames have different orders of derivatives (e.g. the primitive
for `-`, again calls `-`; the external interpreter makes sure that
inference results for these end up in different caches).
Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a little awkward, since we assume elsewhere that these must merge, to ensure that inference converges. But that's already slightly broken (I think all of this logic probably should be over in abstract_call_method instead of here), and this is experimental, so I guess that's okay with you?

@Keno
Copy link
Member Author

Keno commented Jun 26, 2020

Seems a little awkward, since we assume elsewhere that these must merge, to ensure that inference converges

I believe convergence is still guaranteed as long as call cycles that are at the same AD gradation merge properly.

Yes, I'm fine with moving this wherever. I'll also imagine that once we figure out the high level abstractions for AbstractInterpreter, there'll be a more explicit way to tag inference frames.

@Keno Keno merged commit ab520c7 into master Jun 26, 2020
@Keno Keno deleted the kf/hooks1 branch June 26, 2020 14:31
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
…preter (JuliaLang#36401)

This extends hookability to the same-frame comparison in inference's
recursion cycle detection. The case I ran into that made this necessary
is a recursive, nested AD transform. In this case, inference must detect
if two frames have different orders of derivatives (e.g. the primitive
for `-`, again calls `-`; the external interpreter makes sure that
inference results for these end up in different caches).
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.

None yet

2 participants