Skip to content

bench: Add Non-Uniform WENO benchmark suite - #609

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
utkuyilmaz1903:bench/weno-nu-performance
Aug 1, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
utkuyilmaz1903:bench/weno-nu-performance

Conversation

@utkuyilmaz1903

@utkuyilmaz1903 utkuyilmaz1903 commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

What

Benchmark suite quantifying the computational cost of non-uniform WENO versus the uniform
baseline, wired into CI via AirspeedVelocity.jl. benchmark/benchmarks.jl defines const SUITE (the standard
PkgBenchmark/ASV entry point) and .github/workflows/benchmark.yml posts a runtime/memory
comparison table on every PR against master.

Fully additive: no src/ changes, no new root dependencies. One new workflow.

  • Layers: kernel (reconstruction only) / rhs (one in-place evaluation) /
    solve (fixed-dt SSPRK33) / discretize (symbolic cost).
  • Grid classes: uniform (scalar dx), uniform_vector (equispaced through the NU path
    to isolate pure kernel overhead), stretched, perturbed (StableRNG seeded).
  • Problems: Smooth periodic advection, inviscid Burgers, two-domain mismatched-grid interface.
  • CI budget: Suite sizes are chosen so the two-revision comparison completes in ~46 min;
    superseded runs are cancelled via a concurrency group. Heavier sweeps are available
    locally through build_weno_suite kwargs.

Cost (from the CI run on this PR)

Layer NU / uniform
Kernel call ~4.9× (97.7 vs 19.9 ns, both 0 alloc)
RHS evaluation (N=128, equispaced data) 1.34× (advection), 1.43× (Burgers)
Symbolic discretize (N=64) ~1.05×
RHS allocations 0 bytes across all 18 problem/grid/N configs

Motivation for the NU capability

Moving-front work-precision: uniform vs stretched vs band-adapted NU grid

