-
Couldn't load subscription status.
- Fork 4
WIP: Tagging #3
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
WIP: Tagging #3
Conversation
src/dual_context.jl
Outdated
|
|
||
|
|
||
| @inline function overdub(ctx::TaggedCtx{T}, f, args...) where {T} | ||
| if length(args) > 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment for why this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just speeds things up, we don't have frules longer than that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add that comment to the source code
Before: ```julia julia> @time D(x -> x * D(y -> x + y, 1), 1) 41.852295 seconds (127.60 M allocations: 6.823 GiB, 5.71% gc time) 1 julia> @time D(x -> x * D(y -> x + y, 1), 1) 1.962306 seconds (5.69 M allocations: 311.423 MiB, 6.14% gc time) 1 ``` after ```julia julia> @time D(x -> x * D(y -> x + y, 1), 1) 12.301352 seconds (40.46 M allocations: 2.227 GiB, 4.98% gc time) 1 julia> @time D(x -> x * D(y -> x + y, 1), 1) 0.467172 seconds (1.62 M allocations: 91.768 MiB, 5.42% gc time) 1 ```
needs this patch on ForwardDiff.jl (along with commenting out Dual ops supported by ChainRules)
dualtest.jl is now a disaster, we need to remove all the old tag tests.
Edit: updated patch