-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Seems to be #265ing #22
Comments
Yes, this is mentioned in the readme; you can call |
Ah, I missed that. I feel like hooking into the julia #265 stuff, |
IIRC we hit a roadblock with making the world-age mechanism hookable when we realized that the compiler would need to backprop the new world age bounds in a way it didn't have to before. So it's going to take some redesign of the world-age mechanism to make that feasible. Also note that there are still some compiler bugs that make it quite possible to trigger miscompiles that manifest as 265-style issues (ref JuliaLabs/Cassette.jl#6, JuliaLang/julia#28595). It's possible that fixing those bugs will fix some of the more blatant 265-style problems without requiring any world age redesign. |
How about this as a work around. While we don't want to call So we track the world-ages of functions,
Then inside each of the calls to functions affected by this (just Demonstrationfor proof of concept,
demo
|
Hmmm, that is not quiet as reliable as it seemed. |
The following is more reliable, but slower. I think there is a way to speed it up,
|
thoughts, on the code I posted before? |
So the idea is that we call It seems hard to do this in general. I could see it working in the case that everything is fully well-typed, but what about if the functions that |
Yes, we call a version of And calculating world ages has to be done recursively, since only functions directly changed have the
I assume you mean _if the methods called are not known at compile time. Yes, if the method called is not known at compile time, the world-age needs to be (recursively) checked for all possibilities. And that set can be lowered somewhat by various things like argument counting (doesn't work for splatting), and knowing some of the argument types, even if not all of them. The code in #22 (comment) But yes the other way would be to call A heuristic to make this much faster would be a max nesting depth for how deep to check for changes in called methods. |
Slightly contrived, but for example: function foo(fs)
f = pop!(fs)
f(1, 2)
end
foo(Any[+]) |
Ah, yes, I see what you mean. |
Would it make sense to call the generators with |
There are some changes to world age handling being discussed in FluxML/IRTools.jl#109, but I lack the know-how to say how they fit into your proposal. |
Maybe there is a catch that is not getting updated when a function is redefined?
Code:
Expected output is 2, then 3
Actual output is 2, then 2 again.
Demo:
The text was updated successfully, but these errors were encountered: