Skip to content

Commit 1c60b7a

Browse files
authored
Increase atol on specific tests for x86 (#2449)
1 parent 25d2023 commit 1c60b7a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/mcmc/ess.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ using Turing
7171
@varname(mu2) => ESS(),
7272
)
7373
chain = sample(StableRNG(seed), MoGtest_default, alg, 2000)
74-
check_MoGtest_default(chain; atol=0.1)
74+
# (penelopeysm) Note that the tolerance for x86 needs to be larger
75+
# because CSMC (i.e. PG) is not reproducible across architectures.
76+
# See https://github.com/TuringLang/Turing.jl/issues/2446.
77+
atol = Sys.ARCH == :i686 ? 0.12 : 0.1
78+
check_MoGtest_default(chain; atol=atol)
7579
end
7680

7781
@testset "TestModels" begin

test/mcmc/gibbs.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,13 @@ end
481481
# the posterior is analytically known? Doing 10_000 samples to run the test suite
482482
# is not ideal
483483
# Issue ref: https://github.com/TuringLang/Turing.jl/issues/2402
484-
@test isapprox(mean(num_ms), 8.6087; atol=0.8)
484+
485+
# (penelopeysm) Note also the larger atol on x86 runners. This is
486+
# needed because PG is not fully reproducible across architectures,
487+
# even when seeded as above. See
488+
# https://github.com/TuringLang/Turing.jl/issues/2446
489+
mean_atol = Sys.ARCH == :i686 ? 1.3 : 0.8
490+
@test isapprox(mean(num_ms), 8.6087; atol=mean_atol)
485491
@test isapprox(std(num_ms), 1.8865; atol=0.02)
486492
end
487493

0 commit comments

Comments
 (0)