From b001128f0093205507361643c07d629532fcb0d8 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sat, 24 Aug 2024 00:53:06 -0700 Subject: [PATCH] ci: parallel CPU testing --- test/layer_tests.jl | 3 ++- test/runtests.jl | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/layer_tests.jl b/test/layer_tests.jl index 6cadcc5..c702051 100644 --- a/test/layer_tests.jl +++ b/test/layer_tests.jl @@ -20,7 +20,8 @@ @jet model(x, ps, st) __f = (x, ps) -> sum(abs2, first(model(x, ps, st))) - test_gradients(__f, x, ps; atol=1e-3, rtol=1e-3) + test_gradients( + __f, x, ps; atol=1e-3, rtol=1e-3, soft_fail=[AutoFiniteDiff()]) end end end diff --git a/test/runtests.jl b/test/runtests.jl index c5e84f6..5ed2d20 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -19,11 +19,15 @@ end using Boltz const BOLTZ_TEST_GROUP = get(ENV, "BOLTZ_TEST_GROUP", "all") +const RETESTITEMS_NWORKERS = parse( + Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 16)))) const RETESTITEMS_NWORKER_THREADS = parse(Int, - get(ENV, "RETESTITEMS_NWORKER_THREADS", string(max(Hwloc.num_virtual_cores(), 1)))) + get(ENV, "RETESTITEMS_NWORKER_THREADS", + string(max(Hwloc.num_virtual_cores() ÷ RETESTITEMS_NWORKERS, 1)))) -@info "Running tests for group: $BOLTZ_TEST_GROUP" +@info "Running tests for group: $BOLTZ_TEST_GROUP with $RETESTITEMS_NWORKERS workers" ReTestItems.runtests( Boltz; tags=(BOLTZ_TEST_GROUP == "all" ? nothing : [Symbol(BOLTZ_TEST_GROUP)]), - nworkers=0, nworker_threads=RETESTITEMS_NWORKER_THREADS, testitem_timeout=3600) + nworkers=ifelse(BACKEND_GROUP ∈ ("cuda", "amdgpu"), 0, RETESTITEMS_NWORKERS), + nworker_threads=RETESTITEMS_NWORKER_THREADS, testitem_timeout=3600)