Skip to content

Commit

Permalink
[NPU] Add env to disable compile opt (#12330)
Browse files Browse the repository at this point in the history
* add env to disable compile opt

* fix style

* fix style
  • Loading branch information
cyita authored Nov 4, 2024
1 parent e54af44 commit 94c4ce3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(
new_value_states = self.convert_to_fp16(curr_key_values[i][1])

print("start compiling")
if mode == "prefill":
if mode == "prefill" and os.environ.get("IPEX_LLM_NPU_DISABLE_COMPILE_OPT", "0") != "1":
self.compile(npu_dpu_groups=6)
else:
self.compile()
Expand Down
6 changes: 5 additions & 1 deletion python/llm/src/ipex_llm/transformers/npu_models/qwen2_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ def __init__(
new_value_states = self.convert_to_fp16(curr_key_values[i][1])

print(f"{mode} start compiling")
if group_size != 0 and (mode == "prefill" or num_layers == 2):
if (
group_size != 0
and (mode == "prefill" or num_layers == 2)
and os.environ.get("IPEX_LLM_NPU_DISABLE_COMPILE_OPT", "0") != "1"
):
self.compile(npu_dpu_groups=6)
else:
self.compile()
Expand Down

0 comments on commit 94c4ce3

Please sign in to comment.