Skip to content

Commit 4e9c484

Browse files
committed
fix: Improve logging and kwarg passing in Dynamo
- Improve kwarg passing through Dynamo frontend - Improve logging in case of TRT compilation failures
1 parent cae6b7c commit 4e9c484

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

py/torch_tensorrt/dynamo/backend/__init__.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,12 @@ def create_backend(
123123
Returns:
124124
Backend for torch.compile
125125
"""
126-
if debug:
127-
logger.setLevel(logging.DEBUG)
128-
129-
settings = CompilationSettings(
126+
return partial(
127+
torch_tensorrt_backend,
130128
debug=debug,
131129
precision=precision,
132130
workspace_size=workspace_size,
133131
min_block_size=min_block_size,
134132
torch_executed_ops=torch_executed_ops,
135133
pass_through_build_failures=pass_through_build_failures,
136134
)
137-
138-
return partial(
139-
torch_tensorrt_backend,
140-
settings=settings,
141-
)

py/torch_tensorrt/dynamo/backend/backends.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ def _pretraced_backend(
7777
)
7878
return trt_compiled
7979
except:
80-
logger.error(
81-
"FX2TRT conversion failed on the subgraph. See trace above. "
82-
+ "Returning GraphModule forward instead.",
83-
exc_info=True,
84-
)
85-
8680
if not settings.pass_through_build_failures:
81+
logger.error(
82+
"FX2TRT conversion failed on the subgraph. See trace above. "
83+
+ "Returning GraphModule forward instead.",
84+
exc_info=True,
85+
)
8786
return gm.forward
8887
else:
8988
raise AssertionError(

0 commit comments

Comments
 (0)