[NPU] Add env to disable compile opt (#12330)

* add env to disable compile opt

* fix style

* fix style
This commit is contained in:
Yina Chen 2024-11-04 11:46:17 +02:00 committed by GitHub
parent e54af44ed6
commit 94c4ce389f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -196,7 +196,7 @@ class LowBitLlamaMultiDecoderlayer(LLMBaseNNFactory):
new_value_states = self.convert_to_fp16(curr_key_values[i][1]) new_value_states = self.convert_to_fp16(curr_key_values[i][1])
print("start compiling") 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) self.compile(npu_dpu_groups=6)
else: else:
self.compile() self.compile()

View file

@ -232,7 +232,11 @@ class LowBitQwenMultiDecoderlayer(LLMBaseNNFactory):
new_value_states = self.convert_to_fp16(curr_key_values[i][1]) new_value_states = self.convert_to_fp16(curr_key_values[i][1])
print(f"{mode} start compiling") 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) self.compile(npu_dpu_groups=6)
else: else:
self.compile() self.compile()