Skip to content

Commit 8ecef1c

Browse files
committed
Fixed review comments
1 parent 63dd055 commit 8ecef1c

File tree

4 files changed

+10
-25
lines changed

4 files changed

+10
-25
lines changed

examples/dynamo/refit_engine_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
print("Refit successfully!")
9292

9393
# %%
94-
# Alterative Workflow using Python Runtime
94+
# Alternative Workflow using Python Runtime
9595
# -----------------------------
9696

9797
# Currently python runtime does not support engine serialization. So the refitting will be done in the same runtime.

py/torch_tensorrt/_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def save(
432432
if kwargs_inputs is None:
433433
kwargs_inputs = {}
434434

435-
if kwargs_inputs and not all(value is not None for value in kwargs_inputs.values()):
435+
if kwargs_inputs and any(value is None for value in kwargs_inputs.values()):
436436
raise ValueError("kwargs should not include None.")
437437
if output_format not in accepted_formats:
438438
raise ValueError(

py/torch_tensorrt/dynamo/_compiler.py

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,6 @@ def compile(
174174
else:
175175
make_refitable = kwargs["refit"]
176176

177-
if kwarg_inputs is None:
178-
kwarg_inputs = {}
179-
180-
if "refit" in kwargs.keys():
181-
warnings.warn(
182-
"Refit is deprecated. Please use make_refitable=True if you want to enable refitting of the engine.",
183-
DeprecationWarning,
184-
stacklevel=2,
185-
)
186-
if make_refitable:
187-
raise ValueError("Use flag make_refitable only. Flag refit is deprecated.")
188-
else:
189-
make_refitable = kwargs["refit"]
190-
191177
engine_capability = EngineCapability._from(engine_capability)
192178

193179
if torch_executed_modules is not None and torch_executed_modules:
@@ -667,15 +653,14 @@ def convert_module_to_trt_engine(
667653
# Assume converters support dynamic shapes and disable validation
668654
CONVERTERS.set_dynamic_shape_support(settings.assume_dynamic_shape_support)
669655

670-
interpreter_result = interpret_module_to_result(
671-
gm,
672-
inputs=flattened_input_list,
673-
arg_inputs=arg_input_list,
674-
kwarg_inputs=kwarg_input_list,
675-
settings=settings,
676-
)
677656
try:
678-
pass
657+
interpreter_result = interpret_module_to_result(
658+
gm,
659+
inputs=flattened_input_list,
660+
arg_inputs=arg_input_list,
661+
kwarg_inputs=kwarg_input_list,
662+
settings=settings,
663+
)
679664
except UnsupportedOperatorException:
680665
logger.error(
681666
f"Conversion of module {gm} not currently fully supported or convertible!",

py/torch_tensorrt/dynamo/_refit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def construct_refit_mapping(
9494
layer_type: str = layer.type.name
9595
if layer_type in MODULE_MAP:
9696
# Cast the parent class to child class to access attributes
97-
# For example: ILayer does not have ILayer.kernal/ILayer.bias
97+
# For example: ILayer does not have ILayer.kernel/ILayer.bias
9898
# So we cast it to IConvolutionLayer and access the attributes
9999
layer.__class__ = MODULE_MAP[layer_type][0]
100100
for weight_type, weight_name in MODULE_MAP[layer_type][1]:

0 commit comments

Comments
 (0)