Skip to content

Commit

Permalink
suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
youkaichao committed Aug 28, 2024
1 parent 6ea1309 commit 940aa21
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions depyf/explain/enable_debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ def __call__(self, code, new_code):
import dill
# code object, especially `new_code` constructed by Dynamo, may not be able to be dumped using `marshal`.
# see https://github.com/pytorch/pytorch/issues/116013 for more details.
try:
with contextlib.suppress(Exception):

Check warning on line 57 in depyf/explain/enable_debugging.py

View check run for this annotation

Codecov / codecov/patch

depyf/explain/enable_debugging.py#L57

Added line #L57 was not covered by tests
dill.dump(code, open(filename + ".original_bytecode", "wb"))
except:
pass
try:

with contextlib.suppress(Exception):

Check warning on line 60 in depyf/explain/enable_debugging.py

View check run for this annotation

Codecov / codecov/patch

depyf/explain/enable_debugging.py#L60

Added line #L60 was not covered by tests
dill.dump(new_code, open(filename + ".transformed_bytecode", "wb"))
except:
pass
try:

with contextlib.suppress(Exception):

Check warning on line 63 in depyf/explain/enable_debugging.py

View check run for this annotation

Codecov / codecov/patch

depyf/explain/enable_debugging.py#L63

Added line #L63 was not covered by tests
dill.dump(decompiled_and_compiled_back_code, open(filename + ".decompiled_and_compiled_back_bytecode", "wb"))
except:
pass

# this fix is used for PyTorch prior to PR https://github.com/pytorch/pytorch/pull/114487
from torch._dynamo.utils import orig_code_map
Expand Down

0 comments on commit 940aa21

Please sign in to comment.