aitune.torch.task.profiling
Submodules
aitune.torch.task.profiling.configaitune.torch.task.profiling.eventsaitune.torch.task.profiling.measuring_stop_strategyaitune.torch.task.profiling.measuring_strategyaitune.torch.task.profiling.metricsaitune.torch.task.profiling.profilingaitune.torch.task.profiling.profiling_stop_strategy
Package Contents
Classes
Functions
API
Bases: ProfilingStopStrategy
Strategy to do not stop profiling until all samples are processed.
Check if the profiling should be stopped.
Strategy when to stop collecting measurements for given batch size.
Get events to use for measuring stop strategy.
Check if the measurement should be stopped.
Parameters:
list[ ProfilingResultEvent ] — List of profiling results events for a one measurement.
Returns: bool
True if the measurement should be stopped, False otherwise.
Strategy how do the measurement and create a ProfilingResultEvent(s).
Do the measurement and create a ProfilingResultEvent(s).
Parameters:
Batch size of the measurement.
Model to measure.
Sample to measure.
Additional keyword arguments.
Returns: list[ ProfilingResultEvent ]
List of ProfilingResultEvent(s).
Bases: MeasuringStrategy
Strategy to measure execution time.
Do the measurement and create a ProfilingResultEvent(s) for the model.
Bases: MeasuringStopStrategy
Strategy to stop collecting measurements after a given number of steps.
Get final measured events after should_stop() has returned True.
Check if the measurement should be stopped.
Configuration for profiling.
Note: all profiling configuration strategies are deepcopied before use.
List of batch sizes to profile.
Whether profiling should batch samples together.
Strategy to stop collecting measurements.
Strategy to measure the model.
Strategy to stop profiling.
Post-init.
Profiling result event.
Details of the backend.
Batch size of the measurement.
Execution time of the measurement.
Unique identifier for the measurement.
Phase of the measurement.
Timestamp of the measurement.
Profiling results.
Profiling status.
Strategy when to stop profiling.
Check if the profiling should be stopped.
Parameters:
list[ ProfilingResultEvent ] — List of profiling results.
Returns: bool
True if the profiling should be stopped, False otherwise.
Bases: MeasuringStopStrategy
Strategy to stop collecting measurements after a stable sliding window has been collected.
Get events to use for measuring stop strategy.
Check if the measurement should be stopped.
Bases: ProfilingStopStrategy
Strategy to stop profiling when throughput is saturated.
Additionally, backoff policy is introduced, allowing for few more measurements after saturation is detected. This is useful to avoid stopping profiling too early, when the model is still not fully optimized.
Parameters:
Minimum relative throughput gain required to continue profiling.
Number of measurements after saturation is detected to continue profiling. 0 means no backoff.
Validate ratio configuration.
Check if the profiling should be stopped.
Get throughput from profiling results.
Parameters:
list[ ProfilingResultEvent ] — List of profiling results.
Batch size to use for throughput calculation. If not provided, it will be inferred from the results.
Returns: float
Throughput in samples per second.
Validate if throughput saturated between consecutive samples.
Parameters:
list[ ProfilingResultEvent ] — Current profiling results.
Minimum relative throughput gain required to continue profiling.
list[ ProfilingResultEvent ] — Previous profiling results or previous throughput.
Returns: bool
True when throughput saturated between consecutive samples.
Profile a callable with given dataset.
Parameters:
Function to profile.
DatasetLike | DataLoaderFactory | torch.Tensor — Dataset to profile.
ProfilingConfig — Configuration for profiling.
Name of the model, optional.
Detailed information of the backend, optional.
Returns: ProfilingStatus
Status of the profiling.