ml.trainers.mixins.profiler
Defines a trainer mixin for profiling PyTorch models.
This can be enabled by setting trainer.profiler.enabled=true
in your
configuration file. It will run the first few steps of training with the
profiler enabled, and then log a report of the results to the log directory.
- class ml.trainers.mixins.profiler.Profiler(enabled: bool = False, record_shapes: bool = False, profile_memory: bool = False, with_stack: bool = False, with_flops: bool = False, with_modules: bool = False, wait_steps: int = 10, warmup_steps: int = 10, active_steps: int = 10, repeat_steps: int = 1, skip_first_steps: int = 10, table_size: int = 10)[source]
Bases:
object
- enabled: bool = False
- record_shapes: bool = False
- profile_memory: bool = False
- with_stack: bool = False
- with_flops: bool = False
- with_modules: bool = False
- wait_steps: int = 10
- warmup_steps: int = 10
- active_steps: int = 10
- repeat_steps: int = 1
- skip_first_steps: int = 10
- table_size: int = 10
- class ml.trainers.mixins.profiler.ProfilerTrainerConfig(name: str = '???', exp_name: str = '${ml.exp_name:null}', exp_dir: str = '???', log_dir_name: str = 'logs', use_double_weight_precision: bool = False, checkpoint: ml.trainers.base.CheckpointConfig = <factory>, profiler: ml.trainers.mixins.profiler.Profiler = <factory>)[source]
Bases:
BaseTrainerConfig
- class ml.trainers.mixins.profiler.ProfilerTrainerMixin(config: ProfilerTrainerConfigT)[source]
Bases:
StepContextMixin
[ProfilerTrainerConfigT
,ModelT
,TaskT
],BaseTrainer
[ProfilerTrainerConfigT
,ModelT
,TaskT
]Defines a trainer mixin for enabling the PyTorch profiler.