Skip to content

Commit a6cefaf

Browse files
committed
ipex model cannot use torch.compile for now
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
1 parent 83bd4ee commit a6cefaf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

optimum/intel/ipex/modeling_base.py

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
_IPEX_SUPPORT_MODEL_TYPES = ("llama", "bert", "vit", "falcon", "gpt2", "qwen2")
6262
_IPEX_EXPORTED_GENERATION_METHODS = ("sample", "greedy_search", "beam_sample", "beam_search", "assisted_generation")
6363
_IPEX_MINIMUM_VERSION_FOR_COMPILE = "2.5.0"
64+
_COMPILE_NOT_READY_MODEL_TYPES = ("llama", "falcon", "gpt2", "qwen2")
6465

6566

6667
def _is_patched_with_ipex(model, task, use_cache: bool = True):
@@ -185,6 +186,7 @@ def can_generate(self):
185186
def maybe_apply_torch_compile(self):
186187
if (
187188
self.model.device.type != "cpu"
189+
or self.config.model_type in _COMPILE_NOT_READY_MODEL_TYPES
188190
or is_ipex_version("<", _IPEX_MINIMUM_VERSION_FOR_COMPILE)
189191
or getattr(self.config, "quantization_config", None)
190192
):

0 commit comments

Comments
 (0)