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§
- Benchmark
Report - Timings of every repetition, with the job count and grid size of the model benchmarked.
- Benchmark
Settings - Model, setup and lengths of one benchmark.
- Repetition
Report - One timed repetition.
Enums§
- Benchmark
Event - 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.repetitionsruns ofsettings.stepssteps, reporting each repetition as it finishes.