Skip to content

Commit 2a100bb

Browse files
committed
Update on "Only print dde partial fx graph for export"
Lazos correctly pointed out this doesn't make sense for compile since we graph break in compile. This results in tons of unwanted user log spew. We do want this in export though since it's drastiaclly reduced the support load for DDEs. This PR does the refactor to keep it in export but remove it from compile cc ezyang SherlockNoMad EikanWang jgong5 wenzhe-nrv voznesenskym penguinwu Guobing-Chen XiaobingSuper zhuhaozhe blzheng jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
1 parent fea31c8 commit 2a100bb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

torch/_dynamo/symbolic_convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ def run(self):
13471347
).print_readable(
13481348
print_output=False, include_stride=True, include_device=True
13491349
)
1350-
e.partial_fx_graph = readable_graph
1350+
e.partial_fx_graph = readable_graph # type: ignore[attr-defined]
13511351
raise
13521352

13531353
raise

torch/export/_trace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# mypy: allow-untyped-decorators
22
# mypy: allow-untyped-defs
33
import dataclasses
4-
import sys
54
import functools
65
import inspect
76
import logging
87
import re
8+
import sys
99
import time
1010
import warnings
1111
from contextlib import contextmanager, nullcontext
@@ -1098,7 +1098,7 @@ def wrapper(*args, **kwargs):
10981098
flags=_EXPORT_FLAGS,
10991099
)
11001100

1101-
if hasattr(e, 'partial_fx_graph'):
1101+
if hasattr(e, "partial_fx_graph"):
11021102
print(
11031103
e.partial_fx_graph,
11041104
file=sys.stderr,

torch/fx/_symbolic_trace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def forward(*args, **kwargs):
846846
root_module="self",
847847
verbose=True,
848848
).src
849-
e.partial_fx_graph = partial_fx_graph
849+
e.partial_fx_graph = partial_fx_graph # type: ignore[attr-defined]
850850
raise
851851

852852
raise

0 commit comments

Comments
 (0)