We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b3b72d commit 4897144Copy full SHA for 4897144
optimum/intel/ipex/modeling_base.py
@@ -62,16 +62,18 @@
62
63
64
def _is_patched_with_ipex(model, task):
65
- ipex_version = "2.2.0" if "xpu" in str(model.device) else "2.5.0"
66
- if is_ipex_version("<", ipex_version):
67
- return False
68
if isinstance(model, torch.jit.ScriptModule):
+ if is_ipex_version("<", "2.5.0"):
+ return False
69
for node in model.graph.nodes():
70
# Jit will record the codes position so we can check if the node use ipex exporter.
71
if "torch_ipex::rotary_position_embedding" in node.__str__():
72
return True
73
return False
74
else:
+ ipex_version = "2.2.0" if "xpu" in str(model.device) else "2.5.0"
75
+ if is_ipex_version("<", ipex_version):
76
77
return model.config.model_type in _IPEX_SUPPORT_MODEL_TYPES and task in _IPEX_EXPORTED_TASK
78
79
0 commit comments