Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable tpp for un-verified models #822

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions optimum/intel/ipex/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def ipex_jit_trace(model, task, use_cache):
sample_inputs.pop("past_key_values")

# Use Tensor Processing Primitives to accelerate linear, see https://arxiv.org/abs/2104.05755.
# Only ipex >= 2.3.0 supports tpp.
if is_ipex_version(">=", "2.3.0"):
# Only ipex >= 2.3.0 supports tpp. The tpp is only verified for llm in generation tasks.
if is_ipex_version(">=", "2.3.0") and task in _IPEX_EXPORTED_GENERATION_TASKS:
_enable_tpp()
model = ipex.optimize(model.eval(), dtype=model.dtype, inplace=True)
# Disable repack while jit tracing to reduce the memory
Expand Down
Loading