mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Also remove compile_time_strobelight_meta frame when generating stack (#126289)
I think I also need to fix this in fbcode, leaving that for future work. Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/126289 Approved by: https://github.com/yanboliang
This commit is contained in:
parent
9c9d0c2fab
commit
b2d9b80fba
2 changed files with 20 additions and 0 deletions
|
|
@ -773,6 +773,22 @@ def _compile(
|
|||
"".join(CapturedTraceback.extract(skip=2 + skip).format()),
|
||||
)
|
||||
# -4: -2 as above, plus trace_structured frames
|
||||
#
|
||||
# NB: the frame looks like this:
|
||||
#
|
||||
# # handled by skip argument
|
||||
# torch/_dynamo/convert_frame.py:1069 in catch_errors
|
||||
# torch/_dynamo/convert_frame.py:910 in _convert_frame
|
||||
# torch/_dynamo/convert_frame.py:464 in _convert_frame_assert
|
||||
# torch/_utils_internal.py:70 in wrapper_function
|
||||
#
|
||||
# # 2 current frame and context lib
|
||||
# env/lib/python3.10/contextlib.py:79 in inner
|
||||
# torch/_dynamo/convert_frame.py:776 in _compile
|
||||
#
|
||||
# # 2 extra here
|
||||
# torch/_logging/_internal.py:1064 in trace_structured
|
||||
# torch/_dynamo/convert_frame.py:780 in <lambda>
|
||||
torch._logging.trace_structured(
|
||||
"dynamo_start",
|
||||
lambda: {
|
||||
|
|
|
|||
|
|
@ -63,10 +63,14 @@ def throw_abstract_impl_not_imported_error(opname, module, context):
|
|||
|
||||
|
||||
# Meta only, act as nop otherwise.
|
||||
#
|
||||
# NB! This treats "skip" kwarg specially!!
|
||||
def compile_time_strobelight_meta(phase_name):
|
||||
def compile_time_strobelight_meta_inner(function):
|
||||
@functools.wraps(function)
|
||||
def wrapper_function(*args, **kwargs):
|
||||
if "skip" in kwargs:
|
||||
kwargs["skip"] = kwargs["skip"] + 1
|
||||
return function(*args, **kwargs)
|
||||
|
||||
return wrapper_function
|
||||
|
|
|
|||
Loading…
Reference in a new issue