Skip to content

ForwardDiff -> 1 #871

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

Merged
merged 4 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# DynamicPPL Changelog

## 0.36.10

Added compatibility with ForwardDiff 1.0.

## 0.36.9

Fixed a failure when sampling from `ProductNamedTupleDistribution` due to
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DynamicPPL"
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
version = "0.36.9"
version = "0.36.10"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down Expand Up @@ -58,7 +58,7 @@ DifferentiationInterface = "0.6.41, 0.7"
Distributions = "0.25"
DocStringExtensions = "0.9"
EnzymeCore = "0.6 - 0.8"
ForwardDiff = "0.10.12"
ForwardDiff = "0.10.12, 1"
InteractiveUtils = "1"
JET = "0.9, 0.10"
KernelAbstractions = "0.9.33"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Documenter = "1"
DocumenterMermaid = "0.1, 0.2"
DynamicPPL = "0.36"
FillArrays = "0.13, 1"
ForwardDiff = "0.10"
ForwardDiff = "0.10, 1"
JET = "0.9, 0.10"
LogDensityProblems = "2"
MCMCChains = "5, 6, 7"
Expand Down
4 changes: 1 addition & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down Expand Up @@ -36,13 +35,12 @@ Accessors = "0.1"
Aqua = "0.8"
Bijectors = "0.15.1"
Combinatorics = "1"
Compat = "4.3.0"
DifferentiationInterface = "0.6.41, 0.7"
Distributions = "0.25"
DistributionsAD = "0.6.3"
Documenter = "1"
EnzymeCore = "0.6 - 0.8"
ForwardDiff = "0.10.12"
ForwardDiff = "0.10.12, 1"
JET = "0.9, 0.10"
LogDensityProblems = "2"
MCMCChains = "6.0.4, 7"
Expand Down
29 changes: 0 additions & 29 deletions test/compat/ad.jl

This file was deleted.

4 changes: 0 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ using MCMCChains
using StableRNGs
using ReverseDiff
using Zygote
using Compat

using Distributed
using LinearAlgebra
Expand Down Expand Up @@ -79,9 +78,6 @@ include("test_util.jl")
end

if GROUP == "All" || GROUP == "Group2"
@testset "compat" begin
include(joinpath("compat", "ad.jl"))
end
@testset "extensions" begin
include("ext/DynamicPPLMCMCChainsExt.jl")
include("ext/DynamicPPLJETExt.jl")
Expand Down
20 changes: 0 additions & 20 deletions test/test_util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@
end
const gdemo_default = gdemo_d()

# TODO(penelopeysm): Remove this (and also test/compat/ad.jl)
function test_model_ad(model, logp_manual)
vi = VarInfo(model)
x = vi[:]

# Log probabilities using the model.
ℓ = DynamicPPL.LogDensityFunction(model, vi)
logp_model = Base.Fix1(LogDensityProblems.logdensity, ℓ)

# Check that both functions return the same values.
lp = logp_manual(x)
@test logp_model(x) ≈ lp

# Gradients based on the manual implementation.
grad = ForwardDiff.gradient(logp_manual, x)

# Gradients based on the model.
@test ForwardDiff.gradient(logp_model, x) ≈ grad
end

"""
short_varinfo_name(vi::AbstractVarInfo)

Expand Down
Loading