File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 20
20
def torch_tensorrt_backend (
21
21
gm : torch .fx .GraphModule , sample_inputs : Sequence [torch .Tensor ], ** kwargs : Any
22
22
) -> torch .nn .Module :
23
+ # Set log level at the top of compilation (torch_tensorrt.dynamo)
24
+ if (
25
+ (
26
+ "options" in kwargs
27
+ and "debug" in kwargs ["options" ]
28
+ and kwargs ["options" ]["debug" ]
29
+ )
30
+ or ("debug" in kwargs and kwargs ["debug" ])
31
+ ) and logger .parent :
32
+ logger .parent .setLevel (logging .DEBUG )
33
+
23
34
DEFAULT_BACKEND = aot_torch_tensorrt_aten_backend
24
35
25
36
compiled_mod : torch .nn .Module = DEFAULT_BACKEND (gm , sample_inputs , ** kwargs )
Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ def compile_module(
197
197
198
198
submodule = getattr (partitioned_module , name )
199
199
200
+ logger .debug (
201
+ "Submodule name: " + str (name ) + " Graph: \n " + str (submodule .graph )
202
+ )
200
203
# Get submodule inputs
201
204
submodule_inputs = partitioning .get_submod_inputs (
202
205
partitioned_module , submodule , sample_inputs
Original file line number Diff line number Diff line change @@ -159,10 +159,6 @@ def parse_dynamo_kwargs(kwargs: Any) -> CompilationSettings:
159
159
valid_kwargs = {k : v for k , v in kwargs .items () if k in valid_attrs }
160
160
settings = replace (settings , ** valid_kwargs )
161
161
162
- # Enable debug/verbose mode if requested
163
- if settings .debug :
164
- logger .setLevel (logging .DEBUG )
165
-
166
162
# TODO: Remove once Dynamo precisions refactoring is complete
167
163
if "enabled_precisions" in kwargs :
168
164
enabled_precisions = kwargs ["enabled_precisions" ]
@@ -188,7 +184,7 @@ def parse_dynamo_kwargs(kwargs: Any) -> CompilationSettings:
188
184
# Parse input runtime specification
189
185
settings .use_python_runtime = use_python_runtime_parser (settings .use_python_runtime )
190
186
191
- logger .debug ( f"Compiling with Settings:\n { settings } " )
187
+ logger .info ( "Compilation Settings: %s \n " , settings )
192
188
193
189
return settings
194
190
You can’t perform that action at this time.
0 commit comments