pytorch/test
Sanket Jayant Purandare 1f46284f9e Extended Module Tracker (#128508)
This is an extension of [ModuleTracker](https://github.com/pytorch/pytorch/blob/main/torch/utils/module_tracker.py) with added features and bug fixes.

1. Allows installing user-defined hooks to be called in pre-fw, post-fw, pre-bw and post-bw hooks of the ``ModTracker``.
2. Adds a function ``get_known_fqn`` that retrieves the fqn of the module as tracked by the ``ModTracker``.
3. Only registers the multi-grad hooks if we are in the forward pass. This is important because, a module's pre-fw and post-fw hooks get called in the backward during AC and we do not want to register multi-grad hooks in this case.
4. Sets the kwarg ``always_call=True`` for post-fw hooks, so that they are called post AC.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/128508
Approved by: https://github.com/wanchaol
2024-06-14 12:01:53 +00:00
..
ao/sparsity
autograd
backends/xeon
benchmark_utils
bottleneck_test
cpp Remove unused functions (#127881) 2024-06-05 05:21:24 +00:00
cpp_api_parity
cpp_extensions Support torch.dtype as parameter in pybind11 cpp extension. (#126865) 2024-05-29 23:19:32 +00:00
custom_backend
custom_operator
distributed Extended Module Tracker (#128508) 2024-06-14 12:01:53 +00:00
distributions
dynamo [easy][subclasses] dynamo.reset() in test_subclass_views (#128659) 2024-06-14 05:18:07 +00:00
dynamo_expected_failures [RELAND2][dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule (#126578) 2024-06-12 04:09:23 +00:00
dynamo_skips
edge [BE][CMake] Use FindPython module (#124613) 2024-05-29 13:17:35 +00:00
error_messages
expect Add coloring to fx graph print out (#128476) 2024-06-13 23:39:04 +00:00
export Revert "[traced-graph][sparse] remove redundant assert in sparse prop test (#128523)" 2024-06-14 08:27:05 +00:00
forward_backward_compatibility [SDPA/memeff] Backport changes from xFormers to PT (#127090) 2024-06-05 07:33:27 +00:00
functorch Revert "[aota] compiled forward outputs requires_grad alignment with eager (#128016)" 2024-06-13 17:56:42 +00:00
fx Save DOT file of graph instead of SVG for GraphTranformObserver (#128634) 2024-06-14 00:54:22 +00:00
higher_order_ops [BE]: Enable ruff TCH rules and autofixes for better imports (#127688) 2024-06-06 16:55:58 +00:00
inductor [inductor] Fix nested indirect indexing case for index_propagation (#128378) 2024-06-14 10:07:06 +00:00
jit [reland] Refresh OpOverloadPacket if a new OpOverload gets added (#128000) 2024-06-05 17:57:09 +00:00
jit_hooks
lazy
mobile
nn Revert "Make nn.Module state_dict load_state_dict pre-hook and state_dict post hook public (#126704)" 2024-06-11 17:45:20 +00:00
onnx Revert "[ONNX] Add upsample trilinear to skip decomp (#128259)" 2024-06-14 01:44:26 +00:00
onnx_caffe2
optim Quick Fix on #126854, deepcopy lr and other possible base_parameters (#127190) 2024-06-03 18:06:31 +00:00
package
profiler [RELAND2][dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule (#126578) 2024-06-12 04:09:23 +00:00
quantization [quant][pt2e][quantizer] Support set_module_name_qconfig in X86InductorQuantizer (#126044) 2024-06-14 07:13:10 +00:00
scripts
test_img
torch_np Revert "[dynamo] Support ndarray.dtype attribute access (#124490)" 2024-06-06 14:21:29 +00:00
typing Flip default value for mypy disallow_untyped_defs [final] (#127836) 2024-06-12 15:28:42 +00:00
xpu
_test_bazel.py
allowlist_for_publicAPI.json [pipelining] Rename to stage.py and schedules.py (#128278) 2024-06-08 04:42:35 +00:00
conftest.py [BE]: Enable ruff TCH rules and autofixes for better imports (#127688) 2024-06-06 16:55:58 +00:00
create_dummy_torchscript_model.py
delete.py
hi.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py
minioptest_failures_dict.json
mkl_verbose.py
mkldnn_verbose.py
pytest_shard_custom.py
run_doctests.sh
run_test.py [TD] Test removal on sm86 (#127131) 2024-06-07 20:19:18 +00:00
simulate_nccl_errors.py
test_ao_sparsity.py
test_autocast.py [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
test_autograd.py Revert "[checkpoint] Clean up selective activation checkpoint and make public (#125795)" 2024-06-14 01:14:59 +00:00
test_autograd_fallback.py
test_binary_ufuncs.py Revert "[dynamo] Support ndarray.dtype attribute access (#124490)" 2024-06-06 14:21:29 +00:00
test_bundled_images.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_bundled_inputs.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_ci_sanity_check_fail.py
test_comparison_utils.py
test_compile_benchmark_util.py
test_complex.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_content_store.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py Support torch.dtype as parameter in pybind11 cpp extension. (#126865) 2024-05-29 23:19:32 +00:00
test_cpp_extensions_jit.py
test_cpp_extensions_mtia_backend.py
test_cpp_extensions_open_device_registration.py
test_cpp_extensions_stream_and_event.py
test_cuda.py [BE][Eazy] remove torch.torch.xxx usages (#127800) 2024-06-05 21:53:49 +00:00
test_cuda_expandable_segments.py
test_cuda_multigpu.py
test_cuda_nvml_based_avail.py
test_cuda_primary_ctx.py
test_cuda_sanitizer.py
test_cuda_trace.py
test_custom_ops.py [custom_op] don't invoke autograd.Function when unnecessary (#127976) 2024-06-13 23:38:23 +00:00
test_dataloader.py
test_datapipe.py [BE][Ez]: Apply PYI059 - Generic always come last (#127685) 2024-06-02 13:38:58 +00:00
test_decomp.py
test_deploy.py
test_determination.py
test_dispatch.py
test_dlpack.py
test_dynamic_shapes.py Do not generate -1* in SymPy expressions when canonicalising (#128411) 2024-06-13 16:49:59 +00:00
test_expanded_weights.py
test_fake_tensor.py [fake tensor] Set _is_param for base fake tensors for views (#127823) 2024-06-05 20:26:52 +00:00
test_flop_counter.py Revert "[cuDNN][SDPA] Remove TORCH_CUDNN_SDPA_ENABLED=1, enable cuDNN SDPA by default on H100 and 2nd on other archs >= sm80 (#125343)" 2024-06-12 18:47:52 +00:00
test_foreach.py Try seeding individual foreach tests (#128220) 2024-06-13 22:42:16 +00:00
test_function_schema.py
test_functional_autograd_benchmark.py
test_functional_optim.py
test_functionalization.py
test_functionalization_of_rng_ops.py
test_futures.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_fx.py
test_fx_experimental.py Revert "Add aten._unsafe_masked_index (#116491)" 2024-06-03 15:51:50 +00:00
test_fx_passes.py
test_fx_reinplace_pass.py
test_hub.py
test_import_stats.py
test_indexing.py
test_itt.py
test_jit.py [BE] enable ruff rule Q from flake8-quotes (#127713) 2024-06-02 23:25:26 +00:00
test_jit_autocast.py
test_jit_disabled.py
test_jit_fuser.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py Enable UFMT on test/test_jit_fuser_te.py (#127759) 2024-06-04 16:56:03 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py
test_jiterator.py
test_kernel_launch_checks.py
test_legacy_vmap.py
test_license.py Fix manual licensing (#128630) 2024-06-14 00:12:09 +00:00
test_linalg.py [ROCm] TunableOp improvements (#124362) 2024-06-03 22:30:11 +00:00
test_logging.py
test_masked.py
test_maskedtensor.py
test_matmul_cuda.py Revert "FP8 rowwise scaling (#125204)" 2024-06-06 16:12:34 +00:00
test_meta.py Correct error message for aten::_local_scalar_dense on meta tensor (#124554) 2024-05-30 00:50:29 +00:00
test_metal.py
test_mkl_verbose.py
test_mkldnn.py
test_mkldnn_fusion.py
test_mkldnn_verbose.py
test_mobile_optimizer.py [BE] enable ruff rule Q from flake8-quotes (#127713) 2024-06-02 23:25:26 +00:00
test_model_dump.py
test_model_exports_to_core_aten.py
test_module_tracker.py
test_modules.py Revert "Default meta device to use swap_tensors in nn.Module._apply (.to_empty and .to('meta')) (#126819)" 2024-06-01 18:46:16 +00:00
test_monitor.py
test_mps.py Add OpInfo entry for as_strided_copy (#127231) 2024-06-13 13:58:47 +00:00
test_multiprocessing.py expose set_thread_name to Python and set thread names (#128448) 2024-06-13 16:38:23 +00:00
test_multiprocessing_spawn.py
test_namedtensor.py
test_namedtuple_return_api.py
test_native_functions.py
test_native_mha.py
test_nestedtensor.py Naive CPU kernels for jagged <-> padded dense conversions (#127007) 2024-06-13 17:13:02 +00:00
test_nn.py [easy] Move state_dict hooks tests to test_module_hooks and decorate tests that call load_state_dict with swap (#126906) 2024-06-10 21:50:17 +00:00
test_nnapi.py
test_numba_integration.py
test_numpy_interop.py [dynamo][numpy] Add unsigned integer dtypes (#125717) 2024-06-05 14:33:47 +00:00
test_openmp.py
test_ops.py Add fake impl for aten.unique_dim (#126561) 2024-06-01 04:03:10 +00:00
test_ops_fwd_gradients.py
test_ops_gradients.py
test_ops_jit.py
test_optim.py Revert "Deprecate torch._utils.is_compiling() and torch._dynamo.external_utils.is_compiling() (#127690)" 2024-06-10 20:44:42 +00:00
test_out_dtype_op.py
test_overrides.py Properly detect nested torch function args (#127496) 2024-06-02 03:43:22 +00:00
test_package.py
test_per_overload_api.py
test_prims.py [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
test_proxy_tensor.py Introduce int_oo (#127693) 2024-06-13 04:08:20 +00:00
test_pruning_op.py
test_public_bindings.py Retire torch.distributed.pipeline (#127354) 2024-06-07 08:11:58 +00:00
test_python_dispatch.py
test_pytree.py [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
test_quantization.py
test_reductions.py
test_scatter_gather_ops.py
test_schema_check.py
test_segment_reductions.py
test_serialization.py Remove tensor subclass detection logic from weights_only unpickler (#127808) 2024-06-05 02:14:30 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Enable UFMT on test_shape_ops.py test_show_pickle.py test_sort_and_select.py (#127165) 2024-06-05 14:31:26 +00:00
test_show_pickle.py Enable UFMT on test_shape_ops.py test_show_pickle.py test_sort_and_select.py (#127165) 2024-06-05 14:31:26 +00:00
test_sort_and_select.py Remove global variable SIZE, and fix linter warning (#128559) 2024-06-13 22:09:51 +00:00
test_sparse.py
test_sparse_csr.py
test_sparse_semi_structured.py [CUDA][Sparse] Change comparison function of test_sparse_semi_structured.py and bump tolerances for sp24_matmuls (#128553) 2024-06-13 06:58:07 +00:00
test_spectral_ops.py
test_stateless.py [BE] wrap deprecated function/class with typing_extensions.deprecated (#127689) 2024-06-02 12:30:43 +00:00
test_static_runtime.py [BE] enable ruff rule Q from flake8-quotes (#127713) 2024-06-02 23:25:26 +00:00
test_subclass.py
test_sympy_utils.py Introduce int_oo (#127693) 2024-06-13 04:08:20 +00:00
test_tensor_creation_ops.py
test_tensorboard.py
test_tensorexpr.py
test_tensorexpr_pybind.py
test_testing.py Retire torch.distributed.pipeline (#127354) 2024-06-07 08:11:58 +00:00
test_throughput_benchmark.py
test_torch.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_transformers.py Revert "[cuDNN][SDPA] Remove TORCH_CUDNN_SDPA_ENABLED=1, enable cuDNN SDPA by default on H100 and 2nd on other archs >= sm80 (#125343)" 2024-06-12 18:47:52 +00:00
test_type_hints.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_type_info.py Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
test_type_promotion.py
test_typing.py
test_unary_ufuncs.py Revert "[dynamo] Support ndarray.dtype attribute access (#124490)" 2024-06-06 14:21:29 +00:00
test_utils.py Flip default value for mypy disallow_untyped_defs [final] (#127836) 2024-06-12 15:28:42 +00:00
test_view_ops.py
test_vulkan.py
test_weak.py
test_xnnpack_integration.py
test_xpu.py Clean up xpu ut to make CI happy (#128383) 2024-06-13 07:06:41 +00:00