-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ADTypes and autodiff by default (#178)
* Remove ForwardDiff as dependency * Add ADTypes as dependency * Add adtype keyword to singlepath * Refactor utility functions to use AD if available * Support OptimizationFunction constructed with adtype * Support adtype in multipathfinder * Support adtype for Turing models * Remove error checks for methods that now work * Increment patch number * Don't set chunksize to 0 Optimization.jl doesn't like this * Don't assume parameters supported Seems to be optional, and Turing models don't support it * Remove type unknown to extension * Remove no-longer-needed check * Remove build_optim_problem * Unify LogDensityProblems methods * Only include test_utils.jl once * Unify example LogDensityProblems * Update tests * Remove adtype constraint to allow `NoAD` * Bump compats to Optimization and Turing versions with ADTypes * Bump deps lower bounds to match those of Turing/Optimization * Bump ForwardDiff lower bound for tests * Bump Optim compat to support Compat v4 * Bump lower bounds for DynamicPPL/Compat compat * Bump compats in other environments to match * Bump lower bounds for docs for DynamicPPL compatibility * Skip downgrading Folds and Transducers for docs/integrations Increasing these lower bounds ultimately produces a conflict since they require BangBang v0.4, but no Turing version yet is compatible with this version. * Fix test * Update since ∇f removed from callback * Bump SciMLBase lower bound to support ADTypes v0.2 * Fail on non-finite gradient only for newer Optimization.jl versions * Bump OptimizationOptimJL lower bound * Bump Turing lower bound * Bump TransformVariables lower bound * Add AbstractADType type constraint * Update docstring * Note ADTypes support * Load ADTypes * Remove unneeded call to `dim` * Add ADTypes and ReverseDiff as docs deps * Update quickstart to use and describe ADTypes * Bump ReverseDiff compat lower bound * Increment version number * Test adtype is correctly used if function provided * Bump Pathfinder compats for docs and integration tests * Avoid deploying docs for downgrade builds
- Loading branch information
Showing
23 changed files
with
315 additions
and
273 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ jobs: | |
version: ${{ matrix.version }} | ||
- uses: julia-actions/[email protected] | ||
with: | ||
skip: LinearAlgebra,Pathfinder,Random,Statistics | ||
skip: LinearAlgebra,Pathfinder,Random,Statistics,Folds,Transducers | ||
projects: ., docs | ||
if: matrix.downgrade | ||
name: Downgrade dependencies to oldest supported versions | ||
|
@@ -86,3 +86,5 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCUMENTER_KEY: ${{ matrix.version == '1' && secrets.DOCUMENTER_KEY || '' }} | ||
GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988 | ||
# don't deploy if it's a downgrade build | ||
DEPLOY_DOCS: ${{ !matrix.downgrade }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
arch: x64 | ||
- uses: julia-actions/[email protected] | ||
with: | ||
skip: LinearAlgebra,Pathfinder,Random,Statistics | ||
skip: LinearAlgebra,Pathfinder,Random,Statistics,Folds,Transducers | ||
projects: ., test/integration/${{ matrix.package }} | ||
if: ${{ matrix.downgrade }} | ||
name: Downgrade dependencies to oldest supported versions | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
name = "Pathfinder" | ||
uuid = "b1d3bc72-d0e7-4279-b92f-7fa5d6d2d454" | ||
authors = ["Seth Axen <[email protected]> and contributors"] | ||
version = "0.8.8" | ||
version = "0.9.0-DEV" | ||
|
||
[deps] | ||
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" | ||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||
Folds = "41a02a25-b8f0-4f67-bc48-60067656b558" | ||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" | ||
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c" | ||
|
@@ -36,40 +36,44 @@ PathfinderDynamicHMCExt = "DynamicHMC" | |
PathfinderTuringExt = ["Accessors", "DynamicPPL", "MCMCChains", "Turing"] | ||
|
||
[compat] | ||
Accessors = "0.1.1" | ||
Distributions = "0.25.57" | ||
Accessors = "0.1.12" | ||
ADTypes = "0.2" | ||
Distributions = "0.25.87" | ||
DynamicHMC = "3.4.0" | ||
DynamicPPL = "0.21.5, 0.22, 0.23, 0.24, 0.25, 0.27" | ||
DynamicPPL = "0.24.7, 0.25, 0.27" | ||
Folds = "0.2.2" | ||
ForwardDiff = "0.10.13" | ||
ForwardDiff = "0.10.19" | ||
IrrationalConstants = "0.1.1, 0.2" | ||
LinearAlgebra = "1.6" | ||
LogDensityProblems = "2.1.0" | ||
MCMCChains = "5.3.0, 6" | ||
Optim = "1.6.2" | ||
Optimization = "3.5" | ||
OptimizationOptimJL = "0.1.1, 0.2, 0.3" | ||
MCMCChains = "6.0.2" | ||
Optim = "1.7.2" | ||
Optimization = "3.16.0" | ||
OptimizationOptimJL = "0.1.7, 0.2, 0.3" | ||
PDMats = "0.11.26" | ||
PSIS = "0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9" | ||
ProgressLogging = "0.1.4" | ||
Random = "1.6" | ||
Requires = "1.1" | ||
SciMLBase = "1.61.2, 2" | ||
ReverseDiff = "1.4.5" | ||
SciMLBase = "1.95.0, 2" | ||
Statistics = "1.6" | ||
StatsBase = "0.33.7, 0.34" | ||
Transducers = "0.4.66" | ||
Turing = "0.24.2, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32" | ||
Turing = "0.30.5, 0.31, 0.32" | ||
UnPack = "1" | ||
julia = "1.6" | ||
|
||
[extras] | ||
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb" | ||
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8" | ||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" | ||
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" | ||
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb" | ||
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" | ||
|
||
[targets] | ||
test = ["OptimizationNLopt", "Test"] | ||
test = ["ForwardDiff", "OptimizationNLopt", "ReverseDiff", "Test"] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.