Skip to main content

Module benchmark

Module benchmark 

Source
Available on non-WebAssembly only.
Expand description

Benchmarks that time repetitions of one model’s step loop, reporting each repetition as it finishes. Native only.

Each repetition builds a fresh state, steps warmup ticks untimed, then times steps ticks of nothing but the model’s step. A CPU repetition steps its warm-up inside one rayon::scope on the caller’s pool, and its timed steps inside another. A GPU repetition waits for the uploads its build queued, then submits its steps in batches and times them up to the wait that drains the device.

Actions fire under BENCH_FIRE, before the step that leaves their tick. An action due from the end of warm-up up to, but not including, the tick a repetition stops on is timed with the steps, and one due on that tick fires after the timer stops.

Structs§

BenchmarkReport
Timings of every repetition, with the job count and grid size of the model benchmarked.
BenchmarkSettings
Model, setup and lengths of one benchmark.
RepetitionReport
One timed repetition.

Enums§

BenchmarkEvent
One event of a running benchmark, in the order they happen.

Constants§

BENCH_FIRE
Rule under which a repetition’s warm-up and timed steps fire actions.

Functions§

run_benchmark
Times settings.repetitions runs of settings.steps steps, reporting each repetition as it finishes.