Work-precision on a moving tanh front (δ = 0.02), measured with the standalone driver this
PR contained before the AirspeedVelocity migration: the band-adapted NU grid reaches equal
error 2.5–3.0× faster than uniform, and 56–536× lower L2 error at equal N. The non-adapted
stretched grid matches uniform's error at higher cost, confirming the gain comes from
adaptation, not the NU path itself. Accuracy/EOC validation lives in the test suite (MMS
convergence tests, #591); this PR is scoped to continuous performance tracking only.

Reproducibility

benchpkg MethodOfLines --rev=master,<branch> -s benchmark/benchmarks.jl --exeflags="--threads=1"

or in the REPL: include("benchmark/benchmarks.jl"); tune!(SUITE); run(SUITE) with
--project=benchmark.

@utkuyilmaz1903
utkuyilmaz1903 force-pushed the bench/weno-nu-performance branch from c4837f2 to 4a71e55 Compare July 22, 2026 10:43
@utkuyilmaz1903 utkuyilmaz1903 changed the title Bench/weno nu performance bench: Add Non-Uniform WENO benchmark suite Jul 22, 2026
@utkuyilmaz1903
utkuyilmaz1903 force-pushed the bench/weno-nu-performance branch from 4a71e55 to e4506e7 Compare July 28, 2026 22:23
@utkuyilmaz1903
utkuyilmaz1903 marked this pull request as ready for review July 29, 2026 10:49
@utkuyilmaz1903

Copy link
Copy Markdown
Member Author

@ChrisRackauckas The PR now contains only the SUITE definition (benchmark/benchmarks.jl) and the standard ASV action workflow .github/workflows/benchmark.yml

Posting the results manually below: since this PR comes from a fork, the action's GITHUB_TOKEN is read-only and falls back to the job summary instead of a PR comment. The two-revision run completed in ~46 min.

Takeaways from this run:

  • Every kernel and rhs entry is strictly 0 allocs: 0 B on both revisions, across all
    grid classes and the interface problem. solve-layer allocations come from ODE solver
    setup, not the generated RHS, and are identical between revisions.
  • All time ratios are ~1.00 within noise, as expected for a benchmark-only diff — this run
    establishes the baseline; future PRs touching the WENO path will be compared against it
    automatically.
  • The NU overhead is directly readable across rows at equal data, e.g. kernel 97.7 vs
    19.9 ns (~4.9×), amortizing to 1.34–1.43× at the RHS level (N=128). Details in the PR
    description.
Time benchmarks
master b22d5de... master / b22d5de...
discretize/advection/perturbed/N=64 0.439 ± 0.0042 s 0.44 ± 0.0072 s 0.999 ± 0.019
discretize/advection/stretched/N=64 0.437 ± 0.0038 s 0.447 ± 0.0064 s 0.978 ± 0.016
discretize/advection/uniform/N=64 0.373 ± 0.0081 s 0.373 ± 0.0043 s 1 ± 0.025
discretize/advection/uniform_vector/N=64 0.393 ± 0.0065 s 0.39 ± 0.0041 s 1.01 ± 0.02
discretize/burgers/perturbed/N=64 0.475 ± 0.008 s 0.468 ± 0.002 s 1.01 ± 0.018
discretize/burgers/stretched/N=64 0.462 ± 0.0083 s 0.488 ± 0.0033 s 0.945 ± 0.018
discretize/burgers/uniform/N=64 0.393 ± 0.0037 s 0.396 ± 0.0049 s 0.994 ± 0.015
discretize/burgers/uniform_vector/N=64 0.42 ± 0.0079 s 0.435 ± 0.0061 s 0.964 ± 0.023
discretize/interface/stretched/N=41 1.02 ± 0.033 s 1.03 ± 0.012 s 0.99 ± 0.034
discretize/interface/uniform_vector/N=41 0.96 ± 0.015 s 0.958 ± 0.013 s 1 ± 0.021
kernel/boundary/target_1 0.0826 ± 0.00054 μs 0.0824 ± 0.00091 μs 1 ± 0.013
kernel/boundary/target_2 0.0963 ± 0.00087 μs 0.0961 ± 0.00037 μs 1 ± 0.0098
kernel/boundary/target_4 0.0972 ± 0.00037 μs 0.0973 ± 0.00059 μs 0.999 ± 0.0072
kernel/boundary/target_5 0.091 ± 0.00043 μs 0.0911 ± 0.00029 μs 1 ± 0.0057
kernel/nonuniform_center 0.0977 ± 0.00056 μs 0.0975 ± 0.00081 μs 1 ± 0.01
kernel/nonuniform_on_uniform_data 0.0976 ± 0.00054 μs 0.0977 ± 0.00069 μs 0.999 ± 0.0089
kernel/uniform 19.9 ± 0.12 ns 19.9 ± 0.08 ns 1 ± 0.0073
rhs/advection/perturbed/N=128 9.18 ± 0.021 μs 9.13 ± 0.02 μs 1.01 ± 0.0032
rhs/advection/perturbed/N=64 4.79 ± 0.01 μs 4.79 ± 0.011 μs 0.999 ± 0.0032
rhs/advection/stretched/N=128 9.15 ± 0.02 μs 9.21 ± 0.029 μs 0.993 ± 0.0038
rhs/advection/stretched/N=64 4.84 ± 0.013 μs 4.82 ± 0.011 μs 1 ± 0.0036
rhs/advection/uniform/N=128 6.12 ± 0.012 μs 6.12 ± 0.012 μs 1 ± 0.0028
rhs/advection/uniform/N=64 3.16 ± 0.024 μs 3.16 ± 0.028 μs 1 ± 0.012
rhs/advection/uniform_vector/N=128 8.17 ± 0.02 μs 8.18 ± 0.023 μs 0.999 ± 0.0038
rhs/advection/uniform_vector/N=64 4.57 ± 0.019 μs 4.68 ± 0.019 μs 0.977 ± 0.0055
rhs/burgers/perturbed/N=128 9.31 ± 0.021 μs 9.31 ± 0.03 μs 1 ± 0.0039
rhs/burgers/perturbed/N=64 4.78 ± 0.0087 μs 4.8 ± 0.01 μs 0.996 ± 0.0028
rhs/burgers/stretched/N=128 9.12 ± 0.03 μs 9.13 ± 0.02 μs 0.999 ± 0.0039
rhs/burgers/stretched/N=64 4.85 ± 0.011 μs 4.86 ± 0.011 μs 0.998 ± 0.0033
rhs/burgers/uniform/N=128 5.93 ± 0.012 μs 5.94 ± 0.012 μs 0.997 ± 0.0028
rhs/burgers/uniform/N=64 3.06 ± 0.02 μs 3.07 ± 0.014 μs 0.999 ± 0.0079
rhs/burgers/uniform_vector/N=128 8.49 ± 0.021 μs 8.49 ± 0.023 μs 1 ± 0.0037
rhs/burgers/uniform_vector/N=64 4.71 ± 0.013 μs 4.71 ± 0.013 μs 1 ± 0.0039
rhs/interface/stretched/N=41 7.32 ± 0.015 μs 7.32 ± 0.018 μs 1 ± 0.0032
rhs/interface/uniform_vector/N=41 6.94 ± 0.014 μs 6.96 ± 0.014 μs 0.997 ± 0.0028
solve/advection/perturbed/N=128 3.66 ± 0.022 ms 3.65 ± 0.037 ms 1 ± 0.012
solve/advection/perturbed/N=64 1.05 ± 0.028 ms 1.04 ± 0.034 ms 1 ± 0.042
solve/advection/stretched/N=128 3.38 ± 0.031 ms 3.39 ± 0.032 ms 0.997 ± 0.013
solve/advection/stretched/N=64 0.991 ± 0.026 ms 0.985 ± 0.026 ms 1.01 ± 0.037
solve/advection/uniform/N=128 2.2 ± 0.021 ms 2.19 ± 0.021 ms 1 ± 0.014
solve/advection/uniform/N=64 0.696 ± 0.029 ms 0.694 ± 0.031 ms 1 ± 0.061
solve/advection/uniform_vector/N=128 2.72 ± 0.027 ms 2.7 ± 0.029 ms 1 ± 0.015
solve/advection/uniform_vector/N=64 0.87 ± 0.031 ms 0.882 ± 0.031 ms 0.987 ± 0.05
solve/burgers/perturbed/N=128 12.4 ± 0.11 ms 12.6 ± 0.093 ms 0.983 ± 0.011
solve/burgers/perturbed/N=64 3.17 ± 0.025 ms 3.15 ± 0.018 ms 1.01 ± 0.0098
solve/burgers/stretched/N=128 11.1 ± 0.098 ms 11.1 ± 0.11 ms 0.998 ± 0.014
solve/burgers/stretched/N=64 3.02 ± 0.016 ms 3.02 ± 0.025 ms 1 ± 0.01
solve/burgers/uniform/N=128 6.38 ± 0.062 ms 6.39 ± 0.078 ms 0.997 ± 0.016
solve/burgers/uniform/N=64 1.77 ± 0.031 ms 1.78 ± 0.03 ms 0.994 ± 0.024
solve/burgers/uniform_vector/N=128 8.8 ± 0.052 ms 8.92 ± 0.069 ms 0.986 ± 0.0096
solve/burgers/uniform_vector/N=64 2.53 ± 0.024 ms 2.52 ± 0.028 ms 1 ± 0.015
solve/interface/stretched/N=41 2.99 ± 0.031 ms 2.91 ± 0.034 ms 1.03 ± 0.016
solve/interface/uniform_vector/N=41 2.33 ± 0.035 ms 2.26 ± 0.04 ms 1.03 ± 0.024
time_to_load 5.99 ± 0.088 s 5.99 ± 0.013 s 1 ± 0.015
Memory benchmarks
master b22d5de... master / b22d5de...
discretize/advection/perturbed/N=64 2.53 M allocs: 0.0999 GB 2.53 M allocs: 0.0999 GB 1
discretize/advection/stretched/N=64 2.52 M allocs: 0.0984 GB 2.52 M allocs: 0.0984 GB 1
discretize/advection/uniform/N=64 2.04 M allocs: 0.075 GB 2.04 M allocs: 0.075 GB 1
discretize/advection/uniform_vector/N=64 2.2 M allocs: 0.082 GB 2.2 M allocs: 0.0823 GB 0.998
discretize/burgers/perturbed/N=64 2.77 M allocs: 0.107 GB 2.77 M allocs: 0.107 GB 1
discretize/burgers/stretched/N=64 2.76 M allocs: 0.107 GB 2.76 M allocs: 0.106 GB 1
discretize/burgers/uniform/N=64 2.12 M allocs: 0.0767 GB 2.12 M allocs: 0.0767 GB 1
discretize/burgers/uniform_vector/N=64 2.43 M allocs: 0.0904 GB 2.43 M allocs: 0.0903 GB 1
discretize/interface/stretched/N=41 5.65 M allocs: 0.205 GB 5.65 M allocs: 0.205 GB 1
discretize/interface/uniform_vector/N=41 5.16 M allocs: 0.181 GB 5.16 M allocs: 0.181 GB 1
kernel/boundary/target_1 0 allocs: 0 B 0 allocs: 0 B
kernel/boundary/target_2 0 allocs: 0 B 0 allocs: 0 B
kernel/boundary/target_4 0 allocs: 0 B 0 allocs: 0 B
kernel/boundary/target_5 0 allocs: 0 B 0 allocs: 0 B
kernel/nonuniform_center 0 allocs: 0 B 0 allocs: 0 B
kernel/nonuniform_on_uniform_data 0 allocs: 0 B 0 allocs: 0 B
kernel/uniform 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/perturbed/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/perturbed/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/stretched/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/stretched/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/uniform/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/uniform/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/uniform_vector/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/advection/uniform_vector/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/perturbed/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/perturbed/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/stretched/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/stretched/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/uniform/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/uniform/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/uniform_vector/N=128 0 allocs: 0 B 0 allocs: 0 B
rhs/burgers/uniform_vector/N=64 0 allocs: 0 B 0 allocs: 0 B
rhs/interface/stretched/N=41 0 allocs: 0 B 0 allocs: 0 B
rhs/interface/uniform_vector/N=41 0 allocs: 0 B 0 allocs: 0 B
solve/advection/perturbed/N=128 2.53 k allocs: 0.144 MB 2.53 k allocs: 0.144 MB 1
solve/advection/perturbed/N=64 1.49 k allocs: 0.0907 MB 1.49 k allocs: 0.0907 MB 1
solve/advection/stretched/N=128 2.53 k allocs: 0.144 MB 2.53 k allocs: 0.144 MB 1
solve/advection/stretched/N=64 1.49 k allocs: 0.0907 MB 1.49 k allocs: 0.0907 MB 1
solve/advection/uniform/N=128 2.53 k allocs: 0.145 MB 2.53 k allocs: 0.145 MB 1
solve/advection/uniform/N=64 1.49 k allocs: 0.0911 MB 1.49 k allocs: 0.0911 MB 1
solve/advection/uniform_vector/N=128 2.53 k allocs: 0.144 MB 2.53 k allocs: 0.144 MB 1
solve/advection/uniform_vector/N=64 1.49 k allocs: 0.0907 MB 1.49 k allocs: 0.0907 MB 1
solve/burgers/perturbed/N=128 2.53 k allocs: 0.144 MB 2.53 k allocs: 0.144 MB 1
solve/burgers/perturbed/N=64 1.49 k allocs: 0.0907 MB 1.49 k allocs: 0.0907 MB 1
solve/burgers/stretched/N=128 2.53 k allocs: 0.144 MB 2.53 k allocs: 0.144 MB 1
solve/burgers/stretched/N=64 1.49 k allocs: 0.0907 MB 1.49 k allocs: 0.0907 MB 1
solve/burgers/uniform/N=128 2.53 k allocs: 0.145 MB 2.53 k allocs: 0.145 MB 1
solve/burgers/uniform/N=64 1.49 k allocs: 0.0911 MB 1.49 k allocs: 0.0911 MB 1
solve/burgers/uniform_vector/N=128 2.53 k allocs: 0.144 MB 2.53 k allocs: 0.144 MB 1
solve/burgers/uniform_vector/N=64 1.49 k allocs: 0.0907 MB 1.49 k allocs: 0.0907 MB 1
solve/interface/stretched/N=41 2.21 k allocs: 0.13 MB 2.21 k allocs: 0.13 MB 1
solve/interface/uniform_vector/N=41 2.21 k allocs: 0.13 MB 2.21 k allocs: 0.13 MB 1
time_to_load 0.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

@ChrisRackauckas
ChrisRackauckas merged commit ba468a1 into SciML:master Aug 1, 2026
51 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants