[NPU] Add env to disable compile opt (#12330)
* add env to disable compile opt * fix style * fix style
This commit is contained in:
parent
e54af44ed6
commit
94c4ce389f
2 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue