Avoid recursion heuristic?#574
Merged
KristofferC merged 2 commits intoJuliaDiff:masterfrom Jan 19, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #574 +/- ##
=======================================
Coverage 85.29% 85.29%
=======================================
Files 9 9
Lines 857 857
=======================================
Hits 731 731
Misses 126 126
Continue to review full report at Codecov.
|
Collaborator
|
Is there a good way to test this? |
Contributor
Author
I'm not sure. |
Contributor
Author
|
Master: julia> using ForwardDiff
julia> @btime convert(ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,Float64,8},4},2}, 1.2);
48.108 ns (1 allocation: 304 bytes)
julia> foo() = convert(ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,Float64,8},4},2}, 1.3)
foo (generic function with 1 method)
julia> @allocated foo()
304PR: julia> using ForwardDiff
[ Info: Precompiling ForwardDiff [f6369f11-7733-5829-9624-2563aa707210]
julia> @btime convert(ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,Float64,8},4},2}, 1.2);
10.525 ns (0 allocations: 0 bytes)
julia> foo() = convert(ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,ForwardDiff.Dual{Nothing,Float64,8},4},2}, 1.3)
foo (generic function with 1 method)
julia> @allocated foo()
0The performance impact from the type instability can be pretty severe. |
Contributor
Author
|
I've added the |
Member
|
@KristofferC Do you have any further comments to this one or is it good to go? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Julia 1.7 + this PR:
Julia 1.7 + ForwardDiff's latest release:
This causes problems for nested AD, especially when trying to limit chunk sizes of outer duals (why create large tuples where each element is already a large tuple}).