Open DilumAluthge opened 5 years ago
I confirmed same kind of behaviour with some functions, for example the one that has print
statement at some point of the function body.
I've just done the new @trace
macro implementation using Vinyl.jl to achieve better performance, and it somehow solves the issues as well:
With the implementation I confirmed I can trace your whole g
function even though it took horrible amount of time.
Honestly I'm not too sure what causes these issues though.
I'll give Vinyl.@trace
a try and see what happens
No, I meant I refactored Traceur.@trace
using Vinyl.jl.
I'll make a PR on this in near days and then you can try on the branch.
Ahhh I see. Sounds good, I'll try once you make the PR
Bump @aviatesk
Any update on this?
@aviatesk Could you share your code for refactoring Traceur.@trace
using Vinyl.jl.?
@DilumAluthge Sorry for super late reply. You can find my attempt to use Vinyl on this branch.
IMHO I'm currently not so interested in this change, since interpreter-based overdubs didn't improve the tracing time well. It seems to be able to get rid of bugs within Cassette (maybe also related to this issue), but I've not tried to dig into the details around that.
But you may find it interesting. If you find some performance pitfalls in my implementation, I really want to hear that.
Summary
Traceur + Zygote + nested differentiation = :(
Minimum working example
I've tested this on Julia
1.2.0-rc2.0
and1.3.0-alpha.0
.Julia 1.2:
Julia 1.3: