-
Notifications
You must be signed in to change notification settings - Fork 89
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
Make work on IRTools #37
Conversation
Nope, Cassette does not do so well when I add the Cassette with precompile.jl2.838656 seconds (11.13 M allocations: 580.525 MiB, 7.72% gc time) |
According to @jrevels, the use of Cassette in this package is purely an implementation detail and could be replaced with regular ol' multiple dispatch. The reason why Jarrett didn't do that to begin with is it requires defining a fair number of methods to resolve ambiguities between the various differential types, rule types, etc. I think going that route will be a cleaner solution overall than replacing the dependency on Cassette with on one IRTools. |
We might want to do this first, which makes things faster. |
Do we know what the reason for the overhead here is and why switching away from Cassette fixes it |
I do not know. |
Would probably be good to debug the actual perf issue before churning through a lot of code. Would also be interested if performing the transform via a Cassette pass vs. using dispatch improved things. |
Debugging Cassette performance issues is really really annoying. StatsProfile.jl and Cthulu.jl are best tools |
Should we anticipate that a custom Cassette |
resolved by JuliaDiff/ChainRulesCore.jl#35 |
This swaps out Cassette for IRTools
@dynamo
.Which was an attempt to solve #35 which it does.
Time of first call for SVD is down to about 1/4 what it was;
Original, Cassette
3.128563 seconds (11.08 M allocations: 577.564 MiB
0.005609 seconds (2.19 k allocations: 152.170 KiB)
No Overdubs (Best Case Senario)
0.794261 seconds (2.49 M allocations: 120.038 MiB, 7.86% gc time)
0.000015 seconds (23 allocations: 3.641 KiB)
IRTools, with precompile.jl (This branch)
0.881375 seconds (2.98 M allocations: 146.369 MiB, 6.39% gc time)
0.000031 seconds (33 allocations: 4.188 KiB)
Note however I added the precompile.jl which makes sure that IRTools itself has been compiled before anything else. Without that it is much worse than anything else.
Next I will try that for Cassette.
Commented out is a sketch of what it should looklike without usiing
IRTools.IR
which is close to what it should looklike without IRTools at all.
Doesn't quiet work.
Which might be nice since no IRTools dep, no need to precompile IRTools.
This is a really simple transform.