xlnstorch.benchmark.BenchmarkRunner

xlnstorch.benchmark.BenchmarkRunner#

class xlnstorch.benchmark.BenchmarkRunner(bench_obj, warmup=10, iters=100, profile=False, backward=False)#

Orchestrates warm-up, steady-state timing and optional profiling.

Note: The runner clones all tensors returned by Benchmark.make_inputs() before each iteration to avoid in-place side-effects leaking across runs.

Parameters:
  • bench_obj (Benchmark) – An instance of a Benchmark subclass.

  • warmup (int) – Number of warm-up iterations executed before timing starts.

  • iters (int) – Number of timed iterations.

  • profile (bool) – Whether to profile the benchmark using torch.profiler.

  • backward (bool) – Whether to run a backward pass after each forward pass.

__init__(bench_obj, warmup=10, iters=100, profile=False, backward=False)#
Parameters:

Methods

__init__(bench_obj[, warmup, iters, ...])

run()

Execute the benchmark.