aitune.torch.task.profiling.measuring_strategy

View as Markdown

Measuring strategies for profiling.

Module Contents

Classes

NameDescription
MeasuringStrategyStrategy how do the measurement and create a ProfilingResultEvent(s).
ModelExecutionTimeMeasuringStrategyStrategy to measure execution time.

API

class aitune.torch.task.profiling.measuring_strategy.MeasuringStrategy()
Abstract

Strategy how do the measurement and create a ProfilingResultEvent(s).

aitune.torch.task.profiling.measuring_strategy.MeasuringStrategy.do_measurement(
batch_size: int,
model: collections.abc.Callable,
sample: tuple[list, dict],
kwargs = {}
) -> list[aitune.torch.task.profiling.events.ProfilingResultEvent]
abstract

Do the measurement and create a ProfilingResultEvent(s).

Parameters:

batch_size
int

Batch size of the measurement.

model
Callable

Model to measure.

sample
tuple[list, dict]

Sample to measure.

**kwargs
Defaults to {}

Additional keyword arguments.

Returns: list[ProfilingResultEvent]

List of ProfilingResultEvent(s).

class aitune.torch.task.profiling.measuring_strategy.ModelExecutionTimeMeasuringStrategy()

Bases: MeasuringStrategy

Strategy to measure execution time.

counter
int = 0
aitune.torch.task.profiling.measuring_strategy.ModelExecutionTimeMeasuringStrategy.do_measurement(
batch_size: int,
model: collections.abc.Callable,
sample: tuple[list, dict],
measurement_kwargs = {}
) -> list[aitune.torch.task.profiling.events.ProfilingResultEvent]

Do the measurement and create a ProfilingResultEvent(s) for the model.