Skip to content

Commit 151fa03

Browse files
committed
feat: Set default ir to dynamo export
BREAKING CHANGE: Changing default IR from Torchscript to dynamo export Signed-off-by: Dheeraj Peri <[email protected]>
1 parent 780e398 commit 151fa03

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

py/torch_tensorrt/_compile.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,15 @@ def _get_target_ir(module_type: _ModuleType, ir: str) -> _IRType:
6161
else:
6262
if ir == "default":
6363
# Options are listed in order of preference
64-
if module_is_tsable:
64+
if module_is_fxable:
6565
logging.log(
66-
logging.Level.Info, "ir was set to default, using TorchScript as ir"
66+
logging.Level.Info, "ir was set to default, using fx_ts_compat as ir"
6767
)
68-
return _IRType.ts
69-
elif module_is_fxable:
68+
return _IRType.fx_ts_compat
69+
elif module_is_tsable:
7070
raise ValueError(
71-
"Was given a torch.fx.GraphModule, fx is not currently supported by Torch-TensorRT"
71+
"ir is set to default but a TorchScript module is provided. Please provide torch.fx.GraphModule or torch.nn.Module as input or set ir = ts"
7272
)
73-
# logging.log(logging.Level.Info, "ir was set to default, using TorchScript as fx")
74-
# return _IRType.fx
7573
else:
7674
raise ValueError("Module was provided with in an unsupported format")
7775
else:

0 commit comments

Comments
 (0)