Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions benchmark/1_bench_sim_model.jl
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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
4 changes: 2 additions & 2 deletions benchmark/2_bench_state_estim.jl
Original file line number Diff line number Diff line change
@@ -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!"] =
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions benchmark/3_bench_predictive_control.jl
Original file line number Diff line number Diff line change
@@ -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(),
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading