You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
), f"Attempted to refit a cached engine with incompatible settings: {incompattible_settings}, (old_settings: {engine_compilation_settings}, new_settings: {self.compilation_settings})"
), f"Attempted to refit a cached engine built for a different input size (input: {i}, cached size: {cached_engine_input_specs[i]}, new size: {self.input_specs[i]}"
628
-
629
-
_LOGGER.info(
630
-
"Found the cached engine that corresponds to this graph. It is directly loaded."
631
-
)
632
-
633
-
# refit the cached engine with the new graph module
# # As of now, the engine becomes non-refittable because when EXCLUDE_WEIGHTS flag is cleared, the REFIT flag is also cleared by TRT to make the plan file smaller
660
-
661
-
returnTRTInterpreterResult(
662
-
engine,
663
-
self._input_names,
664
-
self._output_names,
665
-
self.weight_name_map,
666
-
self.ctx.requires_output_allocator,
667
-
)
668
-
returnNone
669
-
670
597
defrun(
671
598
self,
672
599
strict_type_constraints: bool=False,
@@ -682,26 +609,6 @@ def run(
682
609
Return:
683
610
TRTInterpreterResult
684
611
"""
685
-
# self.engine_cache could be None if:
686
-
# 1) engine_cache is not passed in when calling this function like convert_exported_program_to_serialized_trt_engine etc., or
687
-
# 2) both cache_built_engines and reuse_cached_engines are False
), f"Attempted to refit a cached engine with incompatible settings: {incompattible_settings}, (old_settings: {cached_engine_compilation_settings}, new_settings: {settings})"
126
+
127
+
fori, einenumerate(
128
+
[
129
+
Input.equivalent_spec(c, i)
130
+
forc, iinzip(cached_engine_inputs, inputs)
131
+
]
132
+
):
133
+
assert (
134
+
e
135
+
), f"Attempted to refit a cached engine built for a different input size (input: {i}, cached size: {cached_engine_inputs[i]}, new size: {inputs[i]}"
136
+
137
+
logger.info(
138
+
"Found the cached engine that corresponds to this graph. It is directly loaded."
139
+
)
140
+
141
+
# refit the cached engine with the new graph module
0 commit comments