This document describes the process of obtaining time measurements for computations of objective functions and their derivatives using different automatic differentiation (AD) frameworks.
Benchmarking process depends on the following variables:
nruns_F
- maximum number of times to run the computation of the objective function for timingnruns_J
- maximum number of times to run the computation of the considered derivative (gradient or Jacobian) for timingtime_limit
- soft (see below) time limit for benchmarking the computation of either the objective function or its gradient/Jacobiantimeout
- hard time limit for the complete (including time that is not measured) benchmarkminimum_measurable_time
- minimum time that computation needs to run to produce a reliable measurement
The following is done for all combinations of considered AD frameworks and sets of parameters for all objective functions. If this process takes more time than timeout
, it is forcibly stopped, and the result is considered to be 'time out'.
- Read the input data and convert into a format fit for consumption by the AD framework being tested. Time is not measured.
- Run any preparation code necessary for the AD framework, that is not AD itself. Time is not measured.
- For both computation of the objective function and computation it gradient/Jacobian:
- Find the number of times computation needs to run consecutively, so that the total run time will be greater than
minimum_measurable_time
. To do that start with 1 and then test the consecutive powers of 2 until theminimum_measurable_time
is reached. Denote the found number asrepeats
. Consider the last measured time divided byrepeats
to be the first sample. - Continue time measuring the computation running for
repeats
times and producing new samples until eithernruns_F
(ornruns_J
as appropriate) samples were produced, or total time taken to produce all current samples is greater thantime_limit
. - Out of all the gathered samples pick the minimum. Most timing noise today is positive, except for clock resolution, which is alleviated by picking an appropriate
minimum_measurable_time
.
- Find the number of times computation needs to run consecutively, so that the total run time will be greater than
- Save the minimal samples to a file. Time is not measured.
- Save the result of the last computations for both objective function and its gradient/Jacobian in a standard format to a file to be compared to the correct results later. Time is not measured.
After this process is complete, the filesystem contains all the information necessary to
- Check the correctness of all finished computations
- Visualize the timings and/or their relations (e.g. we can plot the times for the computations of differentiated functions relative to the times for the computations of corresponding objective functions)