Profiler
- class lightning.pytorch.profilers.Profiler(dirpath=None, filename=None)
Bases:
ABCIf you wish to write a custom profiler, you should inherit from this class.
- describe()
Logs a profile report after the conclusion of run.
- Return type:
- profile(action_name)
Yields a context manager to encapsulate the scope of a profiled action.
Example:
with self.profile('load training data'): # load training data codeThe profiler will start once you’ve entered the context and will automatically stop once you exit the code block.
- Return type:
- setup(stage, local_rank=None, log_dir=None)
Execute arbitrary pre-profiling set-up steps.
- Return type:
- abstract start(action_name)
Defines how to start recording an action.
- Return type:
- abstract stop(action_name)
Defines how to record the duration once an action is complete.
- Return type:
- teardown(stage)
Execute arbitrary post-profiling tear-down steps.
Closes the currently open file and stream.
- Return type:
Was this page helpful?
Thanks for the feedback.