pytorch/test/profiler
Sheng Fu 2ea4b56ec8 Record min/max of integral tensor in ET (#143088)
Summary:
In et-replay, random data is used to run the operators. However, it does not work well for the op that uses index to access tensor. For example, embedding ops, which use the indices to look up the embedding table. If random data is used for these index ops, et-replay usually runs into invalid memory access issue.

To fix it, ET provides an environment variable "ENABLE_PYTORCH_EXECUTION_TRACE_INTEGRAL_TENSOR_RANGE", if it is set, ET will capture the min/max value of the flattened integral tensor. Then in et_replay, the min/max is used to generate the random tensor within that range. It fixed invalid memory access issue.

Test Plan: buck2 run mode/opt caffe2/test:test_profiler_cuda -- profiler.test_execution_trace.TestExecutionTraceCUDA.test_execution_trace_record_integral_tensor_range_cuda

Differential Revision: D66666931

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143088
Approved by: https://github.com/sanrise
2024-12-18 08:20:35 +00:00
..
profiler_utils_mock_events.json
test_cpp_thread.cpp Fix flaky SIGSEGV crash in test_profile_memory (#136304) 2024-09-20 02:56:49 +00:00
test_cpp_thread.py [profiler][UT] instantiate profiler UTs for devices and enable UTs for xpu profiler (#134316) 2024-11-05 05:46:13 +00:00
test_cpp_thread_lib.pyi
test_execution_trace.py Record min/max of integral tensor in ET (#143088) 2024-12-18 08:20:35 +00:00
test_kineto.py init kineto after torch module initialized (#131448) 2024-10-31 13:24:24 +00:00
test_memory_profiler.py [ci, 3.13] disable segfaulting profiler tests in 3.13 (#141674) 2024-12-05 00:24:48 +00:00
test_profiler.py [Profiler] Add Optional Flag to turn off external correlations v2 (#143314) 2024-12-16 23:49:13 +00:00
test_profiler_tree.py [ci, 3.13] disable segfaulting dynamo-wrapped profiler test (#141951) 2024-12-05 00:33:26 +00:00
test_record_function.py
test_torch_tidy.py [ci, 3.13] disable segfaulting profiler tests in 3.13 (#141674) 2024-12-05 00:24:48 +00:00