-
Notifications
You must be signed in to change notification settings - Fork 7
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
Proper Circular Reference Handling #416
base: main
Are you sure you want to change the base?
Conversation
If the proper fix will take some time, do you think it makes sense to build a workaround, or should we disable Mooncake tests in Turing.jl for now? Currently CI is failing on Turing.jl master due to the stack overflows. |
How about using |
Do any of you know what changed that made the tests start to fail? Comparing the last success with the first failure I see very little change: (last success -> first failure) Both are running Julia 1.11.1. I've just made a PR pinning |
So, what's going on is previously DI wasn't exposed to the Anyway, I'm going to make a tiny version of this PR in which This does raise a separate question though: why are things getting boxed, and generating circular references, in the Turing.jl tests? It's possible that this kind of thing will have performance implications for the test suite, so it might actually be good to look into what's going on there if we want to get the test suite to run more quickly 🤷 |
@devmotion kindly pointed me towards this discussion from slack. TLDR, I should try and find a way to avoid using edit: another reason that I need to be able to produce an independent version of the inputs to a function is to ensure that the state of everything after running the function is the same as what is produced by running the forwards-pass of AD. I really don't know how I would do this without something deepcopy-like in nature. I think we might have to roll our own, but I want to get my head around the issues discussed in the julia issue linked above before doing so. |
Here is another reason to find a good solution to this problem. The operation above is very similar to copying tapes in |
This is blocked by JuliaLang/julia#56775 |
A fix for JuliaLang/julia#56775 has now been merged, and should appear in 1.11.3. |
Performance Ratio:
|
Codecov ReportAttention: Patch coverage is
|
This PR targets finishing off #204
This seems to be blocked by JuliaLang/julia#56775 currently -- I make use of
deepcopy
inside ofTestUtils.test_rule_correctness
, and it falls over for circular references involvingArray
s currently. Per the linked issue, I'm not 100% certain whether it's a bug in Julia 1.11.2, or expected behaviour (it feels like a bug though).I'm not 100% sure who's attention we should attempt to get over JuliaLang/julia#56775 -- any idea @yebai @mhauru @penelopeysm ?
I'll also have a think about whether I can avoid the use of
deepcopy
-- I'm reasonably confident that I need it, but I might be wrong.edit: definitely need
deepcopy
, because I need to be able to tell whether a rule has successfully returned inputs to their initial state. In order to make this comparison, I need to keep the initial state around, which requires the use ofdeepcopy
. The only workaround would be to roll my own version ofdeepcopy
, which I'm not keen on.edit2:
deepcopy
seems to be fine on 1.10 though, so I could just do development on 1.10, and only run tests involving circular references on 1.10 for now.