Skip to content

Commit 0a4200b

Browse files
committed
Beef up the workers
1 parent f0494c2 commit 0a4200b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test/runtests.jl‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ args = parse_args(ARGS; custom = ["fast"])
3030
# --fast: skip AD tests and inject fast_tests=true into each worker sandbox
3131
fast = !isnothing(args.custom["fast"])
3232

33+
# Enzyme workers end up needing ~4 GB, but the default job count assumes ~2 GB per worker.
34+
# Cap the number of jobs by increasing the per-worker memory budger unless --jobs was given.
35+
selected = copy(testsuite)
36+
ParallelTestRunner.filter_tests!(selected, args)
37+
if isnothing(args.jobs) && any(startswith("enzyme"), keys(selected))
38+
njobs = clamp(Int(Sys.free_memory() ÷ (4 * Int64(2)^30)), 1, Sys.CPU_THREADS)
39+
args = ParallelTestRunner.ParsedArgs(
40+
Some(njobs), args.verbose, args.quickfail, args.list, args.custom, args.positionals
41+
)
42+
end
43+
3344
setup_path = joinpath(@__DIR__, "setup.jl")
3445
const init_worker_code = quote
3546
const fast_tests = $fast

0 commit comments

Comments
 (0)