Skip to content

Commit 1279080

Browse files
authored
"Fix" perturbation confusion, ushering in a new age of glorious dual numbers and prosperity (#213)
* add method for making single seed and improve performance of multi-seed constructor * refactor Dual to include a tag type parameter This enables us to throw the proper error(s) in case of perturbation confusion * unroll config type definitions for readability * fix binary Dual ambiguities * fix predicate definition order * update configuration API with new tagging infrastructure and begin removing experimental multithreading functionality If you have a use case where the input is large enough for multithreading to be useful, then you should probably be using ReverseDiff instead of ForwardDiff. The exception to this is jacobian calculation, but ForwardDiff.jacobian never supported multithreading anyway. Once Julia's multithreading model matures, we can consider implementing multithreading for ForwardDiff.jacobian, but we probably should never again support it for gradients. * get all tests passing except for deprecation layer + SIMD tests * drop Julia v0.5 * remove non-v0.6 version compat code and replace test_approx_duals with a simpler predicate (proposed by @KristofferC) * use where syntax instead of to-be-deprecated prefix typevar syntax * implement ForwardDiff v0.4.x --> v0.5.x deprecation layer * update benchmarks * change T to V in Partials code to avoid confusion with tag parameter * update docs
1 parent 82dcd98 commit 1279080

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1311
-1588
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: julia
22
julia:
3-
- 0.5
43
- 0.6
54
- nightly
65
notifications:

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
julia 0.5
1+
julia 0.6-
22
DiffBase 0.0.3
3-
Compat 0.19.0
43
Calculus 0.2.0
54
NaNMath 0.2.2
65
SpecialFunctions 0.1.0

benchmark/ForwardDiffBenchmarks.jl renamed to benchmarks/benchmarks.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
module ForwardDiffBenchmarks
2-
31
using ForwardDiff, DiffBase
42
using BenchmarkTools
53

@@ -39,11 +37,11 @@ for f in (DiffBase.VECTOR_TO_NUMBER_FUNCS..., DiffBase.MATRIX_TO_NUMBER_FUNCS...
3937
fval[length(x)] = @benchmarkable $(f)($x)
4038

4139
gout = DiffBase.DiffResult(y, similar(x, typeof(y)))
42-
gcfg = ForwardDiff.Config(x)
40+
gcfg = ForwardDiff.GradientConfig(nothing, x)
4341
fgrad[length(x)] = @benchmarkable ForwardDiff.gradient!($gout, $f, $x, $gcfg)
4442

4543
hout = DiffBase.DiffResult(y, similar(x, typeof(y)), similar(x, typeof(y), length(x), length(x)))
46-
hcfg = ForwardDiff.HessianConfig(hout, x)
44+
hcfg = ForwardDiff.HessianConfig(nothing, hout, x)
4745
fhess[length(x)] = @benchmarkable ForwardDiff.hessian!($hout, $f, $x, $hcfg)
4846
end
4947
end
@@ -56,9 +54,7 @@ for f in DiffBase.ARRAY_TO_ARRAY_FUNCS
5654
fval[length(x)] = @benchmarkable $(f)($x)
5755

5856
out = DiffBase.JacobianResult(y, x)
59-
cfg = ForwardDiff.Config(x)
60-
fjac[length(x)] = @benchmarkable ForwardDiff.jacobian!($out, $f, $x, $cfg)
57+
cfg = ForwardDiff.JacobianConfig(nothing, y, x)
58+
fjac[length(x)] = @benchmarkable ForwardDiff.jacobian!($out, $f, $y, $x, $cfg)
6159
end
6260
end
63-
64-
end # module
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)