diff --git a/Manifest.toml b/Manifest.toml index d86c9e5e0..a8a088be8 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.11.4" manifest_format = "2.0" -project_hash = "f8ede0ee89806fd59fc0feecd3210fa53189aa73" +project_hash = "24221517ec61f36e1c18b76e91ad12167021a6dd" [[deps.ADTypes]] git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32" @@ -376,9 +376,9 @@ version = "1.6.0" [[deps.BracketingNonlinearSolve]] deps = ["CommonSolve", "ConcreteStructs", "NonlinearSolveBase", "PrecompileTools", "Reexport", "SciMLBase"] -git-tree-sha1 = "47d6e355097ef6df3c39080a0045ecfd00ff514e" +git-tree-sha1 = "1d2a0c173ccdb01d7c30b541aeae01f077cb8df2" uuid = "70df07ce-3d50-431d-a3e7-ca6ddb60ac1e" -version = "1.1.1" +version = "1.1.2" weakdeps = ["ForwardDiff"] [deps.BracketingNonlinearSolve.extensions] @@ -489,9 +489,9 @@ version = "3.29.0" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] -git-tree-sha1 = "c7acce7a7e1078a20a285211dd73cd3941a871d6" +git-tree-sha1 = "67e11ee83a43eb71ddc950302c53bf33f0690dfe" uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -version = "0.12.0" +version = "0.12.1" weakdeps = ["StyledStrings"] [deps.ColorTypes.extensions] @@ -550,10 +550,10 @@ uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.1.1+0" [[deps.ComponentArrays]] -deps = ["Adapt", "ArrayInterface", "ChainRulesCore", "ConstructionBase", "ForwardDiff", "Functors", "LinearAlgebra", "StaticArrayInterface", "StaticArraysCore"] -git-tree-sha1 = "eac93b2a05d33465d50e5448aefba8c06a69f738" +deps = ["Adapt", "ArrayInterface", "ChainRulesCore", "ConstructionBase", "Functors", "LinearAlgebra", "StaticArrayInterface", "StaticArraysCore"] +git-tree-sha1 = "9b870f26eb31f7dfc7e5c2678d4be23a04aea702" uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" -version = "0.15.25" +version = "0.15.26" [deps.ComponentArrays.extensions] ComponentArraysGPUArraysExt = "GPUArrays" @@ -694,9 +694,9 @@ version = "0.4.0" [[deps.DiffEqBase]] deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "FastPower", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "Setfield", "Static", "StaticArraysCore", "Statistics", "TruncatedStacktraces"] -git-tree-sha1 = "4263b49db273d67f13b83af609712aed69ccf38a" +git-tree-sha1 = "e384a2cf3bb402e6dc66b1503ade22c7c1471c4d" uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.166.0" +version = "6.167.2" [deps.DiffEqBase.extensions] DiffEqBaseCUDAExt = "CUDA" @@ -772,9 +772,9 @@ version = "7.16.1" [[deps.DifferentiationInterface]] deps = ["ADTypes", "LinearAlgebra"] -git-tree-sha1 = "cf6dcb4b21bdd893fd45be70791d6dc89ca16506" +git-tree-sha1 = "70e500f6d5d50091d87859251de7b8cd060c1cce" uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" -version = "0.6.48" +version = "0.6.50" [deps.DifferentiationInterface.extensions] DifferentiationInterfaceChainRulesCoreExt = "ChainRulesCore" @@ -859,9 +859,9 @@ weakdeps = ["ChainRulesCore", "DensityInterface", "Test"] [[deps.DistributionsAD]] deps = ["Adapt", "ChainRules", "ChainRulesCore", "Compat", "Distributions", "FillArrays", "LinearAlgebra", "PDMats", "Random", "Requires", "SpecialFunctions", "StaticArrays", "StatsFuns", "ZygoteRules"] -git-tree-sha1 = "02c2e6e6a137069227439fe884d729cca5b70e56" +git-tree-sha1 = "4acbf909e892ce1f94c39a138541566c1aad5e66" uuid = "ced4e74d-a319-5a8a-b0ac-84af2272839c" -version = "0.6.57" +version = "0.6.58" weakdeps = ["ForwardDiff", "LazyArrays", "ReverseDiff", "Tracker"] [deps.DistributionsAD.extensions] @@ -871,10 +871,9 @@ weakdeps = ["ForwardDiff", "LazyArrays", "ReverseDiff", "Tracker"] DistributionsADTrackerExt = "Tracker" [[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +git-tree-sha1 = "e7b7e6f178525d17c720ab9c081e4ef04429f860" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" +version = "0.9.4" [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] @@ -889,9 +888,9 @@ version = "3.5.0" [[deps.DynamicPPL]] deps = ["ADTypes", "AbstractMCMC", "AbstractPPL", "Accessors", "BangBang", "Bijectors", "Compat", "ConstructionBase", "DifferentiationInterface", "Distributions", "DocStringExtensions", "InteractiveUtils", "LinearAlgebra", "LogDensityProblems", "MacroTools", "OrderedCollections", "Random", "Requires", "Test"] -git-tree-sha1 = "4070ee7251d99838b474581539d83884867b4bd4" +git-tree-sha1 = "5f150e0ebb4e156effd5403bd384bc941c853bc7" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" -version = "0.35.5" +version = "0.35.6" [deps.DynamicPPL.extensions] DynamicPPLChainRulesCoreExt = ["ChainRulesCore"] @@ -917,15 +916,15 @@ uuid = "cad2338a-1db2-11e9-3401-43bc07c9ede2" version = "2.0.0" [[deps.EnumX]] -git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" +git-tree-sha1 = "bddad79635af6aec424f53ed8aad5d7555dc6f00" uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" -version = "1.0.4" +version = "1.0.5" [[deps.Enzyme]] deps = ["CEnum", "EnzymeCore", "Enzyme_jll", "GPUCompiler", "LLVM", "Libdl", "LinearAlgebra", "ObjectFile", "PrecompileTools", "Preferences", "Printf", "Random", "SparseArrays"] -git-tree-sha1 = "b83e375689f3c6cf769035b2a3b4332ebc692366" +git-tree-sha1 = "59c1db6e150d55f2df6a1383759931bf8571c6b8" uuid = "7da242da-08ed-463a-9acd-ee780be4f1d9" -version = "0.13.34" +version = "0.13.35" [deps.Enzyme.extensions] EnzymeBFloat16sExt = "BFloat16s" @@ -1015,10 +1014,10 @@ uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" version = "1.8.1" [[deps.FFTW_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4d81ed14783ec49ce9f2e168208a12ce1815aa25" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6d6219a004b8cf1e0b4dbe27a2860b8e04eba0be" uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" -version = "3.3.10+3" +version = "3.3.11+0" [[deps.FLoops]] deps = ["BangBang", "Compat", "FLoopsBase", "InitialValues", "JuliaVariables", "MLStyle", "Serialization", "Setfield", "Transducers"] @@ -1056,9 +1055,9 @@ uuid = "442a2c76-b920-505d-bb47-c5924d526838" version = "1.0.2" [[deps.FastPower]] -git-tree-sha1 = "58c3431137131577a7c379d00fea00be524338fb" +git-tree-sha1 = "df32f07f373f06260cd6af5371385b5ef85dd762" uuid = "a4df4552-cc26-4903-aec0-212e50a0e84b" -version = "1.1.1" +version = "1.1.2" [deps.FastPower.extensions] FastPowerEnzymeExt = "Enzyme" @@ -1161,9 +1160,9 @@ version = "0.14.25" [[deps.Fontconfig_jll]] deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Zlib_jll"] -git-tree-sha1 = "21fac3c77d7b5a9fc03b0ec503aa1a6392c34d2b" +git-tree-sha1 = "301b5d5d731a0654825f1f2e906990f7141a106b" uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" -version = "2.15.0+0" +version = "2.16.0+0" [[deps.Format]] git-tree-sha1 = "9c68794ef81b08086aeb32eeaf33531668d5f5fc" @@ -1182,9 +1181,9 @@ weakdeps = ["StaticArrays"] [[deps.FreeType2_jll]] deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "786e968a8d2fb167f2e4880baba62e0e26bd8e4e" +git-tree-sha1 = "2c5512e11c791d1baed2049c5652441b28fc6a31" uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.13.3+1" +version = "2.13.4+0" [[deps.FriBidi_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -1246,9 +1245,9 @@ version = "0.1.6" [[deps.GPUCompiler]] deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "PrecompileTools", "Preferences", "Scratch", "Serialization", "TOML", "TimerOutputs", "UUIDs"] -git-tree-sha1 = "199f213e40a7982e9138bc9edc3299419d510390" +git-tree-sha1 = "b08c164134dd0dbc76ff54e45e016cf7f30e16a4" uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" -version = "1.2.0" +version = "1.3.2" [[deps.GR]] deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Qt6Wayland_jll", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"] @@ -1281,16 +1280,16 @@ uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" version = "2.82.4+0" [[deps.Graphite2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "01979f9b37367603e2848ea225918a3b3861b606" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "8a6dbda1fd736d60cc477d99f2e7a042acfa46e8" uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" -version = "1.3.14+1" +version = "1.3.15+0" [[deps.Graphs]] deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -git-tree-sha1 = "1dc470db8b1131cfc7fb4c115de89fe391b9e780" +git-tree-sha1 = "3169fd3440a02f35e549728b0890904cfd4ae58a" uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" -version = "1.12.0" +version = "1.12.1" [[deps.Grisu]] git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" @@ -1451,10 +1450,10 @@ uuid = "82899510-4779-5014-852e-03e436cf321d" version = "1.0.0" [[deps.JLFzf]] -deps = ["Pipe", "REPL", "Random", "fzf_jll"] -git-tree-sha1 = "71b48d857e86bf7a1838c4736545699974ce79a2" +deps = ["REPL", "Random", "fzf_jll"] +git-tree-sha1 = "1d4015b1eb6dc3be7e6c400fbd8042fe825a6bac" uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c" -version = "0.1.9" +version = "0.1.10" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] @@ -1697,9 +1696,9 @@ version = "3.2.2+2" [[deps.Libgcrypt_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll"] -git-tree-sha1 = "8be878062e0ffa2c3f67bb58a595375eda5de80b" +git-tree-sha1 = "d77592fa54ad343c5043b6f38a03f1a3c3959ffe" uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" -version = "1.11.0+0" +version = "1.11.1+0" [[deps.Libglvnd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll", "Xorg_libXext_jll"] @@ -1721,9 +1720,9 @@ version = "1.18.0+0" [[deps.Libmount_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "89211ea35d9df5831fca5d33552c02bd33878419" +git-tree-sha1 = "a31572773ac1b745e0343fe5e2c8ddda7a37e997" uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" -version = "2.40.3+0" +version = "2.41.0+0" [[deps.Libtask]] deps = ["FunctionWrappers", "LRUCache", "LinearAlgebra", "Statistics"] @@ -1739,9 +1738,9 @@ version = "4.7.1+0" [[deps.Libuuid_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e888ad02ce716b319e6bdb985d2ef300e7089889" +git-tree-sha1 = "321ccef73a96ba828cd51f2ab5b9f917fa73945a" uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" -version = "2.40.3+0" +version = "2.41.0+0" [[deps.LineSearch]] deps = ["ADTypes", "CommonSolve", "ConcreteStructs", "FastClosures", "LinearAlgebra", "MaybeInplace", "SciMLBase", "SciMLJacobianOperators", "StaticArraysCore"] @@ -1766,9 +1765,9 @@ version = "1.11.0" [[deps.LinearSolve]] deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "GPUArraysCore", "InteractiveUtils", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "c64ec326eeeb20c065afd6aa5add4fad458e460a" +git-tree-sha1 = "2bbbdcce6d80a4aed929365d0d97b15b264bb9e7" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "3.7.0" +version = "3.7.2" [deps.LinearSolve.extensions] LinearSolveBandedMatricesExt = "BandedMatrices" @@ -2228,9 +2227,9 @@ version = "0.10.3" [[deps.NLSolversBase]] deps = ["ADTypes", "DifferentiationInterface", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "1f78293864c5e48ecf97269b0e23d7be28eb1958" +git-tree-sha1 = "b14c7be6046e7d48e9063a0053f95ee0fc954176" uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.9.0" +version = "7.9.1" [[deps.NLopt]] deps = ["CEnum", "NLopt_jll"] @@ -2258,9 +2257,9 @@ version = "4.5.1" [[deps.NNlib]] deps = ["Adapt", "Atomix", "ChainRulesCore", "GPUArraysCore", "KernelAbstractions", "LinearAlgebra", "Random", "ScopedValues", "Statistics"] -git-tree-sha1 = "e8d4268b4a438bdad98937e4bca45881363b4767" +git-tree-sha1 = "4abc63cdd8dd9dd925d8e879cda280bedc8013ca" uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" -version = "0.9.29" +version = "0.9.30" [deps.NNlib.extensions] NNlibAMDGPUExt = "AMDGPU" @@ -2282,9 +2281,9 @@ version = "0.9.29" [[deps.NaNMath]] deps = ["OpenLibm_jll"] -git-tree-sha1 = "cc0a5deefdb12ab3a096f00a6d42133af4560d71" +git-tree-sha1 = "9b8215b1ee9e78a293f99797cd31375471b2bcae" uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "1.1.2" +version = "1.1.3" [[deps.NameResolution]] deps = ["PrettyPrint"] @@ -2347,9 +2346,9 @@ version = "4.5.0" [[deps.NonlinearSolveBase]] deps = ["ADTypes", "Adapt", "ArrayInterface", "CommonSolve", "Compat", "ConcreteStructs", "DifferentiationInterface", "EnzymeCore", "FastClosures", "LinearAlgebra", "Markdown", "MaybeInplace", "Preferences", "Printf", "RecursiveArrayTools", "SciMLBase", "SciMLJacobianOperators", "SciMLOperators", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] -git-tree-sha1 = "8a2437b5ead050301b6a6258f226e5137e511000" +git-tree-sha1 = "369acf69870d75c47db9622dad7b98cae9f1f083" uuid = "be0214bd-f91f-a760-ac4e-3421ce2b2da0" -version = "1.5.0" +version = "1.5.1" weakdeps = ["BandedMatrices", "DiffEqBase", "ForwardDiff", "LineSearch", "LinearSolve", "SparseArrays", "SparseMatrixColorings"] [deps.NonlinearSolveBase.extensions] @@ -2415,9 +2414,9 @@ version = "1.3.5+1" [[deps.OneHotArrays]] deps = ["Adapt", "ChainRulesCore", "Compat", "GPUArraysCore", "LinearAlgebra", "NNlib"] -git-tree-sha1 = "c8c7f6bfabe581dc40b580313a75f1ecce087e27" +git-tree-sha1 = "ec127b6ef91de07a48ed9db251d63b0a46490b90" uuid = "0b1bfda6-eb8a-41d2-88d8-f5af5cad476f" -version = "0.2.6" +version = "0.2.7" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -2431,9 +2430,9 @@ version = "0.8.1+4" [[deps.OpenMPI_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML", "Zlib_jll"] -git-tree-sha1 = "da913f03f17b449951e0461da960229d4a3d1a8c" +git-tree-sha1 = "047b66eb62f3cae59ed260ebb9075a32a04350f1" uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "5.0.7+1" +version = "5.0.7+2" [[deps.OpenSSL]] deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] @@ -2454,10 +2453,10 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.6+0" [[deps.Optim]] -deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] -git-tree-sha1 = "c1f51f704f689f87f28b33836fd460ecf9b34583" +deps = ["Compat", "EnumX", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] +git-tree-sha1 = "31b3b1b8e83ef9f1d50d74f1dd5f19a37a304a1f" uuid = "429524aa-4258-5aef-a3af-852621145aeb" -version = "1.11.0" +version = "1.12.0" [deps.Optim.extensions] OptimMOIExt = "MathOptInterface" @@ -2530,9 +2529,9 @@ version = "1.8.0" [[deps.OrdinaryDiffEq]] deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqAdamsBashforthMoulton", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqDefault", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqExplicitRK", "OrdinaryDiffEqExponentialRK", "OrdinaryDiffEqExtrapolation", "OrdinaryDiffEqFIRK", "OrdinaryDiffEqFeagin", "OrdinaryDiffEqFunctionMap", "OrdinaryDiffEqHighOrderRK", "OrdinaryDiffEqIMEXMultistep", "OrdinaryDiffEqLinear", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqLowStorageRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqNordsieck", "OrdinaryDiffEqPDIRK", "OrdinaryDiffEqPRK", "OrdinaryDiffEqQPRK", "OrdinaryDiffEqRKN", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqSSPRK", "OrdinaryDiffEqStabilizedIRK", "OrdinaryDiffEqStabilizedRK", "OrdinaryDiffEqSymplecticRK", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "Static", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "798f5e1a1f8b5a1bbba1e6134b77a77ccc509678" +git-tree-sha1 = "97037e44313e33cd29e8b08e2ec82dd157f866ae" uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -version = "6.92.0" +version = "6.93.0" [[deps.OrdinaryDiffEqAdamsBashforthMoulton]] deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqLowOrderRK", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] @@ -2548,9 +2547,9 @@ version = "1.3.0" [[deps.OrdinaryDiffEqCore]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FastPower", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "SymbolicIndexingInterface", "TruncatedStacktraces"] -git-tree-sha1 = "f47451c0ca3a2b0f11e966ed7731f2bd17d9b0e3" +git-tree-sha1 = "ba84fa52a477a537213b7d0a6a83ba9b2f3aaa00" uuid = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" -version = "1.19.0" +version = "1.22.0" weakdeps = ["EnzymeCore"] [deps.OrdinaryDiffEqCore.extensions] @@ -2588,9 +2587,9 @@ version = "1.5.0" [[deps.OrdinaryDiffEqFIRK]] deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "FastGaussQuadrature", "FastPower", "LinearAlgebra", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Polyester", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators"] -git-tree-sha1 = "7dfc32df06db3d9d10128053c0e53deb213fb28d" +git-tree-sha1 = "588f454cc1c48c20a32f03838af4983053a1d3ae" uuid = "5960d6e9-dd7a-4743-88e7-cf307b64f125" -version = "1.8.0" +version = "1.9.0" [[deps.OrdinaryDiffEqFeagin]] deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] @@ -2672,9 +2671,9 @@ version = "1.1.0" [[deps.OrdinaryDiffEqRosenbrock]] deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"] -git-tree-sha1 = "a0d1e65771e087a84c398f20ea5f189043869997" +git-tree-sha1 = "bede3226fd485741e364239e23236e07ace77639" uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" -version = "1.7.0" +version = "1.8.0" [[deps.OrdinaryDiffEqSDIRK]] deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLBase", "TruncatedStacktraces"] @@ -2725,9 +2724,9 @@ version = "10.42.0+1" [[deps.PDMats]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "966b85253e959ea89c53a9abebbf2e964fbf593b" +git-tree-sha1 = "48566789a6d5f6492688279e22445002d171cf76" uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" -version = "0.11.32" +version = "0.11.33" [[deps.PackageExtensionCompat]] git-tree-sha1 = "fb28e33b8a95c4cee25ce296c817d89cc2e53518" @@ -2753,11 +2752,6 @@ git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "2.8.1" -[[deps.Pipe]] -git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d" -uuid = "b98c9c47-44ae-5843-9183-064241ee97a0" -version = "1.3.0" - [[deps.Pixman_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl"] git-tree-sha1 = "db76b1ecd5e9715f3d043cec13b2ec93ce015d53" @@ -2837,9 +2831,9 @@ version = "0.2.4" [[deps.PreallocationTools]] deps = ["Adapt", "ArrayInterface", "ForwardDiff"] -git-tree-sha1 = "8765738bc5a6f1554cb61c5ddfae5bf279e8b110" +git-tree-sha1 = "4406f9a118bfcf362290d755fcb46c0c4894beae" uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" -version = "0.4.25" +version = "0.4.26" weakdeps = ["ReverseDiff", "SparseConnectivityTracer"] [deps.PreallocationTools.extensions] @@ -2886,9 +2880,9 @@ version = "0.1.4" [[deps.ProgressMeter]] deps = ["Distributed", "Printf"] -git-tree-sha1 = "8f6bc219586aef8baf0ff9a5fe16ee9c70cb65e4" +git-tree-sha1 = "1efcd8b38f007101ec6c4ff42df9aedd1b5450de" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.10.2" +version = "1.10.3" [[deps.PtrArrays]] git-tree-sha1 = "1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d" @@ -2998,9 +2992,9 @@ version = "0.6.12" [[deps.RecursiveArrayTools]] deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "35ac79a85c8086892258581d8b6df9cd8db5c91a" +git-tree-sha1 = "112c876cee36a5784df19098b55db2b238afc36a" uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" -version = "3.31.1" +version = "3.31.2" [deps.RecursiveArrayTools.extensions] RecursiveArrayToolsFastBroadcastExt = "FastBroadcast" @@ -3049,9 +3043,9 @@ version = "1.1.1" [[deps.ReverseDiff]] deps = ["ChainRulesCore", "DiffResults", "DiffRules", "ForwardDiff", "FunctionWrappers", "LinearAlgebra", "LogExpFunctions", "MacroTools", "NaNMath", "Random", "SpecialFunctions", "StaticArrays", "Statistics"] -git-tree-sha1 = "cc6cd622481ea366bb9067859446a8b01d92b468" +git-tree-sha1 = "fce158da5228197d0cabaa31077a4c1b77b093be" uuid = "37e2e3b7-166d-5795-8a7a-e32c996b4267" -version = "1.15.3" +version = "1.16.0" [[deps.Rmath]] deps = ["Random", "Rmath_jll"] @@ -3067,9 +3061,9 @@ version = "0.5.1+0" [[deps.Roots]] deps = ["Accessors", "CommonSolve", "Printf"] -git-tree-sha1 = "442b4353ee8c26756672afb2db81894fc28811f3" +git-tree-sha1 = "3ac13765751ffc81e3531223782d9512f6023f71" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.2.6" +version = "2.2.7" [deps.Roots.extensions] RootsChainRulesCoreExt = "ChainRulesCore" @@ -3108,9 +3102,9 @@ version = "0.1.1" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Moshi", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] -git-tree-sha1 = "fe9bbf68543d5f72ae2218f3d8c8faeab761dd52" +git-tree-sha1 = "6f3987e7fed3239d06985a4752670ca5ff25c695" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.77.2" +version = "2.82.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -3141,9 +3135,9 @@ version = "0.1.1" [[deps.SciMLOperators]] deps = ["Accessors", "ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools"] -git-tree-sha1 = "6149620767866d4b0f0f7028639b6e661b6a1e44" +git-tree-sha1 = "1c4b7f6c3e14e6de0af66e66b86d525cae10ecb4" uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" -version = "0.3.12" +version = "0.3.13" weakdeps = ["SparseArrays", "StaticArraysCore"] [deps.SciMLOperators.extensions] @@ -3152,9 +3146,9 @@ weakdeps = ["SparseArrays", "StaticArraysCore"] [[deps.SciMLSensitivity]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "ChainRulesCore", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "Distributions", "Enzyme", "FastBroadcast", "FiniteDiff", "ForwardDiff", "FunctionProperties", "FunctionWrappersWrappers", "Functors", "GPUArraysCore", "LinearAlgebra", "LinearSolve", "Markdown", "PreallocationTools", "QuadGK", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "ReverseDiff", "SciMLBase", "SciMLJacobianOperators", "SciMLOperators", "SciMLStructures", "StaticArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tracker", "Zygote"] -git-tree-sha1 = "40094b8d6afe1bcfee252ce2ab3c4a09d08c60c4" +git-tree-sha1 = "0004bbb37f8043eea2692a6d8d6f4a1471414829" uuid = "1ed8b502-d754-442c-8d5d-10ac956f44a1" -version = "7.75.0" +version = "7.76.0" weakdeps = ["Mooncake"] [deps.SciMLSensitivity.extensions] @@ -3311,15 +3305,19 @@ uuid = "dc90abb0-5640-4711-901d-7e5b23a2fada" version = "0.1.2" [[deps.SparseMatrixColorings]] -deps = ["ADTypes", "DataStructures", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "e0ae9189392572abe85bc9fd4ce35e772b1e1e10" +deps = ["ADTypes", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "b7de46dc1cc6a12e4ba4c614f3754015f6fc63ef" uuid = "0a514795-09f3-496d-8182-132a7b665d35" -version = "0.4.14" -weakdeps = ["Colors"] +version = "0.4.15" [deps.SparseMatrixColorings.extensions] + SparseMatrixColoringsCliqueTreesExt = "CliqueTrees" SparseMatrixColoringsColorsExt = "Colors" + [deps.SparseMatrixColorings.weakdeps] + CliqueTrees = "60701a23-6482-424a-84db-faee86b9b1f8" + Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" + [[deps.SpecialFunctions]] deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] git-tree-sha1 = "64cca0c26b4f31ba18f13f6c12af7c85f478cfde" @@ -3405,9 +3403,9 @@ version = "0.33.21" [[deps.StatsFuns]] deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] -git-tree-sha1 = "b423576adc27097764a90e163157bcfc9acf0f46" +git-tree-sha1 = "35b09e80be285516e52c9054792c884b9216ae3c" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "1.3.2" +version = "1.4.0" weakdeps = ["ChainRulesCore", "InverseFunctions"] [deps.StatsFuns.extensions] @@ -3434,9 +3432,9 @@ version = "2.5.0" [[deps.StochasticDiffEq]] deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqNoiseProcess", "DocStringExtensions", "FastPower", "FiniteDiff", "ForwardDiff", "JumpProcesses", "LevyArea", "LinearAlgebra", "Logging", "MuladdMacro", "NLsolve", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"] -git-tree-sha1 = "9c524fdc91dee5fb73795f1ec06cee022bf6e13d" +git-tree-sha1 = "e48c760e73ebf9c0726892625a072cca3b96ea96" uuid = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" -version = "6.74.1" +version = "6.75.0" [[deps.StrideArraysCore]] deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] @@ -3446,21 +3444,23 @@ version = "0.5.7" [[deps.Strided]] deps = ["LinearAlgebra", "StridedViews", "TupleTools"] -git-tree-sha1 = "f9ce8284e6eec72a21de3603493eb5355fcf7f39" +git-tree-sha1 = "4a1128f5237b5d0170d934a2eb4fa7a273639c9f" uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" -version = "2.2.0" +version = "2.3.0" [[deps.StridedViews]] deps = ["LinearAlgebra", "PackageExtensionCompat"] -git-tree-sha1 = "b60baf1998bcdccc57e1cc2c6703df1f619a3754" +git-tree-sha1 = "425158c52aa58d42593be6861befadf8b2541e9b" uuid = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143" -version = "0.3.2" +version = "0.4.1" [deps.StridedViews.extensions] StridedViewsCUDAExt = "CUDA" + StridedViewsPtrArraysExt = "PtrArrays" [deps.StridedViews.weakdeps] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + PtrArrays = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d" [[deps.StringManipulation]] deps = ["PrecompileTools"] @@ -3524,9 +3524,9 @@ version = "1.0.3" [[deps.TZJData]] deps = ["Artifacts"] -git-tree-sha1 = "7def47e953a91cdcebd08fbe76d69d2715499a7d" +git-tree-sha1 = "72df96b3a595b7aab1e101eb07d2a435963a97e2" uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" -version = "1.4.0+2025a" +version = "1.5.0+2025b" [[deps.TableOperations]] deps = ["SentinelArrays", "Tables", "Test"] @@ -3604,9 +3604,9 @@ version = "0.5.28" [[deps.Tracker]] deps = ["Adapt", "ChainRulesCore", "DiffRules", "ForwardDiff", "Functors", "LinearAlgebra", "LogExpFunctions", "MacroTools", "NNlib", "NaNMath", "Optimisers", "Printf", "Random", "Requires", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "c266e49953dadd0923caa17b3ea464ab6b97b3f2" +git-tree-sha1 = "83697ba2237663355de8fb0a800144cda44848a0" uuid = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" -version = "0.2.37" +version = "0.2.38" weakdeps = ["PDMats"] [deps.Tracker.extensions] @@ -3667,22 +3667,10 @@ weakdeps = ["DynamicHMC", "Optim"] TuringDynamicHMCExt = "DynamicHMC" TuringOptimExt = "Optim" -[[deps.TuringBenchmarking]] -deps = ["ADTypes", "AbstractMCMC", "BenchmarkTools", "DynamicPPL", "ForwardDiff", "LinearAlgebra", "LogDensityProblems", "PrettyTables", "Requires", "ReverseDiff", "Zygote"] -git-tree-sha1 = "a03f2d71dfc88bf370d67c8ae84dfa109b2702bb" -uuid = "0db1332d-5c25-4deb-809f-459bc696f94f" -version = "0.5.9" - - [deps.TuringBenchmarking.extensions] - TuringBenchmarkingBridgeStanExt = "BridgeStan" - - [deps.TuringBenchmarking.weakdeps] - BridgeStan = "c88b6f0a-829e-4b0b-94b7-f06ab5908f5a" - [[deps.URIs]] -git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" +git-tree-sha1 = "cbbebadbcc76c5ca1cc4b4f3b0614b3e603b5000" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.5.1" +version = "1.5.2" [[deps.UUIDs]] deps = ["Random", "SHA"] @@ -3814,21 +3802,21 @@ version = "2.13.6+1" [[deps.XSLT_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "XML2_jll", "Zlib_jll"] -git-tree-sha1 = "7d1671acbe47ac88e981868a078bd6b4e27c5191" +git-tree-sha1 = "82df486bfc568c29de4a207f7566d6716db6377c" uuid = "aed1982a-8fda-507f-9586-7b0439959a61" -version = "1.1.42+0" +version = "1.1.43+0" [[deps.XZ_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "56c6604ec8b2d82cc4cfe01aa03b00426aac7e1f" +git-tree-sha1 = "6e6f1a4f245f66f93f28e55879f9ba47fed66f36" uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800" -version = "5.6.4+1" +version = "5.8.0+0" [[deps.Xorg_libICE_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "326b4fea307b0b39892b3e85fa451692eda8d46c" +git-tree-sha1 = "a3ea76ee3f4facd7a64684f9af25310825ee3668" uuid = "f67eecfb-183a-506d-b269-f58e52b52d7c" -version = "1.1.1+0" +version = "1.1.2+0" [[deps.Xorg_libSM_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libICE_jll"] @@ -3964,9 +3952,9 @@ version = "2.39.0+0" [[deps.Xorg_xtrans_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6dba04dbfb72ae3ebe5418ba33d087ba8aa8cb00" +git-tree-sha1 = "a63799ff68005991f9d9491b6e95bd3478d783cb" uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" -version = "1.5.1+0" +version = "1.6.0+0" [[deps.Zlib_jll]] deps = ["Libdl"] @@ -3981,9 +3969,9 @@ version = "1.5.7+1" [[deps.Zygote]] deps = ["AbstractFFTs", "ChainRules", "ChainRulesCore", "DiffRules", "Distributed", "FillArrays", "ForwardDiff", "GPUArrays", "GPUArraysCore", "IRTools", "InteractiveUtils", "LinearAlgebra", "LogExpFunctions", "MacroTools", "NaNMath", "PrecompileTools", "Random", "Requires", "SparseArrays", "SpecialFunctions", "Statistics", "ZygoteRules"] -git-tree-sha1 = "0b3c944f5d2d8b466c5d20a84c229c17c528f49e" +git-tree-sha1 = "3c73ed65f928f8602e9a30e93125b209133498a9" uuid = "e88e6eb3-aa80-5325-afca-941959d7151f" -version = "0.6.75" +version = "0.6.76" weakdeps = ["Colors", "Distances", "Tracker"] [deps.Zygote.extensions] diff --git a/Project.toml b/Project.toml index daed8daf6..d98ae25d1 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918" AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d" AdvancedMH = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170" +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Bijectors = "76274a88-744f-5084-9051-94815aaf08c4" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" @@ -48,7 +49,6 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" -TuringBenchmarking = "0db1332d-5c25-4deb-809f-459bc696f94f" UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" diff --git a/core-functionality/index.qmd b/core-functionality/index.qmd index 5bd8ec061..5600a967a 100755 --- a/core-functionality/index.qmd +++ b/core-functionality/index.qmd @@ -344,13 +344,9 @@ For example, let `c` be a `Chain`: #### Variable Types and Type Parameters -The element type of a vector (or matrix) of random variables should match the `eltype` of its prior distribution, `<: Integer` for discrete distributions and `<: AbstractFloat` for continuous distributions. Moreover, if the continuous random variable is to be sampled using a Hamiltonian sampler, the vector's element type needs to either be: +The element type of a vector (or matrix) of random variables should match the `eltype` of its prior distribution, `<: Integer` for discrete distributions and `<: AbstractFloat` for continuous distributions. -1. `Real` to enable auto-differentiation through the model which uses special number types that are sub-types of `Real`, or - -2. Some type parameter `T` defined in the model header using the type parameter syntax, e.g. `function gdemo(x, ::Type{T} = Float64) where {T}`. - -Similarly, when using a particle sampler, the Julia variable used should either be: +Moreover, when using a particle sampler, the Julia variable used should either be: 1. An `Array`, or diff --git a/usage/automatic-differentiation/index.qmd b/usage/automatic-differentiation/index.qmd index e95d28083..12657f49e 100755 --- a/usage/automatic-differentiation/index.qmd +++ b/usage/automatic-differentiation/index.qmd @@ -12,34 +12,129 @@ using Pkg; Pkg.instantiate(); ``` -## Switching AD Modes +## What is Automatic Differentiation? -Turing currently supports four automatic differentiation (AD) backends for sampling: [ForwardDiff](https://github.com/JuliaDiff/ForwardDiff.jl) for forward-mode AD; and [Mooncake](https://github.com/compintell/Mooncake.jl), [ReverseDiff](https://github.com/JuliaDiff/ReverseDiff.jl), and [Zygote](https://github.com/FluxML/Zygote.jl) for reverse-mode AD. -`ForwardDiff` is automatically imported by Turing. To utilize `Mooncake`, `Zygote`, or `ReverseDiff` for AD, users must explicitly import them with `import Mooncake`, `import Zygote` or `import ReverseDiff`, alongside `using Turing`. +Automatic differentiation (AD) is a technique used in Turing.jl to evaluate the gradient of a function at a given set of arguments. +In the context of Turing.jl, the function being differentiated is the log probability density of a model, and the arguments are the parameters of the model (i.e. the values of the random variables). +The gradient of the log probability density is used by various algorithms in Turing.jl, such as HMC (including NUTS), mode estimation (which uses gradient-based optimization), and variational inference. -As of Turing version v0.30, the global configuration flag for the AD backend has been removed in favour of [`AdTypes.jl`](https://github.com/SciML/ADTypes.jl), allowing users to specify the AD backend for individual samplers independently. -Users can pass the `adtype` keyword argument to the sampler constructor to select the desired AD backend, with the default being `AutoForwardDiff(; chunksize=0)`. +The Julia ecosystem has a number of AD libraries. +You can switch between them at will using the unified [ADTypes.jl](https://github.com/SciML/ADTypes.jl/) interface, which for a given AD backend, provides types such as `AutoBackend` (see [the documentation](https://docs.sciml.ai/ADTypes/stable/) for more details). +For example, to use the [Mooncake.jl](https://github.com/compintell/Mooncake.jl) package for AD, you can run the following: -For `ForwardDiff`, pass `adtype=AutoForwardDiff(; chunksize)` to the sampler constructor. A `chunksize` of `nothing` permits the chunk size to be automatically determined. For more information regarding the selection of `chunksize`, please refer to [related section of `ForwardDiff`'s documentation](https://juliadiff.org/ForwardDiff.jl/dev/user/advanced/#Configuring-Chunk-Size). +```{julia} +using Turing +setprogress!(false) +# Note that if you specify a custom AD backend, you must also import it. +import Mooncake -For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. An additional keyword argument called `compile` can be provided to `AutoReverseDiff`. It specifies whether to pre-record the tape only once and reuse it later (`compile` is set to `false` by default, which means no pre-recording). This can substantially improve performance, but risks silently incorrect results if not used with care. +@model function f() + x ~ Normal() + # Rest of your model here +end +sample(f(), HMC(0.1, 5; adtype=AutoMooncake(; config=nothing)), 100) +``` +By default, if you do not specify a backend, Turing will default to [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl). +In this case, you do not need to import ForwardDiff, as it is already a dependency of Turing. -Pre-recorded tapes should only be used if you are absolutely certain that the sequence of operations performed in your code does not change between different executions of your model. -Thus, e.g., in the model definition and all implicitly and explicitly called functions in the model, all loops should be of fixed size, and `if`-statements should consistently execute the same branches. -For instance, `if`-statements with conditions that can be determined at compile time or conditions that depend only on fixed properties of the model, e.g. fixed data. -However, `if`-statements that depend on the model parameters can take different branches during sampling; hence, the compiled tape might be incorrect. -Thus you must not use compiled tapes when your model makes decisions based on the model parameters, and you should be careful if you compute functions of parameters that those functions do not have branching which might cause them to execute different code for different values of the parameter. +## Choosing an AD Backend + +There are two aspects to choosing an AD backend: firstly, what backends are available; and secondly, which backend is best for your model. + +### Usable AD Backends + +Turing.jl uses the functionality in [DifferentiationInterface.jl](https://github.com/JuliaDiff/DifferentiationInterface.jl) ('DI') to interface with AD libraries in a unified way. +Thus, in principle, any AD library that has integrations with DI can be used with Turing; you should consult the [DI documentation](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/stable/) for an up-to-date list of compatible AD libraries. + +Note, however, that not all AD libraries in there are tested on Turing models. +Thus, it is likely that some of them will either error (because they don't know how to differentiate through Turing's code), or maybe even silently give incorrect results (if you are very unlucky). + +Formally, our working model is that we have several _tiers_ of integration with AD libraries. +Generally, we recommend that users choose AD libraries that are in **Tier 2 or above**. + +| Integration tier | Works with DI | Tested in DynamicPPL CI | Summary | Current examples | +|------------------|---------------|-------------------------|----------------------------------|--------------------------| +| 3 | Yes | Yes | 'We will (try to) make it work' | Mooncake | +| 2 | Yes | Yes | 'We think it should work' | ForwardDiff, ReverseDiff | +| 1 | Yes | No | 'You're on your own' | Enzyme, Zygote | +| 0 | No | No | 'You can't use this' | | + +**Tier 0** means that the AD library is not integrated with DI, and thus will not work with Turing. + +**Tier 1** means that the AD library is integrated with DI, and you can try to use it with Turing if you like; however, we provide no guarantee that it will work correctly. +If you submit an issue about using Turing with a Tier 1 library, it is unlikely that we will be able to help you, unless the issue is very simple to fix. + +**Tier 2** indicates some level of confidence on our side that the AD library will work, because it is included as part of DynamicPPL's continuous integration (CI) tests. +If you find that a Tier 2 backend does not work with Turing, you are welcome to submit an issue, and we will try to look into it. +Note, however, that this does not imply that we take responsibility for ensuring that any given model will work with these backends. +This may be either due to upstream bugs / limitations (which exist even for ForwardDiff), or simply because of time constraints. +However, if there are workarounds that can be implemented in Turing to make the backend work, we will try to do so. + +**Tier 3** is the same as Tier 2, but in addition to that, we formally also take responsibility for ensuring that the backend works with Turing models. +If you submit an issue about using Turing with a Tier 3 library, we will actively try to make it work. +Realistically, this is only possible for AD backends that are actively maintained by somebody on the Turing team, such as Mooncake. + +### The Best AD Backend for Your Model + +Given this choice of backends, how do you choose the best one for your model? + +A simple heuristic is to look at the number of parameters in your model. +The log density of the model, i.e. the function being differentiated, is a function that goes from $\mathbb{R}^n \to \mathbb{R}$, where $n$ is the number of parameters in your model. +For models with a small number of parameters (say up to 20), forward-mode AD (e.g. ForwardDiff) is generally faster due to a smaller overhead. +On the other hand, for models with a large number of parameters, reverse-mode AD (e.g. ReverseDiff or Mooncake) is generally faster as it computes the gradients with respect to all parameters in a single pass. + +For a more exact approach, you can benchmark the different AD backends on your model. + +```{julia} +using ADTypes +using BenchmarkTools +using DynamicPPL: LogDensityFunction +using LogDensityProblems: logdensity_and_gradient +using ForwardDiff, ReverseDiff, Mooncake + +@model function f(y) + x = Vector{Float64}(undef, length(y)) + for i in eachindex(y) + x[i] ~ Normal() + y[i] ~ Normal(x[i]) + end +end + +ADTYPES = [AutoForwardDiff(), AutoReverseDiff(; compile=true), AutoMooncake(; config=nothing)] + +function benchmark_model(size) + x, y = randn(size), randn(size) + for adtype in ADTYPES + ldf = LogDensityFunction(f(y); adtype=adtype) + result = @benchmark logdensity_and_gradient($ldf, $x) + println("AD type: $adtype, time: $(median(result).time)") + end +end + +benchmark_model(10) +``` -For `Zygote`, pass `adtype=AutoZygote()` to the sampler constructor. +(Note that the times are reported in nanoseconds.) +We can also use this to see that reverse-mode AD works better on larger models: -And the previously used interface functions including `ADBackend`, `setadbackend`, `setsafe`, `setchunksize`, and `setrdcache` are deprecated and removed. +```{julia} +benchmark_model(100) +``` + +::: {.callout-note} +The additional keyword argument `compile=true` for `AutoReverseDiff` specifies whether to pre-record the tape only once and reuse it later. +By default, this is set to `false`, which means no pre-recording. +Setting `compile=true` can substantially improve performance, but risks silently incorrect results if not used with care. +Pre-recorded tapes should only be used if you are absolutely certain that the sequence of operations performed in your code does not change between different executions of your model. +::: ## Compositional Sampling with Differing AD Modes -Turing supports intermixed automatic differentiation methods for different variable spaces. The snippet below shows using `ForwardDiff` to sample the mean (`m`) parameter, and using `ReverseDiff` for the variance (`s`) parameter: +Turing supports intermixed automatic differentiation methods for different variable spaces when using a Gibbs sampler. +The snippet below shows using `ForwardDiff` to sample the mean (`m`) parameter, and using `ReverseDiff` for the variance (`s²`) parameter: ```{julia} using Turing @@ -65,14 +160,69 @@ c = sample( ) ``` -Generally, reverse-mode AD, for instance `ReverseDiff`, is faster when sampling from variables of high dimensionality (greater than 20), while forward-mode AD, for instance `ForwardDiff`, is more efficient for lower-dimension variables. This functionality allows those who are performance sensitive to fine tune their automatic differentiation for their specific models. +## Troubleshooting -If the differentiation method is not specified in this way, Turing will default to using whatever the global AD backend is. -Currently, this defaults to `ForwardDiff`. +### ForwardDiff -The most reliable way to ensure you are using the fastest AD that works for your problem is to benchmark them using [`TuringBenchmarking`](https://github.com/TuringLang/TuringBenchmarking.jl): +A common error with ForwardDiff looks like this: ```{julia} -using TuringBenchmarking -benchmark_model(gdemo(1.5, 2), adbackends=[AutoForwardDiff(), AutoReverseDiff()]) +#| error: true +@model function forwarddiff_fail() + x = Float64[0.0, 1.0] + a ~ Normal() + @show typeof(a) + x[1] = a + b ~ MvNormal(x, I) +end +sample(forwarddiff_fail(), NUTS(; adtype=AutoForwardDiff()), 10) ``` + +The problem here is the line `x[1] = a`. +When the log probability density of the model is calculated, `a` is sampled from a normal distribution and is thus a Float64; however, when ForwardDiff calculates the gradient of the log density, `a` is a `ForwardDiff.Dual` object. +However, `x` is _always_ a `Vector{Float64}`, and the call `x[1] = a` attempts to insert a `Dual` object into a `Vector{Float64}`, which is not allowed. + +::: {.callout-note} +In more depth: the basic premise of ForwardDiff is that functions have to accept `Real` parameters instead of `Float64` (since `Dual` is a subtype of `Real`). +Here, the line `x[1] = a` is equivalent to `setindex!(x, a, 1)`, and although the method `setindex!(::Vector{Float64}, ::Real, ...)` does exist, it attempts to convert the `Real` into a `Float64`, which is where it fails. +::: + +There are two ways around this. + +Firstly, you could broaden the type of the container: + +```{julia} +@model function forwarddiff_working1() + x = Real[0.0, 1.0] + a ~ Normal() + x[1] = a + b ~ MvNormal(x, I) +end +sample(forwarddiff_working1(), NUTS(; adtype=AutoForwardDiff()), 10) +``` + +Or, you can pass a type as a parameter to the model: + +```{julia} +@model function forwarddiff_working2(::Type{T}=Float64) where T + x = T[0.0, 1.0] + a ~ Normal() + x[1] = a + b ~ MvNormal(x, I) +end +sample(forwarddiff_working2(), NUTS(; adtype=AutoForwardDiff()), 10) +``` + +## For AD Backend Developers + +Suppose you have developed a new AD backend and want to integrate it with Turing. +Revisiting the tier system described above, to go from Tier 0 to Tier 1, you should first integrate your AD library with DifferentiationInterface. + +Going from Tier 1 to Tier 2 is the situation that will likely require the most work. +We believe that integration tests should be run on _both_ the AD library and Turing to ensure that changes to either do not break the compatibility. +Thus, we require that AD libraries in Tier 2 have their own CI tests that run Turing models; and in return we will also add tests for your AD backend on our side. +Please do open an issue in the first instance if you would like to discuss this further. + +We are currently working on formalising and exporting a set of tests, which will allow you to easily test your AD library on a range of Turing models. +Keep an eye out for updates on this in the future! +