Skip to content

Commit 755a833

Browse files
authored
Disable warm up for compiled model (huggingface#1189)
* warm up do not work for compiled model Signed-off-by: jiqing-feng <jiqing.feng@intel.com> * fix warmup Signed-off-by: jiqing-feng <jiqing.feng@intel.com> --------- Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
1 parent 51d9c08 commit 755a833

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

optimum/intel/ipex/modeling_base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def __init__(
149149

150150
self.maybe_apply_torch_compile()
151151

152-
if warmup:
152+
if warmup and not self.compiled:
153153
self._init_warmup()
154154

155155
@classmethod
@@ -317,7 +317,7 @@ def __init__(
317317
if hasattr(self.model_cls, "_convert_to_bloom_cache"):
318318
self._convert_to_bloom_cache = self.model_cls._convert_to_bloom_cache
319319

320-
if warmup:
320+
if warmup and not self.compiled:
321321
self._init_warmup()
322322

323323
@torch.no_grad()
@@ -448,7 +448,7 @@ def __init__(
448448
if hasattr(self.model_cls, "_convert_to_standard_cache"):
449449
self._convert_to_standard_cache = self.model_cls._convert_to_standard_cache
450450

451-
if warmup:
451+
if warmup and not self.compiled:
452452
self._init_warmup()
453453

454454
@torch.no_grad()

0 commit comments

Comments
 (0)