Skip to content

Commit 3bd899b

Browse files
authored
Merge pull request #492 from JuliaControl/bench_smaller
bench: create 3 bench categories (improve parallelism)
2 parents fc18685 + 631fd65 commit 3bd899b

5 files changed

Lines changed: 16 additions & 9 deletions

File tree

‎.github/workflows/benchmark.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ permissions:
88
jobs:
99
bench:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
group:
15+
- SimModel
16+
- StateEstimator
17+
- PredictiveController
1118
if: ${{ contains(github.event.pull_request.labels.*.name, 'benchmark') }}
1219
steps:
1320
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
1421
with:
1522
julia-version: '1'
23+
job-summary: 'true'
24+
filter: ${{ matrix.group }}
25+
bench-on: HEAD # Forces AirspeedVelocity to use the benchmark script from the PR branch, TO DELETE

‎benchmark/1_bench_sim_model.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ----------------------------------------------------------------------------------------
22
## ----------------- UNIT TESTS ----------------------------------------------------------
33
## ----------------------------------------------------------------------------------------
4-
const UNIT_MODEL = SUITE["UNIT TESTS"]["SimModel"]
4+
const UNIT_MODEL = SUITE["SimModel"]["UNIT TESTS"]
55

66
UNIT_MODEL["LinModel"]["updatestate!"] =
77
@benchmarkable(
@@ -27,5 +27,5 @@ UNIT_MODEL["NonLinModel"]["linearize!"] =
2727
## ----------------------------------------------------------------------------------------
2828
## ----------------- CASE STUDIES ---------------------------------------------------------
2929
## ----------------------------------------------------------------------------------------
30-
const CASE_MODEL = SUITE["CASE STUDIES"]["SimModel"]
30+
const CASE_MODEL = SUITE["SimModel"]["CASE STUDIES"]
3131
# TODO: Add case study benchmarks for SimModel

‎benchmark/2_bench_state_estim.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## ----------------------------------------------------------------------------------------
22
## ----------------- UNIT TESTS -----------------------------------------------------------
33
## ----------------------------------------------------------------------------------------
4-
const UNIT_ESTIM = SUITE["UNIT TESTS"]["StateEstimator"]
4+
const UNIT_ESTIM = SUITE["StateEstimator"]["UNIT TESTS"]
55

66
skf = SteadyKalmanFilter(linmodel)
77
UNIT_ESTIM["SteadyKalmanFilter"]["preparestate!"] =
@@ -206,7 +206,7 @@ UNIT_ESTIM["MovingHorizonEstimator"]["getinfo!"]["NonLinModel"] =
206206
## ----------------------------------------------------------------------------------------
207207
## ----------------- CASE STUDIES ---------------------------------------------------------
208208
## ----------------------------------------------------------------------------------------
209-
const CASE_ESTIM = SUITE["CASE STUDIES"]["StateEstimator"]
209+
const CASE_ESTIM = SUITE["StateEstimator"]["CASE STUDIES"]
210210

211211
## ----------------- Case study: CSTR -----------------------------------------------------
212212
model = CSTR_model

‎benchmark/3_bench_predictive_control.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -----------------------------------------------------------------------------------------
22
# ---------------------- UNIT TESTS -------------------------------------------------------
33
# -----------------------------------------------------------------------------------------
4-
const UNIT_MPC = SUITE["UNIT TESTS"]["PredictiveController"]
4+
const UNIT_MPC = SUITE["PredictiveController"]["UNIT TESTS"]
55

66
linmpc_ss = LinMPC(
77
linmodel, transcription=SingleShooting(),
@@ -157,7 +157,7 @@ UNIT_MPC["NonLinMPC"]["getinfo!"]["NonLinModel"] =
157157
## ----------------------------------------------------------------------------------------
158158
## ---------------------- CASE STUDIES ----------------------------------------------------
159159
## ----------------------------------------------------------------------------------------
160-
const CASE_MPC = SUITE["CASE STUDIES"]["PredictiveController"]
160+
const CASE_MPC = SUITE["PredictiveController"]["CASE STUDIES"]
161161

162162
## ----------------- Case study: CSTR without feedforward ---------------------------------
163163
model = CSTR_model

‎benchmark/benchmarks.jl‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ using JuMP, OSQP, DAQP, Ipopt, MadNLP, UnoSolver
44

55
const SUITE = BenchmarkGroup(["ModelPredictiveControl"])
66

7-
SUITE["UNIT TESTS"] = BenchmarkGroup(["allocation-free", "allocations", "single call"])
8-
SUITE["CASE STUDIES"] = BenchmarkGroup(["performance", "speed" ,"integration"])
9-
107
include("0_bench_setup.jl")
118
include("1_bench_sim_model.jl")
129
include("2_bench_state_estim.jl")

0 commit comments

Comments
 (0)