Skip to content

[RFC] Should we use measured or reported solver runtimes? #159

Description

@siddharth-krishna

The current benchmarking scripts measure the wall clock time (note: we are switching to time.perf_counter in an in-flight PR) taken by the call to linopy.solvers.solve_problem, which is a function in the Python library that acts as a uniform solver interface and handles parsing the solver responses and results. This means the measured runtime includes not just the time taken to solve the LP/MILP problem, but also the time taken by the solver to parse the input file and write the output file, or to check that the license (if any) is valid. Note that since all our benchmarks are LP/MPS files already, this measured time does not include the time taken by linopy to serialize the problem to a file.

An alternative is to use the reported runtime for solving from the solver. Some solvers expose this in their APIs:

Gurobipy: model.Runtime
PySCIPOpt: model.getSolvingTime()
HiGHSpy: highs.getRunTime()

This runtime presumably excludes the time for input/output and license checks.

Arguments for using measured runtime:

  1. It is closer to the end-user's experience: if a solver takes an extra 10s because it reads input files inefficiently or has to consult a remote license server, then the user will feel that the solver is 10s slower when they use it on their problems.
  2. It does not require trusting that solvers do not (un)intentionally report inaccurate solving runtimes. (This can be mitigated to some extent by comparing reported runtimes to measured runtimes while analyzing benchmark results.)
  3. If we use reported runtime, we will have to check that all solvers use a consistent definition of runtime (e.g. all of them exclude the time to parse inputs).

Arguments for using reported runtime:

  1. It measures the core of what the solver does (solving the problem), and our performance history page reflects improvements to solver algorithms, not just faster input file parsers.
  2. The measured runtime includes any time spent by linopy in the solver interface. For instance, if a solver does not have a Python API or linopy doesn't use one (e.g. CBC), then this runtime includes the time taken by linopy to parse the result/solution file.

We invite everyone to discuss the above in this issue. (@jajhall, @mattmilten, @pfetsch, @jjhforrest, and your teams, if you'll forgive the 2nd notification from me today, we would love to hear your thoughts on this as well.)

For now, we plan to record both reported and measured runtime in the results, and check if there are any big discrepancies in our v1 benchmark run next week. But we will await the discussion here before deciding which runtime to use in the website's analyses and graphs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions