mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Summary: Refactor torch.profiler.profile by separate it into one low level class and one high level wrapper. The PR include the following change: 1. separate class torch.profiler.profile into two separated class: kineto_profiler and torch.profiler.profile. 2. The former class has the low-level functionality exposed in C++ level like: prepare_profiler, start_profiler, stop_profiler. 3. The original logics in torch.profiler.profile including export_chrome_trace, export_stacks, key_averages, events, add_metadata are all moved into kineto_profiler since they are all exposed by the torch.autograd.profiler. 4. The new torch.profiler.profile is fully back-compatible with original class since it inherit from torch.profiler.kineto_profiler. Its only responsibility in new implementation is the maintenance of the finite state machine of ProfilerAction. With the refactoring, the responsibility boundary is clear and the new logic is simple to understand. Pull Request resolved: https://github.com/pytorch/pytorch/pull/63302 Reviewed By: albanD Differential Revision: D33006442 Pulled By: robieta fbshipit-source-id: 30d7c9f5c101638703f1243fb2fcc6ced47fb690
28 lines
475 B
ReStructuredText
28 lines
475 B
ReStructuredText
.. currentmodule:: torch.profiler
|
|
|
|
torch.profiler
|
|
==============
|
|
|
|
Overview
|
|
--------
|
|
.. automodule:: torch.profiler
|
|
|
|
|
|
API Reference
|
|
-------------
|
|
|
|
.. autoclass:: torch.profiler._KinetoProfile
|
|
:members:
|
|
|
|
.. autoclass:: torch.profiler.profile
|
|
:members:
|
|
|
|
.. autoclass:: torch.profiler.ProfilerAction
|
|
:members:
|
|
|
|
.. autoclass:: torch.profiler.ProfilerActivity
|
|
:members:
|
|
|
|
.. autofunction:: torch.profiler.schedule
|
|
|
|
.. autofunction:: torch.profiler.tensorboard_trace_handler
|