From 4f177b883bac900ce21f09209243050f581af6f7 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Wed, 11 Dec 2024 22:38:25 +0000 Subject: [PATCH 1/4] Try just 1 thread on x86 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 63019aa44..304e8dc95 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,7 +47,7 @@ jobs: - version: '1' os: ubuntu-latest arch: x86 - num_threads: 2 + num_threads: 1 # Windows - version: '1' os: windows-latest From 6bc67bfe313c5b186f1f047eef1a1867b52f5ea9 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 12 Dec 2024 11:21:51 +0000 Subject: [PATCH 2/4] Insert GC call before doctests --- test/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runtests.jl b/test/runtests.jl index aea02a337..f8ec885f5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -114,6 +114,7 @@ include("test_util.jl") # This is a line that starts with "└ @ " and ends with the line number. r"└ @ .+:[0-9]+", ] + GC.gc() doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters) end end From 4412a3cc989b36746e44ad223392a22e688f6841 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 12 Dec 2024 14:42:34 +0000 Subject: [PATCH 3/4] verbose=true for main testset --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index f8ec885f5..a8d0e4603 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -42,7 +42,7 @@ Random.seed!(100) include("test_util.jl") -@testset "DynamicPPL.jl" begin +@testset verbose=true "DynamicPPL.jl" begin if GROUP == "All" || GROUP == "DynamicPPL" @testset "interface" begin include("utils.jl") From 03935b71b52c949556c8654f3f6defa0774a0144 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 12 Dec 2024 14:42:46 +0000 Subject: [PATCH 4/4] Suppress unneeded output --- test/debug_utils.jl | 9 ++++++++- test/lkj.jl | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/debug_utils.jl b/test/debug_utils.jl index dfa46affc..3fc877503 100644 --- a/test/debug_utils.jl +++ b/test/debug_utils.jl @@ -199,7 +199,14 @@ @test retype <: Tuple # Just make sure the following is runnable. - @test (DynamicPPL.DebugUtils.model_warntype(model); true) + # Suppress output to avoid GHA slowdown(?) + @test begin + oldstd = stdout + redirect_stdout(devnull) + DynamicPPL.DebugUtils.model_warntype(model) + redirect_stdout(oldstd) + true + end end end end diff --git a/test/lkj.jl b/test/lkj.jl index b9c20f916..d581cd21b 100644 --- a/test/lkj.jl +++ b/test/lkj.jl @@ -22,14 +22,14 @@ _lkj_atol = 0.05 model = lkj_prior_demo() # `SampleFromPrior` will sample in constrained space. @testset "SampleFromPrior" begin - samples = sample(model, SampleFromPrior(), 1_000) + samples = sample(model, SampleFromPrior(), 1_000; progress=false) @test mean(map(Base.Fix2(getindex, Colon()), samples)) ≈ target_mean atol = _lkj_atol end # `SampleFromUniform` will sample in unconstrained space. @testset "SampleFromUniform" begin - samples = sample(model, SampleFromUniform(), 1_000) + samples = sample(model, SampleFromUniform(), 1_000; progress=false) @test mean(map(Base.Fix2(getindex, Colon()), samples)) ≈ target_mean atol = _lkj_atol end @@ -39,7 +39,7 @@ end model = lkj_chol_prior_demo(uplo) # `SampleFromPrior` will sample in unconstrained space. @testset "SampleFromPrior" begin - samples = sample(model, SampleFromPrior(), 1_000) + samples = sample(model, SampleFromPrior(), 1_000; progress=false) # Build correlation matrix from factor corr_matrices = map(samples) do s M = reshape(s.metadata.vals, (2, 2)) @@ -50,7 +50,7 @@ end # `SampleFromUniform` will sample in unconstrained space. @testset "SampleFromUniform" begin - samples = sample(model, SampleFromUniform(), 1_000) + samples = sample(model, SampleFromUniform(), 1_000; progress=false) # Build correlation matrix from factor corr_matrices = map(samples) do s M = reshape(s.metadata.vals, (2, 2))