From 4a13495da78262d531afcd5b5a2ebb3cd63ac48d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 06:17:50 -0300 Subject: [PATCH] CompatHelper: bump compat for Turing to 0.30, (keep existing compat) (#99) * CompatHelper: bump compat for Turing to 0.30, (keep existing compat) * fix: adbackends with Turing 0.30 --------- Co-authored-by: CompatHelper Julia Co-authored-by: Jose Storopoli --- Project.toml | 2 +- test/ad_backends.jl | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index 3047079..84c7154 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/test/ad_backends.jl b/test/ad_backends.jl index f0dc11d..243d9a4 100644 --- a/test/ad_backends.jl +++ b/test/ad_backends.jl @@ -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