pytorch/torch
Anupam Bhatnagar f4b804eeaa Call profiler step via optimizer post hook (#90101)
This PR adds the `_profile_using_dynolog` function to `torch/__init__.py`. The `_profile_using_dynolog` method allows registering the optimizer step post hook. This is required to collect iteration based traces using dynolog.

Other related changes for tests to pass:
1. Updated `optimizer.pyi`
1. Updated `overrides.py`
1. The test `test_kineto_profiler_multiple_steppers` in `test_profiler.py` has been broken down into two cases:
     - `test_kineto_profiler_multiple_steppers_with_override_True` : this test uses the override argument
     - `test_kineto_profiler_multiple_steppers_with_override_False` : this test uses the environment variable
Pull Request resolved: https://github.com/pytorch/pytorch/pull/90101
Approved by: https://github.com/albanD
2023-01-13 18:07:40 +00:00
..
_C Add check-sparse-tensor-invariants flag to Context - 2nd try. (#92094) 2023-01-13 14:50:33 +00:00
_C_flatbuffer
_decomp Fixed output memory format mismatch for bicubic2d (#90470) 2023-01-12 19:52:28 +00:00
_dispatch
_dynamo Do not leak SkipFrame exception to parent frames (#91059) 2023-01-13 17:11:22 +00:00
_functorch Reland "AOT Autograd refactor + cleanup, handle intermediate views of bases, use view replay, fix non-tensor input handling" (#92076) 2023-01-12 21:32:05 +00:00
_inductor generate set_device call to ensure context existence (#92055) 2023-01-12 17:23:49 +00:00
_lazy
_prims fixing test_batch_norm_implicit_dtype_promotion (__main__.TestNvFuserDynamo) (#91541) 2023-01-10 00:31:36 +00:00
_prims_common Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
_refs Support zero dimensions in softmax decompositions (#91322) 2023-01-11 09:35:43 +00:00
_subclasses Revert "[Modes] Add assert that the mode isn't already on the stack (#90770)" 2023-01-12 16:44:29 +00:00
amp
ao [quant][fx] Add support for GRU in fx graph mode quantization (#91976) 2023-01-13 07:00:12 +00:00
autograd Reland "Add torch.utils.device_mode" (#91796) 2023-01-09 20:57:12 +00:00
backends Dynamo benchmark: add CPU specific changes (#88477) 2023-01-07 09:26:06 +00:00
contrib
cpu
csrc [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
cuda [inductor] Reduce device context manager overhead (#91045) 2023-01-12 16:51:59 +00:00
distributed [follow-up] Python Attr Serialization (#88913) 2023-01-13 17:38:51 +00:00
distributions Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
fft
func [functorch] move batch_norm_replacement to torch.func (#91412) 2023-01-12 19:15:41 +00:00
futures Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
fx Add kwargs support to torch.export() API (#92013) 2023-01-13 15:17:26 +00:00
jit Add shape function for movedim op (#91696) 2023-01-06 18:24:52 +00:00
legacy
lib Some CMake and CUDA cleanup given recent update to C++17 (#90599) 2022-12-30 11:19:26 +00:00
linalg Fix terminology within linalg.slogdet docs (#91129) 2022-12-20 01:55:27 +00:00
masked unify reduction types from different operators: scatter, scatter_reduce, segment_reduce (#91499) 2023-01-13 04:32:34 +00:00
monitor Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
multiprocessing
nested
nn [follow-up] Python Attr Serialization (#88913) 2023-01-13 17:38:51 +00:00
onnx [ONNX] Documentation for torch.onnx.find_mismatch (#90728) 2023-01-11 23:58:57 +00:00
optim Call profiler step via optimizer post hook (#90101) 2023-01-13 18:07:40 +00:00
package Minor fix in package exporter (#90306) 2022-12-27 18:01:59 +00:00
profiler Call profiler step via optimizer post hook (#90101) 2023-01-13 18:07:40 +00:00
quantization [ao] making _is_activation_post_process private with BC (#90554) 2022-12-16 08:09:33 +00:00
signal Reland "Add torch.utils.device_mode" (#91796) 2023-01-09 20:57:12 +00:00
sparse Add check-sparse-tensor-invariants flag to Context - 2nd try. (#92094) 2023-01-13 14:50:33 +00:00
special
testing Add check-sparse-tensor-invariants flag to Context - 2nd try. (#92094) 2023-01-13 14:50:33 +00:00
utils Revert "[Modes] Add assert that the mode isn't already on the stack (#90770)" 2023-01-12 16:44:29 +00:00
__config__.py
__future__.py
__init__.py Add check-sparse-tensor-invariants flag to Context - 2nd try. (#92094) 2023-01-13 14:50:33 +00:00
_appdirs.py
_classes.py
_deploy.py
_guards.py Properly resolve source_ref when constructing shape guards (#91058) 2022-12-30 05:56:56 +00:00
_jit_internal.py [JIT] Skip builtins while enumerating class methods (#91805) 2023-01-06 21:45:09 +00:00
_linalg_utils.py
_lobpcg.py Fix typo in _lobpcg.py (#91641) 2023-01-04 15:19:05 +00:00
_lowrank.py
_meta_registrations.py Return empty attention weights when need_atten_weights = False (#91782) 2023-01-06 19:06:48 +00:00
_namedtensor_internals.py Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
_ops.py Fix circular import in torch/autograd/function.py (#90415) 2022-12-14 16:20:57 +00:00
_python_dispatcher.py
_six.py
_sources.py
_storage_docs.py
_tensor_docs.py fix in-place geometric pmf (#92049) 2023-01-12 19:56:44 +00:00
_tensor_str.py Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
_tensor.py Make torch.split take symint as arg (#91724) 2023-01-07 00:00:03 +00:00
_torch_docs.py Fix torch.where signature mismatch that was caused by torchgen (#91627) 2023-01-13 16:17:55 +00:00
_utils_internal.py
_utils.py [follow-up] Python Attr Serialization (#88913) 2023-01-13 17:38:51 +00:00
_VF.py
_vmap_internals.py Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
_weights_only_unpickler.py
abi-check.cpp
CMakeLists.txt Some CMake and CUDA cleanup given recent update to C++17 (#90599) 2022-12-30 11:19:26 +00:00
custom_class_detail.h
custom_class.h
extension.h
functional.py Update version numbers in torch.{stft,istft} deprecations (#91761) 2023-01-05 22:17:37 +00:00
hub.py Preventing crashing incase of no network by loading from cache (#91569) 2023-01-11 11:56:46 +00:00
library.h
library.py Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
overrides.py Reland "Add torch.utils.device_mode" (#91796) 2023-01-09 20:57:12 +00:00
py.typed
quasirandom.py
random.py
README.txt
return_types.py
script.h
serialization.py Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
storage.py Rename Tensor._storage to Tensor.untyped_storage and update docs (#91414) 2022-12-28 19:21:34 +00:00
torch_version.py
types.py

Note [TH abstraction violation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TH/THC provide some hpp headers, which are proper C++ headers rather than
C headers.  These headers serve double duty as *internal implementation
detail* headers, whose contents should largely not be used by external
clients.

Ideally, we would not install these headers at all; instead, you should
use public functions (in headers like `THTensor.h`, NOT `THTensor.hpp`)
to manipulate these structs.  However, there are a few places
in torch/csrc where we violate this abstraction.  They are marked with
a pointer to this note.  Each of those sites will have to be refactored
when we refactor the guts of THTensor and related structures.