aitune.torch.tune_strategy.mixin.performance_validation_mixin
aitune.torch.tune_strategy.mixin.performance_validation_mixin
Performance validation mixin for tune strategy.
Module Contents
Classes
Functions
API
Bases: TuneStrategy
TuneStrategy mixin that validates each backend against a TorchEager throughput baseline.
When performance validation is enabled, profiles TorchEager during _pre_tune with the strategy profiling config narrowed to the resolved batch size (from graph_spec.get_max_batch_size()) to establish a baseline. For every candidate backend, profiles with the same task-local profiling config and appends a PerformanceValidationMixinResult. Backends with speedup below the configured threshold are rejected.
Build, correctness-validate, then profile and check throughput against baseline.
Returns the built backend, or None when correctness fails (raise_on_failure=False) or performance check rejects it (speedup below threshold).
Emit an explicit message when the TorchEager baseline is the selected backend.
Emits a speedup line after tuning completes.
Runs pre-tune setup and profiles TorchEager when performance validation is enabled.
Returns the strategy profiling config narrowed to one validation batch size.
Enables or disables TorchEager baseline profiling and candidate performance checks.
Throughput and speedup result for a single backend.
Returns the full speedup summary line with module/backend fields.
Returns a compact speedup line without module/backend fields.