Skip to content

Commit

Permalink
CompatHelper: bump compat for Turing to 0.30, (keep existing compat) (#…
Browse files Browse the repository at this point in the history
…99)

* CompatHelper: bump compat for Turing to 0.30, (keep existing compat)

* fix: adbackends with Turing 0.30

---------

Co-authored-by: CompatHelper Julia <[email protected]>
Co-authored-by: Jose Storopoli <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2023
1 parent a4eab6f commit 4a13495
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ StatsBase = "0.33, 0.34"
StatsModels = "0.6.28, 0.7"
TableOperations = "1.2"
Tables = "1.6"
Turing = "0.20 - 0.27, 0.28, 0.29"
Turing = "0.20 - 0.27, 0.28, 0.29, 0.30"
julia = "1"
14 changes: 4 additions & 10 deletions test/ad_backends.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,24 @@
m = turing_model(f, cheese)
# only running 2 samples to test if the different ADs runs
@timed_testset "ForwardDiff" begin
Turing.setadbackend(:forwarddiff)
chn = sample(m, NUTS(), 2)
chn = sample(m, NUTS(; adtype=AutoForwardDiff(; chunksize=8)), 2)
@test chn isa Chains
end
# TODO: fix Tracker tests
# @timed_testset "Tracker" begin
# using Tracker
# Turing.setadbackend(:tracker)
# chn = sample(m, NUTS(), 2)
# chn = sample(m, NUTS(; adtype=AutoTracker()), 2)
# @test chn isa Chains
# end
# TODO: fix Zygote tests
# @timed_testset "Zygote" begin
# using Zygote
# Turing.setadbackend(:zygote)
# chn = sample(m, NUTS(), 2)
# chn = sample(m, NUTS(; adtype=AutoZygote()), 2)
# @test chn isa Chains
# end
@timed_testset "ReverseDiff" begin
using ReverseDiff
Turing.setadbackend(:reversediff)
chn = sample(m, NUTS(), 2)
chn = sample(m, NUTS(; adtype=AutoReverseDiff(; compile=true)), 2)
@test chn isa Chains
end
# go back to defaults
Turing.setadbackend(:forwarddiff)
end

0 comments on commit 4a13495

Please sign in to comment.