Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try just 1 thread on x86 #747

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- version: '1'
os: ubuntu-latest
arch: x86
num_threads: 2
num_threads: 1
# Windows
- version: '1'
os: windows-latest
Expand Down
9 changes: 8 additions & 1 deletion test/debug_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions test/lkj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand All @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Random.seed!(100)

include("test_util.jl")

@testset "DynamicPPL.jl" begin
@testset verbose=true "DynamicPPL.jl" begin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@testset verbose=true "DynamicPPL.jl" begin
@testset verbose = true "DynamicPPL.jl" begin

if GROUP == "All" || GROUP == "DynamicPPL"
@testset "interface" begin
include("utils.jl")
Expand Down Expand Up @@ -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
Expand Down
Loading