Skip to content

Commit

Permalink
Increase atol on specific tests for x86 (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm authored Dec 20, 2024
1 parent 25d2023 commit 1c60b7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/mcmc/ess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ using Turing
@varname(mu2) => ESS(),
)
chain = sample(StableRNG(seed), MoGtest_default, alg, 2000)
check_MoGtest_default(chain; atol=0.1)
# (penelopeysm) Note that the tolerance for x86 needs to be larger
# because CSMC (i.e. PG) is not reproducible across architectures.
# See https://github.com/TuringLang/Turing.jl/issues/2446.
atol = Sys.ARCH == :i686 ? 0.12 : 0.1
check_MoGtest_default(chain; atol=atol)
end

@testset "TestModels" begin
Expand Down
8 changes: 7 additions & 1 deletion test/mcmc/gibbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,13 @@ end
# the posterior is analytically known? Doing 10_000 samples to run the test suite
# is not ideal
# Issue ref: https://github.com/TuringLang/Turing.jl/issues/2402
@test isapprox(mean(num_ms), 8.6087; atol=0.8)

# (penelopeysm) Note also the larger atol on x86 runners. This is
# needed because PG is not fully reproducible across architectures,
# even when seeded as above. See
# https://github.com/TuringLang/Turing.jl/issues/2446
mean_atol = Sys.ARCH == :i686 ? 1.3 : 0.8
@test isapprox(mean(num_ms), 8.6087; atol=mean_atol)
@test isapprox(std(num_ms), 1.8865; atol=0.02)
end

Expand Down

0 comments on commit 1c60b7a

Please sign in to comment.