From 20ac8d75d59bfc4ae51602962f55807f8318e9ef Mon Sep 17 00:00:00 2001 From: cehongwang <123616592+cehongwang@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:29:06 -0700 Subject: [PATCH] Implemented basic pipeline for Refitting (#2886) --- py/torch_tensorrt/dynamo/_compiler.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/py/torch_tensorrt/dynamo/_compiler.py b/py/torch_tensorrt/dynamo/_compiler.py index afe9dec322..9e861bd215 100644 --- a/py/torch_tensorrt/dynamo/_compiler.py +++ b/py/torch_tensorrt/dynamo/_compiler.py @@ -176,6 +176,18 @@ def compile( if kwarg_inputs is None: kwarg_inputs = {} + + if "refit" in kwargs.keys(): + warnings.warn( + "Refit is deprecated. Please use make_refitable=True if you want to enable refitting of the engine.", + DeprecationWarning, + stacklevel=2, + ) + if make_refitable: + raise ValueError("Use flag make_refitable only. Flag refit is deprecated.") + else: + make_refitable = kwargs["refit"] + engine_capability = EngineCapability._from(engine_capability) if torch_executed_modules is not None and torch_executed_modules: