From 959bebb99673eac629ed4fa24bb2ebeca2049b28 Mon Sep 17 00:00:00 2001 From: seabbs-bot Date: Sat, 5 Dec 2026 00:46:33 +0000 Subject: [PATCH] Time only the convolution body for a revision whose fixtures predate the suite Kit 0.5.2's history workflow times each tag with that tag's own test/ADFixtures, but with the pushed commit's benchmark script. v0.1.0's fixtures lack the registry calls the script makes, so every bench cell failed to load the script. Such a revision now times the convolution body alone. The kit side is https://github.com/EpiAware/EpiAwarePackageTools.jl/issues/623. Co-Authored-By: Claude Opus 5.5 --- benchmark/benchmarks.jl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index 87e2480a0..23f0eb618 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -47,6 +47,14 @@ end using ADFixtures import DifferentiationInterface as DI +# The history workflow times each tag with that tag's own `test/ADFixtures` +# (EpiAwarePackageTools 0.5.2). Fixtures from before this suite's registry +# calls, those of v0.1.0, cannot build its gradient grid or matrix cases, +# so such a revision times the convolution body alone. +const _CURRENT_FIXTURES = isdefined(ADFixtures, :benchmarked_backends) +_CURRENT_FIXTURES || @warn "test/ADFixtures predates this suite: " * + "timing the convolution body alone" + # `BENCHMARK_TIER`: `pr`, the default when unset or empty, is small enough # for a pull request job; `full` times everything below. `pr` leaves out the # registry scenarios, the `NoAdjoint` and `loop` arms, the forward modes and @@ -78,7 +86,8 @@ const _PR_BACKENDS = ("ForwardDiff", "Mooncake reverse", "Enzyme reverse") # `BENCHMARK_MATRIX=false` also leaves out the matrix cases' gradients, # so a job times only the registry grid; the `primal` groups follow # `BENCHMARK_BACKENDS` alone. -const _ALL_BACKENDS = ADFixtures.benchmarked_backends() +const _ALL_BACKENDS = _CURRENT_FIXTURES ? + ADFixtures.benchmarked_backends() : NamedTuple[] const _SELECTED = let spec = strip(get(ENV, "BENCHMARK_BACKENDS", "")) if isempty(spec) nothing @@ -88,7 +97,7 @@ const _SELECTED = let spec = strip(get(ENV, "BENCHMARK_BACKENDS", "")) ) known = Set(["primal"; [e.name for e in _ALL_BACKENDS]]) unknown = setdiff(names, known) - isempty(unknown) || error( + isempty(unknown) || !_CURRENT_FIXTURES || error( "unknown BENCHMARK_BACKENDS $(join(sort!(collect(unknown)), ", "))" ) names @@ -100,7 +109,7 @@ end # `BENCHMARK_BACKENDS`. const _ONLY = let only = String(strip(get(ENV, "BENCHMARK_AD_BACKEND", ""))) isempty(only) || only in [e.name for e in _ALL_BACKENDS] || - error("unknown BENCHMARK_AD_BACKEND $only") + !_CURRENT_FIXTURES || error("unknown BENCHMARK_AD_BACKEND $only") only end _selected(name) = !(_AD_ONLY && name == "primal") && @@ -168,7 +177,8 @@ using ADFixtures: MatrixCases # Left out with `BENCHMARK_MATRIX=false` (see `BENCHMARK_BACKENDS` above) # and in the `ad` tier. -const _MATRIX = get(ENV, "BENCHMARK_MATRIX", "true") != "false" && !_AD_ONLY +const _MATRIX = get(ENV, "BENCHMARK_MATRIX", "true") != "false" && + !_AD_ONLY && _CURRENT_FIXTURES # The `pr` tier times only the `rule` arm, on its three backends. const _MATRIX_ARMS = _FULL ? ("rule", "NoAdjoint", "loop") : ("rule",) const _MATRIX_BACKENDS = _FULL ? BENCHMARK_BACKENDS :