diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 788c19ffa..7ae313318 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -8,8 +8,18 @@ permissions: jobs: bench: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + group: + - SimModel + - StateEstimator + - PredictiveController if: ${{ contains(github.event.pull_request.labels.*.name, 'benchmark') }} steps: - uses: MilesCranmer/AirspeedVelocity.jl@action-v1 with: julia-version: '1' + job-summary: 'true' + filter: ${{ matrix.group }} + bench-on: HEAD # Forces AirspeedVelocity to use the benchmark script from the PR branch, TO DELETE diff --git a/benchmark/1_bench_sim_model.jl b/benchmark/1_bench_sim_model.jl index e58fb6d39..211542a41 100644 --- a/benchmark/1_bench_sim_model.jl +++ b/benchmark/1_bench_sim_model.jl @@ -1,7 +1,7 @@ ## ---------------------------------------------------------------------------------------- ## ----------------- UNIT TESTS ---------------------------------------------------------- ## ---------------------------------------------------------------------------------------- -const UNIT_MODEL = SUITE["UNIT TESTS"]["SimModel"] +const UNIT_MODEL = SUITE["SimModel"]["UNIT TESTS"] UNIT_MODEL["LinModel"]["updatestate!"] = @benchmarkable( @@ -27,5 +27,5 @@ UNIT_MODEL["NonLinModel"]["linearize!"] = ## ---------------------------------------------------------------------------------------- ## ----------------- CASE STUDIES --------------------------------------------------------- ## ---------------------------------------------------------------------------------------- -const CASE_MODEL = SUITE["CASE STUDIES"]["SimModel"] +const CASE_MODEL = SUITE["SimModel"]["CASE STUDIES"] # TODO: Add case study benchmarks for SimModel \ No newline at end of file diff --git a/benchmark/2_bench_state_estim.jl b/benchmark/2_bench_state_estim.jl index 0829ca803..fd89b0dbc 100644 --- a/benchmark/2_bench_state_estim.jl +++ b/benchmark/2_bench_state_estim.jl @@ -1,7 +1,7 @@ ## ---------------------------------------------------------------------------------------- ## ----------------- UNIT TESTS ----------------------------------------------------------- ## ---------------------------------------------------------------------------------------- -const UNIT_ESTIM = SUITE["UNIT TESTS"]["StateEstimator"] +const UNIT_ESTIM = SUITE["StateEstimator"]["UNIT TESTS"] skf = SteadyKalmanFilter(linmodel) UNIT_ESTIM["SteadyKalmanFilter"]["preparestate!"] = @@ -206,7 +206,7 @@ UNIT_ESTIM["MovingHorizonEstimator"]["getinfo!"]["NonLinModel"] = ## ---------------------------------------------------------------------------------------- ## ----------------- CASE STUDIES --------------------------------------------------------- ## ---------------------------------------------------------------------------------------- -const CASE_ESTIM = SUITE["CASE STUDIES"]["StateEstimator"] +const CASE_ESTIM = SUITE["StateEstimator"]["CASE STUDIES"] ## ----------------- Case study: CSTR ----------------------------------------------------- model = CSTR_model diff --git a/benchmark/3_bench_predictive_control.jl b/benchmark/3_bench_predictive_control.jl index ceb11676f..91633be55 100644 --- a/benchmark/3_bench_predictive_control.jl +++ b/benchmark/3_bench_predictive_control.jl @@ -1,7 +1,7 @@ # ----------------------------------------------------------------------------------------- # ---------------------- UNIT TESTS ------------------------------------------------------- # ----------------------------------------------------------------------------------------- -const UNIT_MPC = SUITE["UNIT TESTS"]["PredictiveController"] +const UNIT_MPC = SUITE["PredictiveController"]["UNIT TESTS"] linmpc_ss = LinMPC( linmodel, transcription=SingleShooting(), @@ -157,7 +157,7 @@ UNIT_MPC["NonLinMPC"]["getinfo!"]["NonLinModel"] = ## ---------------------------------------------------------------------------------------- ## ---------------------- CASE STUDIES ---------------------------------------------------- ## ---------------------------------------------------------------------------------------- -const CASE_MPC = SUITE["CASE STUDIES"]["PredictiveController"] +const CASE_MPC = SUITE["PredictiveController"]["CASE STUDIES"] ## ----------------- Case study: CSTR without feedforward --------------------------------- model = CSTR_model diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl index 914ff804a..d0cf60c0a 100644 --- a/benchmark/benchmarks.jl +++ b/benchmark/benchmarks.jl @@ -4,9 +4,6 @@ using JuMP, OSQP, DAQP, Ipopt, MadNLP, UnoSolver const SUITE = BenchmarkGroup(["ModelPredictiveControl"]) -SUITE["UNIT TESTS"] = BenchmarkGroup(["allocation-free", "allocations", "single call"]) -SUITE["CASE STUDIES"] = BenchmarkGroup(["performance", "speed" ,"integration"]) - include("0_bench_setup.jl") include("1_bench_sim_model.jl") include("2_bench_state_estim.jl")